ATK.Models.Powspec#

class ATK.Models.Powspec[source]#

Bases: Container, DataFrameIOMixin, TableIOMixin, FITSIOMixin

Container for storing a Lomb-Scargle periodogram. This object stores both data and relevant metadata.

Units

The following attributes are automatically converted to Quantity with a default unit unless one is explictly provided:

  • fopt - d⁻¹

  • popt - d

  • frequency - d⁻¹


Data Methods

The following Data Methods are supported by Powspec - either individually or through DataSet.apply():




Attributes

band

Photometric band of stored data.

fopt

Frequency of highest power.

frequency

Frequency values.

obj_id

Survey-specific object ID.

popt

Period corresponding to frequency of highest power.

power

Power at each frequency.

survey

Survey from which the stored data originates.

Methods

crop([cmin, cmax, inplace])

Crops all array-like attributes to a given range in x (i.e. frequency).

from_dataframe(target, data, **kwargs)

Construct a Powspec from a DataFrame.

from_table(target, data, **kwargs)

Construct a Powspec from a Table.

show([show_types, show_all])

Prints structure to stdout in a human-readable format.

to_dataframe()

Combines all array-like attributes of a structure into a DataFrame.

to_hdu()

Converts structure into a FITS BinTableHDU.

to_table()

Combines all array-like attributes of a structure into a Table, preserving units.



Attribute Descriptions

band: str | None = None#

Photometric band of stored data.

fopt: Quantity | None = None#

Frequency of highest power.

frequency: Quantity | None = None#

Frequency values.

obj_id: str | None = None#

Survey-specific object ID.

None unless present from original Lightcurve.

popt: Quantity | None = None#

Period corresponding to frequency of highest power.

power: ndarray | None = None#

Power at each frequency.

survey: str | None = None#

Survey from which the stored data originates.


Method Descriptions

crop(cmin: float | None = None, cmax: float | None = None, inplace=True)[source]#

Crops all array-like attributes to a given range in x (i.e. frequency).

At least one of cmin, cmax must be provided.

Parameters:
cminfloat or Quantity, optional

Minimum x value. If not provided, bottom range is not clipped.

If a Unit is not provided, cmin is assumed to be in the same unit as x.

cmaxfloat or Quantity, optional.

Maximum x value. If not provided, top range is not clipped.

If a Unit is not provided, cmax is assumed to be in the same unit as x.

inplacebool, optional

If True, modify the current Powspec inplace. If False, operate on and return a copy - leaving the original unchanged.

Returns:
Self

The cropped Powspec. Returns self if inplace=True, otherwise returns a new instance.

classmethod from_dataframe(target, data, **kwargs)#

Construct a Powspec from a DataFrame.

Parameters:
targetTarget, int, or SkyCoord

Astronomical target with which to associate input data.

Can be a Target, a Gaia Source ID (int), or a SkyCoord.

dataDataFrame

Tabular data containing the relevant fields (i.e. array-like attributes) required to construct a Powspec. Units are assumed to be as listed above.

**kwargs

Additional keyword arguments to be forwarded to the internal parser.

The following keyword arguments are required: survey, band

Returns:
Powspec
classmethod from_table(target, data, **kwargs)#

Construct a Powspec from a Table.

Parameters:
targetTarget, int, or SkyCoord

Astronomical target with which to associate input data.

Can be a Target, a Gaia Source ID (int), or a SkyCoord.

dataTable

Tabular data containing the relevant fields (i.e. array-like attributes) required to construct a Powspec. Units are taken from the table where available, with missing units assumed to be those listed above.

**kwargs

Additional keyword arguments to be forwarded to the internal parser.

The following keyword arguments are required: survey, band

Returns:
Powspec
show(show_types=False, show_all=False)#

Prints structure to stdout in a human-readable format.

Parameters:
show_typesbool, optional

If True, print data types of structure attributes.

Default is False

show_allbool, optional

If True, do not truncate printing of large iterables.

Default is False.

Returns:
self
to_dataframe()#

Combines all array-like attributes of a structure into a DataFrame.

Units are not preserved.

Returns:
DataFrame
to_hdu() BinTableHDU#

Converts structure into a FITS BinTableHDU.

Returns:
BinTableHDU
to_table()#

Combines all array-like attributes of a structure into a Table, preserving units.

Returns:
Table