Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ixstools
xrstools
Commits
734f930a
Commit
734f930a
authored
Dec 16, 2020
by
myron
Browse files
a forgotten check on input variables
parent
5f43930b
Changes
2
Hide whitespace changes
Inline
Side-by-side
XRStools/XRS_swissknife.py
View file @
734f930a
...
...
@@ -1063,7 +1063,7 @@ def loadscan_2Dimages_galaxies(mydata):
#
"""
allowed_keys
=
[
"roiaddress"
,
'Ydim'
,
'Zdim'
,
'Edim'
,
"signalfile"
,
"monitor_address"
,
"expdata"
,
]
allowed_keys
=
[
"roiaddress"
,
'Ydim'
,
'Zdim'
,
'Edim'
,
"signalfile"
,
"monitor_address"
,
"expdata"
,
"scan_interval"
]
check_allowed_keys
(
mydata
,
allowed_keys
)
roiaddress
=
None
...
...
nonregressions/volumes/test3/batch_extraction_esynth1.py
View file @
734f930a
g
# newfactors e' gia pronto , dopo verifica fuzionalita di roi_sel in ximages
# newfactors e' gia pronto , dopo verifica fuzionalita di roi_sel in ximages
import
numpy
as
np
import
h5py
import
glob
...
...
@@ -8,6 +8,10 @@ BATCH_PARALLELISM = 1
import
os
def
main
():
os
.
system
(
"mkdir results"
)
peaks_shifts
=
np
.
array
(
[
0.0
,
0.0
,
...
...
@@ -15,21 +19,23 @@ def main():
0.0
,
])
-
0.0
datadir
=
"/data/raffaela/GS9_dataGalaxies/"
filter_path
=
datadir
+
"mymask.h5:/mymask"
filename_template
=
"GS9_%05d_01.nxs"
dataprefix
=
"/data/raffaela/"
datadir
=
dataprefix
+
"GS9_dataGalaxies/"
filter_path
=
dataprefix
+
"mymask.h5:/mymask"
filename_template
=
"GS9_%05d_01"
data_path_template
=
datadir
+
filename_template
+
".nxs:/root_spyc_config1d_RIXS_00001/scan_data/data_07"
monitor_path_template
=
None
# monitor_path_template = datadir + filename_template +"_monitor.hd5:/monitor"
energy_exp_grid
=
h5py
.
File
(
datadir
+
(
filename_template
%
1
)
+
".nxs"
,
"r"
)[
"/root_spyc_config1d_RIXS_00001/actuator_1_1"
][()]
print
(
datadir
+
(
filename_template
%
1
)
+
".nxs"
)
energy_exp_grid
=
h5py
.
File
(
datadir
+
(
filename_template
%
1
)
+
".nxs"
,
"r"
)[
"/root_spyc_config1d_RIXS_00001/scan_data/actuator_1_1"
][()]
energy_custom_grid
=
np
.
array
(
energy_exp_grid
)
energy_custom_grid
[
0
]
-=
0.1
energy_custom_grid
[
-
1
]
-=
0.1
energy_custom_grid
[
+
1
]
-=
0.1
scan_interval
=
[
1
,
257
]
# from 1 to 475 included
...
...
@@ -37,15 +43,12 @@ def main():
Zdim
=
16
Edim
=
19
reference_scan_list
=
list
(
range
(
1
,
20
))
custom_components_file
=
None
# custom_components_file = "components.h5"
roi_scan_num
=
list
(
range
(
1
,
20
))
reference_clip
=
None
# reference_clip = [ 90, 180 ]
...
...
@@ -60,18 +63,17 @@ def main():
[
"niter_global"
,
1
]
])
resynth_z_square
=
0
selected_rois
=
list
(
range
(
0
,
4
)
)
)
selected_rois
=
list
(
range
(
0
,
4
)
)
steps_to_do
=
{
"do_step_make_roi"
:
False
,
"do_step_sample_extraction"
:
Fals
e
,
"do_step_sample_extraction"
:
Tru
e
,
"do_step_extract_reference_scan"
:
False
,
"do_step_fit_reference_response"
:
False
,
"do_step_resynthetise_reference"
:
False
,
"do_step_scalar"
:
Tru
e
,
"do_step_scalar"
:
Fals
e
,
"do_step_interpolation_coefficients"
:
False
,
"do_step_finalise_for_fit"
:
False
}
...
...
@@ -125,7 +127,7 @@ def main():
energy_custom_grid
=
energy_custom_grid
,
custom_components_file
=
use_
custom_components_file
,
custom_components_file
=
custom_components_file
,
interpolation_infos_file
=
interpolation_infos_file
)
...
...
@@ -402,7 +404,6 @@ def get_scalars( iE = None,
def
get_volume_Esynt
(
scalarprods_file
=
None
,
interpolation_file
=
None
):
os
.
system
(
"mkdir DATASFORCC"
)
os
.
system
(
"mkdir results"
)
inputstring
=
"""
superR_getVolume_Esynt :
...
...
@@ -449,66 +450,48 @@ def reshuffle( volumefile = "volumes.h5", nick = None ):
## THE FOLLOWING PART IS THE RELEVANT ONE
tools_sequencer
(
peaks_shifts
=
None
,
datadir
=
None
,
filter_path
=
None
,
roi_scan_num
=
None
,
roi_target_path
=
None
,
data_path_template
=
None
,
def
tools_sequencer
(
peaks_shifts
=
None
,
datadir
=
None
,
filter_path
=
None
,
roi_scan_num
=
None
,
roi_target_path
=
None
,
data_path_template
=
None
,
steps_to_do
=
None
,
scan_interval
=
None
,
Ydim
=
None
,
Zdim
=
None
,
Edim
=
None
,
scan_interval
=
None
,
Ydim
=
None
,
Zdim
=
None
,
Edim
=
None
,
monitor_path_template
=
None
,
signals_target_file
=
None
,
monitor_path_template
=
None
,
signals_target_file
=
None
,
reference_scan_list
=
None
,
reference_clip
=
None
,
extracted_reference_target_file
=
None
,
extracted_reference_target_file
=
None
,
isolate_spot_by
=
None
,
isolate_spot_by
=
None
,
response_target_file
=
None
,
response_fit_options
=
None
,
resynthetised_reference_and_roi_target_file
=
None
,
resynthetised_reference_and_roi_target_file
=
None
,
resynth_z_square
=
None
,
selected_rois
=
None
,
scalar_products_target_file
=
None
,
energy_custom_grid
=
None
,
energy_custom_grid
=
None
,
custom_components_file
=
None
,
interpolation_infos_file
=
None
)
interpolation_infos_file
=
None
,
def
tools_sequencer
(
peaks_shifts
=
None
,
datadir
=
None
,
filter_path
=
None
,
data_path_template
=
None
,
energy_custom_grid
=
None
,
energy_exp_grid
=
None
,
monitor_path_template
=
None
,
scan_interval
=
None
,
scans_to_use_for_roi
=
None
,
Ydim
=
None
,
Zdim
=
None
,
Edim
=
None
,
roi_target_path
=
None
,
reference_target_file
=
None
,
signals_target_file
=
None
,
scalarprods_target_file
=
None
,
steps_to_do
=
None
,
use_custom_components
=
None
custom_components
=
None
)
:
...
...
@@ -518,7 +501,7 @@ def tools_sequencer( peaks_shifts = None,
roi_path
=
roi_target_path
if
(
steps_to_do
[
"do_step_make_reference"
]):
if
(
"do_step_make_reference"
in
steps_to_do
and
steps_to_do
[
"do_step_make_reference"
]):
get_reference
(
roi_path
=
roi_path
,
reference_target_file
=
reference_target_file
)
reference_file
=
reference_target_file
...
...
@@ -541,7 +524,7 @@ def tools_sequencer( peaks_shifts = None,
if
(
steps_to_do
[
"do_step_scalar
_products
"
]):
if
(
steps_to_do
[
"do_step_scalar"
]):
os
.
system
(
"rm %s"
%
scalarprods_target_file
)
for
iE
in
range
(
Edim
)
:
get_scalars
(
iE
=
iE
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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