Wiki source code of DEMO - Working with FLASH data

Last modified by makuadm on 2026-01-07 06:21

Hide last authors
sndueste 42.5 1 Experimental data is recorded as HDF files[[~[link~]>>doc:FS-FLASH USER tmp.Data Acquisition and controls 1.DAQ and controls overview.Offline data analysis (DAQ).The FLASH HDF5 structure.WebHome]] on the GPFS file system[[~[link~]>>https://docs.desy.de/asap3/]]. The access rights are linked to the user's DESY account and can be managed by the PI via the GAMMA portal[[~[link~]>>url:https://gamma-portal.desy.de/||shape="rect"]]. The experimental data can be downloaded via the GAMMA portal, but it is advised to use the DESY computing infrastructure. Access point are via ssh, Maxwell-Display Server[[~[link~]>>url:https://confluence.desy.de/display/MXW/Maxwell+Cluster||shape="rect"]] or JuyterHub[[~[link~]>>url:https://confluence.desy.de/display/MXW/JupyterHub+on+Maxwell||shape="rect"]]. We recommend using the JupyterHub for data exploration and the SLURM resources for high performances computing - see FAB for easy usage of the infrastructure.
cpassow 21.1 2
sndueste 38.1 3 {{info title="How to login JupyterHub"}}
makuadm 43.1 4 === ===
cpassow 26.1 5
sndueste 38.1 6 {{view-file att--filename="tmp.mp4" height="150"/}}
7 {{/info}}
cpassow 26.1 8
sndueste 35.1 9 {{info}}
sndueste 41.1 10 === There are different options that help you to work with the FLASH HDF5 data in Python ===
sndueste 35.1 11
sndueste 39.1 12 * The currently developed option for large data sets: [[the FAB package>>url:https://hasfcpkg.desy.de/fab/fab.html||shape="rect"]] ... see below
13 * and for smaller projects:  (% class="Object" %)[[https:~~/~~/gitlab.desy.de/christopher.passow/flash-daq-hdf>>url:https://gitlab.desy.de/christopher.passow/flash-daq-hdf||shape="rect"]]
sndueste 35.1 14
sndueste 42.4 15 (% class="Object" %)See also the collection of Demo data and sample scripts : [[doc:FS-FLASH USER tmp.Data Acquisition and controls 1.DAQ and controls overview.Offline data analysis (DAQ).Collection of HDF5 sample data from different beamlines.WebHome]]
sndueste 35.1 16 {{/info}}
17
cpassow 26.1 18
sndueste 36.1 19 [[~[~[image:attach:image2023-9-29_11-1-37.png~]~]>>url:https://hasfcpkg.desy.de/fab/fab.html||shape="rect"]]
sndueste 33.1 20
sndueste 34.1 21 {{expand title="older ideas ..."}}
sndueste 36.1 22 (% class="Object" %)(object oriented) [[https:~~/~~/gitlab.desy.de/christopher.passow/fdh-builder>>url:https://gitlab.desy.de/christopher.passow/fdh-builder.git||shape="rect"]]
sndueste 33.1 23
cpassow 21.1 24 ----
25
26 === TODO ===
27
cpassow 22.1 28 (% class="task-list" %)
29 (((
makuadm 43.1 30 {{task reference="/Tasks/Task_18" status="InProgress" completeDate="" createDate="2026-01-06" reporter=""}}
sndueste 41.3 31 Short descriptions including Links:   → as Text
makuadm 43.1 32 \\
cpassow 22.1 33 {{/task}}
34 )))
35
cpassow 8.1 36
cpassow 22.1 37 (% class="task-list" %)
38 (((
makuadm 52.1 39 {{task reference="/Tasks/Task_22" status="InProgress" completeDate="" createDate="2026-01-07" reporter=""}}
cpassow 22.1 40 distribution
makuadm 52.1 41 \\
cpassow 22.1 42 {{/task}}
43 )))
44
cpassow 21.1 45
cpassow 22.1 46 (% class="task-list" %)
47 (((
makuadm 50.1 48 {{task reference="/Tasks/Task_25" status="InProgress" completeDate="" createDate="2026-01-07" reporter=""}}
cpassow 22.1 49 Documentation
makuadm 50.1 50 \\
cpassow 22.1 51 {{/task}}
52 )))
53
cpassow 2.1 54
cpassow 22.1 55 (% class="task-list" %)
56 (((
makuadm 49.1 57 {{task reference="/Tasks/Task_27" status="InProgress" completeDate="" createDate="2026-01-07" reporter=""}}
cpassow 22.1 58 Binder
makuadm 49.1 59 \\
cpassow 22.1 60 {{/task}}
61 )))
62
cpassow 2.1 63
cpassow 22.1 64 (% class="task-list" %)
65 (((
makuadm 48.1 66 {{task reference="/Tasks/Task_29" status="InProgress" completeDate="" createDate="2026-01-07" reporter=""}}
cpassow 22.1 67 Screencast
makuadm 48.1 68 \\
cpassow 22.1 69 {{/task}}
70 )))
71
cpassow 2.1 72
cpassow 15.1 73
cpassow 21.1 74 ----
cpassow 2.1 75
cpassow 21.1 76 ==== under review ====
cpassow 4.1 77
78
cpassow 8.1 79 {{code language="bash"}}
cpassow 9.1 80 conda create -n flashh5 python=3.10 # 3.10 not necessary, but would prefer 3.8 or higher
cpassow 8.1 81 source activate flashh5
cpassow 10.1 82 conda install ipython numpy pandas #TODO: fix dependcies
cpassow 8.1 83 conda install -c https://www.desy.de/~cpassow/condarepo/ flashh5
84
85 ## on jhub
cpassow 11.1 86 conda install ipykernel
cpassow 8.1 87 python -m ipykernel install --user --name flashh5 --display-name "flashh5"
88
89
cpassow 11.1 90 ## to remove on jhub
91 ## delete from: /home/$USER/.local/share/jupyter/kernels/
cpassow 8.1 92 {{/code}}
93
sndueste 41.3 94 {{code language="py" title="
95 moved to repository?"}}
cpassow 4.1 96 class RunDirectory:
97
cpassow 21.1 98 def get_run_table(): # more or less information? RunComment | Number of Files | start & stop time ?
cpassow 4.1 99 ...
100
cpassow 21.1 101 def get_run(daq, run_number): # daq is not needed!
102
cpassow 4.1 103 ...
104
105
cpassow 25.1 106 class Run: # constructor optional without RunDirectory or use there self.path
cpassow 4.1 107
cpassow 7.1 108 def get_files():
cpassow 4.1 109 ...
110
cpassow 18.1 111 def get_channels(): # of file #1
cpassow 4.1 112 ...
113
cpassow 8.1 114 def get_start_time(): # better as attribute?
cpassow 4.1 115 ...
116
cpassow 8.1 117 def get_stop_time(): # which? | better as attribute?
cpassow 4.1 118 ...
cpassow 12.1 119
cpassow 19.1 120 def to_df(daq_map): # to_df(daq_map, slice) slice=[0:4] -> throw Exception
cpassow 4.1 121 ...
122
cpassow 7.1 123 def to_series(channel):
cpassow 4.1 124 ...
125
cpassow 7.1 126 def to_array(channel):
cpassow 4.1 127 ...
128 {{/code}}
129
cpassow 6.1 130 {{code language="py" title="ideas"}}
cpassow 10.1 131 run.to_df(daq_map)
132 run.to_series(daq_adr or daq_map) # on channel only?
133 run.to_array(daq_adr) # on channel only?
cpassow 5.1 134
cpassow 21.1 135 ## interesting?
cpassow 10.1 136 # run.to_dask(daq_map)
137 # run.to_xarray(daq_map)
cpassow 5.1 138 {{/code}}
139
cpassow 30.1 140
sndueste 41.3 141
sndueste 33.1 142 {{/expand}}