Commit 535e15bd authored by Wei Shoulin's avatar Wei Shoulin
Browse files

h

parent 2937a76b
......@@ -3,6 +3,9 @@ import time
def format_datetime(dt):
return dt.strftime('%Y-%m-%d %H:%M:%S')
def format_compact_datetime(dt):
return dt.strftime('%Y%m%d%H%M%S')
def format_date(dt):
return dt.strftime('%Y-%m-%d')
......
UPLOAD_CHUNK_SIZE = 1024*1000*4
PI = 3.14159265358979323846
UPLOAD_CHUNK_SIZE = 16*1024
STATUS_SUCESS = 0
......
......@@ -15,4 +15,9 @@ def get_header_value(key: str, header, default_value = None):
def get_healpix_id(ra, dec, nside=32):
hp = HEALPix(nside=nside, order='nested', frame=ICRS())
coord = SkyCoord(ra = ra * u.deg, dec = dec * u.deg, frame='icrs')
return hp.skycoord_to_healpix(coord)
\ No newline at end of file
return hp.skycoord_to_healpix(coord)
def get_healpix_ids(ra, dec, radius, nside=32):
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)
\ No newline at end of file
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