stella.adapter
Class LinearPrimeFocus

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.FocussingMoments
                          extended by stella.adapter.LinearPrimeFocus
All Implemented Interfaces:
Cloneable, Abortable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class LinearPrimeFocus
extends FocussingMoments

Class that allows focusing of the prime focus unit on STELLA-II. It operates a linear stage that can attain positions from zero to 31400. For auto-focus, the fiber-viewing unit is used.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFALTSHIFT
          Shift the image by 60 pixel to avoid obsuration by the pinhole.
private static double DEFAZSHIFT
          Shift the image by 60 pixel to avoid obsuration by the pinhole.
private static String DEFFOCUSAXIS
          Default name of the linear dirver.
private static double DEFFOCUSOFFSET
          Default focusoffset fine.
private static String DEFFOCUSTEMP
          Default focus temperature parameter name.
private static String DEFFOCUSVALUE
          Default focus temperature parameter name.
private static String DEFLINEARDRIVER
          Default name of the linear dirver.
private static double DEFSEARCHOFFSET
          Default focusoffset on step, where we search a coarse focus.
private static double DEFSTEP0
          Default step0
private static double DEFSTEPTEMP
          Default steptemp
private static double DEFSTEPTEMPSQ
          Default steptemp
private static double DEFTEMP0
          Default temp0
private  Value focus
          The focus position updated by me.
static String KEY_ALTSHIFT
          Points to the offset to apply to altitude before focusing.
static String KEY_AZSHIFT
          Points to the offset to apply to azimuth before focusing.
static String KEY_FOCUSAXIS
          The name of the focus axis on the linear stage.
static String KEY_FOCUSTEMP
          The name of the temperature sensor to use.
static String KEY_FOCUSVALUE
          The name of the parameter that holds the focus.
static String KEY_LINEARDRIVER
          The name of the driver in the master that holds the linear stage.
static String KEY_STEP0
          The step position for focus temperture T0.
static String KEY_STEPTEMP
          Per degree difference to T0, we add this number of steps.
static String KEY_STEPTEMPSQ
          Per degree difference to T0, we add this number of steps.
static String KEY_TEMP0
          At this temperature, optimal focus is at step0.
static String KEY_TEMPMIN
          If this is set, we do not do a focus search in colder temps.
private  MultiAxes linear
          The Multi-axis driver used for linear positioning.
static String LINEARTYPE
          The type of this unit as a string.
private  int maxsteps
          The focus axis can assume values from zero to this.
private  Value temp
          The temperature value.
 
Fields inherited from class stella.adapter.FocussingMoments
EXTRAFOCAL, INTRAFOCAL, KEY_A4ERROR, KEY_A4SLOPE, KEY_ADUSIZE, KEY_BLOBSIZE, KEY_DOSAVE, KEY_DOSEARCH, KEY_ERRORZERNIKE, KEY_EXPOSEFOCUS, KEY_FOCUSBINNING, KEY_FOCUSFRAME, KEY_FOCUSOFFSET, KEY_FOCUSORDER, KEY_HIGHSKYSIGMA, KEY_LOWSKYSIGMA, KEY_MAXFOCUSEXPOSE, KEY_MEDIANSKY, KEY_MOMENTS, KEY_MOMENTSFRAME, KEY_SEARCHOFFSET, KEY_SEARCHORDER, KEY_SEARCHSTEPS, KEY_SKYFRAME, KEY_ZERNIKESTEP, KEY_ZEXPOSE, SEARCH
 
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
LinearPrimeFocus(Map<String,String> prop)
          Constructs a new focussing unit.
 
Method Summary
protected  double crudeFocus()
          We position the linear sledge at the temperature model focus.
protected  ErrorEvent doUnitTask(String mode)
          Task of this unit is to auto focus after a successful acquire.
 double getMaximumFocus()
          Returns the maximum focus step this unit can reach, which is step 31400 something.
 double getMinimumFocus()
          Returns the minimum focus step this unit can reach, which is step 0.
protected  String getUnitType()
          This is the linear stage in the prime focus of stella one, used for focusing.
protected  boolean isValid()
          We are valid only if we have the linear drive and the moments.
protected  boolean setFocus(double step)
          We set the focus of the linear stage to the specified value.
protected  boolean setFocusOffset(double step)
          We set the offset of the linear stage to the specified value.
protected  void setMaster(AdapterMaster chef)
          From the master, we query the driver for the linear stage and grab the temperature and the fits moments parameter.
 
Methods inherited from class stella.adapter.FocussingMoments
doFocusTask, setAbort
 
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

LINEARTYPE

public static final String LINEARTYPE
The type of this unit as a string.

See Also:
Constant Field Values

KEY_LINEARDRIVER

public static final String KEY_LINEARDRIVER
The name of the driver in the master that holds the linear stage.

See Also:
Constant Field Values

KEY_FOCUSAXIS

public static final String KEY_FOCUSAXIS
The name of the focus axis on the linear stage.

See Also:
Constant Field Values

KEY_STEP0

public static final String KEY_STEP0
The step position for focus temperture T0.

See Also:
Constant Field Values

KEY_TEMP0

public static final String KEY_TEMP0
At this temperature, optimal focus is at step0.

See Also:
Constant Field Values

KEY_STEPTEMP

public static final String KEY_STEPTEMP
Per degree difference to T0, we add this number of steps.

See Also:
Constant Field Values

KEY_STEPTEMPSQ

public static final String KEY_STEPTEMPSQ
Per degree difference to T0, we add this number of steps.

See Also:
Constant Field Values

KEY_FOCUSTEMP

public static final String KEY_FOCUSTEMP
The name of the temperature sensor to use.

See Also:
Constant Field Values

KEY_FOCUSVALUE

public static final String KEY_FOCUSVALUE
The name of the parameter that holds the focus.

See Also:
Constant Field Values

KEY_AZSHIFT

public static final String KEY_AZSHIFT
Points to the offset to apply to azimuth before focusing.

See Also:
Constant Field Values

KEY_ALTSHIFT

public static final String KEY_ALTSHIFT
Points to the offset to apply to altitude before focusing.

See Also:
Constant Field Values

KEY_TEMPMIN

public static final String KEY_TEMPMIN
If this is set, we do not do a focus search in colder temps.

See Also:
Constant Field Values

DEFLINEARDRIVER

private static final String DEFLINEARDRIVER
Default name of the linear dirver.

See Also:
Constant Field Values

DEFFOCUSAXIS

private static final String DEFFOCUSAXIS
Default name of the linear dirver.

See Also:
Constant Field Values

DEFFOCUSVALUE

private static final String DEFFOCUSVALUE
Default focus temperature parameter name.

See Also:
Constant Field Values

DEFFOCUSTEMP

private static final String DEFFOCUSTEMP
Default focus temperature parameter name.

See Also:
Constant Field Values

DEFSTEP0

private static final double DEFSTEP0
Default step0

See Also:
Constant Field Values

DEFTEMP0

private static final double DEFTEMP0
Default temp0

See Also:
Constant Field Values

DEFSTEPTEMP

private static final double DEFSTEPTEMP
Default steptemp

See Also:
Constant Field Values

DEFSTEPTEMPSQ

private static final double DEFSTEPTEMPSQ
Default steptemp

See Also:
Constant Field Values

DEFFOCUSOFFSET

private static final double DEFFOCUSOFFSET
Default focusoffset fine.

See Also:
Constant Field Values

DEFSEARCHOFFSET

private static final double DEFSEARCHOFFSET
Default focusoffset on step, where we search a coarse focus.

See Also:
Constant Field Values

DEFALTSHIFT

private static final double DEFALTSHIFT
Shift the image by 60 pixel to avoid obsuration by the pinhole.

See Also:
Constant Field Values

DEFAZSHIFT

private static final double DEFAZSHIFT
Shift the image by 60 pixel to avoid obsuration by the pinhole.

See Also:
Constant Field Values

linear

private MultiAxes linear
The Multi-axis driver used for linear positioning.


maxsteps

private int maxsteps
The focus axis can assume values from zero to this.


temp

private Value temp
The temperature value.


focus

private Value focus
The focus position updated by me.

Constructor Detail

LinearPrimeFocus

public LinearPrimeFocus(Map<String,String> prop)
Constructs a new focussing unit. On registering of the master we query the driver for the linear stage.

Method Detail

getMinimumFocus

public double getMinimumFocus()
Returns the minimum focus step this unit can reach, which is step 0.

Specified by:
getMinimumFocus in class FocussingMoments

getMaximumFocus

public double getMaximumFocus()
Returns the maximum focus step this unit can reach, which is step 31400 something.

Specified by:
getMaximumFocus in class FocussingMoments

setMaster

protected void setMaster(AdapterMaster chef)
From the master, we query the driver for the linear stage and grab the temperature and the fits moments parameter.

Overrides:
setMaster in class FocussingMoments

isValid

protected boolean isValid()
We are valid only if we have the linear drive and the moments.

Overrides:
isValid in class FocussingMoments

doUnitTask

protected ErrorEvent doUnitTask(String mode)
Task of this unit is to auto focus after a successful acquire. Currently, no offset from the acquire position is neecded, thus we can directly spawn the FocussingMoments.doFocusTask(java.lang.String)

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

crudeFocus

protected double crudeFocus()
We position the linear sledge at the temperature model focus. This position is returned, if applicable, otherwise -1 is returned.

Specified by:
crudeFocus in class FocussingMoments

getUnitType

protected String getUnitType()
This is the linear stage in the prime focus of stella one, used for focusing.

Specified by:
getUnitType in class AdapterUnit

setFocus

protected boolean setFocus(double step)
We set the focus of the linear stage to the specified value. This is a number in the range of 0-31400, its units is steps.

Specified by:
setFocus in class FocussingUnit

setFocusOffset

protected boolean setFocusOffset(double step)
We set the offset of the linear stage to the specified value. This is a number in the range of 0-31400, its units is steps.

Specified by:
setFocusOffset in class FocussingUnit