Commit 835241c4 authored by myron's avatar myron
Browse files

peaks_shifts are read from elastic scan

parent 921ddb77
...@@ -7,6 +7,7 @@ import h5py ...@@ -7,6 +7,7 @@ import h5py
import math import math
from XRStools import tools_sequencer_esynth from XRStools import tools_sequencer_esynth
from XRStools import xrs_read, xrs_rois
import os import os
def main(): def main():
...@@ -25,11 +26,7 @@ def main(): ...@@ -25,11 +26,7 @@ def main():
Zdim = 10 Zdim = 10
Edim = 7 Edim = 7
peaks_shifts = h5py.File("../peaks_positions_for_analysers.h5","r")["peaks_positions"][()] elastic_scan_for_peaks_shifts = 42
assert( len(peaks_shifts) == 72)
Enominal = np.median(peaks_shifts)
peaks_shifts-= Enominal
energy_custom_grid = [ 2*13.253006- 13.25551 , 13.253006, 13.25551, 13.258008, 13.260506 , 13.263004, 13.268 ] energy_custom_grid = [ 2*13.253006- 13.25551 , 13.253006, 13.25551, 13.258008, 13.260506 , 13.263004, 13.268 ]
...@@ -95,6 +92,27 @@ def main(): ...@@ -95,6 +92,27 @@ def main():
resynthetised_reference_and_roi_target_file = "results/resynthetised_roi_and_scan.h5" resynthetised_reference_and_roi_target_file = "results/resynthetised_roi_and_scan.h5"
interpolation_infos_file = "interpolation_infos.json" interpolation_infos_file = "interpolation_infos.json"
###########################################################################################
###### LOADING PEAKS SHIFTS
###### peaks_shifts = h5py.File("../peaks_positions_for_analysers.h5","r")["peaks_positions"][()]
###### assert( len(peaks_shifts) == 72)
roiob = xrs_rois.roi_object()
roiob.loadH5( roi_target_path )
elastic = xrs_read.Hydra( datadir )
elastic.set_roiObj( roiob )
elastic.get_compensation_factor( elastic_scan_for_peaks_shifts , method='sum')
el_dict = elastic.cenom_dict
Enominal = np.median( list( el_dict.values() ) )
peaks_shift = np.array([ el_dict["ROI%02d"%i] if ("ROI%02d"%i) in el_dict else nan for i in range 72 ] )
Enominal = np.median(peaks_shifts)
peaks_shifts-= Enominal
##############################################################
##########################################################################
tools_sequencer_esynth.tools_sequencer( peaks_shifts = peaks_shifts , tools_sequencer_esynth.tools_sequencer( peaks_shifts = peaks_shifts ,
datadir = datadir , datadir = datadir ,
......
...@@ -26,11 +26,7 @@ def main(): ...@@ -26,11 +26,7 @@ def main():
Zdim = 10 Zdim = 10
Edim = 7 Edim = 7
peaks_shifts = h5py.File("../peaks_positions_for_analysers.h5","r")["peaks_positions"][()] elastic_scan_for_peaks_shifts = 42
assert( len(peaks_shifts) == 72)
Enominal = np.median(peaks_shifts)
peaks_shifts-= Enominal
datadir = "/data/id20/inhouse/data/run3_20/run3_es949" datadir = "/data/id20/inhouse/data/run3_20/run3_es949"
...@@ -93,9 +89,27 @@ def main(): ...@@ -93,9 +89,27 @@ def main():
response_target_file = "results/response.h5" response_target_file = "results/response.h5"
############# correggi typo resynthetised_reference_and_roi_target_file = "results/resynthetised_roi_and_scan.h5"
resynthetised_reference_and_roi_target_file = "results/resyntetised_roi_and_scan.h5"
###########################################################################################
###### LOADING PEAKS SHIFTS
###### peaks_shifts = h5py.File("../peaks_positions_for_analysers.h5","r")["peaks_positions"][()]
###### assert( len(peaks_shifts) == 72)
roiob = xrs_rois.roi_object()
roiob.loadH5( roi_target_path )
elastic = xrs_read.Hydra( datadir )
elastic.set_roiObj( roiob )
elastic.get_compensation_factor( elastic_scan_for_peaks_shifts , method='sum')
el_dict = elastic.cenom_dict
Enominal = np.median( list( el_dict.values() ) )
peaks_shift = np.array([ el_dict["ROI%02d"%i] if ("ROI%02d"%i) in el_dict else nan for i in range 72 ] )
Enominal = np.median(peaks_shifts)
peaks_shifts-= Enominal
##############################################################
##########################################################################
tools_sequencer_interp.tools_sequencer( peaks_shifts = peaks_shifts , tools_sequencer_interp.tools_sequencer( peaks_shifts = peaks_shifts ,
datadir = datadir , datadir = datadir ,
filter_path = filter_path , filter_path = filter_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