... | ... | @@ -60,7 +60,7 @@ return run - the object to be passed to further functions. |
|
|
|
|
|
### get_array() and get_image()
|
|
|
|
|
|
Both functions are working very similarly. They do have many possible options via various input parameters. Those are however set with proper default values, so if you don't know, don't set it. Below, the get_array() is explained first, get_image has then just tiny variations. Both serves to give you a value of some diagnostics. Simple usage would be
|
|
|
Both functions are working very similarly. They do have many possible options via various input parameters. Those are however set with proper default values, so if you don't know, don't set it. Below, the get_array() is explained first, get_image has then just tiny variations. Both serves to give you a value of some diagnostics. Simple usage would be
|
|
|
|
|
|
`data,trains=em.get_array(run,diag_nickname)`
|
|
|
|
... | ... | @@ -68,21 +68,34 @@ where : |
|
|
|
|
|
_run_ - the run object you got from open_run
|
|
|
|
|
|
_diag_nickname_ - name of the diagnostics you are interested in, as defined in the local dictionary, e.g. 'JF4', 'XGM_HED',... The dictionary of nicknames can be seen below, or eventually at the beginning of the source code. It is to be graduallye exteded to follow status of HED.
|
|
|
_diag_nickname_ - name of the diagnostics you are interested in, as defined in the local dictionary, e.g. 'JF4', 'XGM_HED',... The dictionary of nicknames can be seen below, or eventually at the beginning of the source code. It is to be graduallye exteded to follow status of HED. In this simplest case, the function would return and average of all trains within this run.
|
|
|
|
|
|
### get_image(run,diag_nickname,trainId=-1,average=True,diag='',recalc=0,threshold_lower=-1,threshold_upper=-1,debug=0,save=False)
|
|
|
If you want to get an average value over all trains where PPU was open (very standard and smart thing), you will first get the trainIds from PPU, and then call the function as:
|
|
|
|
|
|
If **train Id**==-1, the the function returns mean or sum of all trains in given run, otherwise it will return image for the single train.
|
|
|
`PPU_open=em.get_PPU_open(run)\
|
|
|
data,trains=em.get_array(run,diag_nickname,PPU=PPU_open)`
|
|
|
|
|
|
average - works for trainId=-1. If true, will return average, otherwise returns sum.
|
|
|
If you want to get some other trains, you can call
|
|
|
|
|
|
**threshold_lower**. If this parameter is set, all pixel with values below this value will be zeroed. And this is done before averaging over trains, so very useful for removing noise on long accumulations
|
|
|
`data,trains=em.get_array(run,diag_nickname,trainId)`
|
|
|
|
|
|
The **debug** parameter (boolean) can just turn on verbose output.
|
|
|
where trainId is either:
|
|
|
|
|
|
-1 -> you'll get average over all trains,
|
|
|
|
|
|
0 -> you will get all trains in the run, then the return value 'trains' will give you trainIds of the returned trains.
|
|
|
|
|
|
positive value -> you will get data for this particular trainId
|
|
|
|
|
|
The image is saved (cached) as tiff file into a ‘./data’ folder. From there, it can be used for other manual analysis. Or if **recalc** is kept at default value (0), the next time the image is read, it is loaded from this cache (to save some time..). If recalc is set to 1, then all data are always loaded from the server.
|
|
|
**Thresholding:** You can use the parameters to process the data. If you set **threshold_lower**, all pixel with values below this value will be zeroed. And this is done before averaging over trains, so very useful for removing noise on long accumulations. **threshold_upper** works similarly, just zero pixels with values above this one, could be useful to remove bad pixels or hard hits on some detectors.
|
|
|
|
|
|
**Caching:** In order to speedup the function, all data you request are cached, i.e. stored as a tiff or pickles in the experimental folder on GPFS `.../ scratch/extra_mmm/` This is supposed to work fine and you shall be happy about it. If that would be for any reason not the case, you can use parameter **recalc=1**, then the eventual content of the cache is ignored and the data are freshly loaded from the system, or you could even use **save=0**, and then it is not trying to save into the cache. The files are stored as pickles if you use the get_array function, or as tiff images if you use the get_image function. You are very welcome to grab the images from the cache yourself and use as you need. The filename typically looks like
|
|
|
|
|
|
`p3129_r0706_JF2_PPU.tif,` where on beginning you have the proposal and run numbers, then the nickname of the diagnostics, and last identification of trains used. It can be either PPU, mean, sum, or particular trainId. If you use the lower thershold, its value is also appended at the end of the filename.
|
|
|
|
|
|
The **debug** parameter (boolean) can just turn on verbose output.
|
|
|
|
|
|
The **dictionary** with the diagnostics can be avoided and the source name provided directly. In that case, not trainId offset is used, i.e. Jungfrau_image=em.get_image(run,runNo,diag_nickname='whatever', diag=”HED_IA1_JF500K1/DET/JNGFR01:daqOutput”, trainId=trainId,debug=debug,recalc=recalc)
|
|
|
The **dictionary** with the diagnostics can be avoided and the source name provided directly. In that case, no trainId offset is used, i.e. Jungfrau_image=em.get_image(run,runNo,diag_nickname='whatever', diag=”HED_IA1_JF500K1/DET/JNGFR01:daqOutput”, trainId=trainId,debug=debug,recalc=recalc) _not tested._
|
|
|
|
|
|
### Diagnostics
|
|
|
|
... | ... | @@ -90,32 +103,7 @@ This dictionary contains list of diagnostics used. Each item contains: |
|
|
|
|
|
**nickname, source, trainId offset, key**
|
|
|
|
|
|
`diags=\[\]\
|
|
|
diags.append(\['JF1',"HED_IA1_JF500K1/DET/JNGFR01:daqOutput",0\])\
|
|
|
diags.append(\['JF2',"HED_IA1_JF500K2/DET/JNGFR02:daqOutput",0\])\
|
|
|
diags.append(\['JF3',"HED_IA1_JF500K3/DET/JNGFR03:daqOutput",0\])\
|
|
|
diags.append(\['JF4',"HED_IA1_JF500K4/DET/JNGFR04:daqOutput",0\])\
|
|
|
diags.append(\['ePix1',"HED_IA1_EPX100-1/DET/RECEIVER:daqOutput",0\])\
|
|
|
diags.append(\['Zyla',"HED_EXP_ZYLA/CAM/5:daqOutput",1,'data.image.pixels'\])\
|
|
|
diags.append(\['Electrons',"HED_IA1_LT/CAM/CAM_3:daqOutput",0\])\
|
|
|
diags.append(\['HIDG1',"HED_EXP_HIDG/CAM/CAM1:daqOutput",0\])\
|
|
|
diags.append(\['HIDG2',"HED_EXP_HIDG/CAM/CAM2:daqOutput",0\])\
|
|
|
diags.append(\['HIDG3',"HED_EXP_HIDG/CAM/CAM3:daqOutput",0\])\
|
|
|
diags.append(\['ILM',"HED_IA1_LT/CAM/CAM_2:daqOutput",0\])\
|
|
|
diags.append(\['CRL_Z',"HED_IA1_NFS/MOTOR/CRL_Z",0\])\
|
|
|
diags.append(\['XGM_HED',"HED_XTD6_XGM/XGM/DOOCS:output",0,'data.intensityTD'\])\
|
|
|
diags.append(\['XGM_SA2',"SA2_XTD1_XGM/XGM/DOOCS:output",0,'data.intensityTD'\])\
|
|
|
diags.append(\['LC_AXIS_4',"HED_IA1_DETM/MOTOR/LC_AXIS_4",0,"actualPosition.value"\])\
|
|
|
diags.append(\['SCAN_Y',"HED_IA1_FSSS/MOTOR/SCAN_Y",0,"actualPosition.value"\])\
|
|
|
diags.append(\['SCAN_Y_enc',"HED_IA1_FSSS/MOTOR/SCAN_Y",0,"encoderPosition.value"\])\
|
|
|
diags.append(\['SCAN_X',"HED_IA1_FSSS/MOTOR/SCAN_X",0,"actualPosition.value"\])\
|
|
|
diags.append(\['ATT_SA2',"SA2_XTD1_ATT/MDL/MAIN",0,"actual.transmission.value"\])\
|
|
|
diags.append(\['ATT_HED',"HED_OPT_ATT/MDL/ATT",0,"actual.transmission.value"\])\
|
|
|
diags.append(\['delay',"HED_HPLAS_HIL/DOOCS/OPTICALDELAY",0,"actualPosition.value"\])\
|
|
|
diags.append(\['IPM_OPT_ch2',"HED_OPT_IPM/ADC/1:channel_2.output",0,'data.peaks'\])\
|
|
|
diags.append(\['IPM_OPT_ch3',"HED_OPT_IPM/ADC/1:channel_3.output",0,'data.peaks'\])\
|
|
|
diags.append(\['IPM_OPT_ch4',"HED_OPT_IPM/ADC/1:channel_4.output",0,'data.peaks'\])\
|
|
|
diags.append(\['IPM_OPT_ch5',"HED_OPT_IPM/ADC/1:channel_5.output",0,'data.peaks'\])`
|
|
|
`diags=\\\[\\\]\\ diags.append(\\\['JF1',"HED_IA1_JF500K1/DET/JNGFR01:daqOutput",0\\\])\\ diags.append(\\\['JF2',"HED_IA1_JF500K2/DET/JNGFR02:daqOutput",0\\\])\\ diags.append(\\\['JF3',"HED_IA1_JF500K3/DET/JNGFR03:daqOutput",0\\\])\\ diags.append(\\\['JF4',"HED_IA1_JF500K4/DET/JNGFR04:daqOutput",0\\\])\\ diags.append(\\\['ePix1',"HED_IA1_EPX100-1/DET/RECEIVER:daqOutput",0\\\])\\ diags.append(\\\['Zyla',"HED_EXP_ZYLA/CAM/5:daqOutput",1,'data.image.pixels'\\\])\\ diags.append(\\\['Electrons',"HED_IA1_LT/CAM/CAM_3:daqOutput",0\\\])\\ diags.append(\\\['HIDG1',"HED_EXP_HIDG/CAM/CAM1:daqOutput",0\\\])\\ diags.append(\\\['HIDG2',"HED_EXP_HIDG/CAM/CAM2:daqOutput",0\\\])\\ diags.append(\\\['HIDG3',"HED_EXP_HIDG/CAM/CAM3:daqOutput",0\\\])\\ diags.append(\\\['ILM',"HED_IA1_LT/CAM/CAM_2:daqOutput",0\\\])\\ diags.append(\\\['CRL_Z',"HED_IA1_NFS/MOTOR/CRL_Z",0\\\])\\ diags.append(\\\['XGM_HED',"HED_XTD6_XGM/XGM/DOOCS:output",0,'data.intensityTD'\\\])\\ diags.append(\\\['XGM_SA2',"SA2_XTD1_XGM/XGM/DOOCS:output",0,'data.intensityTD'\\\])\\ diags.append(\\\['LC_AXIS_4',"HED_IA1_DETM/MOTOR/LC_AXIS_4",0,"actualPosition.value"\\\])\\ diags.append(\\\['SCAN_Y',"HED_IA1_FSSS/MOTOR/SCAN_Y",0,"actualPosition.value"\\\])\\ diags.append(\\\['SCAN_Y_enc',"HED_IA1_FSSS/MOTOR/SCAN_Y",0,"encoderPosition.value"\\\])\\ diags.append(\\\['SCAN_X',"HED_IA1_FSSS/MOTOR/SCAN_X",0,"actualPosition.value"\\\])\\ diags.append(\\\['ATT_SA2',"SA2_XTD1_ATT/MDL/MAIN",0,"actual.transmission.value"\\\])\\ diags.append(\\\['ATT_HED',"HED_OPT_ATT/MDL/ATT",0,"actual.transmission.value"\\\])\\ diags.append(\\\['delay',"HED_HPLAS_HIL/DOOCS/OPTICALDELAY",0,"actualPosition.value"\\\])\\ diags.append(\\\['IPM_OPT_ch2',"HED_OPT_IPM/ADC/1:channel_2.output",0,'data.peaks'\\\])\\ diags.append(\\\['IPM_OPT_ch3',"HED_OPT_IPM/ADC/1:channel_3.output",0,'data.peaks'\\\])\\ diags.append(\\\['IPM_OPT_ch4',"HED_OPT_IPM/ADC/1:channel_4.output",0,'data.peaks'\\\])\\ diags.append(\\\['IPM_OPT_ch5',"HED_OPT_IPM/ADC/1:channel_5.output",0,'data.peaks'\\\])`
|
|
|
|
|
|
## Obsolete functions:
|
|
|
|
... | ... | |