... | ... | @@ -58,24 +58,20 @@ verbose - if True, will make more output |
|
|
|
|
|
return run - the object to be passed to further functions.
|
|
|
|
|
|
### get_shot_trainId_2 (run,diag='JF4',debug=0,use_cache=1)
|
|
|
### get_array() and get_image()
|
|
|
|
|
|
Tries to find out which run contained the data with laser shot. It will find it as a trainId with the strongest data in diagnostics given by 'diag'. if use_cache, then it will store the result in local pickle and read it later for faster access.
|
|
|
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
|
|
|
|
|
|
**return trainId, ratio** - ratio is the ratio between strongest and second strongest shot, so you can use it to say if it was real and good laser shot.
|
|
|
`data,trains=em.get_array(run,diag_nickname)`
|
|
|
|
|
|
### get_shot_trainId (run,diag='JF4',debug=0,use_cache=1)
|
|
|
where :
|
|
|
|
|
|
Identical as get_shot_trainId_2, but it returns only one parameter:
|
|
|
_run_ - the run object you got from open_run
|
|
|
|
|
|
**return trainId**
|
|
|
_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.
|
|
|
|
|
|
### get_image(run,diag_nickname,trainId=-1,average=True,diag='',recalc=0,threshold_lower=-1,threshold_upper=-1,debug=0,save=False)
|
|
|
|
|
|
run - the run object from open_run
|
|
|
|
|
|
diag_nickname - name of the diagnostics in the local dictionary. The dictionary of nicknames can be seen and ajdusted at the beginning of the source code. It contains:\[nickame, data source name, trainID offset\]
|
|
|
|
|
|
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.
|
|
|
|
|
|
average - works for trainId=-1. If true, will return average, otherwise returns sum.
|
... | ... | @@ -88,6 +84,55 @@ The image is saved (cached) as tiff file into a ‘./data’ folder. From there, |
|
|
|
|
|
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)
|
|
|
|
|
|
### Diagnostics
|
|
|
|
|
|
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'\])`
|
|
|
|
|
|
## Obsolete functions:
|
|
|
|
|
|
### get_shot_trainId_2 (run,diag='JF4',debug=0,use_cache=1)
|
|
|
|
|
|
Tries to find out which run contained the data with laser shot. It will find it as a trainId with the strongest data in diagnostics given by 'diag'. if use_cache, then it will store the result in local pickle and read it later for faster access.
|
|
|
|
|
|
**return trainId, ratio** - ratio is the ratio between strongest and second strongest shot, so you can use it to say if it was real and good laser shot.
|
|
|
|
|
|
### get_shot_trainId (run,diag='JF4',debug=0,use_cache=1)
|
|
|
|
|
|
Identical as get_shot_trainId_2, but it returns only one parameter:
|
|
|
|
|
|
**return trainId**
|
|
|
|
|
|
###
|
|
|
|
|
|
### **get_array_raw(run,diag_nickname,diag='')**
|
|
|
|
|
|
Somehow similar to get_image. gets you a numpy array of diagnostics given by diag_nickname in given run. The cache is not yet implemented here.
|
... | ... | |