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
Show whitespace changes
Inline
Side-by-side
csst_dfs_api/common/catalog.py
View file @
52aa0c24
...
@@ -28,15 +28,18 @@ class CatalogApi(object):
...
@@ -28,15 +28,18 @@ class CatalogApi(object):
return
self
.
gaia3_query
(
ra
,
dec
,
radius
,
min_mag
,
max_mag
,
obstime
,
limit
)
return
self
.
gaia3_query
(
ra
,
dec
,
radius
,
min_mag
,
max_mag
,
obstime
,
limit
)
else
:
else
:
return
Result
.
error
(
message
=
"%s catalog search not yet implemented"
%
(
catalog_name
,
))
return
Result
.
error
(
message
=
"%s catalog search not yet implemented"
%
(
catalog_name
,
))
def
_fields_dtypes
(
self
,
rec
):
def
_fields_dtypes
(
self
,
rec
):
fields
=
tuple
(
rec
.
__dataclass_fields__
.
keys
())
fields
=
tuple
(
rec
.
__dataclass_fields__
.
keys
())
dtypes
=
[]
dtypes
=
[]
for
_
,
f
in
rec
.
__dataclass_fields__
.
items
():
for
_
,
f
in
rec
.
__dataclass_fields__
.
items
():
if
f
.
type
==
int
:
if
f
.
type
==
int
:
dtypes
.
append
(
'i8'
)
dtypes
.
append
(
'i8'
)
if
f
.
type
==
float
:
el
if
f
.
type
==
float
:
dtypes
.
append
(
'f8'
)
dtypes
.
append
(
'f8'
)
if
f
.
type
==
str
:
elif
f
.
type
==
str
:
dtypes
.
append
(
'S2'
)
else
:
dtypes
.
append
(
'S2'
)
dtypes
.
append
(
'S2'
)
dtypes
=
tuple
(
dtypes
)
dtypes
=
tuple
(
dtypes
)
return
fields
,
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