stella.parameter
Class Horizon

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractTargetParameter
                      extended by stella.parameter.AbstractTargetValue
                          extended by stella.parameter.Horizon
All Implemented Interfaces:
Cloneable, Parameter, TargetDependingValue, ParameterDepending, TargetDepending, TargetDependingParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class Horizon
extends AbstractTargetValue
implements ParameterDepending

The horizon is a global constraint that deals with the partial vignetting of the field of view. It depends on target az and alt and is different for the two STELLA locations. On robotel, or any other telescope, this parameter is just a wrapper class for an implementation of the Vignetting interface.


Nested Class Summary
private static class Horizon.Ellipsoidal
          The class to calculate the shadow of two elliptical roofs, like in STELLA.
static class Horizon.Show
          We display a panel that shows stella1-vigentting as gray-shaded
static class Horizon.Stella1
          The vignetting introduced by the building for stella1.
static class Horizon.Stella2
          The vignetting introduced by the building for stella2.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  TargetDependingValue alt
          The altitude value.
private  TargetDependingValue az
          The azimuth parameter.
private  Vignetting cap
          The vignetting instance.
private static String DEFALT
          The default name of the az parameter.
private static String DEFAZ
          The default name of the az parameter.
static String DEFNAME
          Default name of this parameter.
private static String DEFVIGNETTING
          The default vignetting class is for STELLA-1.
static String KEY_ALT
          The name of the altitude target parameter.
static String KEY_AZ
          The name of the azimuth target parameter.
static String KEY_VIGNETTING
          This points to the name of the class used for Vignetting.
 
Fields inherited from class stella.parameter.AbstractTargetParameter
KEY_INDEX
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
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.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
Horizon(Map<String,String> info)
          Constructs a new airmass target object.
 
Method Summary
private  Double calculate(Number aztarget, Number alttarget)
          Calculates the azimuth using the hour angle and the declination of the target.
 Number getForTarget(TargetDefinition star)
          Gets the declination of the target star.
 Number getValue()
          Returns the target's actual airmass, wrapped into a Double.
 void init()
          Initializes the horizon with its vignetting instance if possible.
 void registerParameter(Parameter what)
          Registers the required additional globals for the Z target.
 void registerTarget(TargetDefinition star)
          Registers a star to this parameter.
 Number setValue(Number val)
          Sets the airmass of the actual target.
 
Methods inherited from class stella.parameter.AbstractTargetValue
get, set
 
Methods inherited from class stella.parameter.AbstractTargetParameter
getAsStar, getConstant, getFormattedFor, getSetup
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString
 
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, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.TargetDependingParameter
getFormattedFor
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString
 
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.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_VIGNETTING

public static final String KEY_VIGNETTING
This points to the name of the class used for Vignetting.

See Also:
Constant Field Values

KEY_AZ

public static final String KEY_AZ
The name of the azimuth target parameter.

See Also:
Constant Field Values

KEY_ALT

public static final String KEY_ALT
The name of the altitude target parameter.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
Default name of this parameter.

See Also:
Constant Field Values

DEFVIGNETTING

private static final String DEFVIGNETTING
The default vignetting class is for STELLA-1.

See Also:
Constant Field Values

DEFAZ

private static final String DEFAZ
The default name of the az parameter.

See Also:
Constant Field Values

DEFALT

private static final String DEFALT
The default name of the az parameter.

See Also:
Constant Field Values

cap

private Vignetting cap
The vignetting instance.


az

private TargetDependingValue az
The azimuth parameter.


alt

private TargetDependingValue alt
The altitude value.

Constructor Detail

Horizon

public Horizon(Map<String,String> info)
Constructs a new airmass target object. Note that this global can only function correctly after the tau and dec of the target and the teide latitude have been registered.

Method Detail

init

public void init()
Initializes the horizon with its vignetting instance if possible.

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

setValue

public Number setValue(Number val)
                throws UnsupportedOperationException
Sets the airmass of the actual target. This is a read-only variable, therefore this method throws an UnsupportedOperationException.

Specified by:
setValue in interface Value
Throws:
UnsupportedOperationException

getForTarget

public Number getForTarget(TargetDefinition star)
Gets the declination of the target star.

Specified by:
getForTarget in interface TargetDependingValue
Specified by:
getForTarget in interface TargetDependingParameter
Returns:
A Double holding the target star's declination.

getValue

public Number getValue()
Returns the target's actual airmass, wrapped into a Double. Note that this method returns null if either of the globals denoting the tau, dec of the target or the latitude is missing.

Specified by:
getValue in interface Value

calculate

private Double calculate(Number aztarget,
                         Number alttarget)
Calculates the azimuth using the hour angle and the declination of the target. The latitude of the site must be registered first. Formular:
       tan(a)=sin(τ)/(sin(φ)cos(τ)-tan(δ)cos(φ))
       


registerParameter

public void registerParameter(Parameter what)
Registers the required additional globals for the Z target. For this particular object, target dec and tau and teide latitude are required. Note that the argumental global is checked for being of instance types of TauTarget, DecTarget or Latitude, rather than querrying for the global name.

Specified by:
registerParameter in interface ParameterDepending

registerTarget

public void registerTarget(TargetDefinition star)
Registers a star to this parameter. The target definition is directly passed to the #tau and #dec reference of this parameter. Note that this will set the target in the additional parameter, too.

Specified by:
registerTarget in interface TargetDepending