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-pipeline
csst_common
Commits
3165c15a
Commit
3165c15a
authored
Oct 28, 2022
by
BO ZHANG
🏀
Browse files
added dfs module
parent
7a6611cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/dfs.py
0 → 100644
View file @
3165c15a
import
os
from
csst_dfs_api.common.catalog
import
CatalogApi
from
csst_dfs_api.msc.level1
import
Level1DataApi
# DFS query
def
gaia_query_from_dfs
(
ra
=
180
,
dec
=
0
,
radius
=
2
,
min_mag
=
0
,
max_mag
=
20
,
obstime
=-
1
,
limit
=-
1
):
""" query gaia edr3 catalog from dfs """
api
=
CatalogApi
()
cat
=
api
.
catalog_query
(
catalog_name
=
"gaia3"
,
ra
=
ra
,
dec
=
dec
,
radius
=
radius
,
min_mag
=
min_mag
,
max_mag
=
max_mag
,
obstime
=
obstime
,
limit
=
limit
)
tbl
=
api
.
to_table
(
cat
)
return
tbl
# TODO: the l1api is not completed
def
get_l1api
(
node
=
"pm"
):
""" get DFS L1 API
Parameters
----------
node: str
in present, node has to be "pm"
Returns
-------
DFS L1 API
Examples
--------
>>>
>>> rec = l1api.write(
>>> level0_id='10000000020',
>>> data_type = "sci",
>>> cor_sci_id = 1,
>>> prc_status = 3,
>>> prc_time = '2022-01-05 15:18:13',
>>> filename = "MSC_MS_210525120000_100000000_20_img.fits",
>>> file_path = "/nfs/data/test20211012/output/L1/150s/MSC_MS_210525120000_100000000_20_img.fits",
>>> pipeline_id = "P1_test",
>>> refs = {})
>>> print('write:', rec)
"""
l1api
=
Level1DataApi
()
return
l1api
if
__name__
==
"__main__"
:
tbl
=
gaia_query_from_dfs
()
print
(
tbl
)
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