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
f6a9c7ab
Commit
f6a9c7ab
authored
Nov 20, 2020
by
myron
Browse files
calculation setup for pure spectral 1+2D scans finished
parent
e7c36a66
Changes
2
Hide whitespace changes
Inline
Side-by-side
XRStools/XRS_swissknife.py
View file @
f6a9c7ab
...
...
@@ -3546,7 +3546,7 @@ def superR_scal_deltaXimages_Esynt(mydata):
for
i
,
rk
in
enumerate
(
roi_keys
):
fattori
[
rk
]
=
1.0
if
"load_factors_from"
in
mydata
:
if
"load_factors_from"
in
mydata
and
mydata
[
"load_factors_from"
]
not
in
[
None
,
"None"
]
:
loaded_fattori
=
json
.
load
(
open
(
mydata
[
"load_factors_from"
],
"r"
)
)
for
i
,
rk
in
enumerate
(
roi_keys
):
...
...
nonregressions/volumes/test2/batch_extraction_esynth1.py
View file @
f6a9c7ab
...
...
@@ -54,7 +54,7 @@ def extract_sample_givenrois(
Ydim
=
None
,
Zdim
=
None
,
Edim
=
None
,
signal_target_file
=
None
signal
s
_target_file
=
None
):
inputstring
=
"""
...
...
@@ -72,7 +72,7 @@ def extract_sample_givenrois(
Zdim : {Zdim}
Edim : {Edim}
signalfile : {signal_target_file}
signalfile : {signal
s
_target_file}
"""
.
format
(
roi_path
=
roi_path
,
data_path_template
=
data_path_template
,
...
...
@@ -81,7 +81,7 @@ def extract_sample_givenrois(
Ydim
=
Ydim
,
Zdim
=
Zdim
,
Edim
=
Edim
,
signal_target_file
=
signal_target_file
)
signal
s
_target_file
=
signal
s
_target_file
)
process_input
(
inputstring
,
exploit_slurm_mpi
=
0
)
...
...
@@ -121,7 +121,6 @@ def InterpInfo_Esynt( cenom , energy_exp_grid = None, custom_ene_list = Non
info_dict
[
str
(
i_interval
)][
"coefficients"
][
str
(
i_ene
)
][
str
(
roi_num
)
]
=
alpha
info_dict
[
str
(
i_interval
+
1
)][
"coefficients"
][
str
(
i_ene
)
][
str
(
roi_num
)
]
=
1
-
alpha
print
(
info_dict
)
return
info_dict
...
...
@@ -208,20 +207,20 @@ def get_reference( roi_path = None, reference_target_file = None ):
def
get_scalars
(
iE
=
None
,
signals_file
=
None
,
reference_file
=
None
,
target_file
=
None
target_file
=
None
):
inputstring
=
"""
superR_scal_deltaXimages_Esynt :
sample_address : {signals_file}:/E{iE}
delta_address : {reference_file}:/Scan0
load_factors_from :
load_factors_from :
nbin : 1
target_address : {target_file}:/
scals_
{iE}/scal_prods
"""
%
format
(
iE
=
iE
,
target_address : {target_file}:/{iE}/scal_prods
"""
.
format
(
iE
=
iE
,
signals_file
=
signals_file
,
reference_file
=
reference_file
,
target_file
=
target_file
target_file
=
target_file
,
)
process_input
(
inputstring
,
exploit_slurm_mpi
=
0
)
...
...
@@ -233,18 +232,15 @@ def get_volume_Esynt( scalarprods_file = None, interpolation_file = None):
inputstring
=
"""
superR_getVolume_Esynt :
scalprods_address : {scalarprods_file
}:/
target_address : {scalarprods_file
}:/data_for_volumes
scalprods_address : {scalarprods_file}:/
target_address : {scalarprods_file}:/data_for_volumes
dict_interp : {interpolation_file}
debin : [1, 1]
output_prefix : DATASFORCC/test0_
"""
.
format
(
scalarprods_file
=
scalarprods_file
,
interpolation_file
=
interpolation_file
)
s
=
inputstring
.
format
(
nick
=
nick
,
volumes_file
=
volumes_file
)
print
(
" INPUT "
,
s
)
process_input
(
s
,
exploit_slurm_mpi
=
1
)
)
process_input
(
inputstring
,
exploit_slurm_mpi
=
1
)
def
myOrder
(
tok
):
...
...
@@ -309,17 +305,14 @@ scans_to_use_for_roi = list(range(1,20))
first_scan_n
=
1
Ydim
=
25
Zdim
=
19
Edim
=
9
roi_target_path
=
"results/myrois.h5:/ROIS"
reference_target_file
=
"results/response.h5"
signal_target_file
=
"results/extracted.h5"
signal
s
_target_file
=
"results/extracted.h5"
scalarprods_target_file
=
"results/scalar_prods.h5"
...
...
@@ -334,7 +327,7 @@ reference_file = reference_target_file
if
(
1
):
# SAMPLE extraction
if
(
0
):
# SAMPLE extraction
extract_sample_givenrois
(
roi_path
=
roi_path
,
data_path_template
=
data_path_template
,
...
...
@@ -344,22 +337,27 @@ if(1): # SAMPLE extraction
Ydim
=
Ydim
,
Zdim
=
Zdim
,
Edim
=
Edim
,
signal_target_file
=
signal_target_file
signal
s
_target_file
=
signal
s
_target_file
)
signal_file
=
signal_target_file
signals_file
=
signals_target_file
interpolation_infos_file
=
"interpolation_infos.json"
if
(
0
):
# INTERPOLATION ESYNTH
info_dict
=
InterpInfo_Esynt
(
cenom
,
energy_exp_grid
=
energy_exp_grid
,
custom_ene_list
=
energy_custom_grid
)
json
.
dump
(
info_dict
,
open
(
"interpolation.json"
,
"w"
),
indent
=
4
)
interpolation_file
=
"interpolation.json"
if
(
1
):
json
.
dump
(
info_dict
,
open
(
interpolation_infos_file
,
"w"
),
indent
=
4
)
if
(
0
):
os
.
system
(
"rm %s"
%
scalarprods_target_file
)
for
iE
in
range
(
Edim
)
:
get_scalars
(
iE
=
iE
,
signals_file
=
signals_file
,
reference_file
=
reference_file
,
target_file
=
scalarprods_target_file
target_file
=
scalarprods_target_file
)
scalarprods_file
=
scalarprods_target_file
...
...
@@ -367,9 +365,9 @@ scalarprods_file = scalarprods_target_file
# ### ESYNTH
if
(
0
):
if
(
1
):
get_volume_Esynt
(
scalarprods_file
=
scalarprods_file
,
interpolation_file
=
interpolation_file
)
:
interpolation_file
=
interpolation_
infos_
file
)
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