Deprecated evaluation API#
Warning
Everything on this page is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0. It is documented here only so that existing code can be migrated. New code should use evaluate, described in Model evaluation.
Before 2.9, evaluating a transit model meant choosing between three methods:
evaluate_ps(...)Evaluate for a single parameter set of scalars.
evaluate_pv(pvp, ldc)Evaluate for a parameter vector population: a 2D array with one row per parameter vector, the parameters packed in the order
[k, t0, p, a, i, e, w].evaluate(...)Dispatch to one of the above based on the types of the arguments.
evaluate now does all of it directly. It accepts scalars, 1D arrays, and 2D arrays and broadcasts on their shapes, so the split serves no purpose.
Calling any method on this page raises an
AstropyDeprecationWarning. The methods still work and still
return the same results; only the warning is new.
Migrating#
From ``evaluate_ps`` – the arguments are unchanged, so the call is the same with a different method name:
flux = tm.evaluate_ps(k, ldc, t0, p, a, i, e, w) # before
flux = tm.evaluate(k, ldc, t0, p, a, i, e, w) # after
From ``evaluate_pv`` – unpack the columns of the packed parameter array into named arguments.
Note that k must be 2D with shape (npv, npb), which is what column zero already is when
sliced with a list:
flux = tm.evaluate_pv(pvp, ldc) # before
flux = tm.evaluate(k=pvp[:, [0]], ldc=ldc, t0=pvp[:, 1], # after
p=pvp[:, 2], a=pvp[:, 3], i=pvp[:, 4],
e=pvp[:, 5], w=pvp[:, 6])
From ``evaluate_pv_ttv`` – there is no replacement yet. The OpenCL models cannot express
per-epoch transit centres through evaluate, because the OpenCL set_data does not accept
epids. Use the Numba RoadRunnerModel with epids
for TTV work, or keep using this method until a replacement lands.
Silencing the warnings#
While migrating, the warnings can be suppressed:
import warnings
from astropy.utils.exceptions import AstropyDeprecationWarning
warnings.filterwarnings('ignore', category=AstropyDeprecationWarning)
Note
Some of PyTransit’s own log posterior function classes still call evaluate_pv internally,
so running one emits these warnings until they are migrated too.
Numba models#
- QuadraticModel.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldcarray-like
Limb darkening coefficients as a 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- UniformModel.evaluate_ps(k, t0, p, a, i, e=0.0, w=0.0)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- EclipseModel.evaluate_ps(k, t0, p, a, i, e=0.0, w=0.0, fr=None)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
- frfloat, optional
Planet-star flux ratio as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- QPower2Model.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldc
Limb darkening coefficients as a 1D or 2D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- ChromosphereModel.evaluate_ps(k, t0, p, a, i, e=0.0, w=0.0)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- GeneralModel.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldcarray-like
Limb darkening coefficients as a 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- GeneralModel.evaluate_pv(pvp, ldc, copy=True)[source]#
Deprecated since version 2.9: The evaluate_pv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a 2D parameter array.
- pvp: ndarray
Parameter array with a shape (npv, npar) where npv is the number of parameter vectors, and each row contains a set of parameters [k, t0, p, a, i, e, w]. The radius ratios can also be given per passband, in which case the row should be structured as [k_0, k_1, k_2, …, k_npb, t0, p, a, i, e, w].
- ldc: ndarray
Limb darkening coefficient array with shape (npv, 2*npb), where npv is the number of parameter vectors and npb is the number of passbands.
This version of the evaluate method is optimized for calculating several models in parallel, such as when using emcee for MCMC sampling.
- ndarray
Modelled flux either as a 1D or 2D ndarray.
- GravityDarkenedModel.evaluate_ps(k, rho, rperiod, tpole, phi, beta, ldc, t0, p, a, i, l=0.0, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array
- rhofloat
Stellar density [g/cm^3]
- rperiodfloat
Stellar rotation period [d]
- tpolefloat
Temperature at the pole [K]
- phifloat
Star’s obliquity to the plane of the sky [rad]
- beta: float
Gravity darkening parameter
- ldcarray-like
Limb darkening coefficients as a 1D array
- t0float
Zero epoch
- pfloat
Orbital period [d]
- afloat
Scaled orbital semi-major axis [R_star]
- ifloat
Orbital inclination [rad]
- lfloat
Orbital azimuth angle [rad]
- efloat, optional
Orbital eccentricity
- wfloat, optional
Argument of periastron
- ndarray
Modelled flux as a 1D ndarray.
OpenCL models#
- UniformModelCL.evaluate_ps(k, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- UniformModelCL.evaluate_pv(pvp, copy=True)[source]#
Deprecated since version 2.9: The evaluate_pv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for 2D parameter array.
- pvp
Parameter array with a shape (npv, npar) where npv is the number of parameter vectors, and each row contains a set of parameters [k, t0, p, a, i, e, w]. The radius ratios can also be given per passband, in which case the row should be structured as [k_0, k_1, k_2, …, k_npb, t0, p, a, i, e, w].
- ldc
Limb darkening coefficient array with shape (npv, 2*npb), where npv is the number of parameter vectors and npb is the number of passbands.
This version of the evaluate method is optimized for calculating several models in parallel, such as when using emcee for MCMC sampling.
- ndarray
Modelled flux either as a 1D or 2D ndarray.
- QuadraticModelCL.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldcarray-like
Limb darkening coefficients as a 1D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
- ndarray
Modelled flux as a 1D ndarray.
- QuadraticModelCL.evaluate_pv(pvp, ldc, copy=True)[source]#
Deprecated since version 2.9: The evaluate_pv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for 2D parameter array.
- pvp
Parameter array with a shape (npv, npar) where npv is the number of parameter vectors, and each row contains a set of parameters [k, t0, p, a, i, e, w]. The radius ratios can also be given per passband, in which case the row should be structured as [k_0, k_1, k_2, …, k_npb, t0, p, a, i, e, w].
- ldc
Limb darkening coefficient array with shape (npv, 2*npb), where npv is the number of parameter vectors and npb is the number of passbands.
This version of the evaluate method is optimized for calculating several models in parallel, such as when using emcee for MCMC sampling.
- ndarray
Modelled flux either as a 1D or 2D ndarray.
- QuadraticModelCL.evaluate_pv_ttv(pvp, ldc, copy=True, tdv=False)[source]#
Deprecated since version 2.9: The evaluate_pv_ttv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the model with a separate transit centre for each light curve.
A transit timing variation (TTV) version of evaluate_pv in which every light curve gets its own mid-transit time instead of sharing a single zero epoch and period. This is the OpenCL equivalent of the epids mechanism the Numba models use, which the OpenCL set_data does not support.
- pvpndarray
Parameter vector population as a 2D array with one row per parameter vector. The parameters are packed as
[k, tc_0, ..., tc_(nlc-1), p, a, i]when tdv is False, giving one transit centre per light curve, and as[k, tc_0, ..., tc_(nlc-1), p_0, ..., p_(nlc-1), a, i]when tdv is True, giving each light curve its own period as well.- ldcndarray
Limb darkening coefficients as a 2D array with a shape
(npv, 2*npb).- copybool, optional
Copy the model from the GPU memory to a NumPy array. Set to False to leave the model on the device.
- tdvbool, optional
Also give each light curve its own orbital period, which changes the transit duration from one transit to the next (transit duration variations).
- ndarray
Modelled flux with a shape
(npv, npt).
- QPower2ModelCL.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldc
Limb darkening coefficients as a 1D or 2D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- QPower2ModelCL.evaluate_pv(pvp, ldc, copy=True)[source]#
Deprecated since version 2.9: The evaluate_pv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a 2D parameter array.
- pvp
Parameter array with a shape (npv, npar) where npv is the number of parameter vectors, and each row contains a set of parameters [k, t0, p, a, i, e, w]. The radius ratios can also be given per passband, in which case the row should be structured as [k_0, k_1, k_2, …, k_npb, t0, p, a, i, e, w].
This version of the evaluate method is optimized for calculating several models in parallel, such as when using emcee for MCMC sampling.
- ndarray
Modelled flux either as a 1D or 2D ndarray.
- RoadRunnerModelCL.evaluate_ps(k, ldc, t0, p, a, i, e=0.0, w=0.0, copy=True)[source]#
Deprecated since version 2.9: The evaluate_ps method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a set of scalar parameters.
- karray-like
Radius ratio(s) either as a single float or an 1D array.
- ldc
Limb darkening coefficients as a 1D or 2D array.
- t0float
Transit center as a float.
- pfloat
Orbital period as a float.
- afloat
Orbital semi-major axis divided by the stellar radius as a float.
- ifloat
Orbital inclination(s) as a float.
- efloat, optional
Orbital eccentricity as a float.
- wfloat, optional
Argument of periastron as a float.
This version of the evaluate method is optimized for calculating a single transit model (such as when using a local optimizer). If you want to evaluate the model for a large number of parameters simultaneously, use either evaluate or evaluate_pv.
- ndarray
Modelled flux as a 1D ndarray.
- RoadRunnerModelCL.evaluate_pv(pvp, ldc, copy=True)[source]#
Deprecated since version 2.9: The evaluate_pv method is deprecated since PyTransit 2.9 and will be removed in PyTransit 3.0.
Evaluate the transit model for a 2D parameter array.
- pvp
Parameter array with a shape (npv, npar) where npv is the number of parameter vectors, and each row contains a set of parameters [k, t0, p, a, i, e, w]. The radius ratios can also be given per passband, in which case the row should be structured as [k_0, k_1, k_2, …, k_npb, t0, p, a, i, e, w].
This version of the evaluate method is optimized for calculating several models in parallel, such as when using emcee for MCMC sampling.
- ndarray
Modelled flux either as a 1D or 2D ndarray.