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

h

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