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.


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.

COA class object

The class object describing the model to use rebinning.

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.


Defined the abscissa values at which to evaluate the model to be rebinned afterwards.


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.



Calculate the model.

setRebinArray_Ndt(time, N, dt)

Defines the overbinning parameters (rebinTimes, rebinIdent).


Calculate the model.


The abscissa values.


The binned model.


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).


The time axis of the “observed” (not overbinned) transit light-curve.


The number of point into which to subdivide each time bin of length dt.


The length of each time bin (on the original not oversampled time axis).