PhotometryData#
- class stellarphot.PhotometryData(*args, input_data=None, colname_map=None, passband_map=None, retain_user_computed=False, **kwargs)[source]#
Bases:
BaseEnhancedTableA modified
astropy.table.QTableto hold reduced photometry data that provides the convenience of validating the data table is in the proper format including units. It returns anPhotometryDatawhich is aastropy.table.QTablewith additional attributes describing the observatory and camera.- Parameters:
- input_data: `astropy.table.QTable`, optional (Default: None)
A table containing all the instrumental aperture photometry results to be validated. Note: It is allowed for the ‘ra’ and ‘dec’ columns to have np.nan values, but if they do, the ‘bjd’ column will not be computed and will also be left with ‘np.nan’.
- observatory: `stellarphot.settings.Observatory`, optional (Default: None)
Information about the observatory.
- camera: `stellarphot.Camera`, optional (Default: None)
A description of the CCD used to perform the photometry.
- 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.- retain_user_computed: bool, optional (Default: False)
If True, any computed columns (see USAGE NOTES below) that already exist in
datawill be retained. If False, will throw an error if any computed columns already exist indata.
- Attributes:
- camera: `stellarphot.Camera`
A description of the CCD used to perform the photometry.
- observatory: `stellarphot.settings.Observatory`, optional (Default: None)
Information about the observatory.
Notes
For validation of inputs, you must provide camera, observatory, AND input_data, if you do not, an empty table will be returned.
To be accepted as valid, the
input_datamust MUST contain the following columns with the following units. The data in those columns is NOT validated, the values in those columns could be invalid. Furthermore, the ‘consistent count units’ below simply means it can be any unit, but it must be the same for all the columns with ‘consistent count units’.Column name
Unit
star_id
None
RA
u.deg
Dec
u.deg
xcenter
u.pix
ycenter
u.pix
fwhm_x
u.pix
fwhm_y
u.pix
width
u.pix
aperture
u.pix
aperture_area
u.pix
annulus_inner
u.pix
annulus_outer
u.pix
annulus_area
u.pix
aperture_sum
consistent count units
annulus_sum
consistent count units
sky_per_pix_avg
consistent count units (per pixel)
sky_per_pix_med
consistent count units (per pixel)
sky_per_pix_std
consistent count units (per pixel)
aperture_net_cnts
consistent count units
noise_cnts
consistent count units
noise_electrons
u.electron
snr
None
mag_inst
None
mag_error
None
exposure
u.s
date-obs
astropy.time.Time with scale=’utc’
airmass
None
passband
None
file
None
In addition to these required columns, the following columns are created based on the input data during creation.
bjd (only if ra and dec are all real numbers, otherwise set to np.nan) night
If these computed columns already exist in
dataclass the class will throw an error a ValueError UNLESS`ignore_computed=True` is passed to the initializer, in which case the columns will be retained and not replaced with the computed values.Attributes Summary
Descriptor to define a custom attribute for a Table subclass.
Descriptor to define a custom attribute for a Table subclass.
Methods Summary
add_bjd_col(observatory)Returns a astropy column of barycentric Julian date times corresponding to the input observations.
Attributes Documentation
- camera#
Descriptor to define a custom attribute for a Table subclass.
The value of the
TableAttributewill be stored in a dict named__attributes__that is stored in the tablemeta. The attribute can be accessed and set in the usual way, and it can be provided when creating the object.Defining an attribute by this mechanism ensures that it will persist if the table is sliced or serialized, for example as a pickle or ECSV file.
See the
MetaAttributedocumentation for additional details.- Parameters:
- defaultobject
Default value for attribute
Examples
>>> from astropy.table import Table, TableAttribute >>> class MyTable(Table): ... identifier = TableAttribute(default=1) >>> t = MyTable(identifier=10) >>> t.identifier 10 >>> t.meta OrderedDict([('__attributes__', {'identifier': 10})])
- observatory#
Descriptor to define a custom attribute for a Table subclass.
The value of the
TableAttributewill be stored in a dict named__attributes__that is stored in the tablemeta. The attribute can be accessed and set in the usual way, and it can be provided when creating the object.Defining an attribute by this mechanism ensures that it will persist if the table is sliced or serialized, for example as a pickle or ECSV file.
See the
MetaAttributedocumentation for additional details.- Parameters:
- defaultobject
Default value for attribute
Examples
>>> from astropy.table import Table, TableAttribute >>> class MyTable(Table): ... identifier = TableAttribute(default=1) >>> t = MyTable(identifier=10) >>> t.identifier 10 >>> t.meta OrderedDict([('__attributes__', {'identifier': 10})])
- phot_descript = {'airmass': None, 'annulus_area': Unit("pix"), 'annulus_inner': Unit("pix"), 'annulus_outer': Unit("pix"), 'annulus_sum': None, 'aperture': Unit("pix"), 'aperture_area': Unit("pix"), 'aperture_net_cnts': None, 'aperture_sum': None, 'date-obs': None, 'dec': Unit("deg"), 'exposure': Unit("s"), 'file': None, 'fwhm_x': Unit("pix"), 'fwhm_y': Unit("pix"), 'mag_error': None, 'mag_inst': None, 'noise_cnts': None, 'noise_electrons': Unit("electron"), 'passband': None, 'ra': Unit("deg"), 'sky_per_pix_avg': None, 'sky_per_pix_med': None, 'sky_per_pix_std': None, 'snr': None, 'star_id': None, 'width': Unit("pix"), 'xcenter': Unit("pix"), 'ycenter': Unit("pix")}#
Methods Documentation