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-dfs
csst-dfs-commons
Commits
535e15bd
Commit
535e15bd
authored
Nov 22, 2022
by
Wei Shoulin
Browse files
h
parent
2937a76b
Changes
3
Hide whitespace changes
Inline
Side-by-side
csst_dfs_commons/convert/date_utils.py
View file @
535e15bd
...
@@ -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'
)
...
...
csst_dfs_commons/models/constants.py
View file @
535e15bd
UPLOAD_CHUNK_SIZE
=
1024
*
1000
*
4
PI
=
3.14159265358979323846
UPLOAD_CHUNK_SIZE
=
16
*
1024
STATUS_SUCESS
=
0
STATUS_SUCESS
=
0
...
...
csst_dfs_commons/utils/fits.py
View file @
535e15bd
...
@@ -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
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