Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
a6c54cf9
Commit
a6c54cf9
authored
3 years ago
by
niejuzi
Browse files
Options
Download
Email Patches
Plain Diff
updated pipeline
parent
8fdb4e50
master
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
csst/msc/pipeline.py
+35
-35
csst/msc/pipeline.py
with
35 additions
and
35 deletions
+35
-35
csst/msc/pipeline.py
+
35
-
35
View file @
a6c54cf9
...
...
@@ -69,41 +69,41 @@ def do_one_exposure(ver_sim="C5.1", dir_l0="", dir_l1="", dir_pcref="", path_aux
# Step 1. Correct instrumental effect
os
.
chdir
(
dir_l1
)
img_list
=
[]
wht_list
=
[]
flg_list
=
[]
fn_list
=
[]
for
this_ccd_id
in
ccd_ids
:
print
(
"processing CCD {}"
.
format
(
this_ccd_id
))
fp_raw
=
dm
.
l0_sci
(
ccd_id
=
this_ccd_id
)
# read data with CsstMscImgData.read
raw
=
CsstMscImgData
.
read
(
fp_raw
)
# in the future, use get_* functions grab
bias
=
dm
.
get_bias
(
this_ccd_id
)
dark
=
dm
.
get_dark
(
this_ccd_id
)
flat
=
dm
.
get_flat
(
this_ccd_id
)
# initialize Instrument Processor
instProc
=
CsstMscInstrumentProc
()
instProc
.
prepare
(
n_jobs
=
n_jobs
)
img
,
wht
,
flg
=
instProc
.
run
(
raw
,
bias
,
dark
,
flat
,
ver_sim
)
instProc
.
cleanup
()
fp_img
=
img
[
0
].
header
[
"FILENAME"
]
+
'.fits'
# save img, wht, flg to somewhere
img
.
writeto
(
dm
.
l1_sci
(
ccd_id
=
this_ccd_id
,
suffix
=
"img"
,
ext
=
"fits"
),
overwrite
=
True
)
wht
.
writeto
(
dm
.
l1_sci
(
ccd_id
=
this_ccd_id
,
suffix
=
"wht"
,
ext
=
"fits"
),
overwrite
=
True
)
flg
.
writeto
(
dm
.
l1_sci
(
ccd_id
=
this_ccd_id
,
suffix
=
"flg"
,
ext
=
"fits"
),
overwrite
=
True
)
# save header
img
[
1
].
header
.
tofile
(
dm
.
l1_sci
(
ccd_id
=
this_ccd_id
,
suffix
=
"img"
,
ext
=
"head"
),
overwrite
=
True
)
# append img, wht, flg list
img_list
.
append
(
img
)
wht_list
.
append
(
wht
)
flg_list
.
append
(
flg
)
fn_list
.
append
(
fp_img
)
#
img_list = []
#
wht_list = []
#
flg_list = []
#
fn_list = []
#
for this_ccd_id in ccd_ids:
#
print("processing CCD {}".format(this_ccd_id))
#
fp_raw = dm.l0_sci(ccd_id=this_ccd_id)
#
# read data with CsstMscImgData.read
#
raw = CsstMscImgData.read(fp_raw)
#
# in the future, use get_* functions grab
#
bias = dm.get_bias(this_ccd_id)
#
dark = dm.get_dark(this_ccd_id)
#
flat = dm.get_flat(this_ccd_id)
#
# initialize Instrument Processor
#
instProc = CsstMscInstrumentProc()
#
instProc.prepare(n_jobs=n_jobs)
#
img, wht, flg = instProc.run(raw, bias, dark, flat, ver_sim)
#
instProc.cleanup()
#
fp_img = img[0].header["FILENAME"] + '.fits'
#
# save img, wht, flg to somewhere
#
img.writeto(dm.l1_sci(ccd_id=this_ccd_id, suffix="img", ext="fits"), overwrite=True)
#
wht.writeto(dm.l1_sci(ccd_id=this_ccd_id, suffix="wht", ext="fits"), overwrite=True)
#
flg.writeto(dm.l1_sci(ccd_id=this_ccd_id, suffix="flg", ext="fits"), overwrite=True)
#
# save header
#
img[1].header.tofile(dm.l1_sci(ccd_id=this_ccd_id, suffix="img", ext="head"), overwrite=True)
#
# append img, wht, flg list
#
img_list.append(img)
#
wht_list.append(wht)
#
flg_list.append(flg)
#
fn_list.append(fp_img)
# Step 2. Calibrate Position
pcProc
=
CsstProcMscPositionCalibration
()
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets