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
2468ff7c
Commit
2468ff7c
authored
Sep 27, 2022
by
xin
Browse files
fix bug no parameter
parent
fedb2da1
Changes
2
Hide whitespace changes
Inline
Side-by-side
ObservationSim/MockObject/MockObject.py
View file @
2468ff7c
...
...
@@ -171,6 +171,8 @@ class MockObject(object):
dy
=
y
-
y_nominal
offset
=
galsim
.
PositionD
(
dx
,
dy
)
real_wcs_local
=
self
.
real_wcs
.
local
(
real_pos
)
for
i
in
range
(
len
(
bandpass_list
)):
bandpass
=
bandpass_list
[
i
]
try
:
...
...
@@ -205,7 +207,7 @@ class MockObject(object):
stamp
=
star
.
drawImage
(
wcs
=
self
.
real_wcs
,
method
=
'phot'
,
offset
=
offset
,
save_photons
=
True
)
stamp
=
star
.
drawImage
(
wcs
=
real_wcs
_local
,
method
=
'phot'
,
offset
=
offset
,
save_photons
=
True
)
xmax
=
max
(
xmax
,
stamp
.
xmax
)
ymax
=
max
(
ymax
,
stamp
.
ymax
)
photons
=
stamp
.
photons
...
...
@@ -214,7 +216,7 @@ class MockObject(object):
photons_list
.
append
(
photons
)
stamp
=
galsim
.
ImageF
(
int
(
xmax
*
1.1
),
int
(
ymax
*
1.1
))
stamp
.
wcs
=
self
.
real_wcs
.
local
(
real_pos
)
stamp
.
wcs
=
self
.
real_wcs
_
local
stamp
.
setCenter
(
x_nominal
,
y_nominal
)
bounds
=
stamp
.
bounds
&
galsim
.
BoundsD
(
0
,
chip
.
npix_x
-
1
,
0
,
chip
.
npix_y
-
1
)
chip
.
img
.
setOrigin
(
0
,
0
)
...
...
ObservationSim/ObservationSim.py
View file @
2468ff7c
...
...
@@ -273,7 +273,7 @@ class Observation(object):
col_num
=
chip
.
colID
,
extName
=
'raw'
)
pos_img
,
offset
,
local_wcs
,
real_wcs
=
obj
.
getPosImg_Offset_WCS
(
img
=
chip
.
img
,
fdmodel
=
self
.
fd_model
,
chip
=
chip
,
verbose
=
False
)
pos_img
,
offset
,
local_wcs
,
real_wcs
=
obj
.
getPosImg_Offset_WCS
(
img
=
chip
.
img
,
fdmodel
=
self
.
fd_model
,
chip
=
chip
,
verbose
=
False
,
img_header
=
h_ext
)
if
pos_img
.
x
==
-
1
or
pos_img
.
y
==
-
1
:
# Exclude object which is outside the chip area (after field distortion)
# print("obj missed!!")
...
...
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