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
55c41637
Commit
55c41637
authored
May 08, 2024
by
Yan Zhaojun
Browse files
debug
parent
03b67b5b
Pipeline
#4389
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 @
55c41637
...
...
@@ -1753,17 +1753,9 @@ class MCIsimulator():
########## finish save PSF fits ##########################################
############################################################################
###### add binary stars to the star catlog #######
binary_star
=
np
.
array
([[
-
0.05
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
0.12
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
5.45
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
5.55
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
10.05
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
10.17
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
15.45
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
],
[
-
15.60
,
20
,
20.5
,
20
,
19.5
,
19
,
18.8
]])
nsrcs
=
len
(
self
.
star
[
'ra_gaia'
])
+
8
nsrcs
=
len
(
self
.
star
[
'ra_gaia'
])
self
.
log
.
info
(
'load star catlog successfully'
)
...
...
@@ -1906,31 +1898,18 @@ class MCIsimulator():
#################### generate star image ##########
# if self.debug:
# nstar=nsrcs
# else:
nstar
=
nsrcs
sim_binary_star
=
False
if
sim_binary_star
:
Nstar
=
nstar
else
:
Nstar
=
nstar
-
8
for
j
in
tqdm
(
range
(
Nstar
)):
### nsrcs length
for
j
in
tqdm
(
range
(
nsrcs
)):
### nsrcs length
if
j
==
0
:
self
.
log
.
info
(
'begin iteration........'
)
if
j
<
nsrcs
-
8
:
starRa
=
3600.0
*
(
newRa
[
j
]
)
# ra of star, arcsecond
starDec
=
3600.0
*
(
newDec
[
j
]
)
# dec of star, arcsecond
else
:
starRa
=
binary_star
[
j
-
nsrcs
,
0
]
+
self
.
information
[
'ra_obj'
]
*
3600.0
starDec
=
binary_star
[
j
-
nsrcs
,
1
]
+
self
.
information
[
'dec_obj'
]
*
3600.0
starRa
=
3600.0
*
(
newRa
[
j
]
)
# ra of star, arcsecond
starDec
=
3600.0
*
(
newDec
[
j
]
)
# dec of star, arcsecond
###################################################################
###### test code #####
...
...
@@ -2007,45 +1986,26 @@ class MCIsimulator():
####### use SED_code to generate star SED #######
# SED of j-th star
if
j
<
nsrcs
-
8
:
umag
=
self
.
star
[
'umag'
][
j
]
gmag
=
self
.
star
[
'gmag'
][
j
]
rmag
=
self
.
star
[
'rmag'
][
j
]
imag
=
self
.
star
[
'imag'
][
j
]
zmag
=
self
.
star
[
'zmag'
][
j
]
wave
=
np
.
linspace
(
2500
,
11000
,
8501
)
# Input redshift
redshift
=
0
# Loading galaxy SED template
t
=
sed
.
Gal_Temp
(
self
.
information
[
'dir_path'
])
# Calculating the magnitude (u, g, r, i, z) of each template
t
.
toMag
(
redshift
=
redshift
)
# Calculating flux
ugriz
=
np
.
array
([
umag
,
gmag
,
rmag
,
imag
,
zmag
])
star_flux
=
sed
.
Model_Galaxy_SED
(
wave
,
ugriz
,
redshift
,
t
,
self
.
information
[
'dir_path'
])
# else:
# umag = binary_star[j-nsrcs, 2]
# gmag = binary_star[j-nsrcs, 3]
# rmag = binary_star[j-nsrcs, 4]
# imag = binary_star[j-nsrcs, 5]
# zmag = binary_star[j-nsrcs, 6]
# wave = np.linspace(2500, 11000, 8501)
# # Input redshift
# redshift = 0
# # Loading galaxy SED template
# t=sed.Gal_Temp(self.information['dir_path'])
# # Calculating the magnitude (u, g, r, i, z) of each template
# t.toMag(redshift=redshift)
# # Calculating flux
# ugriz = np.array([umag, gmag, rmag, imag, zmag])
# star_flux = sed.Model_Galaxy_SED(wave, ugriz, redshift, t, self.information['dir_path'])
#########################################
umag
=
self
.
star
[
'umag'
][
j
]
gmag
=
self
.
star
[
'gmag'
][
j
]
rmag
=
self
.
star
[
'rmag'
][
j
]
imag
=
self
.
star
[
'imag'
][
j
]
zmag
=
self
.
star
[
'zmag'
][
j
]
wave
=
np
.
linspace
(
2500
,
11000
,
8501
)
# Input redshift
redshift
=
0
# Loading galaxy SED template
t
=
sed
.
Gal_Temp
(
self
.
information
[
'dir_path'
])
# Calculating the magnitude (u, g, r, i, z) of each template
t
.
toMag
(
redshift
=
redshift
)
# Calculating flux
ugriz
=
np
.
array
([
umag
,
gmag
,
rmag
,
imag
,
zmag
])
star_flux
=
sed
.
Model_Galaxy_SED
(
wave
,
ugriz
,
redshift
,
t
,
self
.
information
[
'dir_path'
])
##cal_SED_photons(self, flux_arr):
intscales
,
PSF_eff_weight
=
self
.
cal_SED_photons
(
star_flux
)
...
...
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