- classmethod craftutils.observation.epoch.SkyCoord.guess_from_table(table, **coord_kwargs)
A convenience method to create and return a new SkyCoord from the data in an astropy Table.
This method matches table columns that start with the case-insensitive names of the the components of the requested frames (including differentials), if they are also followed by a non-alphanumeric character. It will also match columns that end with the component name if a non-alphanumeric character is before it.
For example, the first rule means columns with names like
'RA[J2000]'or'ra'will be interpreted asraattributes for ~astropy.coordinates.ICRS frames, but'RAJ2000'or'radius'are not. Similarly, the second rule applied to the ~astropy.coordinates.Galactic frame means that a column named'gal_l'will be used as the thelcomponent, butgallor'fill'will not.The definition of alphanumeric here is based on Unicode’s definition of alphanumeric, except without
_(which is normally considered alphanumeric). So for ASCII, this means the non-alphanumeric characters are<space>_!"#$%&'()*+,-./\:;<=>?@[]^`{|}~).Parameters¶
- table~astropy.table.Table or subclass
The table to load data from.
- **coord_kwargs
Any additional keyword arguments are passed directly to this class’s constructor.
Returns¶
- newsc~astropy.coordinates.SkyCoord or subclass
The new instance.
Raises¶
- ValueError
If more than one match is found in the table for a component, unless the additional matches are also valid frame component names. If a “coord_kwargs” is provided for a value also found in the table.