PhaseAnalyzer#
- class VSPEC.analysis.PhaseAnalyzer(path, fluxunit=Unit('W / (um m2)'))#
Bases:
object
Class to store and analyze VSPEC phase curves
Class to read all the data produced from a phase VSPEC curve simulation. This class also includes some basic-but-powerfull analysis methods meant to be quickly used to create nice figures.
- Parameters:
path (pathlib.Path or str) – The path to the directory storing all the final output. This is usually …/AllModelSpectraValues/
fluxunit (astropy.units.Unit, default=u.Unit('W m-2 um-1')) – Standard unit to use with flux values. This way they are safely converted between Quantity and float
- observation_data#
DataFrame containing the observation geometry at each epoch.
- Type:
- time#
Time coordinate of each epoch
- Type:
- phase#
Phase of the planet at each epoch. Between 0 and 360 degrees
- Type:
- unique_phase#
Non-cyclical phase of the planet at each epoch. Can be greater than 360 degrees
- Type:
- wavelength#
Wavelength values of the spectral axis.
- Type:
- star#
2D array of stellar flux
- Type:
- reflected#
2D array of reflected flux
- Type:
- thermal#
2D array of thermal flux
- Type:
- total#
2D array of total flux
- Type:
- noise#
2D array of noise flux
- Type:
- layers#
HDUList of layer arrays
- Type:
Methods Summary
get_layer
(var)Get data from layer variable.
Get the mean molecular mass
lightcurve
(source, pixel[, normalize, noise])Produce a lightcurve
spectrum
(source, images[, noise])Get a 1D spectrum
to_fits
()To Fits
to_twocolumn
(index, outfile[, fmt, wl])Write data to a two column file that can be used in a retrival.
write_fits
(filename)Save PhaseAnalyzer object as a .fits file.
Methods Documentation
-
get_layer(var: str)
astropy.units.Quantity
# Get data from layer variable.
Access the self.layers attribute and return the result as a astropy.units.Quantity object for a single variable.
- get_mean_molecular_mass()#
Get the mean molecular mass
- lightcurve(source, pixel, normalize='none', noise=False)#
Produce a lightcurve
Return the lightcurve of source of the wavelengths described by pixel
- Parameters:
source (str) – Which data array to access.
pixel (int or 2-tuple of int) – Pixel(s) of spectral axis to use when building lightcurve.
normalize (str or int, default='none') – Normalization scheme. If integer, pixel of time axis to normalize the lightcurve to. Otherwise it is a keyword to describe the normalization process: ‘none’ or ‘max’
noise (bool or float or int, default=False) – Should gaussian noise be added? If float, scale gaussian noise by this parameter.
- Returns:
Lightcurve of the desired source in the desired bandpass
- Return type:
- Raises:
ValueError – If noise is not bool, float, or int
ValueError – If normalize is not recognized or True
- Warns:
RuntimeWarning – If normalize is False
- spectrum(source, images, noise=False)#
Get a 1D spectrum
Return the spectrum of a specified source at a single epoch or average over multiple epochs.
- Parameters:
source (str) – Which data array to access. If ‘noise’ is specified, use propagation of error formula to calculate theoretical noise of spectrum.
images (int or 2-tuple of int) – Pixel(s) of time axis to use when building spectrum.
noise (bool or float or int) – Should gaussian noise be added? If float, scale gaussian noise by this parameter.
- Returns:
Spectrum of the desired source over the desired epoch(s)
- Return type:
- Raises:
ValueError – If noise is not bool, float, or int
- to_fits() HDUList #
To Fits
Covert PhaseAnalyzer to an astropy.io.fits.HDUList object
- Returns:
Data converted to the .fits format
- Return type: