Commit 18f1fb13 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

msc level2

parent 26093469
......@@ -13,12 +13,6 @@ REF_TYPE_SKY = "sky"
REF_TYPES = (REF_TYPE_BIAS, REF_TYPE_DARK, REF_TYPE_FlAT, REF_TYPE_ARC, REF_TYPE_LAMP, REF_TYPE_SKY)
OBS_TYPE_SCI = "sci"
OBS_TYPE_CAL = "cal"
OBS_TYPE_TEST = "test"
OBS_TYPE_JOIN = "join" # joint observation fo IFS and MCI
OBS_TYPES = (OBS_TYPE_SCI, OBS_TYPE_CAL, OBS_TYPE_TEST, OBS_TYPE_JOIN)
MODULE_MSC = "MSC"
MODULE_MBI = "MBI"
MODULE_SLS = "SLS"
......@@ -73,6 +67,8 @@ SLS_DECTECTORS2FILTER = {
30: "GI"
}
MSC_SCI_OBS_TYPE = 'SCI'
MSC_SCI_OBS_TYPE = 'SCIE'
SCI_OBS_TYPES = [MSC_SCI_OBS_TYPE]
SCI_OBS_TYPES = [MSC_SCI_OBS_TYPE]
\ No newline at end of file
DEFAULT_NSIDE = 256
\ No newline at end of file
......@@ -286,4 +286,5 @@ class Level2CoCatalogRecord(BaseModel):
RatioErr_Disk: float = -1
Spread_Model: float = -1
SpreadErr_Model: float = -1
NS128HIdx: int = 0
Brick_Id: int = 0
Filter: str = ''
......@@ -23,7 +23,7 @@ def get_header_value(key: str, headers, default_value = None):
except Exception as e:
return default_value
def get_healpix_id(ra, dec, nside=32):
def get_healpix_id(ra, dec, nside=256):
try:
hp = HEALPix(nside=nside, order='nested', frame=ICRS())
coord = SkyCoord(ra = ra * u.deg, dec = dec * u.deg, frame='icrs')
......@@ -31,7 +31,7 @@ def get_healpix_id(ra, dec, nside=32):
except:
return -1
def get_healpix_ids(ra, dec, radius, nside=32):
def get_healpix_ids(ra, dec, radius, nside=256):
hp = HEALPix(nside=nside, order='nested', frame=ICRS())
coord = SkyCoord(ra = ra * u.deg, dec = dec * u.deg, frame='icrs')
return hp.cone_search_skycoord(coord, radius = radius * u.deg)
......@@ -72,4 +72,5 @@ def hdul_of_healpix_ids(hdulist, nside=256):
xyzpoly = tuple(map(tuple, xyzpoly))
xyzpoly = np.array(xyzpoly).reshape(-1, 3)
healpixids = hp.query_polygon(nside, xyzpoly.T)
return healpixids
import unittest
from astropy.io import fits
from csst_dfs_commons.utils.fits import get_header_value, get_healpix_id, get_healpix_ids, hdul_of_healpix_ids
class CommonFitsTestCase(unittest.TestCase):
def setUp(self):
pass
def test_hdul_of_healpix_ids(self):
hdul = fits.open()
r = hdul_of_healpix_ids(id = 1)
......@@ -12,3 +12,4 @@ class CommonModelsTestCase(unittest.TestCase):
r = Request(id = 1)
assert r.id == 1, "not equal"
assert r.xxx == '', "not equal"
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