Commit fbbc1685 authored by myron's avatar myron
Browse files

tests with esynth OK

parent 6d9a61cf
......@@ -711,7 +711,7 @@ int main(int argc, char ** argv) {
}
pb.settoVal(X ,0.0f);
for(int iter_c = 0; iter_c<5; iter_c++) {
for(int iter_c = 0; iter_c<10; iter_c++) {
pb.setVectA_and_Mat( XvectA, ffacts ) ;
......@@ -734,7 +734,7 @@ int main(int argc, char ** argv) {
}
for(int iter = 0; iter<20; iter++) {
for(int iter = 0; iter<10; iter++) {
pb.settozero(grad);
......
......@@ -18,10 +18,6 @@ def main():
roi_scan_num = [245,246,247]
reference_scan_list = [245, 246, 247]
monitor_column = "izero/0.000001"
......@@ -64,8 +60,8 @@ def main():
])
# selected_rois = list(range(0,24)) + list( range(36,60) )
selected_rois = list( range(60,72) )
selected_rois = list( range(24,36) ) + list( range(60,72) )
# selected_rois = list(range(0,72))
volume_retrieval_beta = 6.0e-20
volume_retrieval_niter = 100
......@@ -77,9 +73,9 @@ def main():
"do_step_fit_reference_response": False,
"do_step_resynthetise_reference": False,
"do_step_scalars" : False,
"do_step_scalars" : True,
"do_step_interpolation_coefficients": False,
"do_step_interpolation_coefficients": True,
"do_step_finalise_for_fit": True
}
......@@ -250,7 +246,7 @@ def extract_sample_givenrois(
monitor_column = monitor_column,
signal_path = signal_path
)
process_input(input_string, exploit_slurm_mpi = 1)
process_input(input_string, exploit_slurm_mpi = 0)
def resynthetise_scan(
......@@ -299,7 +295,7 @@ def get_scalars( iE = None,
delta_address : {reference_file}:/rois_and_reference/scans/ScansSum
load_factors_from :
nbin : 1
target_address : {target_file}:/{iE}/scal_prods
target_address : {target_file}:/E{iE}/scal_prods
roi_keys : {selected_rois}
""" . format( iE = iE,
signals_file = signals_file ,
......@@ -315,10 +311,10 @@ def get_scalars( iE = None,
def InterpInfo_Esynt_components(peaks_shifts , signals_file=None, custom_ene_list = None, custom_components = None, selected_rois = None ):
f = h5py.File(signals_file,"r")
volum_list = list(f.keys())
volumes_list = list(f.keys())
ene_list = []
for v in volum_list:
for v in volumes_list:
dg_Scans = [ t for t in f[v]["scans"].keys() if t[:4]=="Scan"]
ene_list.append( f[v]["scans"][dg_Scans[0]] ["motorDict"]["energy"][()] )
......@@ -367,20 +363,20 @@ def InterpInfo_Esynt( peaks_shifts ,
):
f = h5py.File(signals_file,"r")
volum_list = list(f.keys())
volumes_list = list(f.keys())
ene_list = []
for v in volum_list:
for v in volumes_list:
dg_Scans = [ t for t in f[v]["scans"].keys() if t[:4]=="Scan"]
ene_list.append( f[v]["scans"][dg_Scans[0]] ["motorDict"]["energy"][()] )
print ( " ecco " , custom_ene_list)
print (" ecco ene_list", np.sort(np.add.outer( ene_list , peaks_shifts[selected_rois]).ravel()) )
print ( " Here custom ene list " , custom_ene_list)
print (" Here all the analyser energies ", np.sort(np.add.outer( ene_list , peaks_shifts[selected_rois]).ravel()) )
order = list(np.argsort( ene_list ))
ene_list = [ ene_list[ii] for ii in order]
volum_list = [ volum_list[ii] for ii in order]
volumes_list = [ volumes_list[ii] for ii in order]
info_dict = {}
......@@ -388,14 +384,14 @@ def InterpInfo_Esynt( peaks_shifts ,
info_dict[str(i_intervallo)] = {}
info_dict[str(i_intervallo)]["E"] = custom_ene_list[ i_intervallo ]
info_dict[str(i_intervallo)]["coefficients"]={}
for t_vn, t_ene in list(zip( volum_list, ene_list )):
for t_vn, t_ene in list(zip( volumes_list, ene_list )):
info_dict[str(i_intervallo)]["coefficients" ][ t_vn ]={}
for i_intervallo in range(len( custom_ene_list)-1):
cE1 = custom_ene_list[ i_intervallo ]
cE2 = custom_ene_list[ i_intervallo+1 ]
for t_vn, t_ene in list(zip(volum_list, ene_list ))[0:]:
for t_vn, t_ene in list(zip(volumes_list, ene_list ))[0:]:
for roi_num, de in enumerate( peaks_shifts ):
if selected_rois and roi_num not in selected_rois:
continue
......@@ -590,7 +586,7 @@ def get_volume_Esynt(
interpolation_infos_file = interpolation_infos_file
)
os.system("mkdir DATASFORCC")
process_input( inputstring, exploit_slurm_mpi = 1)
process_input( inputstring, exploit_slurm_mpi = 0)
main()
......
Markdown is supported
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