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
ce424fdd
Commit
ce424fdd
authored
Jun 20, 2025
by
Zhang Xin
Browse files
crs ref file miss bug; modify obs type
parent
eba9a6c2
Changes
4
Show whitespace changes
Inline
Side-by-side
observation_sim/config/ChipOutput.py
View file @
ce424fdd
...
...
@@ -29,6 +29,7 @@ class ChipOutput(object):
project_cycle
=
self
.
config
[
"project_cycle"
],
run_counter
=
self
.
config
[
"run_counter"
],
chip_name
=
self
.
chip_label
,
obstype
=
pointing
.
pointing_type
,
dataset
=
pointing
.
dataset
)
obs_id
=
_util
.
get_obs_id
(
img_type
=
self
.
pointing_type
,
project_cycle
=
config
[
"project_cycle"
],
run_counter
=
config
[
...
...
@@ -71,7 +72,7 @@ class ChipOutput(object):
self
.
hdr
+=
additional_column_names
def
create_output_file
(
self
):
if
self
.
pointing_type
==
'
SCI
'
:
if
self
.
pointing_type
==
'
WIDE'
or
self
.
pointing_type
==
'DEEP
'
:
self
.
cat
=
open
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
),
"w"
)
self
.
logger
.
info
(
"Creating catalog file %s ...
\n
"
%
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
)))
...
...
observation_sim/config/Pointing.py
View file @
ce424fdd
...
...
@@ -10,7 +10,7 @@ import observation_sim.instruments._util as _util
class
Pointing
(
object
):
def
__init__
(
self
,
id
=
0
,
ra
=
0.
,
dec
=
0.
,
img_pa
=
0.
,
timestamp
=
1621915200
,
sat_x
=
0.
,
sat_y
=
0.
,
sat_z
=
0.
,
sun_x
=
0.
,
sun_y
=
0.
,
sun_z
=
0.
,
sat_vx
=
0.
,
sat_vy
=
0.
,
sat_vz
=
0.
,
exp_time
=
150.
,
pointing_type
=
'
SCI
'
,
pointing_type_code
=
'101'
,
pointing_id
=
'00000001'
,
obs_config_file
=
None
,
t_shutter_open
=
1.3
,
t_shutter_close
=
1.3
,
dataset
=
'csst-msc-c9-25sqdeg-v3'
):
def
__init__
(
self
,
id
=
0
,
ra
=
0.
,
dec
=
0.
,
img_pa
=
0.
,
timestamp
=
1621915200
,
sat_x
=
0.
,
sat_y
=
0.
,
sat_z
=
0.
,
sun_x
=
0.
,
sun_y
=
0.
,
sun_z
=
0.
,
sat_vx
=
0.
,
sat_vy
=
0.
,
sat_vz
=
0.
,
exp_time
=
150.
,
pointing_type
=
'
WIDE
'
,
pointing_type_code
=
'101'
,
pointing_id
=
'00000001'
,
obs_config_file
=
None
,
t_shutter_open
=
1.3
,
t_shutter_close
=
1.3
,
dataset
=
'csst-msc-c9-25sqdeg-v3'
):
self
.
id
=
id
self
.
ra
=
ra
self
.
dec
=
dec
...
...
@@ -91,6 +91,9 @@ class Pointing(object):
# [TODO] Can also define other survey types
if
is_deep
==
2
:
self
.
survey_field_type
=
"DEEP"
self
.
pointing_type
=
"DEEP"
else
:
self
.
pointing_type
=
"WIDE"
if
not
self
.
obs_config_file
:
self
.
obs_config_file
=
str
(
columns
[
20
])
...
...
@@ -102,7 +105,7 @@ class Pointing(object):
self
.
pointing_type_code
=
columns
[
21
][
0
:
3
]
self
.
obs_id
=
columns
[
21
][
3
:]
if
self
.
obs_param
[
"obs_type"
]:
self
.
pointing_type
=
self
.
obs_param
[
"obs_type"
]
else
:
self
.
timestamp
=
t
...
...
observation_sim/instruments/chip/chip_utils.py
View file @
ce424fdd
...
...
@@ -82,7 +82,7 @@ def getChipSLSConf(chipID):
def
generateHeader
(
chip
,
pointing
,
img_type
=
None
,
img_type_code
=
None
,
project_cycle
=
'9'
,
run_counter
=
'1'
):
if
(
img_type
is
None
)
or
(
img_type_code
is
None
):
img_type
=
pointing
.
pointing
_type
img_type
=
pointing
.
survey_field
_type
img_type_code
=
pointing
.
pointing_type_code
h_prim
=
generatePrimaryHeader
(
...
...
@@ -95,12 +95,13 @@ def generateHeader(chip, pointing, img_type=None, img_type_code=None, project_cy
pixel_scale
=
chip
.
pix_scale
,
time_pt
=
pointing
.
timestamp
,
exptime
=
pointing
.
exp_time
,
im_
type
=
img_type
,
obs
type
=
img_type
,
sat_pos
=
[
pointing
.
sat_x
,
pointing
.
sat_y
,
pointing
.
sat_z
],
sat_vel
=
[
pointing
.
sat_vx
,
pointing
.
sat_vy
,
pointing
.
sat_vz
],
project_cycle
=
project_cycle
,
run_counter
=
run_counter
,
chip_name
=
str
(
chip
.
chipID
).
rjust
(
2
,
'0'
))
chip_name
=
str
(
chip
.
chipID
).
rjust
(
2
,
'0'
),
dataset
=
pointing
.
dataset
)
h_ext
=
generateExtensionHeader
(
chip
=
chip
,
xlen
=
chip
.
npix_x
,
...
...
observation_sim/sim_steps/prepare_headers.py
View file @
ce424fdd
...
...
@@ -18,7 +18,7 @@ def prepare_headers(self, chip, pointing):
project_cycle
=
self
.
overall_config
[
"project_cycle"
],
run_counter
=
self
.
overall_config
[
"run_counter"
],
chip_name
=
str
(
chip
.
chipID
).
rjust
(
2
,
'0'
),
obstype
=
pointing
.
survey_field
_type
,
obstype
=
pointing
.
pointing
_type
,
dataset
=
pointing
.
dataset
)
self
.
h_ext
=
generateExtensionHeader
(
chip
=
chip
,
...
...
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