Using an overbinned model in calculations¶
Calculating the model at more points than actually needed can be very useful, e.g., if finite integration times are to be taken into account. The turnIntoRebin method turns every “normal” model into one, which uses rebinning. See the tutorial for an example of the application.
- PyAstronomy.funcFit.turnIntoRebin(CO)¶
Turn a “normal” fitting object into rebinning fitting object.
This function accepts a class object representing a model and returns another class object extended by the rebinning functionality.
- Parameters
- COA class object
The class object describing the model to use rebinning.
- Returns
- Rebinned modelFitting object
Another class object extended by the rebinning functionality.
The class object returned by the turnIntoRebin function is the received class object with a modified evaluate method and some extra functionality; technically, this is achieved by inheritance. The class object denoted by _ModelRebinDocu below inherits the functionality of the incoming class object and is returned.
- class PyAstronomy.funcFit._ModelRebinDocu(*args, **kwargs)¶
Base class providing rebinning functionality.
The model is evaluated at more points than actually needed. Several points are than averaged to obtain a “binned” model, which can, for example, account for finite integration times in observations.
- Attributes
- rebinTimesarray
Defined the abscissa values at which to evaluate the model to be rebinned afterwards.
- rebinIdentdict
A dictionary associating bin number (in the unbinned model) with a list holding the bins in rebinTimes, which are to be averaged to obtain the binned model.
Methods
evaluate
(x)Calculate the model.
setRebinArray_Ndt
(time, N, dt)Defines the overbinning parameters (rebinTimes, rebinIdent).
- evaluate(x)¶
Calculate the model.
- Parameters
- xarray
The abscissa values.
- Returns
- modelarray,
The binned model.
Notes
This function calculates the model at those time points specified by the rebinTimes property and saves the result in the class property unbinnedModel. Then it bins according to the definitions in rebinIdent and save the resulting model in the binnedModel property.
- setRebinArray_Ndt(time, N, dt)¶
Defines the overbinning parameters (rebinTimes, rebinIdent).
It is assumed that the time points given in the time array refer to the center of the time bins and every bin has length dt. The bins are then subdivided into N subintervals; the center of each such subinterval becomes a point in the overbinned time axis (rebinTimes).
- Parameters
- timearray
The time axis of the “observed” (not overbinned) transit light-curve.
- Nint
The number of point into which to subdivide each time bin of length dt.
- dtfloat
The length of each time bin (on the original not oversampled time axis).