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
f058808a
Commit
f058808a
authored
Nov 02, 2024
by
Fang Yuedong
Browse files
add crosstalk step. add validation for objects parameters
parent
2eb4e6b5
Pipeline
#7206
failed with stage
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/obs_config_SCI.yaml
View file @
f058808a
...
...
@@ -74,6 +74,8 @@ call_sequence:
# Add bias
bias
:
bias_16channel
:
YES
# Add cross-talk
cross_talk
:
{}
# Add readout noise
readout_noise
:
{}
# Apply gain
...
...
observation_sim/mock_objects/CatalogBase.py
View file @
f058808a
...
...
@@ -29,8 +29,8 @@ class CatalogBase(metaclass=ABCMeta):
param
=
{
"star"
:
-
1
,
"id"
:
-
1
,
"ra"
:
0
,
"dec"
:
0
.
,
"ra"
:
-
999.
,
"dec"
:
-
999
.
,
"ra_orig"
:
0.
,
"dec_orig"
:
0.
,
"z"
:
0.
,
...
...
@@ -44,15 +44,15 @@ class CatalogBase(metaclass=ABCMeta):
"bfrac"
:
0.
,
"av"
:
0.
,
"redden"
:
0.
,
"hlr_bulge"
:
0
.
,
"hlr_disk"
:
0
.
,
"hlr_bulge"
:
-
999
.
,
"hlr_disk"
:
-
999
.
,
"ell_bulge"
:
0.
,
"ell_disk"
:
0.
,
"ell_tot"
:
0.
,
"e1_disk"
:
0
.
,
"e2_disk"
:
0
.
,
"e1_bulge"
:
0
.
,
"e2_bulge"
:
0
.
,
"e1_disk"
:
-
999
.
,
"e2_disk"
:
-
999
.
,
"e1_bulge"
:
-
999
.
,
"e2_bulge"
:
-
999
.
,
"teff"
:
0.
,
"logg"
:
0.
,
"feh"
:
0.
,
...
...
observation_sim/sim_steps/__init__.py
View file @
f058808a
...
...
@@ -11,11 +11,11 @@ class SimSteps:
from
.prepare_headers
import
prepare_headers
,
updateHeaderInfo
from
.add_sky_background
import
add_sky_background_sci
,
add_sky_flat_calibration
,
add_sky_background
from
.add_objects
import
add_objects
from
.add_objects
import
add_objects
,
_is_obj_valid
from
.add_cosmic_rays
import
add_cosmic_rays
from
.add_pattern_noise
import
apply_PRNU
,
add_poisson_and_dark
,
add_detector_defects
,
add_nonlinearity
,
add_blooming
,
add_bias
from
.add_brighter_fatter_CTE
import
add_brighter_fatter
,
apply_CTE
from
.readout_output
import
add_prescan_overscan
,
add_readout_noise
,
apply_gain
,
quantization_and_output
from
.readout_output
import
add_prescan_overscan
,
add_readout_noise
,
apply_gain
,
quantization_and_output
,
add_crosstalk
from
.add_LED_flat
import
add_LED_Flat
...
...
@@ -37,4 +37,5 @@ SIM_STEP_TYPES = {
"quantization_and_output"
:
"quantization_and_output"
,
"led_calib_model"
:
"add_LED_Flat"
,
"sky_flatField"
:
"add_sky_flat_calibration"
,
"cross_talk"
:
"add_crosstalk"
}
observation_sim/sim_steps/add_objects.py
View file @
f058808a
...
...
@@ -10,6 +10,22 @@ from observation_sim.psf import PSFGauss, FieldDistortion, PSFInterp, PSFInterpS
from
astropy.time
import
Time
from
datetime
import
datetime
,
timezone
def
_is_obj_valid
(
self
,
obj
):
if
obj
.
param
[
'star'
]
==
4
:
# Currently there's no parameter checks for 'calib' type
return
True
pos_keys
=
[
'ra'
,
'dec'
]
shape_keys
=
[
'hlr_bulge'
,
'hlr_disk'
,
'e1_disk'
,
'e2_disk'
,
'e1_bulge'
,
'e2_bulge'
]
if
any
(
obj
.
param
[
key
]
==
-
999.
for
key
in
pos_keys
):
msg
=
'One or more positional information (ra, dec) is missing'
self
.
chip_output
.
Log_error
(
msg
)
return
False
if
obj
.
param
[
'star'
]
==
0
and
any
(
obj
.
param
[
key
]
==
-
999.
for
key
in
shape_keys
):
msg
=
'One or more shape information (hlr_bulge, hlr_disk, e1_disk, e2_disk, e1_bulge, e2_bulge) is missing'
self
.
chip_output
.
Log_error
(
msg
)
return
False
return
True
def
add_objects
(
self
,
chip
,
filt
,
tel
,
pointing
,
catalog
,
obs_param
):
...
...
@@ -85,6 +101,9 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
# break
obj
=
cat
.
objs
[
j
]
if
not
self
.
_is_obj_valid
(
obj
):
continue
# load and convert SED; also caculate object's magnitude in all CSST bands
try
:
sed_data
=
cat
.
load_sed
(
obj
)
...
...
@@ -153,7 +172,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
if
pos_img
.
x
==
-
1
or
pos_img
.
y
==
-
1
:
self
.
chip_output
.
Log_info
(
'obj_ra = %.6f, obj_dec = %.6f, obj_ra_orig = %.6f, obj_dec_orig = %.6f'
%
(
obj
.
ra
,
obj
.
dec
,
obj
.
ra_orig
,
obj
.
dec_orig
))
self
.
chip_output
.
Log_error
(
"Object
ed
missed: %s"
%
(
obj
.
id
))
self
.
chip_output
.
Log_error
(
"Object missed: %s"
%
(
obj
.
id
))
missed_obj
+=
1
obj
.
unload_SED
()
continue
...
...
@@ -199,7 +218,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
pass
elif
isUpdated
==
0
:
missed_obj
+=
1
self
.
chip_output
.
Log_error
(
"Object
ed
missed: %s"
%
(
obj
.
id
))
self
.
chip_output
.
Log_error
(
"Object missed: %s"
%
(
obj
.
id
))
else
:
self
.
chip_output
.
Log_error
(
"Draw error, object omitted: %s"
%
(
obj
.
id
))
...
...
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