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
Show whitespace changes
Inline
Side-by-side
csst_dfs_commons/convert/date_utils.py
View file @
535e15bd
...
...
@@ -4,6 +4,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'
)
...
...
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
...
...
csst_dfs_commons/utils/fits.py
View file @
535e15bd
...
...
@@ -16,3 +16,8 @@ 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
)
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