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
Bo Zhang
csst
Commits
263564e9
Commit
263564e9
authored
Apr 29, 2022
by
BO ZHANG
🏀
Browse files
force float32 in instrumental correction
parent
8b0f1aaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst/msc/inst_corr.py
View file @
263564e9
...
...
@@ -146,7 +146,7 @@ class CsstMscInstrumentProc(CsstProcessor):
assert
isinstance
(
raw
,
CsstMscImgData
)
self
.
__img
=
np
.
copy
(
raw
.
data
)
self
.
__wht
=
np
.
zeros_like
(
raw
.
data
,
dtype
=
float
)
self
.
__wht
=
np
.
zeros_like
(
raw
.
data
,
dtype
=
np
.
float
32
)
self
.
__flg
=
np
.
zeros_like
(
raw
.
data
,
dtype
=
np
.
uint16
)
exptime
=
raw
.
get_keyword
(
'EXPTIME'
,
hdu
=
0
)
...
...
@@ -163,9 +163,9 @@ class CsstMscInstrumentProc(CsstProcessor):
print
(
'finish the run and save the results back to CsstData'
)
img
=
raw
.
deepcopy
(
name
=
"SCI"
,
data
=
self
.
__img
)
wht
=
raw
.
deepcopy
(
name
=
"WHT"
,
data
=
self
.
__wht
)
flg
=
raw
.
deepcopy
(
name
=
"FLG"
,
data
=
self
.
__flg
)
img
=
raw
.
deepcopy
(
name
=
"SCI"
,
data
=
self
.
__img
.
astype
(
np
.
float32
)
)
wht
=
raw
.
deepcopy
(
name
=
"WHT"
,
data
=
self
.
__wht
.
astype
(
np
.
float32
)
)
flg
=
raw
.
deepcopy
(
name
=
"FLG"
,
data
=
self
.
__flg
.
astype
(
np
.
float32
)
)
img
.
set_keyword
(
"FILENAME"
,
img
.
get_keyword
(
"FILENAME"
,
hdu
=
0
).
replace
(
"_raw"
,
"_img"
),
hdu
=
0
)
wht
.
set_keyword
(
"FILENAME"
,
wht
.
get_keyword
(
"FILENAME"
,
hdu
=
0
).
replace
(
"_raw"
,
"_wht"
),
hdu
=
0
)
flg
.
set_keyword
(
"FILENAME"
,
flg
.
get_keyword
(
"FILENAME"
,
hdu
=
0
).
replace
(
"_raw"
,
"_flg"
),
hdu
=
0
)
...
...
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