Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ixstools
xrstools
Commits
835241c4
Commit
835241c4
authored
Dec 02, 2020
by
myron
Browse files
peaks_shifts are read from elastic scan
parent
921ddb77
Changes
2
Hide whitespace changes
Inline
Side-by-side
nonregressions/volumes/esrf_scans/esynth/batch_extraction_esynth1.py
View file @
835241c4
...
...
@@ -7,6 +7,7 @@ import h5py
import
math
from
XRStools
import
tools_sequencer_esynth
from
XRStools
import
xrs_read
,
xrs_rois
import
os
def
main
():
...
...
@@ -25,11 +26,7 @@ def main():
Zdim
=
10
Edim
=
7
peaks_shifts
=
h5py
.
File
(
"../peaks_positions_for_analysers.h5"
,
"r"
)[
"peaks_positions"
][()]
assert
(
len
(
peaks_shifts
)
==
72
)
Enominal
=
np
.
median
(
peaks_shifts
)
peaks_shifts
-=
Enominal
elastic_scan_for_peaks_shifts
=
42
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():
resynthetised_reference_and_roi_target_file
=
"results/resynthetised_roi_and_scan.h5"
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
,
datadir
=
datadir
,
...
...
nonregressions/volumes/esrf_scans/interpolation/batch_extraction_interp.py
View file @
835241c4
...
...
@@ -26,11 +26,7 @@ def main():
Zdim
=
10
Edim
=
7
peaks_shifts
=
h5py
.
File
(
"../peaks_positions_for_analysers.h5"
,
"r"
)[
"peaks_positions"
][()]
assert
(
len
(
peaks_shifts
)
==
72
)
Enominal
=
np
.
median
(
peaks_shifts
)
peaks_shifts
-=
Enominal
elastic_scan_for_peaks_shifts
=
42
datadir
=
"/data/id20/inhouse/data/run3_20/run3_es949"
...
...
@@ -93,9 +89,27 @@ def main():
response_target_file
=
"results/response.h5"
############# correggi typo
resynthetised_reference_and_roi_target_file
=
"results/resyntetised_roi_and_scan.h5"
resynthetised_reference_and_roi_target_file
=
"results/resynthetised_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
,
datadir
=
datadir
,
filter_path
=
filter_path
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment