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
787c4612
Commit
787c4612
authored
Oct 08, 2020
by
myron
Browse files
saving opional_solution factors to be used for harvesting and equalisation
parent
b0ccb329
Changes
1
Hide whitespace changes
Inline
Side-by-side
XRStools/XRS_swissknife.py
View file @
787c4612
...
...
@@ -2507,11 +2507,11 @@ def superR_getVolume_fullfit(mydata):
plane_contrib
=
np
.
tensordot
(
m
,
probes
,
axes
=
[
[
1
,
2
],
[
1
,
2
]
]
)
scal_dd
+=
(
m
*
m
).
sum
()
print
(
" zscan_keys "
,
zscan_keys
)
keypos
=
zscan_keys
.
index
(
zkey
)
scal_ds
[:]
=
scal_ds
+
np
.
tensordot
(
plane_contrib
,
solution
[
keypos
],
axes
=
[
[
0
,
1
],
[
0
,
1
]
]
)
scal_ss
[:]
=
scal_ss
+
np
.
tensordot
(
np
.
tensordot
(
SS
,
solution
[
keypos
],
axes
=
[[
1
],[
1
]])
,
solution
[
keypos
],
axes
=
[[
0
,
1
],[
1
,
0
]])
fattori
[
rk
]
=
scal_ds
/
scal_ss
### Renormalising the overall strenght of all the factors
sum
=
0.0
for
rk
in
roi_keys
:
...
...
@@ -3038,7 +3038,6 @@ def superR_scal_deltaXimages(mydata):
scal_dd
+=
(
m
*
m
).
sum
()
print
(
" zscan_keys "
,
zscan_keys
)
keypos
=
zscan_keys
.
index
(
zkey
)
scal_ds
[:]
=
scal_ds
+
np
.
tensordot
(
plane_contrib
,
solution
[
keypos
],
axes
=
[
[
0
,
1
],
[
0
,
1
]
]
)
...
...
@@ -3059,16 +3058,19 @@ def superR_scal_deltaXimages(mydata):
fattori
[
rk
]
=
scal_ds
/
scal_ss
### Renormalising the overall strenght of all the factors
### Renormalising the overall strenght of all the factors
sum
=
0.0
for
rk
in
roi_keys
:
sum
=
sum
+
fattori
[
rk
]
*
fattori
[
rk
]
for
rk
in
roi_keys
:
fattori
[
rk
]
=
fattori
[
rk
]
/
np
.
sqrt
(
sum
/
len
(
roi_keys
)
)
fattori
[
rk
]
=
float
(
fattori
[
rk
]
/
np
.
sqrt
(
sum
/
len
(
roi_keys
)
))
if
"load_factors_from"
in
mydata
:
fattori
=
json
.
load
(
open
(
mydata
[
"load_factors_from"
],
"r"
)
)
if
"save_factors_on"
in
mydata
:
json
.
dump
(
fattori
,
open
(
mydata
[
"save_factors_on"
],
"w"
)
)
## These arrays below will contain, after summation and for each process,
## the contribution of the process's workload
...
...
@@ -3245,7 +3247,8 @@ def superR_scal_deltaXimages(mydata):
h5f
.
flush
()
h5f
.
close
()
return
fattori
def
superR_scal_deltaXimages_Esynt
(
mydata
):
""" This step supposes that you have:
...
...
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