Commit 04df5b18 authored by myron's avatar myron
Browse files

adapt monitor for energy scans

parent 253974e6
......@@ -6,7 +6,7 @@ variables:
PROJECT_NAME: "xrstools"
LOCAL_REPO: "/dev/shm/gitlab_ci/xrstools"
VENV_DIR: /dev/shm/gitlab_ci/xrstools/venv
USE_CLEAN_VENV: "true"
USE_CLEAN_VENV: "false"
CLEAN_RESULTS: "true"
test:
......
......@@ -1153,6 +1153,8 @@ def loadscan_2Dimages_galaxies(mydata):
loadscan_2Dimages_galaxies :
roiaddress : "hdf5filename:nameofroigroup" # the same given in create_rois
expdata : "kapton_%05d_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07"
monitor_address : "kapton_%05d_01_monitor.nxs:/monitor" # oppure None
scan_interval : [1,2] # from 1 to 1 included ( kapton_00001_01.nxs)
......@@ -1215,6 +1217,16 @@ def loadscan_2Dimages_galaxies(mydata):
hf.require_group(egroup+scangroup+roigroup)
hf.require_dataset(egroup+scangroup+roigroup+"matrix", [Ydim, box.shape[0], box.shape[1]] , "f",exact="True")
hf[egroup+scangroup+roigroup+"cornerpos"] = origin
if mydata["monitor_address"] not in [None,"None"] :
averaged_monitor = 0
for iscan in todo_list:
monitor_filename, monitor_dataname = split_hdf5_address( mydata["monitor_address"] % iscan )
monitor = np.array(h5py.File(monitor_filename,"r")[monitor_dataname][:])
averaged_monitor += monitor
averaged_monitor = averaged_monitor / len(todo_list)
for iscan in todo_list:
iZ = (iscan-scan_interval[0]) % Zdim
......@@ -1225,6 +1237,15 @@ def loadscan_2Dimages_galaxies(mydata):
data = np.array(h5py.File(filename,"r")[dataname][:])
if mydata["monitor_address"] not in [None,"None"] :
monitor_filename, monitor_dataname = split_hdf5_address( mydata["monitor_address"] % iscan )
monitor = np.array(h5py.File(monitor_filename,"r")[monitor_dataname][:])
monitor[:] = monitor / averaged_monitor
data[:] = data / monitor[:, None, None]
for roikey, (origin, box) in roiob.red_rois.items():
......
create_rois_galaxies :
expdata : "/data/scisofttmp/mirone/raffaela/kapton_00001_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07" ##-- this pointsto, inside a hdf5 file, a stack of images z,y,x
filter_path : "/data/scisofttmp/mirone/raffaela/mymask.h5:/mymask" # the target destination for rois
expdata : "/data/scisofttmp/mirone/raffaela/kapton_00001_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07" ##-- this pointsto, inside a hdf5 file, a stack of images
filter_path : "/data/scisofttmp/mirone/raffaela/mymask.h5:/mymask"
roiaddress : "results/myrois.h5:/ROIS" # the target destination for rois
\ No newline at end of file
......@@ -5,6 +5,9 @@ loadscan_2Dimages_galaxies :
expdata : "/data/scisofttmp/mirone/raffaela/GS9_dataGalaxies/GS9_%05d_01.nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07"
monitor_address : None
scan_interval : [1,257] # from 1 to 256 included
Ydim : 16
......
create_rois_galaxies :
expdata : "/data/scisofttmp/mirone/Loic1/data/HC-D_2Dmap_0130.nxs:/root.spyc.config1d_RIXS_0024/scan_data/data_03"
filter_path : "/data/scisofttmp/mirone/Loic1/mask.h5:/filter"
roiaddress : "results/myrois.h5:/ROIS" # the target destination for rois
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment