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
22b7ef20
Commit
22b7ef20
authored
Jan 24, 2025
by
Yan Zhaojun
Browse files
Replace shao.py
parent
1ffa986c
Pipeline
#7898
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 @
22b7ef20
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
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)
#
# checkInputList(input_ra_list, input_nstars)
# checkInputList(input_dec_list, input_nstars)
# checkInputList(input_pmra_list, input_nstars)
# checkInputList(input_pmdec_list, input_nstars)
# checkInputList(input_rv_list, input_nstars)
# checkInputList(input_parallax_list, input_nstars)
#
# if type(input_x) != type(1.1):
# raise TypeError("Parameter 8 is not double!", input_x)
# if type(input_y) != type(1.1):
# raise TypeError("Parameter 9 is not double!", input_y)
# if type(input_z) != type(1.1):
# raise TypeError("Parameter 10 is not double!", input_z)
# if type(input_vx) != type(1.1):
# raise TypeError("Parameter 11 is not double!", input_vx)
# if type(input_vy) != type(1.1):
# raise TypeError("Parameter 12 is not double!", input_vy)
# if type(input_vz) != type(1.1):
# raise TypeError("Parameter 13 is not double!", input_vz)
#Convert km -> m
# Convert km -> m
input_x
=
input_x
*
1000.0
input_y
=
input_y
*
1000.0
input_z
=
input_z
*
1000.0
...
...
@@ -129,6 +98,5 @@ def onOrbitObsPosition(path, input_ra_list, input_dec_list, input_pmra_list, inp
raise
RuntimeError
(
"Calculate error!"
)
output_ra_list
.
append
(
output_ra
.
value
)
output_dec_list
.
append
(
output_dec
.
value
)
return
output_ra_list
,
output_dec_list
\ No newline at end of file
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