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
dc74ba7f
Commit
dc74ba7f
authored
Oct 26, 2024
by
Zhang Xin
Browse files
pep8
parent
2166c80e
Pipeline
#7119
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
observation_sim/astrometry/Astrometry_util.py
View file @
dc74ba7f
...
...
@@ -12,8 +12,8 @@ def checkInputList(input_list, n):
if
not
isinstance
(
input_list
,
list
):
raise
TypeError
(
"Input type is not list!"
,
input_list
)
for
i
in
input_list
:
if
type
(
i
)
!=
type
(
1.1
):
if
type
(
i
)
!=
type
(
1
):
if
type
(
i
)
is
not
type
(
1.1
):
if
type
(
i
)
is
not
type
(
1
):
raise
TypeError
(
"Input list's element is not float or int!"
,
input_list
)
if
len
(
input_list
)
!=
n
:
...
...
observation_sim/mock_objects/Galaxy.py
View file @
dc74ba7f
...
...
@@ -33,7 +33,7 @@ class Galaxy(MockObject):
raise
ValueError
(
"!!!The number of PSF profiles and the number of bandpasses must be equal."
)
objs
=
[]
if
nphotons_tot
==
None
:
if
nphotons_tot
is
None
:
nphotons_tot
=
self
.
getElectronFluxFilt
(
filt
,
tel
,
exptime
)
# print("nphotons_tot = ", nphotons_tot)
...
...
@@ -92,7 +92,7 @@ class Galaxy(MockObject):
return
final
def
drawObj_multiband
(
self
,
tel
,
pos_img
,
psf_model
,
bandpass_list
,
filt
,
chip
,
nphotons_tot
=
None
,
g1
=
0
,
g2
=
0
,
exptime
=
150.
,
fd_shear
=
None
):
if
nphotons_tot
==
None
:
if
nphotons_tot
is
None
:
nphotons_tot
=
self
.
getElectronFluxFilt
(
filt
,
tel
,
exptime
)
# print("nphotons_tot = ", nphotons_tot)
...
...
@@ -471,7 +471,7 @@ class Galaxy(MockObject):
return
1
,
pos_shear
def
getGSObj
(
self
,
psf
,
g1
=
0
,
g2
=
0
,
flux
=
None
,
filt
=
None
,
tel
=
None
,
exptime
=
150.
):
if
flux
==
None
:
if
flux
is
None
:
flux
=
self
.
getElectronFluxFilt
(
filt
,
tel
,
exptime
)
disk
=
galsim
.
Sersic
(
n
=
self
.
disk_sersic_idx
,
half_light_radius
=
self
.
hlr_disk
,
flux
=
1.0
)
...
...
observation_sim/mock_objects/MockObject.py
View file @
dc74ba7f
...
...
@@ -108,7 +108,7 @@ class MockObject(object):
def
drawObj_multiband
(
self
,
tel
,
pos_img
,
psf_model
,
bandpass_list
,
filt
,
chip
,
nphotons_tot
=
None
,
g1
=
0
,
g2
=
0
,
exptime
=
150.
,
fd_shear
=
None
):
if
nphotons_tot
==
None
:
if
nphotons_tot
is
None
:
nphotons_tot
=
self
.
getElectronFluxFilt
(
filt
,
tel
,
exptime
)
# print("nphotons_tot = ", nphotons_tot)
...
...
@@ -581,7 +581,7 @@ class MockObject(object):
def
drawObj_PSF
(
self
,
tel
,
pos_img
,
psf_model
,
bandpass_list
,
filt
,
chip
,
nphotons_tot
=
None
,
g1
=
0
,
g2
=
0
,
exptime
=
150.
,
fd_shear
=
None
,
chip_output
=
None
):
if
nphotons_tot
==
None
:
if
nphotons_tot
is
None
:
nphotons_tot
=
self
.
getElectronFluxFilt
(
filt
,
tel
,
exptime
)
# print("nphotons_tot = ", nphotons_tot)
...
...
@@ -650,7 +650,7 @@ class MockObject(object):
os
.
makedirs
(
fn
,
exist_ok
=
True
)
fn
=
fn
+
"/ccd_{:}"
.
format
(
chip
.
chipID
)
+
\
"_psf_"
+
str
(
self
.
param
[
'id'
])
+
".fits"
if
fn
!=
None
:
if
fn
is
not
None
:
if
os
.
path
.
exists
(
fn
):
os
.
remove
(
fn
)
hdu
=
fitsio
.
PrimaryHDU
()
...
...
observation_sim/mock_objects/SpecDisperser/__init__.py
View file @
dc74ba7f
tools/get_pointing.py
View file @
dc74ba7f
...
...
@@ -63,7 +63,7 @@ class Chip(object):
if
(
xcen
is
None
)
or
(
ycen
is
None
):
xcen
=
self
.
cen_pix_x
ycen
=
self
.
cen_pix_y
if
pix_scale
==
None
:
if
pix_scale
is
None
:
pix_scale
=
self
.
pix_scale
# dudx = -np.cos(img_rot.rad) * pix_scale
# dudy = -np.sin(img_rot.rad) * pix_scale
...
...
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