Commit 6635dbbb authored by myron's avatar myron
Browse files

adjusted renormalisation of resynthetised reference scan for spots going outside the detector

parent f74b6598
......@@ -1288,18 +1288,25 @@ def loadscan_2Dimages_galaxies_foilscan(mydata):
hf[ "image" ] = roiob.input_image
rois_dict_group = hf.require_group("rois_dict" )
for roikey, (origin, box) in roiob.red_rois.items():
roigroup=roikey+"/"
hf.require_group( roigroup )
hf[ roigroup +"origin" ] = origin
hf[ roigroup +"mask" ] = box
if roikey in rois_dict_group:
del rois_dict_group[roikey]
rois_dict_group[roikey] = h5py.SoftLink( "/"+ roigroup )
filename, dataname = split_hdf5_address( mydata["expdata"] )
data = np.array(h5py.File(filename,"r")[dataname][:])
for roikey, (origin, box) in roiob.red_rois.items():
roigroup=roikey[3:]+"/" # with "ROI" removed, nly numerical part
......@@ -3946,6 +3953,10 @@ def superR_recreate_rois(mydata):
## where new rois and bnew scan are written
target_filename : "newrois.h5:ROI_B_FIT8/"
## filter_rois=1 activates a filtering mechanism which discards ROIS according to a
## simple statistical criteria which is har coded in file reponse_percussionelle.py
## routine get_spots_list
filter_rois : 1
"""
foil_scan_address = mydata["old_scan_address"]
......
......@@ -1433,7 +1433,9 @@ def DOROIS(filename = "../nonregressions/demo_imaging.hdf5" , groupname = "ROI_B
for i in range(len(newspots)):
newspots[i] = newspots[i]/newspots[i].sum()
spot_sum = newspots[i].sum()
if spot_sum:
newspots[i] = newspots[i]/spot_sum
h5["matrix"] = newspots
......
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