|
|
Hi, this should be the main place for collaborative documentation of extra_mmm.
|
|
|
|
|
|
This is a library written to ease the access to the data, designed to be run via the Jupyter notebook at the Maxwell cluster.
|
|
|
The best way to understand it is to check the example notebook at
|
|
|
## Sample notebooks
|
|
|
|
|
|
<https://max-jhub.desy.de/user/msmid/notebooks/GPFS/exfel/exp/HED/202101/p002621/usr/Software/Michal/Shot_overview_2621_Demo.ipynb>
|
|
|
Sample notebooks are typically closely tailored to fit given campaign or task, but due to their similarities, they might also undergo an almost continuous evolution. The good idea might be to sort them based on the proposal number. And they should be definitely better described then they are now.
|
|
|
|
|
|
Or a more complex one (comparing laser shot to preshot) at:
|
|
|
One should try to transfer all parts of code which are stable and universal enough from the notebooks to the library, in order to keep the codes clear and ease its understanding.
|
|
|
|
|
|
https://max-jhub.desy.de/user/msmid/lab/tree/GPFS/exfel/exp/HED/202101/p002621/usr/Software/master/extra_mmm_test.ipynb
|
|
|
The current notebooks are:
|
|
|
|
|
|
The basic routines are:
|
|
|
### scan
|
|
|
|
|
|
Postprocess the data of the Karabo scan tool - useful for e.g. rocking curve of HAPG mirror, focal Z-scan,...?
|
|
|
|
|
|
### run_overview
|
|
|
|
|
|
Opens one run and plots all diagnostics which scientist dreams of.
|
|
|
|
|
|
#### shoot
|
|
|
|
|
|
Developed for the 'typical relaxed experiment'. Shows data from the actual shot (it finds the trainNumber of shot within specific run) and compares them to the preshot (integrated images over all trains). The version from proposal 2621 is showing the SAXS, PCI, and HAPG spectrometer.
|
|
|
|
|
|
# extra_mmm
|
|
|
|
|
|
This is a library written to ease the access to the data, designed to be run via the Jupyter notebook at the Maxwell cluster. The best way to understand it is to check the example notebook at
|
|
|
|
|
|
<https://max-jhub.desy.de/user/msmid/notebooks/GPFS/exfel/exp/HED/202101/p002621/usr/Software/Michal/Shot_overview_2621_Demo.ipynb>
|
|
|
|
|
|
Or a more complex one (comparing laser shot to preshot) at:
|
|
|
|
|
|
<https://max-jhub.desy.de/user/msmid/lab/tree/GPFS/exfel/exp/HED/202101/p002621/usr/Software/master/extra_mmm_test.ipynb>
|
|
|
|
|
|
The basic routines are:
|
|
|
|
|
|
#### open_run()
|
|
|
|
|
|
run = open_run(proposal, runNo, data='proc')\
|
|
|
The data=‘proc’ defines that we are reading the processed data, i.e. after subtraction of dark frames and after gain correction. For Jungfrau detector that means, that resulting data are already calibrated, and value of each pixel corresponds to deposited energy in \[keV\]. It is possible to read the ‘raw’ data as well; those could be available faster, but might be harder to interpret (not recommended).
|
|
|
The data=‘proc’ defines that we are reading the processed data, i.e. after subtraction of dark frames and after gain correction. For Jungfrau detector that means, that resulting data are already calibrated, and value of each pixel corresponds to deposited energy in \[keV\]. It is possible to read the ‘raw’ data as well; those could be available faster, but might be harder to interpret (not recommended).
|
|
|
|
|
|
#### get_shot_trainId()
|
|
|
|
|
|
trainId=em.get_shot_trainId(run) - tries to find out which run contained the data with laser shot. Might need to be updated for new campaigns.
|
|
|
trainId=em.get_shot_trainId(run) - tries to find out which run contained the data with laser shot. Might need to be updated for new campaigns.
|
|
|
|
|
|
#### get_image()
|
|
|
|
|
|
jf=em.get_image(run,runNo,'JF1',trainId,debug,threshold_lower,recalc)
|
|
|
jf=em.get_image(run,runNo,'JF1',trainId,debug,threshold_lower,recalc)
|
|
|
|
|
|
First 2 arguments are from open_run. The third argument is a ‘nickname’ of diagnostics to get image from. The dictionary of nicknames can be seen and ajdusted at the beginning of the source code. It contains:\[nickame, data source name, trainID offset\]
|
|
|
First 2 arguments are from open_run. The third argument is a ‘nickname’ of diagnostics to get image from. 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 of all trains in given run, otherwise it will return image for the single train.
|
|
|
|
|
|
**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
|
|
|
|
|
|
The **debug** parameter (boolean) can just turn on verbose output.
|
|
|
The **debug** parameter (boolean) can just turn on verbose output.
|
|
|
|
|
|
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.
|
|
|
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.
|
|
|
|
|
|
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) |
|
|
\ No newline at end of file |