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
fbbc1685
Commit
fbbc1685
authored
Dec 02, 2020
by
myron
Browse files
tests with esynth OK
parent
6d9a61cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
fitcc/frsv.cc
View file @
fbbc1685
...
...
@@ -711,7 +711,7 @@ int main(int argc, char ** argv) {
}
pb
.
settoVal
(
X
,
0.0
f
);
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
<
2
0
;
iter
++
)
{
for
(
int
iter
=
0
;
iter
<
1
0
;
iter
++
)
{
pb
.
settozero
(
grad
);
...
...
nonregressions/volumes/esrf_scans/esynth/batch_extraction_esynth1.py
View file @
fbbc1685
...
...
@@ -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"
:
Fals
e
,
"do_step_scalars"
:
Tru
e
,
"do_step_interpolation_coefficients"
:
Fals
e
,
"do_step_interpolation_coefficients"
:
Tru
e
,
"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
())
volum
es
_list
=
list
(
f
.
keys
())
ene_list
=
[]
for
v
in
volum_list
:
for
v
in
volum
es
_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
())
volum
es
_list
=
list
(
f
.
keys
())
ene_list
=
[]
for
v
in
volum_list
:
for
v
in
volum
es
_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
]
volum
es
_list
=
[
volum
es
_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
(
volum
es
_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
(
volum
es
_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
()
...
...
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