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
c0c380ab
Commit
c0c380ab
authored
Dec 03, 2024
by
Wei Chengliang
Browse files
update codestyle-PEP8
parent
6281c265
Pipeline
#7400
passed with stage
in 0 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
catalog/C10_Catalog.py
View file @
c0c380ab
...
...
@@ -457,6 +457,10 @@ class Catalog(CatalogBase):
self
.
objs
.
append
(
obj
)
def
free_mem
(
self
,
**
kward
):
self
.
starDDL
.
freeGlobeData
()
del
self
.
starDLL
def
_load
(
self
,
**
kwargs
):
self
.
objs
=
[]
self
.
ids
=
0
...
...
@@ -499,10 +503,6 @@ class Catalog(CatalogBase):
else
:
print
(
"number of objects in catalog: "
,
len
(
self
.
objs
))
def
free_mem
(
self
,
**
kward
):
self
.
starDDL
.
freeGlobeData
()
del
self
.
starDLL
def
load_sed
(
self
,
obj
,
**
kwargs
):
if
obj
.
type
==
'star'
:
# _, wave, flux = tag_sed(
...
...
catalog/C9_Catalog.py
View file @
c0c380ab
...
...
@@ -468,7 +468,7 @@ class Catalog(CatalogBase):
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
-
1
,
0.
)
self
.
objs
.
append
(
obj
)
def
free_mem
(
self
,
**
kward
):
self
.
starDDL
.
freeGlobeData
()
del
self
.
starDLL
...
...
observation_sim/instruments/Filter.py
View file @
c0c380ab
...
...
@@ -159,10 +159,9 @@ class Filter(object):
self
.
mag_limiting
,
self
.
mag_saturation
=
_util
.
calculateLimitMag
(
psf_fwhm
=
psf_fwhm
,
pixelSize
=
pix_scale
,
throughputFn
=
throughput_file
,
readout
=
5.0
,
skyFn
=
skyFn
,
darknoise
=
dark_noise
,
exTime
=
exptime
,
fw
=
full_well
)
if
full_depth_exptime
is
not
None
:
self
.
mag_limiting
,
_
=
_util
.
calculateLimitMag
(
psf_fwhm
=
psf_fwhm
,
pixelSize
=
pix_scale
,
throughputFn
=
throughput_file
,
readout
=
5.0
,
skyFn
=
skyFn
,
darknoise
=
dark_noise
,
exTime
=
full_depth_exptime
,
fw
=
full_well
)
self
.
mag_limiting
,
_
=
_util
.
calculateLimitMag
(
psf_fwhm
=
psf_fwhm
,
pixelSize
=
pix_scale
,
throughputFn
=
throughput_file
,
readout
=
5.0
,
skyFn
=
skyFn
,
darknoise
=
dark_noise
,
exTime
=
full_depth_exptime
,
fw
=
full_well
)
print
(
"for filter %s: mag_limiting: %.3f, mag_saturation: %.3f"
%
(
self
.
filter_type
,
self
.
mag_limiting
,
self
.
mag_saturation
))
observation_sim/instruments/chip/effects.py
View file @
c0c380ab
...
...
@@ -339,7 +339,7 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu
charge
=
imgarr
[
yi
+
1
,
xi
]
-
fullwell
yi
+=
1
# if yi > imgarr.shape[0]:
if
yi
>
imgarr
.
shape
[
0
]
or
yi
==
(
imgarr
.
shape
[
0
]
//
2
):
if
yi
>
imgarr
.
shape
[
0
]
or
yi
==
(
imgarr
.
shape
[
0
]
//
2
):
break
else
:
# calculate bleeding trail:
...
...
observation_sim/mock_objects/CatalogBase.py
View file @
c0c380ab
...
...
@@ -95,9 +95,7 @@ class CatalogBase(metaclass=ABCMeta):
if
norm_filt
is
not
None
:
if
hasattr
(
norm_filt
,
'bandpass_full'
):
norm_filt
=
Table
(
np
.
array
(
np
.
array
([
norm_filt
.
bandpass_full
.
wave_list
*
10.0
,
norm_filt
.
bandpass_full
.
func
(
norm_filt
.
bandpass_full
.
wave_list
)])).
T
,
names
=
([
'WAVELENGTH'
,
'SENSITIVITY'
]))
norm_filt
=
Table
(
np
.
array
(
np
.
array
([
norm_filt
.
bandpass_full
.
wave_list
*
10.0
,
norm_filt
.
bandpass_full
.
func
(
norm_filt
.
bandpass_full
.
wave_list
)])).
T
,
names
=
([
'WAVELENGTH'
,
'SENSITIVITY'
]))
norm_thr_rang_ids
=
norm_filt
[
'SENSITIVITY'
]
>
0.001
else
:
norm_filt
=
Table
(
...
...
observation_sim/sim_steps/add_objects.py
View file @
c0c380ab
...
...
@@ -75,8 +75,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
for
ifilt
in
range
(
len
(
self
.
all_filters
)):
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
),
exptime
=
pointing
.
exp_time
,
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
...
...
@@ -102,7 +102,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
# # [DEBUG] [TODO]
# if j >= 10:
# break
obj
=
cat
.
objs
[
j
]
if
not
self
.
_is_obj_valid
(
obj
):
...
...
@@ -112,7 +112,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
try
:
sed_data
=
cat
.
load_sed
(
obj
)
norm_filt
=
cat
.
load_norm_filt
(
obj
)
obj
.
sed
,
obj
.
param
[
"mag_%s"
%
filt
.
filter_type
.
lower
()],
obj
.
param
[
"flux_%s"
%
filt
.
filter_type
.
lower
()]
=
cat
.
convert_sed
(
mag
=
obj
.
param
[
"mag_use_normal"
],
sed
=
sed_data
,
...
...
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