stella.adapter
Class CenterOfGravityShift

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.adapter.AbstractPinholeShift
                  extended by stella.adapter.CenterOfGravityShift
All Implemented Interfaces:
Cloneable, PinholeShift, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class CenterOfGravityShift
extends AbstractPinholeShift

Simple implementation of a pinhole shift detector. From a fixed pinhole position given in the properties, we calculate the shift be appyling a simple center-of-gravity method. The center of gravity is not necessarily the true shift from the pinhole. This can be in a simple way accounted for by the gain factor, splitted for convenience into an x and y gain factor. The recommended way, though, is to feed the shifts derived from this class into a PID control, adjusting the P-term accordingly.


Nested Class Summary
static class CenterOfGravityShift.Test
          Test class.
 
Nested classes/interfaces inherited from class stella.adapter.AbstractPinholeShift
AbstractPinholeShift.Background, AbstractPinholeShift.Evaluate, AbstractPinholeShift.Reconstruct
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFXGAIN
          Default gain factor from fitting artificial images.
private static double DEFYGAIN
          Default gain factor from fitting artificial images.
static String KEY_XGAIN
          This key is the scaling of the center of gravity shift.
static String KEY_YGAIN
          This key is the scaling of the center of gravity shift.
 
Fields inherited from class stella.adapter.AbstractPinholeShift
KEY_ADNOISE, KEY_APPLICABLE, KEY_GAIN, KEY_PINHOLE, KEY_SIGMACLIP, KEY_SKYTHICK
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
CenterOfGravityShift(Map<String,String> prop)
          Constructs a new CenterOfGravityShift object.
 
Method Summary
 Vector2D getBackground(nom.tam.fits.ImageHDU hdu)
          This method calculates the background as the median of a frame at the outer edge of the apllicable window.
 Point2D initFiberView(nom.tam.fits.Fits ccd)
          Returns the center of gravity shift of the image from the pinhole position.
 
Methods inherited from class stella.adapter.AbstractPinholeShift
backgroundFrameMean, backgroundFrameMedian, backgroundMean, backgroundMedian, getAduSignal, getApplicableWindow, getFlux, getFwhm, getPinholePosition, getSignalToNoise, init
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, 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 util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_XGAIN

public static final String KEY_XGAIN
This key is the scaling of the center of gravity shift.

See Also:
Constant Field Values

KEY_YGAIN

public static final String KEY_YGAIN
This key is the scaling of the center of gravity shift.

See Also:
Constant Field Values

DEFXGAIN

private static final double DEFXGAIN
Default gain factor from fitting artificial images.

See Also:
Constant Field Values

DEFYGAIN

private static final double DEFYGAIN
Default gain factor from fitting artificial images.

See Also:
Constant Field Values
Constructor Detail

CenterOfGravityShift

public CenterOfGravityShift(Map<String,String> prop)
Constructs a new CenterOfGravityShift object.

Method Detail

getBackground

public Vector2D getBackground(nom.tam.fits.ImageHDU hdu)
This method calculates the background as the median of a frame at the outer edge of the apllicable window.

Returns:
The background ADU in x and its ADU-sigma in y.

initFiberView

public Point2D initFiberView(nom.tam.fits.Fits ccd)
Returns the center of gravity shift of the image from the pinhole position. The true center of gravity is scaled with two functions to return true shifts.

Parameters:
ccd - The image of the pinhole entrance
Returns:
The pixel shift from the pinhole center to the star.