Commit 3165c15a authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added dfs module

parent 7a6611cb
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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment