Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdc
GRIS Gregor Infrared Spectrograph
grisinv
Commits
e7863ff4
Commit
e7863ff4
authored
Nov 30, 2021
by
Vigeesh Gangadharan
Browse files
free commincator works, try return
parent
b4cd05c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
grisinv/invert.py
View file @
e7863ff4
...
...
@@ -247,47 +247,44 @@ def vfisv(
progress
=
np
.
zeros
(
shape
=
(
1
),
dtype
=
"int32"
)
common_comm
.
Recv
([
progress
,
MPI
.
INT
],
source
=
MPI
.
ANY_SOURCE
,
tag
=
4000
+
i
)
print
(
'Completed inversions'
)
# receive the inversion result from grisinv:master
data
=
np
.
zeros
(
shape
=
(
vfisv_data
.
LX
,
vfisv_data
.
LY
,
vfisv_data
.
LZ
),
dtype
=
"float32"
,
order
=
"F"
,
)
print
(
'1.'
)
common_comm
.
Recv
([
data
,
MPI
.
FLOAT
],
source
=
1
,
tag
=
4000
)
# TODO: Clean this part
# Get the fits
print
(
'2.'
)
sifit
=
np
.
zeros_like
(
vfisv_data
.
SI
)
common_comm
.
Recv
([
sifit
,
MPI
.
FLOAT
],
source
=
1
,
tag
=
6660
)
print
(
'3.'
)
sqfit
=
np
.
zeros_like
(
vfisv_data
.
SQ
)
common_comm
.
Recv
([
sqfit
,
MPI
.
FLOAT
],
source
=
1
,
tag
=
6661
)
print
(
'4.'
)
sufit
=
np
.
zeros_like
(
vfisv_data
.
SU
)
common_comm
.
Recv
([
sufit
,
MPI
.
FLOAT
],
source
=
1
,
tag
=
6662
)
print
(
'5.'
)
svfit
=
np
.
zeros_like
(
vfisv_data
.
SV
)
common_comm
.
Recv
([
svfit
,
MPI
.
FLOAT
],
source
=
1
,
tag
=
6663
)
print
(
'6. Disconnecting intercommunicator'
)
# disengage vifisv:master+slaves
common_comm
.
Free
()
print
(
'7. Disconnecting intracommunicator'
)
pycomm
.
Free
()
p
rint
(
'Disconnected'
)
p
ycomm
.
Free
(
)
# TODO: Clean this
# arrange data for output into maps.
inv_data
,
stokes_data
=
process_vfisv_output
(
data
,
sifit
,
sqfit
,
sufit
,
svfit
,
vfisv_data
)
print
(
'Output processesd'
)
# change the vfisv_data to a header list here and pass the header for return
header
=
make_header
(
vfisv_data
)
print
(
'returning data'
)
return
inv_data
,
stokes_data
,
header
...
...
@@ -756,6 +753,7 @@ def write_fits(data, header, out, errors=None):
errors
,
overwrite
=
True
,
output_verify
=
"silentfix+exception"
,
checksum
=
True
)
print
(
'Return after Dones'
)
return
None
...
...
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