Skip to content
Snippets Groups Projects
Commit 5a43559e authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

Merge branch 'dssc_load' into 'master'

Automatically finds semester and topic

See merge request SCS/ToolBox!51
parents 5ec7d187 806a742b
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ import warnings ...@@ -8,6 +8,7 @@ import warnings
import psutil import psutil
import karabo_data as kd import karabo_data as kd
from karabo_data.read_machinery import find_proposal
from karabo_data.geometry2 import DSSC_1MGeometry from karabo_data.geometry2 import DSSC_1MGeometry
import ToolBox as tb import ToolBox as tb
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -20,21 +21,22 @@ from imageio import imread ...@@ -20,21 +21,22 @@ from imageio import imread
class DSSC: class DSSC:
def __init__(self, semester, proposal, topic='SCS', distance=1): def __init__(self, proposal, distance=1):
""" Create a DSSC object to process DSSC data. """ Create a DSSC object to process DSSC data.
inputs: inputs:
semester: semester string proposal: (int,str) proposal number string
proposal: proposal number string distance: (float) distance sample to DSSC detector in meter
topic: topic, by default SCS
distance: distance sample to DSSC detector in meter
""" """
self.semester = semester if isinstance(proposal,int):
proposal = 'p{:06d}'.format(proposal)
runFolder = find_proposal(proposal)
self.semester = runFolder.split('/')[-2]
self.proposal = proposal self.proposal = proposal
self.topic = topic self.topic = runFolder.split('/')[-3]
self.tempdir = None self.tempdir = None
self.save_folder = f'/gpfs/exfel/exp/{self.topic}/{self.semester}/{self.proposal}/usr/condensed_runs/' self.save_folder = os.path.join(runFolder, 'usr/condensed_runs/')
self.distance = distance self.distance = distance
self.px_pitch_h = 236 # horizontal pitch in microns self.px_pitch_h = 236 # horizontal pitch in microns
self.px_pitch_v = 204 # vertical pitch in microns self.px_pitch_v = 204 # vertical pitch in microns
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment