Commit 55940064 authored by myron's avatar myron
Browse files

all non regression tests pass

parent a79301c5
......@@ -104,25 +104,21 @@ def prepare(
runit( s , work_dir, "05_setup_recentering.yaml" )
s="""
loadscan_2Dimages :
expdata : {data_file}
roiaddress : roi.h5:/ROI_AS_SELECTED
scan_interval : [{scan_for_roi},{scan_for_roi_P1}]
monitor_column : {monitorcolumn}
monitorcolumn : {monitorcolumn}
recenterings : recentering.h5:/recentering
recenterings_confirmed : recentering.h5:/confirmed_shift
signaladdress : Centered_sample_scans
sumto1D : 0
energycolumn : 'Anal Energy'
monitorcolumn : izero
""".format( data_file = data, scan_for_roi = scan_for_sample_roi , scan_for_roi_P1 = scan_for_sample_roi +1 , monitorcolumn = monitorcolumn )
runit( s , work_dir, "06_calculate_recentering.yaml" )
s="""
superR_fit_responses:
foil_scan_address : roi.h5:/ROI_AS_SELECTED/calibration_scan/scans/Scan%03d
......@@ -137,7 +133,6 @@ def prepare(
simmetrizza : 1
filter_rois : 0
target_file : fitted_response.h5:/ScanFittedResponse_%03d
MPI_N_PROCS : 1
fit_lines : 1
"""%( reference_scan, beta_response, reference_scan )
runit( s , work_dir, "07_fit.yaml" )
......@@ -149,7 +144,7 @@ def prepare(
nex : 0
old_scan_address : roi.h5:/ROI_AS_SELECTED/calibration_scan/scans/Scan%03d
filter_rois : 0
recenterings_refines : recentering.h5:/confirmed_shift
recenterings_refined : recentering.h5:/confirmed_shift
target_filename : newscan.h5:/ROI_AS_SELECTED/calibration_scan/scans/ScanReSynth_%03d
"""%( reference_scan, reference_scan, reference_scan )
runit( s , work_dir, "08_resynth.yaml" )
......@@ -202,7 +197,7 @@ def extract(
scan_interval : [{start}, {end}]
zmargin : 0
target : ../{result_file}:/fromscans_{start}_{end}
final_plot : PLOT
# final_plot : PLOT
DE : 0.0
niterLip : {niterLip}
niter : {niter}
......
......@@ -244,14 +244,14 @@ class Loader_map_as_anydict( object):
class myOrderedDict (collections.OrderedDict):
def __setitem__(self,a,b):
if type(a)==type("") and a in self:
self[a+"_tagkajs"]=b
self[a+"_TAG_this_key_is_given_twice"]=b
else:
## print super(myOrderedDict, self)
super(myOrderedDict, self).__setitem__(a,b )
def cleaned(key):
while key[-8:]=="_tagkajs":
while key[-28:]=="_TAG_this_key_is_given_twice":
key=key[:-8]
return key
......@@ -1281,7 +1281,7 @@ def extract_spectra(mydata):
final_plot : "PLOT" # or "NOPLOT"
"""
allowed_keys = [ "target","sample_address","scan_interval","roiaddress","DE","discard_threshold","threshold_fraction","zmargin", "flatTriggerer","slope","fitted_response","niter","niterLip","beta","weight_by_response","reference_scan", ]
allowed_keys = [ "target","sample_address","scan_interval","roiaddress","DE","discard_threshold","threshold_fraction","zmargin", "flatTriggerer","slope","fitted_response","niter","niterLip","beta","weight_by_response","reference_scan","reference_address" ]
check_allowed_keys(mydata, allowed_keys)
target_filename , target_groupname = split_hdf5_address( mydata["target"])
......@@ -1390,7 +1390,7 @@ def extract_spectra(mydata):
rois_keys = list(set.intersection( set(rois_keys), set(rois_keys_orig) ) )
printf(" After filtering the list of rois to be used is ", rois_keys )
print(" After filtering the list of rois to be used is ", rois_keys )
incidentE = None
if "motorDict/energy" in h5:
......@@ -3975,7 +3975,10 @@ def superR_recreate_rois(mydata):
h5f = h5py.File(recenterings_filename,"r")
h5 = h5f[recenterings_groupname]
recenterings= {}
chiavi = filterRoiList(h5.keys())
chiavi = filterRoiList(h5.keys(), prefix="")
for c in chiavi:
recenterings[int(c)]= h5[c][:]
assert(recenterings[int(c)].shape == (2,))
......
This diff is collapsed.
......@@ -9,8 +9,8 @@ if(1):
os.system("xz -d --keep preparation_run4_16/ROI.xz ; mv preparation_run4_16/ROI preparation_run4_16/roi.h5" )
os.system("xz -d --keep preparation_run4_16/roi_sample.h5.xz" )
spectra_extraction.prepare(
if 1:
spectra_extraction.prepare(
work_dir="preparation_run4_16",
data = "/data/id20/inhouse/data/run4_16/run6_ihr/rixs" ,
scan_for_roi= 66 ,
......@@ -27,7 +27,7 @@ if(1):
do_recentering= True,
beta_response = 1.0
)
)
spectra_extraction.extract(
work_dir="preparation_run4_16",
......@@ -51,5 +51,5 @@ ref = np.loadtxt( "results/spectra_ref.txt")
assert( abs(ref-results).max( )< 1.0e-7)
if os.environ["CLEAN_RESULTS"] == "true" :
if "CLEAN_RESULTS" in os.environ and os.environ["CLEAN_RESULTS"] == "true" :
os.system("rm results/*")
......@@ -280,5 +280,5 @@ lw_ex.save_average_Sqw(save_path+'/h2o_pixel_hq.dat', emin=0.0, emax=600.0, norm
check_results( os.path.join(save_path,'h2o_pixel_hq.dat') , os.path.join(save_path,"h2o_pixel_hq_ref.dat") )
if os.environ["CLEAN_RESULTS"] == "true" :
if "CLEAN_RESULTS" in os.environ and os.environ["CLEAN_RESULTS"] == "true" :
os.system("rm %s/*" % save_path)
......@@ -387,5 +387,5 @@ check_results(tosavepath("non_reg_output_gui_raman_mediumq.txt"),tosavepath("non
check_results(tosavepath("non_reg_output_gui_raman_highq.txt"),tosavepath("non_reg_output_gui_raman_reference_highq.txt"))
print(" OK " )
if os.environ["CLEAN_RESULTS"] == "true" :
if "CLEAN_RESULTS" in os.environ and os.environ["CLEAN_RESULTS"] == "true" :
os.system("rm %s/*" % save_path)
......@@ -282,5 +282,5 @@ lw_ex.save_average_Sqw(save_path+'/h2o_pixel_hq_small.dat', emin=0.0, emax=600.0
check_results( os.path.join(save_path,'h2o_pixel_hq_small.dat') , os.path.join(save_path,"h2o_pixel_hq_small.dat.ref") )
if os.environ["CLEAN_RESULTS"] == "true" :
if "CLEAN_RESULTS" in os.environ and os.environ["CLEAN_RESULTS"] == "true" :
os.system("rm %s/*" % save_path)
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