Skip to content

Commit 5f54ec6

Browse files
authored
Merge pull request #2957 from tristandijkstra/main
MPC: Add star catalog column
2 parents 73afabf + 9fc602e commit 5f54ec6

File tree

3 files changed

+52
-44
lines changed

3 files changed

+52
-44
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ New Tools and Services
88
Service fixes and enhancements
99
------------------------------
1010

11+
mpc
12+
^^^
13+
14+
- Parse star catalog information when querying observations database [#2957]
15+
1116

1217
Infrastructure, Utility and Other Changes and Additions
1318
-------------------------------------------------------

astroquery/mpc/core.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -868,38 +868,42 @@ def get_observations_async(self, targetid, *,
868868
+-------------------+--------------------------------------------+
869869
| ``phottype`` (*) | comet photometry type (nuclear/total, str) |
870870
+-------------------+--------------------------------------------+
871+
| ``catalog`` (!) | star catalog used in the observation (str) |
872+
+-------------------+--------------------------------------------+
871873
| ``observatory`` | IAU observatory code (str) |
872874
+-------------------+--------------------------------------------+
873875
874876
(*): Column names are optional and
875877
depend on whether an asteroid or a comet has been queried.
876878
877-
(#): Parameters ``Note1`` and ``Note2`` are defined `here
878-
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_.
879+
(#): Parameters ``Note1`` and ``Note2`` are defined in the
880+
`MPC 80-column format description
881+
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_
882+
883+
(!): `Description of star catalog codes
884+
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_
879885
880886
881887
Examples
882888
--------
883889
>>> from astroquery.mpc import MPC
884890
>>> MPC.get_observations(12893) # doctest: +SKIP
885-
<QTable masked=True length=1401>
886-
number desig discovery note1 ... mag band observatory
887-
... mag
888-
int64 str9 str1 str1 ... float64 str1 str3
889-
------ --------- --------- ----- ... ------- ---- -----------
890-
12893 1998 QS55 -- -- ... 0.0 -- 413
891-
12893 1998 QS55 -- -- ... 0.0 -- 413
892-
12893 1998 QS55 * 4 ... 0.0 -- 809
893-
12893 1998 QS55 -- 4 ... 0.0 -- 809
894-
12893 1998 QS55 -- 4 ... 0.0 -- 809
895-
12893 1998 QS55 -- 4 ... 18.4 -- 809
896-
... ... ... ... ... ... ... ...
897-
12893 1998 QS55 -- -- ... 18.63 c T05
898-
12893 1998 QS55 -- -- ... 18.55 c T05
899-
12893 1998 QS55 -- -- ... 18.3 r I41
900-
12893 1998 QS55 -- -- ... 18.3 r I41
901-
12893 1998 QS55 -- -- ... 18.2 r I41
902-
12893 1998 QS55 -- -- ... 18.3 r I41
891+
<QTable length=2772>
892+
number desig discovery note1 ... band catalog observatory
893+
...
894+
int32 str9 str1 str1 ... str1 str1 str3
895+
------ --------- --------- ----- ... ---- ------- -----------
896+
12893 1998 QS55 -- -- ... -- -- 413
897+
12893 1998 QS55 -- -- ... -- -- 413
898+
12893 1998 QS55 * 4 ... -- -- 809
899+
12893 1998 QS55 -- 4 ... -- -- 809
900+
12893 1998 QS55 -- 4 ... -- -- 809
901+
... ... ... ... ... ... ... ...
902+
12893 1998 QS55 -- -- ... o V T05
903+
12893 1998 QS55 -- -- ... o V M22
904+
12893 1998 QS55 -- -- ... o V M22
905+
12893 1998 QS55 -- -- ... o V M22
906+
12893 1998 QS55 -- -- ... o V M22
903907
"""
904908

905909
request_payload = {'table': 'observations'}
@@ -1207,11 +1211,11 @@ def _parse_result(self, result, **kwargs):
12071211
names=('number', 'pdesig', 'discovery',
12081212
'note1', 'note2', 'epoch',
12091213
'RA', 'DEC', 'mag', 'band',
1210-
'observatory'),
1214+
'catalog', 'observatory'),
12111215
col_starts=(0, 5, 12, 13, 14, 15,
1212-
32, 44, 65, 70, 77),
1216+
32, 44, 65, 70, 71, 77),
12131217
col_ends=(4, 11, 12, 13, 14, 31,
1214-
43, 55, 69, 70, 79),
1218+
43, 55, 69, 70, 71, 79),
12151219
fast_reader=False)
12161220

12171221
# convert asteroid designations
@@ -1252,11 +1256,11 @@ def _parse_result(self, result, **kwargs):
12521256
names=('number', 'comettype', 'desig',
12531257
'note1', 'note2', 'epoch',
12541258
'RA', 'DEC', 'mag', 'phottype',
1255-
'observatory'),
1259+
'catalog', 'observatory'),
12561260
col_starts=(0, 4, 5, 13, 14, 15,
1257-
32, 44, 65, 70, 77),
1261+
32, 44, 65, 70, 71, 77),
12581262
col_ends=(3, 4, 12, 13, 14, 31,
1259-
43, 55, 69, 70, 79),
1263+
43, 55, 69, 70, 71, 79),
12601264
fast_reader=False)
12611265

12621266
# convert comet designations

docs/mpc/mpc.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -445,24 +445,23 @@ asteroid 12893:
445445

446446
>>> obs = MPC.get_observations(12893)
447447
>>> print(obs) # doctest: +IGNORE_OUTPUT
448-
number desig discovery note1 ... DEC mag band observatory
449-
... deg mag
450-
------ --------- --------- ----- ... ------------------- ----- ---- -----------
451-
12893 1998 QS55 -- -- ... -15.78888888888889 0.0 -- 413
452-
12893 1998 QS55 -- -- ... -15.788944444444445 0.0 -- 413
453-
12893 1998 QS55 * 4 ... 5.526472222222222 0.0 -- 809
454-
12893 1998 QS55 -- 4 ... 5.525555555555555 0.0 -- 809
455-
12893 1998 QS55 -- 4 ... 5.524805555555555 0.0 -- 809
456-
12893 1998 QS55 -- 4 ... 5.440555555555556 18.4 -- 809
457-
... ... ... ... ... ... ... ... ...
458-
12893 1998 QS55 -- -- ... 12.63075 18.53 c T05
459-
12893 1998 QS55 -- -- ... 12.63088888888889 18.63 c T05
460-
12893 1998 QS55 -- -- ... 12.631472222222223 18.55 c T05
461-
12893 1998 QS55 -- -- ... 12.669888888888888 18.3 r I41
462-
12893 1998 QS55 -- -- ... 12.71525 18.3 r I41
463-
12893 1998 QS55 -- -- ... 12.716833333333334 18.2 r I41
464-
12893 1998 QS55 -- -- ... 12.717527777777779 18.3 r I41
465-
Length = 1401 rows
448+
number desig discovery note1 note2 ... mag band catalog observatory
449+
... mag
450+
------ --------- --------- ----- ----- ... ----- ---- ------- -----------
451+
12893 1998 QS55 -- -- -- ... ——— -- -- 413
452+
12893 1998 QS55 -- -- -- ... ——— -- -- 413
453+
12893 1998 QS55 * 4 -- ... ——— -- -- 809
454+
12893 1998 QS55 -- 4 -- ... ——— -- -- 809
455+
12893 1998 QS55 -- 4 -- ... ——— -- -- 809
456+
12893 1998 QS55 -- 4 -- ... 18.4 -- -- 809
457+
... ... ... ... ... ... ... ... ... ...
458+
12893 1998 QS55 -- -- C ... 18.71 o V T05
459+
12893 1998 QS55 -- -- C ... 18.31 o V T05
460+
12893 1998 QS55 -- -- C ... 18.41 o V M22
461+
12893 1998 QS55 -- -- C ... 18.52 o V M22
462+
12893 1998 QS55 -- -- C ... 18.43 o V M22
463+
12893 1998 QS55 -- -- C ... 18.2 o V M22
464+
Length = 2772 rows
466465

467466
The query results of `~astroquery.mpc.MPCClass.get_observations` are parsed
468467
into a `~astropy.table.QTable` by default; it is also possible to

0 commit comments

Comments
 (0)