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
d851b140
Commit
d851b140
authored
Oct 25, 2024
by
Yan Zhaojun
Browse files
update
parent
912f171d
Pipeline
#7088
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
d851b140
...
@@ -26,7 +26,7 @@ from scipy.interpolate import interp1d
...
@@ -26,7 +26,7 @@ from scipy.interpolate import interp1d
import
ipy.spatial
as
spatial
import
ipy.spatial
as
spatial
# import sc
# import sc
# from matplotlib import pyplot as plt
# from matplotlib import pyplot as plt
#from joblib import Parallel, delayed
#
from joblib import Parallel, delayed
"""
"""
Created on Mon Oct 18 09:38:35 2021
Created on Mon Oct 18 09:38:35 2021
...
@@ -96,7 +96,9 @@ except:
...
@@ -96,7 +96,9 @@ except:
from
.mci_so
import
cdm03bidir
from
.mci_so
import
cdm03bidir
####################################################
####################################################
########################### functions #########################
# functions
def
get_file_extension
(
filename
):
def
get_file_extension
(
filename
):
# 使用os.path.splitext()函数分割文件名和扩展名
# 使用os.path.splitext()函数分割文件名和扩展名
file_name
,
extension
=
os
.
path
.
splitext
(
filename
)
file_name
,
extension
=
os
.
path
.
splitext
(
filename
)
...
@@ -119,6 +121,8 @@ parameters in parallel and serial direction.
...
@@ -119,6 +121,8 @@ parameters in parallel and serial direction.
"""
"""
# CDM03bidir
# CDM03bidir
class
CDM03bidir
():
class
CDM03bidir
():
"""
"""
Class to run CDM03 CTI model, class Fortran routine to perform the actual CDM03 calculations.
Class to run CDM03 CTI model, class Fortran routine to perform the actual CDM03 calculations.
...
...
csst_mci_sim/support/shao.py
View file @
d851b140
...
@@ -50,7 +50,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
...
@@ -50,7 +50,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
input_vy
=
input_vy
*
1000.0
input_vy
=
input_vy
*
1000.0
input_vz
=
input_vz
*
1000.0
input_vz
=
input_vz
*
1000.0
if
not
isinstance
(
type
(
input_date_str
),
str
):
if
not
isinstance
(
type
(
input_date_str
),
str
):
# type(input_date_str) != type("2025-03-05"):
# type(input_date_str) != type("2025-03-05"):
raise
TypeError
(
"Parameter 15 is not string!"
,
input_date_str
)
raise
TypeError
(
"Parameter 15 is not string!"
,
input_date_str
)
else
:
else
:
...
@@ -75,7 +75,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
...
@@ -75,7 +75,7 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
raise
TypeError
(
raise
TypeError
(
"Parameter 15 day range error [1 ~ 31]!"
,
input_day
)
"Parameter 15 day range error [1 ~ 31]!"
,
input_day
)
if
not
isinstance
(
type
(
input_time_str
),
str
):
if
not
isinstance
(
type
(
input_time_str
),
str
):
# type(input_time_str) != type("20:15:15.15"):
# type(input_time_str) != type("20:15:15.15"):
raise
TypeError
(
"Parameter 16 is not string!"
,
input_time_str
)
raise
TypeError
(
"Parameter 16 is not string!"
,
input_time_str
)
else
:
else
:
...
...
csst_mci_sim/zodiacal.py
View file @
d851b140
...
@@ -29,7 +29,7 @@ def zodiacal(ra, dec, time, path):
...
@@ -29,7 +29,7 @@ def zodiacal(ra, dec, time, path):
dt
=
datetime
.
fromisoformat
(
time
)
dt
=
datetime
.
fromisoformat
(
time
)
jd
=
julian
.
to_jd
(
dt
,
fmt
=
'jd'
)
jd
=
julian
.
to_jd
(
dt
,
fmt
=
'jd'
)
#
##
jd = time2jd(dt)
#
jd = time2jd(dt)
t
=
Time
(
jd
,
format
=
'jd'
,
scale
=
'utc'
)
t
=
Time
(
jd
,
format
=
'jd'
,
scale
=
'utc'
)
astro_sun
=
get_sun
(
t
)
astro_sun
=
get_sun
(
t
)
...
@@ -48,7 +48,7 @@ def zodiacal(ra, dec, time, path):
...
@@ -48,7 +48,7 @@ def zodiacal(ra, dec, time, path):
# interpolated zodical surface brightness at 0.5 um
# interpolated zodical surface brightness at 0.5 um
zodi
=
pd
.
read_csv
(
path
+
'MCI_inputData/refs/zodi_map.dat'
,
zodi
=
pd
.
read_csv
(
path
+
'MCI_inputData/refs/zodi_map.dat'
,
sep
=
'\s+'
,
header
=
None
,
comment
=
'#'
)
sep
=
'
\
\
s+'
,
header
=
None
,
comment
=
'#'
)
beta_angle
=
np
.
array
([
0
,
5
,
10
,
15
,
20
,
25
,
30
,
45
,
60
,
75
])
beta_angle
=
np
.
array
([
0
,
5
,
10
,
15
,
20
,
25
,
30
,
45
,
60
,
75
])
lamda_angle
=
np
.
array
([
0
,
5
,
10
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
lamda_angle
=
np
.
array
([
0
,
5
,
10
,
15
,
20
,
25
,
30
,
35
,
40
,
45
,
60
,
75
,
90
,
105
,
120
,
135
,
150
,
165
,
180
])
60
,
75
,
90
,
105
,
120
,
135
,
150
,
165
,
180
])
...
@@ -58,7 +58,7 @@ def zodiacal(ra, dec, time, path):
...
@@ -58,7 +58,7 @@ def zodiacal(ra, dec, time, path):
# read the zodical spectrum in the ecliptic
# read the zodical spectrum in the ecliptic
cat_spec
=
pd
.
read_csv
(
cat_spec
=
pd
.
read_csv
(
path
+
'MCI_inputData/refs/solar_spec.dat'
,
sep
=
'\s+'
,
header
=
None
,
comment
=
'#'
)
path
+
'MCI_inputData/refs/solar_spec.dat'
,
sep
=
'
\
\
s+'
,
header
=
None
,
comment
=
'#'
)
wave
=
cat_spec
[
0
].
values
# A
wave
=
cat_spec
[
0
].
values
# A
spec0
=
cat_spec
[
1
].
values
# 10^-8 W m^�? sr^�? μm^�?
spec0
=
cat_spec
[
1
].
values
# 10^-8 W m^�? sr^�? μm^�?
zodi_norm
=
252
# 10^-8 W m^�? sr^�? μm^�?
zodi_norm
=
252
# 10^-8 W m^�? sr^�? μm^�?
...
...
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