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
1ffa986c
Commit
1ffa986c
authored
Jan 24, 2025
by
Yan Zhaojun
Browse files
Replace shao.py
parent
c5ca2363
Pipeline
#7897
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/support/shao.py
View file @
1ffa986c
from
ctypes
import
*
def
checkInputList
(
input_list
,
n
):
if
type
(
input_list
)
!=
type
([
1
,
2
,
3
]):
raise
TypeError
(
"Input type is not list!"
,
input_list
)
for
i
in
input_list
:
if
type
(
i
)
!=
type
(
1.1
):
if
type
(
i
)
!=
type
(
1
):
raise
TypeError
(
"Input list's element is not float or int!"
,
input_list
)
if
len
(
input_list
)
!=
n
:
raise
RuntimeError
(
"Length of input list is not equal to stars' number!"
,
input_list
)
#
def checkInputList(input_list, n):
#
if type(input_list) != type([1, 2, 3]):
#
raise TypeError("Input type is not list!", input_list)
#
for i in input_list:
#
if type(i) != type(1.1):
#
if type(i) != type(1):
#
raise TypeError("Input list's element is not float or int!", input_list)
#
if len(input_list) != n:
#
raise RuntimeError("Length of input list is not equal to stars' number!", input_list)
def
onOrbitObsPosition
(
path
,
input_ra_list
,
input_dec_list
,
input_pmra_list
,
input_pmdec_list
,
input_rv_list
,
\
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
if
type
(
input_nstars
)
!=
type
(
1
):
raise
TypeError
(
"Parameter 7 is not int!"
,
input_nstars
)
#
Check input parameters
#
if type(input_nstars) != type(1):
#
raise TypeError("Parameter 7 is not int!", input_nstars)
#
# checkInputList(input_ra_list, input_nstars)
# checkInputList(input_dec_list, input_nstars)
# checkInputList(input_pmra_list, input_nstars)
...
...
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