Mathematical functions for simulating light curves.
Gauss2D(x, y, amp, x0, y0, sx, sy, rho)¶
A two-dimensional gaussian with arbitrary covariance.
GaussInt(a, b, c)¶
Returns the definite integral of x^n * exp(-ax^2 + bx + c) from 0 to 1.
PLD(fpix, ferr, trninds, t, aperture)¶
Perform first order PLD on a light curve
- flux :
detrended light curve
- rawflux :
raw light curve
PSF(A, psf_args, ccd_args, xpos, ypos)¶
Computes a stellar Point Spread Function (PSF) from given parameters.
dictionary of PSF parameters
dictionary of CCD parameters
array of PSF motion in x around detector relative to (x_0, y_0)
array of PSF motion in y around detector relative to (x_0, y_0)
PixelFlux(cx, cy, amp, x0, y0, sx, sy, rho, fast=True, **kwargs)¶
The flux in a given pixel of the detector, calculated from the integral of the convolution of a 2D gaussian with a polynomial.
The intra-pixel variability polynomial coefficients along the x axis, expressed as a list from 0th to 3rd order.
The intra-pixel variability polynomial coefficients along the y axis, expressed as a list from 0th to 3rd order.
The amplitude of the normalized gaussian (the integral of the gaussian over the entire xy plane is equal to this value).
The x position of the center of the gaussian relative to the left pixel edge.
The y position of the center of the gaussian relative to the bottom pixel edge.
The standard deviation of the gaussian in the x direction (before rotation).
The standard deviation of the gaussian in the y direction (before rotation).
The correlation coefficient between x and y, a value between -1 and 1. See en.wikipedia.org/wiki/Pearson_correlation_coefficient. If this is 0, x and y are uncorrelated (zero rotation).
If True, analytically integrates the function along the x axis and numerically integrates it along the y axis. This can greatly speed things up, with no loss of accuracy. If False, numerically integrates in both dimensions (not recommended).
PolyGaussIntegrand1D(y, cx, cy, amp, x0, y0, sx, sy, rho)¶
This is the product of the 2D Gaussian PSF, a polynomial in y, and a polynomial in x, analytically integrated along x. The integral along y is not analytic and must be done numerically. However, the analytical integration along the first dimension speeds up the entire calculation by a factor of ~20.
PolyGaussIntegrand2D(x, y, cx, cy, amp, x0, y0, sx, sy, rho)¶
This is straight up the product of the 2D Gaussian PSF, a polynomial in y, and a polynomial in x, at a given location on the pixel. Integrating this in 2D across the entire pixel yields the total flux in that pixel.
Returns a polynomial with coefficients coeffs evaluated at x.
Compares the fast and slow ways of computing the flux. Reports the time each method took and the difference in the flux between the two methods.