The model classes

The PalLC and PalLCCirc classes encapsulates all relevant calculations; the latter considers only circular orbits, while the former, PAlLC, uses the KeplerEllipse class from PyA’s astrolib to consider a Kepler orbit.

They inherits from funFit’s OneDFit class.

Circular orbit

class PyAstronomy.modelSuite.XTran.palTrans.PalLC

Calculate and fit analytical transit light-curves using the formulae provided by Pal 2008.

This class uses a circular planetary orbit.

Note

The evaluation of elliptical integrals is essential in calculating the transit model. While both the mpmath module and the Boost libraries implement those integrals, it is the Boost library, which evaluates them by far more quickly. Yet, the support for Boost has to be added manually.

Model parameters:
  • p - Radius ratio between planet and star.

  • a - Semi-major axis of planetary orbit [stellar radii].

  • i - Inclination of orbit in degrees (90 deg is edge on view).

  • linLib - Linear limb-darkening coefficient.

  • quadLimb - Quadratic limb-darkening coefficient.

  • T0 - Time offset of transit center.

  • per - Period of planetary orbit.

  • b - Describes the flux ratio between a stellar companion and the main star (default is 0).

This class inherits the functionality of funcFit’s OneDFit object. You can, therefore, set and get the parameter using the brackets:

e.g., pallc[“p”] = 0.12345

Warning

Time units have to be consistent.

Methods

MCMCautoParameters(ranges[, picky, ...])

Convenience function to generate parameters for MCMC fit.

addConditionalRestriction(*args)

Define a conditional restriction.

assignValue(specval)

Assign new values to variables.

assignValues(specval)

Assign new values to variables.

autoFitMCMC(x, y, ranges[, picky, stepsize, ...])

Convenience function to using auto-generated sampling parameters in MCMC.

availableParameters()

Provides a list of existing parameters.

delRestriction(parName)

Delete restriction

description([parenthesis])

Returns a description of the model based on the names of the individual components.

errorConfInterval(par[, dstat, statTol, ...])

Calculate confidence interval for a parameter.

evaluate(time)

Calculate a light curve according to the analytical models given by Pal 2008.

fit(x, y[, yerr, X0, minAlgo, mAA, ...])

Carries out a fit.

fitEMCEE([x, y, yerr, nwalker, priors, ...])

MCMC sampling using emcee package.

fitMCMC(x, y, X0, Lims, Steps[, yerr, ...])

Carry out MCMC fit/error estimation.

freeParamNames()

Get the names of the free parameters.

freeParameters()

Get names and values of free parameters.

freeze(specifiers)

Consider variables free to float.

frozenParameters()

Get names and values of frozen parameters.

getRelationsOf(specifier)

Return relations of a variable.

getRestrictions()

Get all restrictions.

hasVariable(specifier)

Determine whether the variable exists.

numberOfFreeParams()

Get number of free parameters.

parameterSummary([toScreen, prefix, sorting])

Writes a summary of the parameters in text form.

parameters()

Obtain parameter names and values.

relate(dependentVar, independentVars[, func])

Define a relation.

removeConditionalRestriction(*args)

Remove an existing conditional constraint.

renameVariable(oldName, newName)

Change name of variable.

restoreState(resource)

Restores parameter values from file or dictionary.

saveState(*args, **kwargs)

Save the state of the fitting object.

setObjectiveFunction([miniFunc])

Define the objective function.

setPenaltyFactor(penalFac)

Change the penalty factor.

setRestriction(restricts)

Define restrictions.

setRootName(root[, rename])

Define the root name of the model.

showConditionalRestrictions(**kwargs)

Show conditional restrictions.

steppar(pars, ranges[, extractFctVal, quiet])

Allows to step a parameter through a specified range.

thaw(specifiers)

Consider variables fixed.

untie(parName[, forceFree])

Remove all relations of parameter parName, i.e., the parameter is not dependend on other parameters.

updateModel()

Recalculate the model using current settings.

whichEllInts()

Says which module is used for the evaluation of the elliptical functions.

evaluate(time)

Calculate a light curve according to the analytical models given by Pal 2008.

Parameters
timearray

An array of time points at which the light curve shall be calculated.

.. note:: time = 0 -> Planet is exactly in the line of sight (phase = 0).
Returns
Modelarray

The analytical light curve is stored in the property lightcurve.

whichEllInts()

Says which module is used for the evaluation of the elliptical functions.

Note

The support for BOOST has to be added manually!

Returns
Identifierstring

Either ‘boost’ or ‘mpmath’ depending on whether the BOOST libraries are used or the mpmath python module.

Full Keplerian orbit

class PyAstronomy.modelSuite.XTran.palTrans.PalLCKep(ke=None, collisionCheck=False)

Analytical transit light-curves using the formulae provided by Pal 2008.

More information on the Keplerian orbit can be found here: Calculate a Keplerian (two body) orbit

Note

The evaluation of elliptical integrals is essential in calculating the transit model. While both the mpmath module and the Boost libraries implement those integrals, it is the Boost library, which evaluates them by far more quickly. Yet, the support for Boost has to be added manually.

Model parameters:
  • p - Radius ratio between planet and star.

  • a - Semi-major axis of planetary orbit [stellar radii].

  • w - Longitude of periastron [deg].

  • Omega - Longitude of the ascending node [deg].

  • e - Orbital eccentricity.

  • i - Inclination of orbit in degrees (90 deg is edge on view).

  • linLib - Linear limb-darkening coefficient.

  • quadLimb - Quadratic limb-darkening coefficient.

  • tau - Time of periastron passage.

  • per - Period of planetary orbit.

  • b - Describes the flux ratio between a stellar companion and the main star (default is 0).

This class inherits the functionality of funcFit’s OneDFit object. You can, therefore, set and get the parameter using the brackets:

e.g., pallc[“p”] = 0.12345

Warning

Time units have to be consistent.

Parameters
keNone, optional

If an instance of KeplerEllipse is given, the parameters a, i, tau, per, w, Omega, and e will be adopted from it.

collisionCheckboolean, optional

If set True, it will be checked whether the two bodies collide on the current orbit.

Methods

MCMCautoParameters(ranges[, picky, ...])

Convenience function to generate parameters for MCMC fit.

addConditionalRestriction(*args)

Define a conditional restriction.

assignValue(specval)

Assign new values to variables.

assignValues(specval)

Assign new values to variables.

autoFitMCMC(x, y, ranges[, picky, stepsize, ...])

Convenience function to using auto-generated sampling parameters in MCMC.

availableParameters()

Provides a list of existing parameters.

delRestriction(parName)

Delete restriction

description([parenthesis])

Returns a description of the model based on the names of the individual components.

errorConfInterval(par[, dstat, statTol, ...])

Calculate confidence interval for a parameter.

evaluate(time)

Calculate a light curve according to the analytical models given by Pal 2008.

fit(x, y[, yerr, X0, minAlgo, mAA, ...])

Carries out a fit.

fitEMCEE([x, y, yerr, nwalker, priors, ...])

MCMC sampling using emcee package.

fitMCMC(x, y, X0, Lims, Steps[, yerr, ...])

Carry out MCMC fit/error estimation.

freeParamNames()

Get the names of the free parameters.

freeParameters()

Get names and values of free parameters.

freeze(specifiers)

Consider variables free to float.

frozenParameters()

Get names and values of frozen parameters.

getRelationsOf(specifier)

Return relations of a variable.

getRestrictions()

Get all restrictions.

hasVariable(specifier)

Determine whether the variable exists.

numberOfFreeParams()

Get number of free parameters.

parameterSummary([toScreen, prefix, sorting])

Writes a summary of the parameters in text form.

parameters()

Obtain parameter names and values.

relate(dependentVar, independentVars[, func])

Define a relation.

removeConditionalRestriction(*args)

Remove an existing conditional constraint.

renameVariable(oldName, newName)

Change name of variable.

restoreState(resource)

Restores parameter values from file or dictionary.

saveState(*args, **kwargs)

Save the state of the fitting object.

setObjectiveFunction([miniFunc])

Define the objective function.

setPenaltyFactor(penalFac)

Change the penalty factor.

setRestriction(restricts)

Define restrictions.

setRootName(root[, rename])

Define the root name of the model.

showConditionalRestrictions(**kwargs)

Show conditional restrictions.

steppar(pars, ranges[, extractFctVal, quiet])

Allows to step a parameter through a specified range.

thaw(specifiers)

Consider variables fixed.

untie(parName[, forceFree])

Remove all relations of parameter parName, i.e., the parameter is not dependend on other parameters.

updateModel()

Recalculate the model using current settings.

whichEllInts()

Says which module is used for the evaluation of the elliptical functions.

evaluate(time)

Calculate a light curve according to the analytical models given by Pal 2008.

Parameters
timearray

An array of time points at which the light curve shall be calculated.

Returns
Modelarray

The analytical light curve is stored in the property lightcurve.