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
Liu Dezi
csst_msc_sim
Commits
a733afaf
Commit
a733afaf
authored
Apr 21, 2022
by
Fang Yuedong
Browse files
fix cat&log file naming, fix CAL output option logic
parent
40121255
Changes
2
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Config/ChipOutput.py
View file @
a733afaf
...
...
@@ -23,12 +23,12 @@ class ChipOutput(object):
# self.cat_name = 'MSC_' + config["obs_setting"]["date_obs"] + config["obs_setting"]["time_obs"] + "_" + str(pointing_ID).rjust(7, '0') + "_" + self.chipLabel.rjust(2,'0') + ".cat"
self
.
cat_name
=
"MSC_1%s_chip_%s_filt_%s"
%
(
str
(
pointing_ID
).
rjust
(
7
,
'0'
),
focal_plane
.
getChipLabel
(
chip
.
chipID
),
filt
.
filter_type
)
+
".cat"
self
.
cat_name
=
"MSC_1%s_chip_%s_filt_%s"
%
(
str
(
pointing_ID
).
rjust
(
8
,
'0'
),
focal_plane
.
getChipLabel
(
chip
.
chipID
),
filt
.
filter_type
)
+
".cat"
self
.
subdir
=
subdir
# Setup logger for each chip
logger_filename
=
"MSC_1%s_chip_%s_filt_%s"
%
(
str
(
pointing_ID
).
rjust
(
7
,
'0'
),
focal_plane
.
getChipLabel
(
chip
.
chipID
),
filt
.
filter_type
)
+
".log"
logger_filename
=
"MSC_1%s_chip_%s_filt_%s"
%
(
str
(
pointing_ID
).
rjust
(
8
,
'0'
),
focal_plane
.
getChipLabel
(
chip
.
chipID
),
filt
.
filter_type
)
+
".log"
self
.
logger
=
logging
.
getLogger
()
fh
=
logging
.
FileHandler
(
os
.
path
.
join
(
self
.
subdir
,
logger_filename
),
mode
=
'w+'
,
encoding
=
'utf-8'
)
fh
.
setLevel
(
logging
.
DEBUG
)
...
...
ObservationSim/Instrument/Chip/Chip.py
View file @
a733afaf
...
...
@@ -494,7 +494,7 @@ class Chip(FocalPlane):
# Output images for calibration pointing
######################################################################################
# Bias output
if
config
[
"output_setting"
][
"bias_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
config
[
"ins_effects"
][
"add_bias"
]
==
True
and
config
[
"output_setting"
][
"bias_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
self
.
logger
is
not
None
:
self
.
logger
.
info
(
" Output N frame Bias files"
)
else
:
...
...
@@ -562,7 +562,7 @@ class Chip(FocalPlane):
del
BiasCombImg
# Export combined (ncombine, Vignetting + PRNU) & single vignetting flat-field file
if
config
[
"output_setting"
][
"flat_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
config
[
"ins_effects"
][
"flat_fielding"
]
==
True
and
config
[
"output_setting"
][
"flat_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
self
.
logger
is
not
None
:
self
.
logger
.
info
(
" Output N frame Flat-Field files"
)
else
:
...
...
@@ -671,7 +671,7 @@ class Chip(FocalPlane):
del
flat_img
# Export Dark current images
if
config
[
"output_setting"
][
"dark_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
config
[
"ins_effects"
][
"add_dark"
]
==
True
and
config
[
"output_setting"
][
"dark_output"
]
==
True
and
pointing_type
==
'CAL'
:
if
self
.
logger
is
not
None
:
self
.
logger
.
info
(
" Output N frame Dark Current files"
)
else
:
...
...
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