Small Feature for NINA
Jan 31, 2021
What is NINA?
NINA, or Nighttime Imaging ‘n’ Astronomy is an “astrophotography imaging suite”. What that means in more common terms is that it’s a tool that astronomers and astrophotographers use to control their equipment to take photos. It can do everything from managing the rotation of an observatory, to controlling the illumination of a light panel for a calibration image. But mostly, it’s used to tell a telescope where to point, keep it trained on the object your imaging and take photos all night long without you having to be beside the telescope managing it yourself.
What was the problem?
NINA provides a Deep Space Object (DSO) search to let you find DSOs and see what their appearance in the night sky would look like. This is the first step for selecting a target for imaging. In the example image below you can see that M31, the Andromeda Galaxy, is an okay target for that night. It’s got a couple hours in the early morning where it’s more than 30 degrees above the horizon.
However, in astronomy, things are never simple. The andromeda galaxy can also be called M31, NGC 224, UGC 454, or a whole bunch of other names. These are all aliases for the same galaxy.
When using the search to set your imaging target for the night, NINA opted to use the longest alias it had in its database. So if you were searching for “M31” and used that to start your imaging sequence for the night, the files from the imaging would bear the name “MCG +07-02-016” instead of “M31” that you entered. If you’re like me, you have no idea what the MCG catalog is, and wouldn’t know what MCG +07-02-016 is if your life depended on it. But there’s a good chance you know the naming for the target that you used in the search.
The Solution
The solution here is somewhat obvious. You could setup a hierarchy of “preferred catalogs” that the search could you. If the user if most familiar with the Messier Catalog, maybe they’d prefer the naming to use the M designation before the NGC designation for the New General Catalog.
However, I think there’s an even better solution. Use the name the user gives you in search! Here’s the rules I came up with for the new algorithm:
- If there was no name used in the search (i.e. user was browsing/searching by properties other than name, like time above the horizon), default to the previous behavior, longest name.
- If there was a name used in the search and there are multiple partial matches, use the old behavior, the oldest alias.
- If there was a name used in the search, and there’s an exact match, use the exact match.
- Finally, if there was a name search, but no partial matches, use the closes alias to the search term by levenshtein distance.
Case Study - The Jellyfish Nebula
The Jellyfish Nebula is about the perfect example. It has 3 aliases in the NINA database, IC 443, LBN 844 and Gem A.
It just so happens that my atlas that I use for finding targets uses the IC catalog for it, which is shorter than the LBN catalog alias, but 1 character.
And the longer LBN match also works with an exact match:
For all the gory details, check out the pull request on Nina’s bitbucket.