stella.adapter
Class AveragePinhole.FullPinhole

java.lang.Object
  extended by stella.adapter.AveragePinhole.FullPinhole
All Implemented Interfaces:
AbstractPinholeModel.PinholeModel, DataModel
Enclosing class:
AveragePinhole

public static class AveragePinhole.FullPinhole
extends Object
implements AbstractPinholeModel.PinholeModel

A pinhole model is the model of a star with fitted intensity and FWHM close to the fixed pinhole position at the given coordinates. We fit for the position of the pinhole (as an offset to a fixed position), the position of the star relativ to the pinhole, the fwhm and flux of the star, the steepness of the pinhole, the pinhole diameter and the remaining reflectivity of the pinhole.


Field Summary
private  double beta
          The beta of the moffat function.
private  double[] data
          The array of the measured data points minus background.
private  boolean fitdeep
          If true, we also try to fit the deepness of the pinhole.
private  boolean fitsteep
          If true, we also try to fit the steepness of the pinhole.
private  Dimension geometry
          The geometry of the frame.
private  VectorG m0
          A first estimate of the model parameters, without steep&deep
private  double[] photsig
          The estimated photon noise sigma.
private  double pindeep
          For modeling the pinhole.
private  double pindip
          For modeling the pinhole.
private  Point2D pinhole
          The fixed pinhole position.
private  double pinsize
          The pinhole size in pixel.
private  double pinsteep
          For modeling the pinhole, the steepness.
 
Constructor Summary
private AveragePinhole.FullPinhole(nom.tam.fits.ImageHDU measured, Rectangle box, double back, double backerr, Point2D pos, double size, double k, double deep, double moffat)
          Constructs a new data model for the pinhole.
 
Method Summary
 double evaluateModel(VectorG dxdy, VectorG xy)
          Per definition, the independant variable, time, is here a two-dimensional vector specifying the location of the pixel.
private  void fitDeep(boolean b)
           
private  void fitSteep(boolean b)
           
 VectorG getFirstModel()
          Returns a first estimate.
 VectorG getFirstStep()
          Returns a first step.
 int getMeasureCount()
          Return the number of measurements in the data model.
 double[] getMeasurementErrors()
          Returns the photon noise.
 double[] getMeasures()
          Returns the data array.
 double[] getModel(VectorG dxdy)
          Per definition, the model data is a Vector of all data points, not an area.
 int getParameterCount()
          The model parameters are Shift of star to pinhole in x-direction, pixel Shift of star to pinhole in y-direction, pixel Total ADU flux of star FWHM of star in pixel. Shift of true pinhole to pinhole-0 in x-direction, pixel Shift of true pinhole to pinhole-0 in y-direction, pixel FWHM of pinhole. steppness of pinhole Reflectivity of pinhole This we
 double[] getResiduals(VectorG a)
          Returns the residulas.
 double[] getStarModel(VectorG dxdy)
          Per definition, the model data is a Vector of all data points, not an area.
 VectorG[] getTimes()
          Returns the evaluation points.
 double[] getTotalErrors()
          Returns the photon noise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pinhole

private Point2D pinhole
The fixed pinhole position.


pinsize

private double pinsize
The pinhole size in pixel.


pinsteep

private double pinsteep
For modeling the pinhole, the steepness.


pindip

private double pindip
For modeling the pinhole.


pindeep

private double pindeep
For modeling the pinhole.


beta

private double beta
The beta of the moffat function.


geometry

private Dimension geometry
The geometry of the frame.


data

private double[] data
The array of the measured data points minus background.


photsig

private double[] photsig
The estimated photon noise sigma.


m0

private VectorG m0
A first estimate of the model parameters, without steep&deep


fitsteep

private boolean fitsteep
If true, we also try to fit the steepness of the pinhole.


fitdeep

private boolean fitdeep
If true, we also try to fit the deepness of the pinhole.

Constructor Detail

AveragePinhole.FullPinhole

private AveragePinhole.FullPinhole(nom.tam.fits.ImageHDU measured,
                                   Rectangle box,
                                   double back,
                                   double backerr,
                                   Point2D pos,
                                   double size,
                                   double k,
                                   double deep,
                                   double moffat)
                            throws IOException,
                                   nom.tam.fits.FitsException
Constructs a new data model for the pinhole. The model is constructed with the measured data (plus the applicable box) and the measured backgound noise. The modeling parameters for the pinhole and the beta of the stellar Moffat function are also stated.

Throws:
IOException
nom.tam.fits.FitsException
Method Detail

fitDeep

private void fitDeep(boolean b)

fitSteep

private void fitSteep(boolean b)

getParameterCount

public int getParameterCount()
The model parameters are This we

Specified by:
getParameterCount in interface DataModel
Returns:
9

getMeasureCount

public int getMeasureCount()
Return the number of measurements in the data model. This is the number of pixel in the image.

Specified by:
getMeasureCount in interface DataModel
Returns:
The number of measurements in the data model. This equals the dimension of the return vector in DataModel.getModel(vec_math.VectorG).

getMeasures

public double[] getMeasures()
Returns the data array.

Specified by:
getMeasures in interface DataModel

getResiduals

public double[] getResiduals(VectorG a)
Returns the residulas.

Specified by:
getResiduals in interface DataModel
Parameters:
a - The model parameters, not necessarily the best fit.

getTotalErrors

public double[] getTotalErrors()
Returns the photon noise.

Specified by:
getTotalErrors in interface DataModel

getMeasurementErrors

public double[] getMeasurementErrors()
Returns the photon noise.

Specified by:
getMeasurementErrors in interface DataModel

getTimes

public VectorG[] getTimes()
Returns the evaluation points. This is an array of geometry.width*geometry.height length, each entry is a Vector2D with pixel coordinates sampling the entire effective area. The name is missleading, though.

Specified by:
getTimes in interface DataModel
Returns:
An array of dimension DataModel.getMeasureCount().

getFirstModel

public VectorG getFirstModel()
Returns a first estimate.

Specified by:
getFirstModel in interface AbstractPinholeModel.PinholeModel

getFirstStep

public VectorG getFirstStep()
Returns a first step.

Specified by:
getFirstStep in interface AbstractPinholeModel.PinholeModel

getModel

public double[] getModel(VectorG dxdy)
Per definition, the model data is a Vector of all data points, not an area. The model parameters are

Specified by:
getModel in interface DataModel
Parameters:
dxdy - The model parameters
Returns:
A model for the data points depending on the model parameters.

getStarModel

public double[] getStarModel(VectorG dxdy)
Per definition, the model data is a Vector of all data points, not an area. The model parameters are

Specified by:
getStarModel in interface AbstractPinholeModel.PinholeModel

evaluateModel

public double evaluateModel(VectorG dxdy,
                            VectorG xy)
Per definition, the independant variable, time, is here a two-dimensional vector specifying the location of the pixel. It can be non-integer. The model parameters are

Specified by:
evaluateModel in interface DataModel
Parameters:
dxdy - The model parameters as defined above
The - pixel location as a two-dim vector.