Skip to content
GitLab
Menu
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
e519bd69
Commit
e519bd69
authored
Nov 23, 2020
by
myron
Browse files
tests OK
parent
2fd2b1ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
nonregressions/volumes/test2/batch_extraction_esynth1.py
View file @
e519bd69
...
@@ -7,18 +7,14 @@ import json
...
@@ -7,18 +7,14 @@ import json
BATCH_PARALLELISM
=
1
BATCH_PARALLELISM
=
1
import
os
import
os
def
main
():
def
main
():
peaks_shifts
=
np
.
array
(
peaks_shifts
=
np
.
array
(
[
6471.983002
,
[
6471.983002
,
6471.318152
,
6471.318152
,
6470.612314
,
6470.612314
,
6471.217828
,
6471.217828
,
])
])
-
6470.6
Enominal
=
6470.6
peaks_shifts
-=
Enominal
datadir
=
"/data/scisofttmp/mirone/Loic1/data/"
datadir
=
"/data/scisofttmp/mirone/Loic1/data/"
filter_path
=
datadir
+
"../mask.h5:/filter"
filter_path
=
datadir
+
"../mask.h5:/filter"
filename_template
=
"HC-D_2Dmap_%04d"
filename_template
=
"HC-D_2Dmap_%04d"
...
@@ -26,13 +22,14 @@ def main():
...
@@ -26,13 +22,14 @@ def main():
monitor_path_template
=
datadir
+
filename_template
+
"_monitor.hd5:/monitor"
monitor_path_template
=
datadir
+
filename_template
+
"_monitor.hd5:/monitor"
# energy_custom_grid = np.array([6746.0,6754.0,6755.5,6756.2,6757.5,6759.3,6762.5,6770.0,6790.5])
# energy_custom_grid = np.array([6746.0,6754.0,6755.5,6756.2,6757.5,6759.3,6762.5,6770.0,6790.5])
energy_custom_grid
=
np
.
array
([
6744.0
,
6754.0
,
6755.5
,
6756.2
,
6757.5
,
6759.3
,
6762.5
,
6770.0
,
6792
])
# energy_custom_grid = np.array([6744.0,6754.0, 6754.8, 6755.5,6756.2,6757.5, 6758.63, 6759.3,6762.5,6770.0,6792])
# energy_custom_grid = np.array([6744.0,6754.0,6755.5,6756.2,6757.5,6759.3,6762.5,6770.0,6792])
energy_custom_grid
=
np
.
array
([
6744.0
,
6754.0
,
6754.8
,
6755.5
,
6756.2
,
6757.5
,
6758.63
,
6759.3
,
6762.5
,
6770.0
,
6792
])
energy_exp_grid
=
h5py
.
File
(
datadir
+
(
filename_template
%
1
)
+
".nxs"
,
"r"
)[
"/root.spyc.config1d_RIXS_0024/scan_data/actuator_1_1"
][()]
energy_exp_grid
=
h5py
.
File
(
datadir
+
(
filename_template
%
1
)
+
".nxs"
,
"r"
)[
"/root.spyc.config1d_RIXS_0024/scan_data/actuator_1_1"
][()]
scan_interval
=
[
1
,
476
]
# from 1 to 475 included
scan_interval
=
[
1
,
476
]
# from 1 to 475 included
scans_to_use_for_roi
=
list
(
range
(
1
,
20
))
Ydim
=
25
Ydim
=
25
Zdim
=
19
Zdim
=
19
...
@@ -49,12 +46,15 @@ def main():
...
@@ -49,12 +46,15 @@ def main():
"do_step_sample_extraction"
:
False
,
"do_step_sample_extraction"
:
False
,
"do_step_scalar_products"
:
False
,
"do_step_scalar_products"
:
False
,
"do_step_interpolation_coefficients"
:
True
,
"do_step_interpolation_coefficients"
:
True
,
"do_step_finalise_for_fit"
:
True
"do_step_finalise_for_fit"
:
True
}
}
use_custom_components
=
None
use_custom_components
=
None
# use_custom_components = "components.h5"
# use_custom_components = "components.h5"
scans_to_use_for_roi
=
list
(
range
(
1
,
20
))
tools_sequencer
(
peaks_shifts
=
peaks_shifts
,
tools_sequencer
(
peaks_shifts
=
peaks_shifts
,
datadir
=
datadir
,
datadir
=
datadir
,
...
...
nonregressions/volumes/test2/extract_components.py
View file @
e519bd69
...
@@ -9,7 +9,7 @@ model = NMF(n_components=NC, init='random', random_state=0, max_iter = 200)
...
@@ -9,7 +9,7 @@ model = NMF(n_components=NC, init='random', random_state=0, max_iter = 200)
d
=
File
(
"solution_all_spectra.h5"
,
"r"
)
[
"data"
][()]
d
=
File
(
"solution_all_spectra.h5"
,
"r"
)
[
"data"
][()]
d
.
shape
=
9
,
-
1
d
.
shape
=
d
.
shape
[
0
]
,
-
1
W
=
model
.
fit_transform
(
d
.
T
)
W
=
model
.
fit_transform
(
d
.
T
)
...
...
Write
Preview
Supports
Markdown
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