stella.xml
Class TelescopeHelper

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.xml.TelescopeHelper
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class TelescopeHelper
extends PropertyBundles
implements Initializable

A helper class for defining DOMTargets, with special emphasis to the telescope used. The telescope helper provides a mapping of users to their institution and their e-mail addresses as well as their notification preferences. These user-definitions are stored as UserProperty and are bound to the telescope helper to allow the same user to have different properties on each telescope. Additionally, the telescope helper provides a mapping of target types to TypeHelper properties.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static boolean DEFFIXEDDEROTATOR
          The default derotator-is-fixed state.
private static float DEFGUIDERLIMIT
          The default limiting magnitude for the guide star.
private static double DEFGUIDERSEPARATION
          The default maximum distance of the guide star.
private static String DEFTELESCOPE
          The default telescope.
private static String DEFTYPELIST
          The default target types.
private static String DEFURLRESOURCES
          The default user path.
private static String DEFUSERLIST
          The default users.
private static double DEFXFIELDOFVIEW
          The default guider field for STELLA-I.
private static double DEFYFIELDOFVIEW
          The default guider field for STELLA-I.
private  TypeHelper help
          The single TypeHelper used in this telescope helper.
static String KEY_FIXEDDEROTATOR
          True, if this telescope has no/fixed derotator.
static String KEY_GUIDERLIMIT
          The minimum brightness of the guiding star.
static String KEY_GUIDERSEPARATION
          The maximum separation of the guiding star in degrees.
static String KEY_HELPERCLASS
          The key mapping to the telescope helper class name.
static String KEY_TELESCOPE
          The telescope this helper is bound to.
static String KEY_TYPELIST
          The targett types for this telescope as a comma-separated list.
static String KEY_USERLIST
          The user properties as a comma-separated file list..
static String KEY_XFIELDOFVIEW
          The key to the guider field of view, x-dircetion.
static String KEY_XSCIENCEVIEW
          The key to the science field of view, x-direction.
static String KEY_YFIELDOFVIEW
          The key to the guider field of view, y-direction.
static String KEY_YSCIENCEVIEW
          The key to the science field of view, y-direction.
private  Map types
          A lookup table mapping target types to TypeHelpers.
private  Map users
          A lookup table mapping user names to their properties.
private  UserProperty utilize
          The user utilizing this telescope helper.
 
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
TelescopeHelper(Map prop)
          Constructs a new telescope helper.
 
Method Summary
 boolean addEmailFragment(Map xml)
          Adds the e-mail section as a part of a TargetFactory mapping.
 boolean addInstitution(Map xml)
          Adds the institution section as a part of a TargetFactory mapping.
 boolean addUserFragment(Map xml)
          Adds the user element as a part of a TargetFactory mapping.
protected  void error(String warn)
          Issues a warning message.
 double getFieldOfView()
          Returns the field-of-view for this telescope.
 Dimension2D getGuiderChipField()
          Returns the chip-size of the guider field in degrees.
private  double getGuideValue(StarDescription center, StarDescription candidate)
          Measures the guide-star quality.
 Map getKnownTypes()
          Returns all known types.
 Map getKnownUsers()
          Retunrs all known users.
 Dimension2D getScienceChipField()
          Returns the chip-size of the guider field in degrees.
 String getTelescope()
          Returns the name of the telescope this helper is bound to.
 TypeHelper getTypeHelper()
          Returns the associated TypeHelper.
 UserProperty getUserProperty()
          Returns the associate UserProperty instance.
protected  void info(String warn)
          Issues a warning message.
 void init()
          Constructs the look-up tables matching user names to UserProperty instances and object types to known type helper properties.
 boolean isFixedDerotator()
          Returns true if this telescope has no derotator or if its derotator is fixed.
 StarDescription selectGuideStar(StarDescription guide, List field)
          Selects a guide star from a list of star.
 boolean selectTargetType(String tt)
          Selects the target type.
 boolean selectUser(String name)
          Selecte a user by name.
protected  void warn(String warn)
          Issues a warning message.
 
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_HELPERCLASS

public static final String KEY_HELPERCLASS
The key mapping to the telescope helper class name.

See Also:
Constant Field Values

KEY_TELESCOPE

public static final String KEY_TELESCOPE
The telescope this helper is bound to.

See Also:
Constant Field Values

KEY_XFIELDOFVIEW

public static final String KEY_XFIELDOFVIEW
The key to the guider field of view, x-dircetion.

See Also:
Constant Field Values

KEY_YFIELDOFVIEW

public static final String KEY_YFIELDOFVIEW
The key to the guider field of view, y-direction.

See Also:
Constant Field Values

KEY_XSCIENCEVIEW

public static final String KEY_XSCIENCEVIEW
The key to the science field of view, x-direction.

See Also:
Constant Field Values

KEY_YSCIENCEVIEW

public static final String KEY_YSCIENCEVIEW
The key to the science field of view, y-direction.

See Also:
Constant Field Values

KEY_FIXEDDEROTATOR

public static final String KEY_FIXEDDEROTATOR
True, if this telescope has no/fixed derotator.

See Also:
Constant Field Values

KEY_GUIDERLIMIT

public static final String KEY_GUIDERLIMIT
The minimum brightness of the guiding star.

See Also:
Constant Field Values

KEY_GUIDERSEPARATION

public static final String KEY_GUIDERSEPARATION
The maximum separation of the guiding star in degrees.

See Also:
Constant Field Values

KEY_USERLIST

public static final String KEY_USERLIST
The user properties as a comma-separated file list..

See Also:
Constant Field Values

KEY_TYPELIST

public static final String KEY_TYPELIST
The targett types for this telescope as a comma-separated list.

See Also:
Constant Field Values

DEFURLRESOURCES

private static final String DEFURLRESOURCES
The default user path.

See Also:
Constant Field Values

DEFTELESCOPE

private static final String DEFTELESCOPE
The default telescope.

See Also:
Constant Field Values

DEFXFIELDOFVIEW

private static final double DEFXFIELDOFVIEW
The default guider field for STELLA-I.

See Also:
Constant Field Values

DEFYFIELDOFVIEW

private static final double DEFYFIELDOFVIEW
The default guider field for STELLA-I.

See Also:
Constant Field Values

DEFFIXEDDEROTATOR

private static final boolean DEFFIXEDDEROTATOR
The default derotator-is-fixed state.

See Also:
Constant Field Values

DEFGUIDERLIMIT

private static final float DEFGUIDERLIMIT
The default limiting magnitude for the guide star.

See Also:
Constant Field Values

DEFGUIDERSEPARATION

private static final double DEFGUIDERSEPARATION
The default maximum distance of the guide star.

See Also:
Constant Field Values

DEFUSERLIST

private static final String DEFUSERLIST
The default users.

See Also:
Constant Field Values

DEFTYPELIST

private static final String DEFTYPELIST
The default target types.

See Also:
Constant Field Values

users

private Map users
A lookup table mapping user names to their properties.


types

private Map types
A lookup table mapping target types to TypeHelpers.


utilize

private UserProperty utilize
The user utilizing this telescope helper.


help

private TypeHelper help
The single TypeHelper used in this telescope helper.

Constructor Detail

TelescopeHelper

public TelescopeHelper(Map prop)
Constructs a new telescope helper.

Method Detail

init

public void init()
Constructs the look-up tables matching user names to UserProperty instances and object types to known type helper properties.

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

getKnownTypes

public Map getKnownTypes()
Returns all known types.


getKnownUsers

public Map getKnownUsers()
Retunrs all known users.


selectUser

public boolean selectUser(String name)
Selecte a user by name. This method should be called at the beginning of a target-constructing session.


selectTargetType

public boolean selectTargetType(String tt)
Selects the target type. Should be called at the beginning of a a target-construction session.


getTypeHelper

public TypeHelper getTypeHelper()
Returns the associated TypeHelper. Can only be called after the {link #selectTargetType} method has been called.


getUserProperty

public UserProperty getUserProperty()
Returns the associate UserProperty instance. Can only be called after the selectUser(java.lang.String) has been issued.


getTelescope

public String getTelescope()
Returns the name of the telescope this helper is bound to.


isFixedDerotator

public boolean isFixedDerotator()
Returns true if this telescope has no derotator or if its derotator is fixed.


getFieldOfView

public double getFieldOfView()
Returns the field-of-view for this telescope. The field returned is the diameter of the circle spanning the guider-ccd size.


getGuiderChipField

public Dimension2D getGuiderChipField()
Returns the chip-size of the guider field in degrees.


getScienceChipField

public Dimension2D getScienceChipField()
Returns the chip-size of the guider field in degrees.


addUserFragment

public boolean addUserFragment(Map xml)
Adds the user element as a part of a TargetFactory mapping. If no user is specified, a warning message is issued.


addEmailFragment

public boolean addEmailFragment(Map xml)
Adds the e-mail section as a part of a TargetFactory mapping. If no user is specified, a warning message is issued.


addInstitution

public boolean addInstitution(Map xml)
Adds the institution section as a part of a TargetFactory mapping. This element is required for time-accounting.


selectGuideStar

public StarDescription selectGuideStar(StarDescription guide,
                                       List field)
Selects a guide star from a list of star. The guide star is the entry in the list that is closest to the position supplied and is brightest. The fov is re-arranged such that the guide star is now on top of the list.


getGuideValue

private double getGuideValue(StarDescription center,
                             StarDescription candidate)
Measures the guide-star quality. This is an almagam from the distance to the center and the brightness of the star.


info

protected void info(String warn)
Issues a warning message. This class pipes directly to Syslog.warning.


warn

protected void warn(String warn)
Issues a warning message. This class pipes directly to Syslog.warning.


error

protected void error(String warn)
Issues a warning message. This class pipes directly to Syslog.warning.