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
95ae816a
Commit
95ae816a
authored
Apr 11, 2023
by
Wei Shoulin
Browse files
except catch
parent
b4cad597
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_dfs_commons/utils/fits.py
View file @
95ae816a
...
...
@@ -21,9 +21,12 @@ def get_header_value(key: str, headers, default_value = None):
return
default_value
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
)
try
:
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
)
except
:
return
-
1
def
get_healpix_ids
(
ra
,
dec
,
radius
,
nside
=
32
):
hp
=
HEALPix
(
nside
=
nside
,
order
=
'nested'
,
frame
=
ICRS
())
...
...
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