public class BeamSplitterFit extends Object implements Multidimensional
f(x,y) = I_0·exp(-((x-x_0)²+(y-y_0)²)/2σ_0²+
k_I I_0·exp(-((x-x_0-Δx)²+(y-y_0-Δy)²)/2σ_0²·k_s²+sky;
The values fitted are I_0, x_0, y_0, σ_0, k_I, k_s, and Δx,
Δy, which are the peak intensity and the peak center on the CCD,
the peak width, the offset of the secondary peak in Δx,y and the
realative intensity k_I and relative width k_s. It is guaranteed,
that Δx and Δy are constant and also k_I and k_s should not
vary. So, determining these coefficients once leaves only four parameter
that vary from frame to frame. The Δx Δy and k's might also
be used for fitting the star plus the hole, with signs on Δ's
reversed.
Solving for the parameters is done with a simplex method. For each x/y
coordinate pair, the function above is evaluated, the
difference to the counts is calculated and squared and the squared
difference is weighed with a poisson noise plus a readout noise.
The sky value is estimated from the median of the outermost pixel.| Modifier and Type | Field and Description |
|---|---|
private int[][] |
counts
The count arra, normally deduced from a fits file, x is first index.
|
private double |
deltax
On declaring hole fitting, we set the binning factor and get deltax.
|
static double |
DELTAX
After averaging some non-pinhole images, the secondary peak offset.
|
private double |
deltay
On declaring hole fitting, we set the binning factor and get deltax.
|
static double |
DELTAY
The average secondary peak offset in the mirror.
|
static double |
FWHMMIRROR
The average fwhm factor between direct and mirror in best focus.
|
private boolean |
hole
If this is true, we fit to double gauss plus pinhole.
|
static double |
IMIRROR
The average intensity factor between the direct and the mirror image.
|
private double |
intensity
On hole fitting, we set the direct intensity and get the mirror i.
|
static double |
KI
The average intensity factor of the secondary peak.
|
static double |
KS
The average fwhm relation between primary and secondary peak.
|
private double |
sigma
On hole fitting, we set the direct fwhm and get the mirror sigma.
|
private double |
sky
The sky count.
|
private double[][] |
weight
The weight of each pixel, calculateed from readout noise and Poisson.
|
| Constructor and Description |
|---|
BeamSplitterFit(int[][] ccd,
double gain,
double readout,
boolean weigh)
Constructs a new beam splitter that can readily be used for Amoeba.
|
| Modifier and Type | Method and Description |
|---|---|
int |
dimension()
Returns 8 for normal fits, 6 for pinhole fits.
|
private double |
evaluate(VectorG fit,
boolean print)
Evaluates the functional fit.
|
void |
evaluateHole(int binx,
int biny,
double idirect,
double fwhmdirect)
If we want to fit the double gaussian and the pinhole as negative
gaussian, we can do that here.
|
double |
evaluateWithNan(VectorG fit)
Evaluates the functional fit.
|
private static double |
gauss(double i0,
double x,
double y,
double sig)
Calculates a two-dimensional gauss.
|
public static final double DELTAX
public static final double DELTAY
public static final double KI
public static final double KS
public static final double IMIRROR
public static final double FWHMMIRROR
private int[][] counts
private double[][] weight
private double sky
private boolean hole
private double deltax
private double deltay
private double intensity
private double sigma
public BeamSplitterFit(int[][] ccd,
double gain,
double readout,
boolean weigh)
public void evaluateHole(int binx,
int biny,
double idirect,
double fwhmdirect)
IMIRROR and
FWHMMIRROR, respectively. In this method, we have to
give the intensity and the fwhm of the direct solution.public double evaluateWithNan(VectorG fit)
evaluateWithNan in interface Multidimensionalprivate double evaluate(VectorG fit, boolean print)
print - If true, we print x/y count fit count-fitpublic int dimension()
dimension in interface Multidimensionalprivate static final double gauss(double i0,
double x,
double y,
double sig)