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-dfs
csst-dfs-api
Commits
52aa0c24
Commit
52aa0c24
authored
May 05, 2022
by
Wei Shoulin
Browse files
to astropy table
parent
cc619975
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api/common/catalog.py
View file @
52aa0c24
...
...
@@ -28,16 +28,19 @@ class CatalogApi(object):
return
self
.
gaia3_query
(
ra
,
dec
,
radius
,
min_mag
,
max_mag
,
obstime
,
limit
)
else
:
return
Result
.
error
(
message
=
"%s catalog search not yet implemented"
%
(
catalog_name
,
))
def
_fields_dtypes
(
self
,
rec
):
fields
=
tuple
(
rec
.
__dataclass_fields__
.
keys
())
dtypes
=
[]
for
_
,
f
in
rec
.
__dataclass_fields__
.
items
():
if
f
.
type
==
int
:
dtypes
.
append
(
'i8'
)
if
f
.
type
==
float
:
el
if
f
.
type
==
float
:
dtypes
.
append
(
'f8'
)
if
f
.
type
==
str
:
dtypes
.
append
(
'S2'
)
elif
f
.
type
==
str
:
dtypes
.
append
(
'S2'
)
else
:
dtypes
.
append
(
'S2'
)
dtypes
=
tuple
(
dtypes
)
return
fields
,
dtypes
...
...
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