sbpy icon indicating copy to clipboard operation
sbpy copied to clipboard

Cometary designations are not fully supported.

Open mkelley opened this issue 1 year ago • 0 comments

Cometary designations are not fully supported:

In [22]: Names.to_packed("73P")
---------------------------------------------------------------------------
TargetNameParseError                      Traceback (most recent call last)
Cell In[22], line 1
----> 1 Names.to_packed("73P")

File /disks/data0/astro/Projects/sbpy/sbpy/data/names.py:194, in Names.to_packed(s)
    190             raise TargetNameParseError(
    191                 ('{} cannot be turned into a '
    192                  'packed number or designation').format(s))
    193 else:
--> 194     raise TargetNameParseError(
    195         ('{} cannot be turned into a '
    196          'packed number or designation').format(s))

TargetNameParseError: 73P cannot be turned into a packed number or designation

In [23]: Names.to_packed("P/2004 A1")
---------------------------------------------------------------------------
TargetNameParseError                      Traceback (most recent call last)
Cell In[23], line 1
----> 1 Names.to_packed("P/2004 A1")

File /disks/data0/astro/Projects/sbpy/sbpy/data/names.py:194, in Names.to_packed(s)
    190             raise TargetNameParseError(
    191                 ('{} cannot be turned into a '
    192                  'packed number or designation').format(s))
    193 else:
--> 194     raise TargetNameParseError(
    195         ('{} cannot be turned into a '
    196          'packed number or designation').format(s))

TargetNameParseError: P/2004 A1 cannot be turned into a packed number or designation

In [24]: Names.to_packed("C/2013 US10")
---------------------------------------------------------------------------
TargetNameParseError                      Traceback (most recent call last)
Cell In[24], line 1
----> 1 Names.to_packed("C/2013 US10")

File /disks/data0/astro/Projects/sbpy/sbpy/data/names.py:194, in Names.to_packed(s)
    190             raise TargetNameParseError(
    191                 ('{} cannot be turned into a '
    192                  'packed number or designation').format(s))
    193 else:
--> 194     raise TargetNameParseError(
    195         ('{} cannot be turned into a '
    196          'packed number or designation').format(s))

TargetNameParseError: C/2013 US10 cannot be turned into a packed number or designation

These examples should use the 12-character format at:

https://www.minorplanetcenter.net/iau/info/PackedDes.html

Take care to account for two characters in a comet fragment designation, at least for numbered periodic comets. The MPC's comet orbit table file packs 73P-BA into "0073P ba":

https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt

However, the packed format description doesn't account for two-character fragment specifiers, and following the 73P rule (fragment in columns 11 and 12) will not work for a provisional designation, which needs to use the 11th character. For this latter case, should we raise an error or make it a 13-character string and raise a warning?

mkelley avatar Aug 27 '24 15:08 mkelley