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
csst-sims
csst_msc_sim
Commits
462a281f
Commit
462a281f
authored
Dec 13, 2023
by
Fang Yuedong
Browse files
fix (temporarily) the crash in ChipOutput due to img_type='CAL'
parent
3c8691f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Config/Header/ImageHeader.py
View file @
462a281f
...
...
@@ -383,7 +383,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
# OBS_id = '1'+ obs_type[im_type] + str(int(project_cycle)) + str(int(run_counter)).rjust(2, '0') + pointNum.rjust(5,'0')
OBS_id
=
get_obs_id
(
img_type
=
im_type
,
project_cycle
=
project_cycle
,
run_counter
=
run_counter
,
pointing_num
=
pointNum
)
h_prim
[
'OBJECT'
]
=
str
(
int
(
project_cycle
))
+
pointNum
.
rjust
(
7
,
'0'
)
h_prim
[
'OBJECT'
]
=
str
(
int
(
project_cycle
))
+
pointNum
.
rjust
(
8
,
'0'
)
h_prim
[
'OBSID'
]
=
OBS_id
# h_prim['TELFOCUS'] = 'f/14'
h_prim
[
'EXPTIME'
]
=
exptime
...
...
ObservationSim/Config/_util.py
View file @
462a281f
def
get_obs_id
(
img_type
=
'SCI'
,
project_cycle
=
6
,
run_counter
=
0
,
pointing_num
=
0
):
obs_type
=
{
'SCI'
:
'01'
,
'BIAS'
:
'03'
,
'DARK'
:
'07'
,
'FLAT'
:
'11'
,
'CRS'
:
'98'
,
'CRD'
:
'99'
}
# obs_type = {'SCI': '01', 'BIAS': '03', 'DARK': '07', 'FLAT': '11', 'CRS': '98', 'CRD': '99'}
obs_type
=
{
'SCI'
:
'01'
,
'BIAS'
:
'03'
,
'DARK'
:
'07'
,
'FLAT'
:
'11'
,
'CRS'
:
'98'
,
'CRD'
:
'99'
,
'CAL'
:
'01'
}
# obs_id = '1'+ obs_type[img_type] + str(int(project_cycle)) + str(int(run_counter)).rjust(2, '0') + str(pointing_num).rjust(5,'0')
obs_id
=
'1'
+
obs_type
[
img_type
]
+
str
(
int
(
project_cycle
)).
rjust
(
2
,
'0'
)
+
str
(
int
(
run_counter
))
+
str
(
pointing_num
).
rjust
(
8
,
'0'
)
return
obs_id
...
...
ObservationSim/Instrument/Chip/Chip.py
View file @
462a281f
...
...
@@ -771,7 +771,7 @@ class Chip(FocalPlane):
DarkCombImg
=
galsim
.
ImageUS
(
DarkCombImg
)
timestamp_obs
+=
10
*
60
chip_utils
.
outputCal
(
chip
=
chip
,
chip
=
self
,
img
=
DarkCombImg
,
ra_cen
=
ra_cen
,
dec_cen
=
dec_cen
,
...
...
ObservationSim/_util.py
View file @
462a281f
...
...
@@ -135,7 +135,7 @@ def makeSubDir_PointingList(path_dict, config, pointing_ID=0):
os
.
makedirs
(
imgDir
,
exist_ok
=
True
)
except
OSError
:
pass
prefix
=
"MSC_"
+
str
(
pointing_ID
).
rjust
(
7
,
'0'
)
prefix
=
"MSC_"
+
str
(
pointing_ID
).
rjust
(
8
,
'0'
)
subImgdir
=
os
.
path
.
join
(
imgDir
,
prefix
)
if
not
os
.
path
.
exists
(
subImgdir
):
try
:
...
...
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