stella.adapter
Class PyramidUnit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.adapter.AdapterUnit
                  extended by stella.adapter.FocussingUnit
                      extended by stella.adapter.PyramidUnit
All Implemented Interfaces:
Cloneable, Guiding.RawFrame, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class PyramidUnit
extends FocussingUnit
implements Guiding.RawFrame

The focus unit is responsible for focusing the telescope once the pyramid has been brought into the beam. It does not change the filter wheel position, this must have been done by the mastermind.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static File DEFBIASPYRAMIDFITS
          The default fits file holding guider bias image data.
private static long DEFBIASPYRAMIDTIME
          The default exposure time in milli seconds of the bias frame.
private static File DEFDARKPYRAMIDFITS
          The default fits file holding guider bias image data.
private static long DEFDARKPYRAMIDTIME
          The default exposure time in milli seconds of the bias frame.
private static int DEFDATAMAXPYRAMID
          The default data max for 'good' filtered pixels.
private static int DEFDATAMINPYRAMID
          The default data min for 'good' filtered pixels.
private static double DEFEXPOSEPYRAMID
          The desired S/N on the pyramid, high because of fussy images.
static String DEFFOCUS
          The default name of the focus parameter.
private static float DEFGAUSSFWHM
          FWHM of the gaussian filter applied.
private static float DEFGAUSSTRUNCATE
          Truncation of the gaussian filter applied.
private static boolean DEFKEEPPYRAMIDFITS
          If true, all acquire fits are kept on disc.
private static int DEFKEEPPYRAMIDWHAT
          An integer specifying which acquire fits to keep.
private static Dimension DEFPYRAMIDBINNING
          The default binning on guide.
private static double DEFPYRAMIDDESIRED
          The optimal distance of the pyramid images.
private static double DEFPYRAMIDDISTFOCUS
          Translates pyramid diagonal differences to focus mm.
private static double DEFPYRAMIDERROR
          The maximum error on pyramid diagonal.
private static Rectangle DEFPYRAMIDFRAME
          The default focus pyramid frame.
private static double DEFPYRAMIDMINFOCUS
          If this focus mm difference is reached, we are satisfied.
private static double DEFPYRAMIDRADIUS
          The search radius for pyramid images, should be smaller than frame.
private static double DEFPYRAMIDSHARP
          The sharpness rejection on pyramid images.
private static int DEFRETRYPYRAMID
          The default number of retries on focus.
private static int DEFSEARCHBOXPYRAMID
          The default search box, unbinned.
private  Value focus
          For focusing with the pyramid, we need the actual telescope focus.
static String KEY_BIASPYRAMIDFITS
          Name and path of the bias fits file, if we have any.
static String KEY_BIASPYRAMIDTIME
          Integration time on the bias fits.
static String KEY_DARKPYRAMIDFITS
          Name and path of the dark fits file, if we have any.
static String KEY_DARKPYRAMIDTIME
          Time of the dark fits file, if we have any.
static String KEY_DATAMAXPYRAMID
          A default data maximum value for star detection.
static String KEY_DATAMINPYRAMID
          A default data minimum value for star detection.
static String KEY_EXPOSEPYRAMID
          A multiplier to get from acquire times to pyramid times.
static String KEY_FOCUS
          The focus of the telescope.
static String KEY_GAUSSFWHM
          FWHM of the gaussian filter applied.
static String KEY_GAUSSTRUNCATE
          Truncation of the gaussian filter applied.
static String KEY_KEEPPYRAMIDFITS
          If true, all acquire fits are kept on disc.
static String KEY_KEEPPYRAMIDWHAT
          An integer specifying which acquire fits to keep.
static String KEY_PYRAMIDBINNING
          The binning used during pyramid.
static String KEY_PYRAMIDDESIRED
          The optimal distance of the pyramid images.
static String KEY_PYRAMIDDISTFOCUS
          Translates pyramid diagonal differences to focus mm.
static String KEY_PYRAMIDERROR
          The maximum error on pyramid diagonal.
static String KEY_PYRAMIDFRAME
          The window on the guider ccd used on pyramid, unbinned.
static String KEY_PYRAMIDMINFOCUS
          If this focus mm difference is reached, we are satisfied.
static String KEY_PYRAMIDRADIUS
          The search radius for pyramid images, should be smaller than frame.
static String KEY_PYRAMIDSHARP
          The sharpness rejection on pyramid images.
static String KEY_RETRYPYRAMID
          Maximum retries on pyramid.
static String KEY_SEARCHBOXPYRAMID
          A search box for star detection, unbinned.
 
Fields inherited from class stella.adapter.FocussingUnit
increase
 
Fields inherited from class stella.adapter.AdapterUnit
ACQUIRETYPE, GUIDERTYPE, PYRAMIDTYPE
 
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
PyramidUnit(Map<String,String> prop)
          Construct a new focus unit that uses a focus pyramid in the main beam.
 
Method Summary
protected  ErrorEvent doUnitTask(String ignored)
          Does focusing of the telescope, when the focus pyramid is already in the beam.
 File getBiasFrame()
          Returns the the bias frame that fits to the requested readout frame.
 long getBiasTime()
          Returns the exposure time applicable for the bias fram which is important for shutterless system.
 Dimension getBinning()
          Returns the applicable binning on the ccd.
 File getDarkFrame()
          Returns the the dark frame that fits to the requested readout frame.
 long getDarkTime()
          Returns the exposure time applicable for the dark frame.
protected  List getPyramid(List stars, double radius, double sharpness)
          We scan the list of Guiding.RawStars for the four brightest entries around the stated center, at a maximum distance as stated.
protected  VectorG getPyramidLocation(List pyramid)
          Fills in pyramid statistics from the four pyramid reflections.
 Rectangle getReadoutFrame()
          Returns the readout frame.
protected  String getUnitType()
          The type of this unit is equal to AdapterUnit.PYRAMIDTYPE.
protected  boolean isValid()
          This unit is valid if the parent is valid and the focus parameter is set.
protected  boolean setFocus(double mm)
          Sets the focus position on the telescope as an absolute mm value.
protected  boolean setFocusOffset(double mm)
          Sets the focus position on the telescope as an absolute mm value.
protected  void setFocusParameter(Value telescopefocus)
          Sets the focus value needed for the pyramid focusing sequence.
protected  void setMaster(AdapterMaster chef)
          Sets the adapter master.
 
Methods inherited from class stella.adapter.FocussingUnit
setIncrease
 
Methods inherited from class stella.adapter.AdapterUnit
getGuider, getMaster, getTelescope, isManual, resetUnit, setGuider, setManual, setTelescope
 
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, init, 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
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_KEEPPYRAMIDFITS

public static final String KEY_KEEPPYRAMIDFITS
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

KEY_KEEPPYRAMIDWHAT

public static final String KEY_KEEPPYRAMIDWHAT
An integer specifying which acquire fits to keep.

See Also:
Constant Field Values

KEY_PYRAMIDFRAME

public static final String KEY_PYRAMIDFRAME
The window on the guider ccd used on pyramid, unbinned.

See Also:
Constant Field Values

KEY_PYRAMIDBINNING

public static final String KEY_PYRAMIDBINNING
The binning used during pyramid.

See Also:
Constant Field Values

KEY_BIASPYRAMIDFITS

public static final String KEY_BIASPYRAMIDFITS
Name and path of the bias fits file, if we have any.

See Also:
Constant Field Values

KEY_BIASPYRAMIDTIME

public static final String KEY_BIASPYRAMIDTIME
Integration time on the bias fits.

See Also:
Constant Field Values

KEY_DARKPYRAMIDFITS

public static final String KEY_DARKPYRAMIDFITS
Name and path of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_DARKPYRAMIDTIME

public static final String KEY_DARKPYRAMIDTIME
Time of the dark fits file, if we have any.

See Also:
Constant Field Values

KEY_DATAMINPYRAMID

public static final String KEY_DATAMINPYRAMID
A default data minimum value for star detection.

See Also:
Constant Field Values

KEY_DATAMAXPYRAMID

public static final String KEY_DATAMAXPYRAMID
A default data maximum value for star detection.

See Also:
Constant Field Values

KEY_SEARCHBOXPYRAMID

public static final String KEY_SEARCHBOXPYRAMID
A search box for star detection, unbinned.

See Also:
Constant Field Values

KEY_RETRYPYRAMID

public static final String KEY_RETRYPYRAMID
Maximum retries on pyramid.

See Also:
Constant Field Values

KEY_PYRAMIDRADIUS

public static final String KEY_PYRAMIDRADIUS
The search radius for pyramid images, should be smaller than frame.

See Also:
Constant Field Values

KEY_PYRAMIDSHARP

public static final String KEY_PYRAMIDSHARP
The sharpness rejection on pyramid images.

See Also:
Constant Field Values

KEY_PYRAMIDERROR

public static final String KEY_PYRAMIDERROR
The maximum error on pyramid diagonal.

See Also:
Constant Field Values

KEY_PYRAMIDDESIRED

public static final String KEY_PYRAMIDDESIRED
The optimal distance of the pyramid images.

See Also:
Constant Field Values

KEY_PYRAMIDDISTFOCUS

public static final String KEY_PYRAMIDDISTFOCUS
Translates pyramid diagonal differences to focus mm.

See Also:
Constant Field Values

KEY_PYRAMIDMINFOCUS

public static final String KEY_PYRAMIDMINFOCUS
If this focus mm difference is reached, we are satisfied.

See Also:
Constant Field Values

KEY_EXPOSEPYRAMID

public static final String KEY_EXPOSEPYRAMID
A multiplier to get from acquire times to pyramid times.

See Also:
Constant Field Values

KEY_GAUSSFWHM

public static final String KEY_GAUSSFWHM
FWHM of the gaussian filter applied.

See Also:
Constant Field Values

KEY_GAUSSTRUNCATE

public static final String KEY_GAUSSTRUNCATE
Truncation of the gaussian filter applied.

See Also:
Constant Field Values

KEY_FOCUS

public static final String KEY_FOCUS
The focus of the telescope.

See Also:
Constant Field Values

DEFKEEPPYRAMIDFITS

private static final boolean DEFKEEPPYRAMIDFITS
If true, all acquire fits are kept on disc.

See Also:
Constant Field Values

DEFKEEPPYRAMIDWHAT

private static final int DEFKEEPPYRAMIDWHAT
An integer specifying which acquire fits to keep.

See Also:
Constant Field Values

DEFPYRAMIDFRAME

private static final Rectangle DEFPYRAMIDFRAME
The default focus pyramid frame.


DEFPYRAMIDBINNING

private static final Dimension DEFPYRAMIDBINNING
The default binning on guide.


DEFBIASPYRAMIDFITS

private static final File DEFBIASPYRAMIDFITS
The default fits file holding guider bias image data.


DEFBIASPYRAMIDTIME

private static final long DEFBIASPYRAMIDTIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFDARKPYRAMIDFITS

private static final File DEFDARKPYRAMIDFITS
The default fits file holding guider bias image data.


DEFDARKPYRAMIDTIME

private static final long DEFDARKPYRAMIDTIME
The default exposure time in milli seconds of the bias frame.

See Also:
Constant Field Values

DEFDATAMINPYRAMID

private static final int DEFDATAMINPYRAMID
The default data min for 'good' filtered pixels.

See Also:
Constant Field Values

DEFDATAMAXPYRAMID

private static final int DEFDATAMAXPYRAMID
The default data max for 'good' filtered pixels.

See Also:
Constant Field Values

DEFSEARCHBOXPYRAMID

private static final int DEFSEARCHBOXPYRAMID
The default search box, unbinned.

See Also:
Constant Field Values

DEFRETRYPYRAMID

private static final int DEFRETRYPYRAMID
The default number of retries on focus.

See Also:
Constant Field Values

DEFPYRAMIDRADIUS

private static final double DEFPYRAMIDRADIUS
The search radius for pyramid images, should be smaller than frame.

See Also:
Constant Field Values

DEFPYRAMIDSHARP

private static final double DEFPYRAMIDSHARP
The sharpness rejection on pyramid images.

See Also:
Constant Field Values

DEFPYRAMIDERROR

private static final double DEFPYRAMIDERROR
The maximum error on pyramid diagonal.

See Also:
Constant Field Values

DEFPYRAMIDDESIRED

private static final double DEFPYRAMIDDESIRED
The optimal distance of the pyramid images.

See Also:
Constant Field Values

DEFPYRAMIDDISTFOCUS

private static final double DEFPYRAMIDDISTFOCUS
Translates pyramid diagonal differences to focus mm.

See Also:
Constant Field Values

DEFPYRAMIDMINFOCUS

private static final double DEFPYRAMIDMINFOCUS
If this focus mm difference is reached, we are satisfied.

See Also:
Constant Field Values

DEFEXPOSEPYRAMID

private static final double DEFEXPOSEPYRAMID
The desired S/N on the pyramid, high because of fussy images.

See Also:
Constant Field Values

DEFGAUSSFWHM

private static final float DEFGAUSSFWHM
FWHM of the gaussian filter applied.

See Also:
Constant Field Values

DEFGAUSSTRUNCATE

private static final float DEFGAUSSTRUNCATE
Truncation of the gaussian filter applied.

See Also:
Constant Field Values

DEFFOCUS

public static final String DEFFOCUS
The default name of the focus parameter.

See Also:
Constant Field Values

focus

private Value focus
For focusing with the pyramid, we need the actual telescope focus.

Constructor Detail

PyramidUnit

public PyramidUnit(Map<String,String> prop)
Construct a new focus unit that uses a focus pyramid in the main beam.

Method Detail

getReadoutFrame

public Rectangle getReadoutFrame()
Returns the readout frame.

Specified by:
getReadoutFrame in interface Guiding.RawFrame

getBinning

public Dimension getBinning()
Returns the applicable binning on the ccd. If null, no special binning should be used. What that means is interpreted on the ccd-server side, but the most natural choice would be to use no binning.

Specified by:
getBinning in interface Guiding.RawFrame

getBiasFrame

public File getBiasFrame()
Returns the the bias frame that fits to the requested readout frame. The file should point to a fits file of equal size as the readout frame. If null, no bias reduction should be performed.

Specified by:
getBiasFrame in interface Guiding.RawFrame

getBiasTime

public long getBiasTime()
Returns the exposure time applicable for the bias fram which is important for shutterless system. Return -1 if no bias frame is available.

Specified by:
getBiasTime in interface Guiding.RawFrame

getDarkFrame

public File getDarkFrame()
Returns the the dark frame that fits to the requested readout frame. The file should point to a fits file of equal size as the readout frame. If null, no bias reduction should be performed.

Specified by:
getDarkFrame in interface Guiding.RawFrame

getDarkTime

public long getDarkTime()
Returns the exposure time applicable for the dark frame. Return -1 if no dark frame is available.

Specified by:
getDarkTime in interface Guiding.RawFrame

setFocusParameter

protected void setFocusParameter(Value telescopefocus)
Sets the focus value needed for the pyramid focusing sequence.

Parameters:
telescopefocus - The Value holding the current focus of the telescope in mm.

getUnitType

protected String getUnitType()
The type of this unit is equal to AdapterUnit.PYRAMIDTYPE.

Specified by:
getUnitType in class AdapterUnit

setMaster

protected void setMaster(AdapterMaster chef)
Sets the adapter master.

Overrides:
setMaster in class AdapterUnit

isValid

protected boolean isValid()
This unit is valid if the parent is valid and the focus parameter is set.

Overrides:
isValid in class AdapterUnit

setFocus

protected boolean setFocus(double mm)
Sets the focus position on the telescope as an absolute mm value. Checking of range is done by the underlying driver.

Specified by:
setFocus in class FocussingUnit

setFocusOffset

protected boolean setFocusOffset(double mm)
Sets the focus position on the telescope as an absolute mm value. Checking of range is done by the underlying driver.

Specified by:
setFocusOffset in class FocussingUnit

doUnitTask

protected ErrorEvent doUnitTask(String ignored)
Does focusing of the telescope, when the focus pyramid is already in the beam. Is not changing filter whell positions, this should be issued by the master mind.

Specified by:
doUnitTask in class AdapterUnit
Parameters:
ignored - If the unit supports more than a single mode, otherwise null
Returns:
null on okay, or an ErrorEvent desribing the failure.

getPyramid

protected List getPyramid(List stars,
                          double radius,
                          double sharpness)
We scan the list of Guiding.RawStars for the four brightest entries around the stated center, at a maximum distance as stated. If four entries are found, they are returned. This method can only work if we focus on a bright star. The list cannot be scanned for stars as the images are distorted, but a basic cosmic-ray hit rejection is implemented by a sharpness-toggle. If less then four stars are detected, null is returned.

Parameters:
stars - The list of raw-stars, no spurious removal, order for mag.
center - The expected center of the pyramid.
radius - The pyramid search radius in unbinned pixel.
sharpness - The maximum sharpness allowed for pyramid images.
Returns:
A list with four entries or null, if not successful.

getPyramidLocation

protected VectorG getPyramidLocation(List pyramid)
Fills in pyramid statistics from the four pyramid reflections. This method returns the center of the pyramid, the side length and the estimate of the side-length error as a four dimensional VectorG.

Parameters:
pyramid - The four pyramid reflections as a list of raw-stars.
Returns:
0/1 center x/y, 2=side length, 3=sigma side length or null.