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
13fa5306
Commit
13fa5306
authored
Dec 07, 2024
by
Fang Yuedong
Browse files
pep8 reformat, replace the return of failed position retrivel to None
parent
291df315
Pipeline
#7471
passed with stage
in 0 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
observation_sim/mock_objects/MockObject.py
View file @
13fa5306
...
...
@@ -78,6 +78,8 @@ class MockObject(object):
(
self
.
posImg
.
x
,
self
.
posImg
.
y
),
flush
=
True
)
self
.
posImg
,
self
.
fd_shear
=
fdmodel
.
get_distorted
(
chip
=
chip
,
pos_img
=
self
.
posImg
)
if
self
.
posImg
is
None
:
return
None
,
None
,
None
,
None
,
None
if
verbose
:
print
(
"After field distortion:
\n
"
)
print
(
"x = %.2f, y = %.2f
\n
"
%
...
...
observation_sim/psf/FieldDistortion.py
View file @
13fa5306
...
...
@@ -62,7 +62,8 @@ class FieldDistortion(object):
the distored position.
"""
if
not
self
.
isContainObj_FD
(
chip
=
chip
,
pos_img
=
pos_img
):
return
galsim
.
PositionD
(
-
1
,
-
1
),
None
# return galsim.PositionD(-1, -1), None
return
None
,
None
if
not
img_rot
:
img_rot
=
np
.
radians
(
self
.
img_rot
)
else
:
...
...
observation_sim/sim_steps/add_objects.py
View file @
13fa5306
...
...
@@ -16,7 +16,8 @@ def _is_obj_valid(self, obj):
# 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'
]
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
)
...
...
@@ -76,7 +77,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
temp_filter
=
self
.
all_filters
[
ifilt
]
temp_filter
.
update_limit_saturation_mags
(
exptime
=
pointing
.
exp_time
,
full_depth_exptime
=
pointing
.
get_full_depth_exptime
(
temp_filter
.
filter_type
),
full_depth_exptime
=
pointing
.
get_full_depth_exptime
(
temp_filter
.
filter_type
),
chip
=
chip
)
if
temp_filter
.
filter_type
.
lower
()
==
self
.
overall_config
[
"obs_setting"
][
"cut_in_band"
].
lower
():
cut_filter
=
temp_filter
...
...
@@ -175,7 +177,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
# [TODO] For now, only consider objects which their centers (after field distortion) are projected within the focal plane
# Otherwise they will be considered missed objects
# if pos_img.x == -1 or pos_img.y == -1 or (not chip.isContainObj(x_image=pos_img.x, y_image=pos_img.y, margin=0.)):
if
pos_img
.
x
==
-
1
or
pos_img
.
y
==
-
1
:
# if pos_img.x == -1 or pos_img.y == -1:
if
pos_img
is
None
:
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 missed: %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