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
7c92aad2
Commit
7c92aad2
authored
Apr 07, 2021
by
Shoulin Wei
Browse files
gaia3
parent
4e772e6e
Changes
4
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api/common/catalog.py
0 → 100644
View file @
7c92aad2
from
.delegate
import
Delegate
class
CatalogApi
(
object
):
def
__init__
(
self
):
self
.
module
=
Delegate
().
load
(
sub_module
=
"common"
)
self
.
stub
=
getattr
(
self
.
module
,
"CatalogApi"
)()
def
catalog_query
(
self
,
ra
:
float
,
dec
:
float
,
radius
:
float
,
catalog_name
:
str
,
min_mag
:
float
,
max_mag
:
float
,
obstime
:
int
,
limit
:
int
):
''' retrieval catalot
args:
ra: in deg
dec: in deg
radius: in deg
catalog_name: one of ['gaia3','','']
min_mag: minimal magnitude
max_mag: maximal magnitude
obstime: seconds
limit: limits returns the number of records
return: a dict as {success: true, totalCount: 100, records:[.....]}
'''
if
catalog_name
==
"gaia3"
:
return
self
.
gaia3_query
(
ra
,
dec
,
radius
,
min_mag
,
max_mag
,
obstime
,
limit
)
else
:
raise
Exception
(
"%s catalog search not yet implemented"
%
(
catalog_name
,
))
def
gaia3_query
(
self
,
ra
:
float
,
dec
:
float
,
radius
:
float
,
min_mag
:
float
,
max_mag
:
float
,
obstime
:
int
,
limit
:
int
):
''' retrieval GAIA DR 3
args:
ra: in deg
dec: in deg
radius: in deg
min_mag: minimal magnitude
max_mag: maximal magnitude
obstime: seconds
limit: limits returns the number of records
return: a dict as {success: true, totalCount: 100, records:[.....]}
'''
return
self
.
stub
.
gaia3_query
(
ra
,
dec
,
radius
,
min_mag
,
max_mag
,
obstime
,
limit
)
csst_dfs_api/common/ephem.py
deleted
100644 → 0
View file @
4e772e6e
from
.delegate
import
Delegate
class
EphemSearchApi
(
object
):
def
__init__
(
self
):
self
.
module
=
Delegate
().
load
(
sub_module
=
"common"
)
self
.
stub
=
getattr
(
self
.
module
,
"EphemSearchApi"
)()
def
gaia_query
(
self
,
ra
:
float
,
dec
:
float
,
radius
:
float
,
mag
:
float
,
limit
:
int
=
1000
):
''' retivial GAIA DR 2
args:
ra: in deg
dec: in deg
radius: in deg
mag:
limit: limits on the number of returns
return: a dict as {success: true, totalCount: 100, records:[.....]}
'''
return
self
.
stub
.
gaia_query
(
ra
,
dec
,
radius
,
mag
,
limit
)
tests/test_common_catalog.py
0 → 100644
View file @
7c92aad2
import
os
import
unittest
from
astropy.io
import
fits
from
csst_dfs_api.common.catalog
import
CatalogApi
class
CommonCatalogTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
api
=
CatalogApi
()
def
test_gaia3_query
(
self
):
recs
=
self
.
api
.
gaia3_query
(
ra
=
56.234039029108935
,
dec
=
14.466534827703473
,
radius
=
4
,
min_mag
=-
1
,
max_mag
=-
1
,
obstime
=
-
1
,
limit
=
2
)
print
(
'find:'
,
recs
)
tests/test_common_ephem.py
deleted
100644 → 0
View file @
4e772e6e
import
os
import
unittest
from
astropy.io
import
fits
from
csst_dfs_api.common.ephem
import
EphemSearchApi
class
CommonEphemTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
api
=
EphemSearchApi
()
def
test_gaia_query
(
self
):
recs
=
self
.
api
.
gaia_query
(
ra
=
260
,
dec
=-
27
,
radius
=
0.01
,
mag
=
0.01
,
limit
=
2
)
print
(
'find:'
,
recs
)
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