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-pipeline
csst_common
Commits
8e5af267
Commit
8e5af267
authored
Jan 10, 2023
by
BO ZHANG
🏀
Browse files
add dm.dfs_rc_auto() to download rc automatically
parent
51b32253
Changes
1
Show whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
8e5af267
...
...
@@ -638,6 +638,49 @@ class CsstMsDataManager:
except
:
return
False
def
get_coord
(
self
):
""" Get pointing coordinate. """
header
=
fits
.
getheader
(
self
.
l0_detector
(
detector
=
self
.
target_detectors
[
0
]))
pointing_ra
=
header
[
"RA_OBJ"
]
pointing_dec
=
header
[
"DEC_OBJ"
]
return
pointing_ra
,
pointing_dec
def
dfs_rc_auto
(
self
):
""" Download RC. """
assert
self
.
dfs_is_available
()
assert
len
(
self
.
target_detectors
)
>=
1
pointing_ra
,
pointing_dec
=
self
.
get_coord
()
refcat
=
self
.
dfs_rc_query
(
ra
=
pointing_ra
,
dec
=
pointing_dec
,
columns
=
(
'ref_epoch'
,
'ra'
,
'ra_error'
,
'dec'
,
'dec_error'
,
'parallax'
,
'parallax_error'
,
'pmra'
,
'pmra_error'
,
'pmdec'
,
'pmdec_error'
,
'phot_g_mean_mag'
,
'source_id'
),
radius
=
2
,
min_mag
=
0
,
max_mag
=
30
,
obstime
=-
1
,
limit
=-
1
)
print
(
f
"RA, Dec = [
{
pointing_ra
}
,
{
pointing_dec
}
], "
f
"Status =
{
isinstance
(
refcat
,
Table
)
}
, "
f
"N_entries =
{
len
(
refcat
)
}
"
)
return
refcat
def
dfs_rc_query
(
self
,
ra
=
180
,
...
...
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