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
7a2eca2f
Commit
7a2eca2f
authored
Oct 25, 2024
by
Yan Zhaojun
Browse files
update
parent
a2b1235d
Pipeline
#7086
failed with stage
in 0 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_mci_sim/CTI/CTI.py
View file @
7a2eca2f
...
...
@@ -130,7 +130,7 @@ class CDM03bidir():
:return: image that has been run through the CDM03 model
:rtype: ndarray """""
# ##
# return data
iflip
=
iquadrant
/
2
...
...
csst_mci_sim/support/cosmicrays.py
View file @
7a2eca2f
...
...
@@ -78,13 +78,8 @@ class cosmicrays():
crImage
=
np
.
zeros
((
self
.
ysize
,
self
.
xsize
),
dtype
=
np
.
float64
)
# x and y shifts
<<<<<<<
HEAD
dx
=
dl
*
np
.
cos
(
phi
)
/
2.
dy
=
dl
*
np
.
sin
(
phi
)
/
2.
=======
dx
=
l
*
np
.
cos
(
phi
)
/
2.
dy
=
l
*
np
.
sin
(
phi
)
/
2.
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
mskdx
=
np
.
abs
(
dx
)
<
1e-8
mskdy
=
np
.
abs
(
dy
)
<
1e-8
dx
[
mskdx
]
=
0.
...
...
@@ -205,11 +200,7 @@ class cosmicrays():
self
.
cosmicrayMap
=
np
.
zeros
((
self
.
ysize
,
self
.
xsize
))
# how many events to draw at once, too large number leads to exceeding the covering fraction
<<<<<<<
HEAD
# cr_n = int(295 * self.exptime / 565. * coveringFraction / 1.4)
=======
####cr_n = int(295 * self.exptime / 565. * coveringFraction / 1.4)
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
cr_n
=
int
(
5000
*
self
.
exptime
/
565.
*
coveringFraction
)
...
...
csst_mci_sim/support/sed.py
100644 → 100755
View file @
7a2eca2f
...
...
@@ -71,15 +71,9 @@ def flux_to_mag(wave, flux, path, band='GAIA_bp'):
float: value of magnitude
"""
# /home/yan/MCI_sim/MCI_input/SED_Code/data
<<<<<<<
HEAD
#
# parent = os.path.dirname(os.path.realpath(__file__))
=======
##import os
###parent = os.path.dirname(os.path.realpath(__file__))
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
band
=
ascii
.
read
(
path
+
'MCI_inputData/SED_Code/seddata/'
+
band
+
'.dat'
)
wave0
=
band
[
'col1'
]
...
...
@@ -134,15 +128,9 @@ class Gal_Temp():
def
__init__
(
self
,
path
):
<<<<<<<
HEAD
#
# parent = os.path.dirname(os.path.realpath(__file__))
=======
###import os
###parent = os.path.dirname(os.path.realpath(__file__))
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
self
.
path
=
path
hdulist
=
fits
.
open
(
self
.
path
+
'MCI_inputData/SED_Code/seddata/galaxy_temp.fits'
)
...
...
@@ -172,15 +160,9 @@ class Star_Temp():
def
__init__
(
self
,
path
):
<<<<<<<
HEAD
#
self
.
path
=
path
# parent = os.path.dirname(os.path.realpath(__file__))
=======
##import os
self
.
path
=
path
####parent = os.path.dirname(os.path.realpath(__file__))
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
# print("获取其父目录——" + parent) # 从当前文件路径中获取目录
hdulist
=
fits
.
open
(
path
+
'MCI_inputData/SED_Code/seddata/stellar_temp.fits'
)
...
...
csst_mci_sim/support/shao.py
View file @
7a2eca2f
from
ctypes
import
*
def
checkInputList
(
input_list
,
n
):
if
not
isinstance
(
type
(
input_list
),
list
):
# if type(input_list) != type([1, 2, 3]):
raise
TypeError
(
"Input type is not list!"
,
input_list
)
for
i
in
input_list
:
<<<<<<<
HEAD
if
not
isinstance
(
type
(
i
),
float
):
# type(i) != type(1.1):
if
not
isinstance
(
type
(
i
),
int
):
# type(i) != type(1):
=======
if
type
(
i
)
!=
type
(
1.1
):
if
type
(
i
)
!=
type
(
1
):
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
raise
TypeError
(
"Input list's element is not float or int!"
,
input_list
)
if
len
(
input_list
)
!=
n
:
...
...
@@ -24,11 +18,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
input_parallax_list
,
input_nstars
,
input_x
,
input_y
,
input_z
,
input_vx
,
input_vy
,
input_vz
,
input_epoch
,
input_date_str
,
input_time_str
):
# Check input parameters
<<<<<<<
HEAD
if
not
isinstance
(
type
(
input_nstars
),
int
):
# type(input_nstars) != type(1):
=======
if
type
(
input_nstars
)
!=
type
(
1
):
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
raise
TypeError
(
"Parameter 7 is not int!"
,
input_nstars
)
checkInputList
(
input_ra_list
,
input_nstars
)
...
...
@@ -38,11 +28,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
checkInputList
(
input_rv_list
,
input_nstars
)
checkInputList
(
input_parallax_list
,
input_nstars
)
<<<<<<<
HEAD
if
not
isinstance
(
type
(
input_x
),
float
):
# type(input_x) != type(1.1):
=======
if
type
(
input_x
)
!=
type
(
1.1
):
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
raise
TypeError
(
"Parameter 8 is not double!"
,
input_x
)
if
not
isinstance
(
type
(
input_y
),
float
):
# type(input_y) != type(1.1):
raise
TypeError
(
"Parameter 9 is not double!"
,
input_y
)
...
...
@@ -63,11 +49,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
input_vy
=
input_vy
*
1000.0
input_vz
=
input_vz
*
1000.0
<<<<<<<
HEAD
if
not
isinstance
(
type
(
input_date_str
),
str
):
# type(input_date_str) != type("2025-03-05"):
=======
if
type
(
input_date_str
)
!=
type
(
"2025-03-05"
):
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
raise
TypeError
(
"Parameter 15 is not string!"
,
input_date_str
)
else
:
input_date_str
=
input_date_str
.
strip
()
...
...
@@ -91,11 +73,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
raise
TypeError
(
"Parameter 15 day range error [1 ~ 31]!"
,
input_day
)
<<<<<<<
HEAD
if
not
isinstance
(
type
(
input_time_str
),
str
):
# type(input_time_str) != type("20:15:15.15"):
=======
if
type
(
input_time_str
)
!=
type
(
"20:15:15.15"
):
>>>>>>>
227
ceb873fa36e1fbb00f61f9d34ac21b7436192
raise
TypeError
(
"Parameter 16 is not string!"
,
input_time_str
)
else
:
input_time_str
=
input_time_str
.
strip
()
...
...
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