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:

pandas.DataFrame

N_images#

Number of epochs in observation

Type:

int

time#

Time coordinate of each epoch

Type:

astropy.units.Quantity

phase#

Phase of the planet at each epoch. Between 0 and 360 degrees

Type:

astropy.units.Quantity

unique_phase#

Non-cyclical phase of the planet at each epoch. Can be greater than 360 degrees

Type:

astropy.units.Quantity

wavelength#

Wavelength values of the spectral axis.

Type:

astropy.units.Quantity

star#

2D array of stellar flux

Type:

astropy.units.Quantity

reflected#

2D array of reflected flux

Type:

astropy.units.Quantity

thermal#

2D array of thermal flux

Type:

astropy.units.Quantity

total#

2D array of total flux

Type:

astropy.units.Quantity

noise#

2D array of noise flux

Type:

astropy.units.Quantity

layers#

HDUList of layer arrays

Type:

astropy.io.fits.HDUList

Methods Summary

get_layer(var)

Get data from layer variable.

get_mean_molecular_mass()

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.

Parameters:

var (str) – The name of the variable to access

Returns:

They layering data of the requested variable

Return type:

astropy.units.Quantity

Raises:

KeyError – If self does not have any image data or if var is not recognized

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:

astropy.units.Quantity

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:

astropy.units.Quantity

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:

astropy.io.fits.HDUList

to_twocolumn(index: tuple, outfile: str, fmt='ppm', wl='um')#

Write data to a two column file that can be used in a retrival.

write_fits(filename: str) None#

Save PhaseAnalyzer object as a .fits file.

Parameters:

filename (str) –