-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Comet packed designation wrong for fragmented periodic comets #965
Comments
Let's read down through the whole file to see how things look. This little command line:
—shows that the file is cleanly split between lines with designations in one format, and a second section that uses another. Omitting long stretches of lines with the same format, here's what we see:
The first thing we can note is that we can't, alas, use your suggestion of using the orbit type The second thing we note is that, as you correctly note, the same field is used sometimes for the (mostly blank) fragment number (I included comet 0051P specifically so we'd get to see an example of a case where the field wasn't blank), and sometimes it's used for a modern packed designation like the ones used for minor planets. For reference, here's how the format is described on their website: https://www.minorplanetcenter.net/iau/info/CometOrbitFormat.html
Which makes it sound so simple! But over in their text description of the format, they describe two different ways the fields can be used, with the "packed form" designation instead being a fragment number: https://www.minorplanetcenter.net/iau/info/PackedDes.html So the problem here is that Pandas doesn't allow columns to have different names depending on their content. There's no way (at least that I know of?) to tell Pandas, "the third column of this file should be called 'fragment number' when there's a non-empty comet number in columns 1-4, but should be called 'packed designation' when columns 1-4 are blank." So in my design for the column numbers, I tried to just stick with the "official" names of the columns given in the first link above. Before wading into further details, let's step back a moment. When I wrote up the code to handle comments, I didn't pay attention to those first columns, because the lines of the file are now much longer than in the old days, and include the full text of the comet name way over to the right. In your example, we can just read the full name So what you want is a way to find the fragment number. Hmm. Maybe the Skyfield documentation on comets could include a little snippet showing how to get the fragment number? It might work something like this:
Hmm. There's a complication here. Because we're only giving one line at a time, Pandas doesn't have the full
— gets a fragment number of But, first, I'll stop here to hear your comments, to learn whether getting the fragment value like this would answer your purpose — or whether there's some other underlying goal? |
Hi Brandon Yes the format is really anoying and complicated :( My idea was that for the numbered comets packed designation is constructed as f'{number}{orbit_tyxpe}' For other comets the fragment is as I see always the last letter in the designation_packed if it is lower case I have constructed a function that can be used and applied on the mpc.load_comets_dataframe_slow pandas dataframe. It overwrites the designation_packed for numbered comets and also adds a new column for fragment_letter might be useful in some cases.
|
Thanks for providing more example code! I agree that it will be nice, either in the documentation or a provided function, for Skyfield to show folks how to handle the inconsistent way that MPC represents comet fragments. But I suspect I should finish out a few items that I'm already working on for Skyfield first, and then once a new release is out, return to this topic. I'll keep it open, though, and hopefully other folks who need your code can cut-and-paste it from here in the meantime. Thanks! |
@brandon-rhodes Something like that: So packed designation for numbered comets would be something like: '0343P' or '0332P-A' For astroquery a packed designation for numbered comets must contain the object type (example: '0343P'). If you send a query without object type (example: '0343') as object ID you get the ephemeris for asteroid 343 instead of comet 343P. |
I noticed that for some comets the packed designation is parsed wrong
This is the MPC 1-line orbital elements beeing parsed
0323P b 2025 12 16.3240 0.040025 0.986146 353.9756 323.4582 5.4670 20240331 26.0 4.0 323P-B/SOHO MPEC 2024-F21
And the output of the mpc.load_comets_dataframe_slow(io.BufferedReader(orbit))
I would guess that for P type orbit the packed designation should be nan but in this case it reads the fragment part.
Here is a short script to reproduce:
The text was updated successfully, but these errors were encountered: