CatalogData#
- class stellarphot.core.CatalogData(*args, input_data=None, catalog_name=None, catalog_source=None, colname_map=None, passband_map=None, **kwargs)[source]#
Bases:
BaseEnhancedTableA class to hold astronomical catalog data while performing validation to confirm the minimum required columns (‘id’, ‘ra’, ‘dec’, ‘mag’, and ‘passband’) are present and have the correct units.
As a convenience function, when the user passes in an astropy table to validate, the user can also pass in a col_rename dict which can be used to rename columns in the data table BEFORE the check that the required columns are present.
- Parameters:
- input_data: `astropy.table.Table`, optional (Default: None)
A table containing all the astronomical catalog data to be validated. This data is copied, so any changes made during validation will not affect the input data, only the data in the class.
- catalog_name: str, optional (Default: None)
User readable name for the catalog.
- catalog_source: str, optional (Default: None)
User readable designation for the source of the catalog (could be a URL or a journal reference).
- colname_map: dict, optional (Default: None)
A dictionary containing old column names as keys and new column names as values. This is used to automatically update the column names to the desired names BEFORE the validation is performed.
- passband_map: `stellarphot.settings.PassbandMap`, optional (Default: None)
An object containing a mapping from instrumental passband names to AAVSO passband names. This is used to automatically update the passband column to AAVSO standard names if desired. See the documentation for
stellarphot.settings.PassbandMapfor more information. The object behaves like a dictionary when accessing it.
- Attributes:
- catalog_name: str
User readable name for the catalog.
- catalog_source: str
User readable designation for the source of the catalog (could be a URL or a journal reference).
- passband_map: `stellarphot.settings.PassbandMap`
An object containing a mapping from instrumental passband names to AAVSO passband names. This is used to automatically update the passband column to AAVSO standard names if desired. See the documentation for
stellarphot.settings.PassbandMapfor more information. The object behaves like a dictionary when accessing it.
Notes
For validation of inputs, you must provide input_data, catalog_name, and catalog_source. If you do not, an empty table will be returned.
input_data MUST contain the following columns with the following units:
Column Name
Unit
id
None
ra
u.deg
dec
u.deg
mag
None
passband
None
Attributes Summary
Methods Summary
from_vizier(field_center, desired_catalog[, ...])Return the items from catalog that are within the search radius and (optionally) within the field of view of a frame.
passband_columns([passbands])Return an
astropy.table.Tablewith passbands as column names instead of the default format, which has a single column for passbands.Attributes Documentation
- catalog_descript = {'dec': Unit("deg"), 'id': None, 'mag': None, 'passband': None, 'ra': Unit("deg")}#
- catalog_name#
- catalog_source#
- passband_map#
Methods Documentation
- classmethod from_vizier(field_center, desired_catalog, radius=<Quantity 0.5 deg>, clip_by_frame=False, padding=100, colname_map=None, mag_column_regex='^([a-zA-Z]+|[a-zA-Z]+-[a-zA-Z]+)_?mag$', color_column_regex='^([a-zA-Z]+-[a-zA-Z]+)$', prepare_catalog=None)[source]#
Return the items from catalog that are within the search radius and (optionally) within the field of view of a frame.
- Parameters:
- field_center
astropy.coordinates.SkyCoord,astropy.wcs.WCS, or FITS header Either a
SkyCoordobject, aWCSobject or a FITS header with WCS information. The input coordinate should be the center of the frame; if a header or WCS is the input then the center of the frame will be determined from the WCS.- desired_catalogstr
Vizier name of the catalog to be searched.
- radiusfloat, optional
Radius, in degrees, around which to search. Default is 0.5.
- clip_by_framebool, optional
If
True, only return items that are within the field of view of the frame. Default isTrue.- paddingint, optional
Coordinates need to be at least this many pixels in from the edge of the frame to be considered in the field of view. Default value is 100.
- colname_mapdict, optional
Dictionary mapping column names in the catalog to column names in a
stellarphot.CatalogDataobject. Default isNone.- mag_column_regexstr, optional
Regular expression to match magnitude columns. See notes below for more information about the default value.
- color_column_regexstr, optional
Regular expression to match color columns. See notes below for more information about the default value.
- prepare_catalogcallable, optional
Function to call on the catalog after it is retrieved from Vizier.
- field_center
- Returns:
stellarphot.CatalogDataTable of catalog information.
Notes
In many Vizier catalogs, the magnitude columns are named with a passband name followed by
mag, sometimes with an underscore_in between. For example, the Johnson V magnitude column isVmagorV_mag. The default value formag_column_regexwill match any column name that starts with a letter or letters, followed bymagor_magwith an underscore in between.In many Vizier catalogs, the color columns are named with the passbands separated by a hyphen. For example, the Johnson V-I color column is
V-I. The default value forcolor_column_regexwill match any column name that starts with a letter or letters, followed by a hyphen, followed by a letter or letters.
- passband_columns(passbands=None)[source]#
Return an
astropy.table.Tablewith passbands as column names instead of the default format, which has a single column for passbands.- Parameters:
- passbandslist, optional
List of passbands to include in the output. If not provided, all passbands in the catalog will be included.
- Returns:
astropy.table.TableTable of catalog information with passbands as column names. See Notes below for important details about column names.
Notes
The column names in the output will be the passband names with
mag_as a prefix. An error column for each passband will be generated, with the prefixmag_error_. If the catalog already has columns with these names, they will be overwritten. The input catalog will not be changed.