net.aerith.misao.image
Class PSFComparer

java.lang.Object
  |
  +--net.aerith.misao.image.PSFComparer

public class PSFComparer
extends java.lang.Object

The PSFComparer is a class to compare two point spread functions.

The method calculateProportionTo calculates the proportion k which minimizes the amount of square of residuals:

     \sigma_{x} { f(x,y) - k * p(x,y) } ^ 2
 
where f(x,y) means the specified PSF, and p(x,y) means the base PSF.

The k is calculated as:

          \sigma_{x} { f(x,y) * p(x,y) }
     k = --------------------------------
              \sigma_{x} p(x,y) ^ 2
 
in the least square method.


Field Summary
protected  PSF base_psf
          The base PSF.
protected  double essential_radius
          The radius from the center not to reject.
protected  double rejected_ratio
          The ratio of pixels to be rejected to calculate the proportion.
protected  java.util.Vector rejected_scopes
          The list of sight scopes to be rejected.
 
Constructor Summary
PSFComparer(PSF base_psf)
          Constructs a PSFComparer.
 
Method Summary
 void addRejectedSightScope(SightScope scope)
          Adds a sight scope to reject pixels within.
 double calculateProportionTo(PSF psf)
          Calculates the proportion to the specified PSF from the base PSF.
 void setEssentialRadius(double radius)
          Sets the radius from the center not to reject.
 void setRejectedRatio(double ratio)
          Sets the ratio of pixels to be rejected to calculate the proportion.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

base_psf

protected PSF base_psf
The base PSF.

rejected_ratio

protected double rejected_ratio
The ratio of pixels to be rejected to calculate the proportion.

essential_radius

protected double essential_radius
The radius from the center not to reject. When negative, every pixel can be rejected.

rejected_scopes

protected java.util.Vector rejected_scopes
The list of sight scopes to be rejected.
Constructor Detail

PSFComparer

public PSFComparer(PSF base_psf)
Constructs a PSFComparer.
Parameters:
base_psf - the base PSF.
Method Detail

setRejectedRatio

public void setRejectedRatio(double ratio)
Sets the ratio of pixels to be rejected to calculate the proportion.
Parameters:
ratio - the ratio of pixels to be rejected to calculate the proportion.

setEssentialRadius

public void setEssentialRadius(double radius)
Sets the radius from the center not to reject. When negative, every pixel can be rejected.
Parameters:
radius - the radius from the center not to reject.

addRejectedSightScope

public void addRejectedSightScope(SightScope scope)
Adds a sight scope to reject pixels within. Note that the sight scope must be expressed as 0 degree is in the direction of x axis, 90 degree is in the direction of y axis.
Parameters:
scope - a sight scope to reject pixels within.

calculateProportionTo

public double calculateProportionTo(PSF psf)
Calculates the proportion to the specified PSF from the base PSF.
Parameters:
psf - the PSF.
Returns:
the proportion to the specified PSF from the base PSF.