stella.adapter
Class AbstractPinholeShift

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.adapter.AbstractPinholeShift
All Implemented Interfaces:
Cloneable, PinholeShift, Initializable, PropertyBearing
Direct Known Subclasses:
AbstractPinholeModel, CenterOfGravityShift, ModelShift, QuadrantShift

public abstract class AbstractPinholeShift
extends PropertyContainer
implements PinholeShift

Implementation of the PinholeShift interface that provides static pinhole positions via a KEY_PINHOLE property. Returns zero on getFlux() and getFwhm(), indicating that it cannot calculate these values.


Nested Class Summary
static class AbstractPinholeShift.Background
          Reads the image on the command line and calculates backgrounds.
static class AbstractPinholeShift.Evaluate
          From reconstructed shift, we make a quantitative analysis.
static class AbstractPinholeShift.Reconstruct
          Tests an algorithm with given properties.
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private static double DEFADNOISE
          Default noise from a perfect A/D converter.
private static Rectangle DEFAPPLICABLE
          The default view, centered at pinhole.
private static double DEFSIGMACLIP
          Default clipping in the sigma range.
private static int DEFSKYTHICK
          The default sky thickness.
static String KEY_ADNOISE
          Noise introduced by the A/D convert.
static String KEY_APPLICABLE
          If only part of the image should be used, this points to the window.
static String KEY_GAIN
          Gain of the CCD
static String KEY_PINHOLE
          This key points to a pinhole property.
static String KEY_SIGMACLIP
          For fitting, only pixels higher than this sigma above sky.
static String KEY_SKYTHICK
          For background frames, the thickness in pixel.
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractPinholeShift(Map<String,String> prop)
          Throws an illegal argument exception, if the pinhole is not set.
 
Method Summary
protected static Vector2D backgroundFrameMean(nom.tam.fits.ImageHDU hdu, Rectangle box, int thick)
          Background is mean of frame, RMS is standard deviation, no clipping.
protected static Vector2D backgroundFrameMedian(nom.tam.fits.ImageHDU hdu, Rectangle box, int thick)
          Background is mean of frame, RMS is standard deviation, no clipping.
protected static Vector2D backgroundMean(nom.tam.fits.ImageHDU hdu, Rectangle box)
          Background is mean of frame, RMS is standard deviation, no clipping.
protected static Vector2D backgroundMedian(nom.tam.fits.ImageHDU hdu, Rectangle box)
          Background is mean of frame, RMS is standard deviation, no clipping.
 Number[] getAduSignal(nom.tam.fits.ImageHDU hdu)
          Gets the measured ADU of the star.First, we call the abstract PinholeShift.getBackground(nom.tam.fits.ImageHDU) method, then we use sigma-clipping to get all pixel that have a signal.
 Rectangle getApplicableWindow()
          If this class has a property named KEY_APPLICABLE and that property can be parsed into a MyRectangle, this method returns the applicable window on the fits frame.
 double getFlux()
          Returns zero.
 double getFwhm()
          Returns zero.
 Point2D getPinholePosition()
          Returns the fixed pinhole position parsed from the properties.
 double getSignalToNoise(nom.tam.fits.ImageHDU hdu)
          Estimates the S/N of the fiber-view image.
 void init()
          Parses the pinhole position.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.adapter.PinholeShift
getBackground, initFiberView
 

Field Detail

KEY_PINHOLE

public static final String KEY_PINHOLE
This key points to a pinhole property.

See Also:
Constant Field Values

KEY_APPLICABLE

public static final String KEY_APPLICABLE
If only part of the image should be used, this points to the window.

See Also:
Constant Field Values

KEY_SKYTHICK

public static final String KEY_SKYTHICK
For background frames, the thickness in pixel.

See Also:
Constant Field Values

KEY_SIGMACLIP

public static final String KEY_SIGMACLIP
For fitting, only pixels higher than this sigma above sky.

See Also:
Constant Field Values

KEY_GAIN

public static final String KEY_GAIN
Gain of the CCD

See Also:
Constant Field Values

KEY_ADNOISE

public static final String KEY_ADNOISE
Noise introduced by the A/D convert. If perfect, 0.289

See Also:
Constant Field Values

DEFAPPLICABLE

private static final Rectangle DEFAPPLICABLE
The default view, centered at pinhole.


DEFSKYTHICK

private static final int DEFSKYTHICK
The default sky thickness.

See Also:
Constant Field Values

DEFSIGMACLIP

private static final double DEFSIGMACLIP
Default clipping in the sigma range.

See Also:
Constant Field Values

DEFADNOISE

private static final double DEFADNOISE
Default noise from a perfect A/D converter.

See Also:
Constant Field Values
Constructor Detail

AbstractPinholeShift

protected AbstractPinholeShift(Map<String,String> prop)
Throws an illegal argument exception, if the pinhole is not set.

Method Detail

init

public void init()
Parses the pinhole position. Throws an illegal argument exception if not present. Checks the range of supplied properties for correctness. Throws an IllegalArgumentException if sky border too thick.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyContainer

getPinholePosition

public Point2D getPinholePosition()
Returns the fixed pinhole position parsed from the properties. Returns null only if the property that was given on construct, was not parsable as a MyPoint2D.

Specified by:
getPinholePosition in interface PinholeShift

backgroundMean

protected static Vector2D backgroundMean(nom.tam.fits.ImageHDU hdu,
                                         Rectangle box)
                                  throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundMedian

protected static Vector2D backgroundMedian(nom.tam.fits.ImageHDU hdu,
                                           Rectangle box)
                                    throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundFrameMean

protected static Vector2D backgroundFrameMean(nom.tam.fits.ImageHDU hdu,
                                              Rectangle box,
                                              int thick)
                                       throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundFrameMedian

protected static Vector2D backgroundFrameMedian(nom.tam.fits.ImageHDU hdu,
                                                Rectangle box,
                                                int thick)
                                         throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

getAduSignal

public Number[] getAduSignal(nom.tam.fits.ImageHDU hdu)
Gets the measured ADU of the star.First, we call the abstract PinholeShift.getBackground(nom.tam.fits.ImageHDU) method, then we use sigma-clipping to get all pixel that have a signal. The number of pixels with signal and the ADU sum are returned.

Returns:
The number of pixels with signal in the first index, the ADU-sum in the second.

getSignalToNoise

public double getSignalToNoise(nom.tam.fits.ImageHDU hdu)
Estimates the S/N of the fiber-view image. First, we call the abstract PinholeShift.getBackground(nom.tam.fits.ImageHDU) method, then we use sigma-clipping to get all pixel that have a signal. The ADU-signal is multiplied by an estimated gain of the CCD to get the photon-signal, the noise is estimated by the sum of the photon-signal and the number of signal pixel times (1+npix/nB) times (sigma^2*gain +gain^2*0.289).

Specified by:
getSignalToNoise in interface PinholeShift

getFlux

public double getFlux()
Returns zero.

Specified by:
getFlux in interface PinholeShift

getFwhm

public double getFwhm()
Returns zero.

Specified by:
getFwhm in interface PinholeShift

getApplicableWindow

public Rectangle getApplicableWindow()
If this class has a property named KEY_APPLICABLE and that property can be parsed into a MyRectangle, this method returns the applicable window on the fits frame.