Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPC: Add star catalog column #2957

Merged
merged 4 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ New Tools and Services
Service fixes and enhancements
------------------------------

mpc
^^^

- Parse star catalog information when querying observations database [#2957]


Infrastructure, Utility and Other Changes and Additions
-------------------------------------------------------
Expand Down
56 changes: 30 additions & 26 deletions astroquery/mpc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,38 +868,42 @@ def get_observations_async(self, targetid, *,
+-------------------+--------------------------------------------+
| ``phottype`` (*) | comet photometry type (nuclear/total, str) |
+-------------------+--------------------------------------------+
| ``catalog`` (!) | star catalog used in the observation (str) |
+-------------------+--------------------------------------------+
| ``observatory`` | IAU observatory code (str) |
+-------------------+--------------------------------------------+

(*): Column names are optional and
depend on whether an asteroid or a comet has been queried.

(#): Parameters ``Note1`` and ``Note2`` are defined `here
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_.
(#): Parameters ``Note1`` and ``Note2`` are defined in the
`MPC 80-column format description
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_

(!): `Description of star catalog codes
<https://minorplanetcenter.net/iau/info/OpticalObs.html>`_


Examples
--------
>>> from astroquery.mpc import MPC
>>> MPC.get_observations(12893) # doctest: +SKIP
<QTable masked=True length=1401>
number desig discovery note1 ... mag band observatory
... mag
int64 str9 str1 str1 ... float64 str1 str3
------ --------- --------- ----- ... ------- ---- -----------
12893 1998 QS55 -- -- ... 0.0 -- 413
12893 1998 QS55 -- -- ... 0.0 -- 413
12893 1998 QS55 * 4 ... 0.0 -- 809
12893 1998 QS55 -- 4 ... 0.0 -- 809
12893 1998 QS55 -- 4 ... 0.0 -- 809
12893 1998 QS55 -- 4 ... 18.4 -- 809
... ... ... ... ... ... ... ...
12893 1998 QS55 -- -- ... 18.63 c T05
12893 1998 QS55 -- -- ... 18.55 c T05
12893 1998 QS55 -- -- ... 18.3 r I41
12893 1998 QS55 -- -- ... 18.3 r I41
12893 1998 QS55 -- -- ... 18.2 r I41
12893 1998 QS55 -- -- ... 18.3 r I41
<QTable length=2772>
number desig discovery note1 ... band catalog observatory
...
int32 str9 str1 str1 ... str1 str1 str3
------ --------- --------- ----- ... ---- ------- -----------
12893 1998 QS55 -- -- ... -- -- 413
12893 1998 QS55 -- -- ... -- -- 413
12893 1998 QS55 * 4 ... -- -- 809
12893 1998 QS55 -- 4 ... -- -- 809
12893 1998 QS55 -- 4 ... -- -- 809
... ... ... ... ... ... ... ...
12893 1998 QS55 -- -- ... o V T05
12893 1998 QS55 -- -- ... o V M22
12893 1998 QS55 -- -- ... o V M22
12893 1998 QS55 -- -- ... o V M22
12893 1998 QS55 -- -- ... o V M22
"""

request_payload = {'table': 'observations'}
Expand Down Expand Up @@ -1207,11 +1211,11 @@ def _parse_result(self, result, **kwargs):
names=('number', 'pdesig', 'discovery',
'note1', 'note2', 'epoch',
'RA', 'DEC', 'mag', 'band',
'observatory'),
'catalog', 'observatory'),
col_starts=(0, 5, 12, 13, 14, 15,
32, 44, 65, 70, 77),
32, 44, 65, 70, 71, 77),
col_ends=(4, 11, 12, 13, 14, 31,
43, 55, 69, 70, 79),
43, 55, 69, 70, 71, 79),
fast_reader=False)

# convert asteroid designations
Expand Down Expand Up @@ -1252,11 +1256,11 @@ def _parse_result(self, result, **kwargs):
names=('number', 'comettype', 'desig',
'note1', 'note2', 'epoch',
'RA', 'DEC', 'mag', 'phottype',
'observatory'),
'catalog', 'observatory'),
col_starts=(0, 4, 5, 13, 14, 15,
32, 44, 65, 70, 77),
32, 44, 65, 70, 71, 77),
col_ends=(3, 4, 12, 13, 14, 31,
43, 55, 69, 70, 79),
43, 55, 69, 70, 71, 79),
fast_reader=False)

# convert comet designations
Expand Down
35 changes: 17 additions & 18 deletions docs/mpc/mpc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -445,24 +445,23 @@ asteroid 12893:

>>> obs = MPC.get_observations(12893)
>>> print(obs) # doctest: +IGNORE_OUTPUT
number desig discovery note1 ... DEC mag band observatory
... deg mag
------ --------- --------- ----- ... ------------------- ----- ---- -----------
12893 1998 QS55 -- -- ... -15.78888888888889 0.0 -- 413
12893 1998 QS55 -- -- ... -15.788944444444445 0.0 -- 413
12893 1998 QS55 * 4 ... 5.526472222222222 0.0 -- 809
12893 1998 QS55 -- 4 ... 5.525555555555555 0.0 -- 809
12893 1998 QS55 -- 4 ... 5.524805555555555 0.0 -- 809
12893 1998 QS55 -- 4 ... 5.440555555555556 18.4 -- 809
... ... ... ... ... ... ... ... ...
12893 1998 QS55 -- -- ... 12.63075 18.53 c T05
12893 1998 QS55 -- -- ... 12.63088888888889 18.63 c T05
12893 1998 QS55 -- -- ... 12.631472222222223 18.55 c T05
12893 1998 QS55 -- -- ... 12.669888888888888 18.3 r I41
12893 1998 QS55 -- -- ... 12.71525 18.3 r I41
12893 1998 QS55 -- -- ... 12.716833333333334 18.2 r I41
12893 1998 QS55 -- -- ... 12.717527777777779 18.3 r I41
Length = 1401 rows
number desig discovery note1 note2 ... mag band catalog observatory
... mag
------ --------- --------- ----- ----- ... ----- ---- ------- -----------
12893 1998 QS55 -- -- -- ... ——— -- -- 413
12893 1998 QS55 -- -- -- ... ——— -- -- 413
12893 1998 QS55 * 4 -- ... ——— -- -- 809
12893 1998 QS55 -- 4 -- ... ——— -- -- 809
12893 1998 QS55 -- 4 -- ... ——— -- -- 809
12893 1998 QS55 -- 4 -- ... 18.4 -- -- 809
... ... ... ... ... ... ... ... ... ...
12893 1998 QS55 -- -- C ... 18.71 o V T05
12893 1998 QS55 -- -- C ... 18.31 o V T05
12893 1998 QS55 -- -- C ... 18.41 o V M22
12893 1998 QS55 -- -- C ... 18.52 o V M22
12893 1998 QS55 -- -- C ... 18.43 o V M22
12893 1998 QS55 -- -- C ... 18.2 o V M22
Length = 2772 rows

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