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_mci_sim
Commits
a8c5018a
Commit
a8c5018a
authored
Apr 14, 2024
by
Yan Zhaojun
Browse files
test
parent
b69ef51d
Pipeline
#4062
canceled with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
a8c5018a
...
@@ -2035,7 +2035,7 @@ class MCIsimulator():
...
@@ -2035,7 +2035,7 @@ class MCIsimulator():
#################### generate star image ##########
#################### generate star image ##########
if
self
.
debug
:
if
self
.
debug
:
nstar
=
100
nstar
=
100
0
else
:
else
:
nstar
=
nsrcs
nstar
=
nsrcs
...
@@ -2088,7 +2088,7 @@ class MCIsimulator():
...
@@ -2088,7 +2088,7 @@ class MCIsimulator():
if
self
.
debug
:
if
self
.
debug
:
if
nlayccd
>
10
:
if
nlayccd
>
10
:
continue
break
st_ra
.
append
(
np
.
float64
(
starRa
/
3600.0
))
st_ra
.
append
(
np
.
float64
(
starRa
/
3600.0
))
st_dec
.
append
(
np
.
float64
(
starDec
/
3600.0
))
st_dec
.
append
(
np
.
float64
(
starDec
/
3600.0
))
...
@@ -2144,7 +2144,7 @@ class MCIsimulator():
...
@@ -2144,7 +2144,7 @@ class MCIsimulator():
# Input redshift
# Input redshift
redshift
=
0
redshift
=
0
self
.
log
.
info
(
'load star catlog 777777777'
)
# Loading galaxy SED template
# Loading galaxy SED template
t
=
sed
.
Gal_Temp
(
self
.
information
[
'dir_path'
])
t
=
sed
.
Gal_Temp
(
self
.
information
[
'dir_path'
])
# Calculating the magnitude (u, g, r, i, z) of each template
# Calculating the magnitude (u, g, r, i, z) of each template
...
@@ -2152,7 +2152,7 @@ class MCIsimulator():
...
@@ -2152,7 +2152,7 @@ class MCIsimulator():
# Calculating flux
# Calculating flux
ugriz
=
np
.
array
([
umag
,
gmag
,
rmag
,
imag
,
zmag
])
ugriz
=
np
.
array
([
umag
,
gmag
,
rmag
,
imag
,
zmag
])
star_flux
=
sed
.
Model_Galaxy_SED
(
wave
,
ugriz
,
redshift
,
t
,
self
.
information
[
'dir_path'
])
star_flux
=
sed
.
Model_Galaxy_SED
(
wave
,
ugriz
,
redshift
,
t
,
self
.
information
[
'dir_path'
])
self
.
log
.
info
(
'load star catlog 888888888888'
)
...
@@ -2218,7 +2218,7 @@ class MCIsimulator():
...
@@ -2218,7 +2218,7 @@ class MCIsimulator():
st_magz
.
append
(
zmag
)
st_magz
.
append
(
zmag
)
self
.
log
.
info
(
'load star catlog 888888888888'
)
######################################################################
######################################################################
psf
=
dict
()
psf
=
dict
()
...
@@ -2251,13 +2251,16 @@ class MCIsimulator():
...
@@ -2251,13 +2251,16 @@ class MCIsimulator():
stamp_img
=
galsim
.
Image
(
conv
,
copy
=
True
)
stamp_img
=
galsim
.
Image
(
conv
,
copy
=
True
)
stamp_img
.
setOrigin
(
0
,
0
)
stamp_img
.
setOrigin
(
0
,
0
)
stamp_img
.
scale
=
0.025
stamp_img
.
scale
=
0.025
self
.
log
.
info
(
'load star catlog 999999999'
)
#################################################
#################################################
photons
=
galsim
.
PhotonArray
.
makeFromImage
(
stamp_img
,
max_flux
=
min
(
1.0
,
stamp_img
.
array
.
max
()
/
10000.0
))
photons
=
galsim
.
PhotonArray
.
makeFromImage
(
stamp_img
,
max_flux
=
min
(
1.0
,
stamp_img
.
array
.
max
()
/
10000.0
))
cx0
,
cy0
=
centroid
(
stamp_img
.
array
)
cx0
,
cy0
=
centroid
(
stamp_img
.
array
)
self
.
log
.
info
(
'load star catlog 99999999999998'
)
if
self
.
appFatt
:
if
self
.
appFatt
:
### apply treering and bright fatter and diffusion;
### apply treering and bright fatter and diffusion;
...
@@ -2293,6 +2296,9 @@ class MCIsimulator():
...
@@ -2293,6 +2296,9 @@ class MCIsimulator():
photons
.
y
=
photons
.
y
/
0.05
+
gy
[
ch
]
photons
.
y
=
photons
.
y
/
0.05
+
gy
[
ch
]
photons
.
addTo
(
final_image
[
ch
])
photons
.
addTo
(
final_image
[
ch
])
self
.
log
.
info
(
'load star catlog 11111111111'
)
###############################
###############################
###### debug code
###### debug code
...
@@ -2316,6 +2322,8 @@ class MCIsimulator():
...
@@ -2316,6 +2322,8 @@ class MCIsimulator():
###############################################################
###############################################################
print
(
'total star nummber on CCD is: '
,
nlayccd
)
print
(
'total star nummber on CCD is: '
,
nlayccd
)
self
.
log
.
info
(
'total star nummber on CCD = %i'
%
(
nlayccd
))
tab
=
Table
()
tab
=
Table
()
tab
[
'st_ra'
]
=
np
.
asarray
(
st_ra
)
tab
[
'st_ra'
]
=
np
.
asarray
(
st_ra
)
tab
[
'st_dec'
]
=
np
.
asarray
(
st_dec
)
tab
[
'st_dec'
]
=
np
.
asarray
(
st_dec
)
...
@@ -2819,9 +2827,9 @@ class MCIsimulator():
...
@@ -2819,9 +2827,9 @@ class MCIsimulator():
######## test code ##########
######## test code ##########
if
self
.
debug
:
if
self
.
debug
:
if
nlayccd
>
10
:
if
nlayccd
>
4
:
#########
#########
continue
break
############################33
############################33
...
@@ -5430,9 +5438,9 @@ class MCIsimulator():
...
@@ -5430,9 +5438,9 @@ class MCIsimulator():
####################################################################
####################################################################
if
self
.
source
in
sourcelist
:
if
self
.
source
in
sourcelist
:
if
self
.
cosmicRays
:
if
self
.
cosmicRays
:
if
self
.
debug
==
False
:
#
if self.debug == False:
self
.
addCosmicRays
()
self
.
addCosmicRays
()
print
(
'addCosmicRays finisth'
)
print
(
'addCosmicRays finisth'
)
##################################################
##################################################
if
self
.
skyback
:
if
self
.
skyback
:
...
@@ -5454,11 +5462,11 @@ class MCIsimulator():
...
@@ -5454,11 +5462,11 @@ class MCIsimulator():
#################################################
#################################################
if
self
.
bleeding
:
if
self
.
bleeding
:
if
self
.
debug
==
False
:
#
if self.debug== False:
self
.
image_g
=
self
.
applyBleeding
(
self
.
image_g
.
copy
())
self
.
image_g
=
self
.
applyBleeding
(
self
.
image_g
.
copy
())
self
.
image_r
=
self
.
applyBleeding
(
self
.
image_r
.
copy
())
self
.
image_r
=
self
.
applyBleeding
(
self
.
image_r
.
copy
())
self
.
image_i
=
self
.
applyBleeding
(
self
.
image_i
.
copy
())
self
.
image_i
=
self
.
applyBleeding
(
self
.
image_i
.
copy
())
print
(
'apply bleeding effect finisth'
)
print
(
'apply bleeding effect finisth'
)
################################################
################################################
...
@@ -5483,9 +5491,9 @@ class MCIsimulator():
...
@@ -5483,9 +5491,9 @@ class MCIsimulator():
#################################################################
#################################################################
if
self
.
source
in
sourcelist
:
if
self
.
source
in
sourcelist
:
if
self
.
radiationDamage
:
if
self
.
radiationDamage
:
if
self
.
debug
==
False
:
#
if self.debug == False:
self
.
applyRadiationDamage
()
self
.
applyRadiationDamage
()
print
(
'applyRadiationDamage()'
)
print
(
'applyRadiationDamage()'
)
######################################################################
######################################################################
###### apply readoutNoise ######
###### apply readoutNoise ######
...
...
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