stella.parameter
Class SolOpposition

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.SolOpposition
All Implemented Interfaces:
Cloneable, Parameter, TargetDependingValue, ParameterDepending, TargetDepending, TargetDependingParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class SolOpposition
extends AbstractTargetValue
implements ParameterDepending, Reloadable

A Value calculating the time out of a given solar ra. This is useful for calculating best observing periods. Its main use is for time of opposition.


Nested Class Summary
static class SolOpposition.Test
          Testing only.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double ASUN
          The constant coefficient.
private static double BSUN
          The linear coefficient.
private static double CSUN
          The quadratic coefficient.
private static double DEFACCURACY
          The default name of the sidereal parameter to use.
private static String DEFECLIPTIC
          The default name of the sidereal parameter to use.
static String DEFNAME
          The default name of this value.
private static String DEFRATARGET
          The default name of the sidereal parameter to use.
private static SimpleDateFormat df
          The decimal formatter for the hour angle.
private  Value epsilon
          The obliqutiy of the ecliptic, degrees.
static String KEY_ACCURACY
          The name of the target longitude to use.
static String KEY_ECLIPTIC
          The name of the target longitude to use.
static String KEY_RATARGET
          The name of the target longitude to use.
private static double LAM
          Constant for excentricity offset.
private static double NYA
          Constant coefficient for calculating mean anamoly.
private static double NYB
          Linear coefficient for calculating mean anamoly.
private static double NYC
          Quadratic coefficient for calculating mean anamoly.
private  TargetDependingParameter ra
          The right ascension of the target, degrees.
 
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
SolOpposition(Map info)
          Constructs a new sol opposition object.
 
Method Summary
private  Long calculate(Number ratarget)
          Calculates the required solar longitude for opposition and calls the static longitudeInvert(double, double) method.
 String getFormatted()
          Returns the formatted longitude value.
 String getFormattedFor(TargetDefinition target)
          Returns the formatted longitude value.
 Number getForTarget(TargetDefinition star)
          Gets the opposition date for a target.
 Number getValue()
          Returns the date when this target will be in opposition to the sun.
static long longitudeInvert(double lamsol, double acc)
          Calculates the date when the sun had the defined solar longitude in the year 2000.
 void registerParameter(Parameter what)
          Registers the required additional globals for the solar opposition.
 void registerTarget(TargetDefinition star)
          Registers a star to this parameter.
 double rescanned(String key, String old, String newval)
          As any parameter depending instance we fail if the parameter we depend on is now a different one.
 Number setValue(Number val)
          Sets the solar opposition date of the actual target.
 
Methods inherited from class stella.parameter.AbstractTargetValue
get, set
 
Methods inherited from class stella.parameter.AbstractTargetParameter
getAsStar, getConstant, getSetup
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getName, getPreserveFile, getString, getString, init, register, 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 util.Reloadable
reload
 
Methods inherited from interface stella.Parameter
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.Initializable
init
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_RATARGET

public static final String KEY_RATARGET
The name of the target longitude to use.

See Also:
Constant Field Values

KEY_ECLIPTIC

public static final String KEY_ECLIPTIC
The name of the target longitude to use.

See Also:
Constant Field Values

KEY_ACCURACY

public static final String KEY_ACCURACY
The name of the target longitude to use.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The default name of this value.

See Also:
Constant Field Values

DEFRATARGET

private static final String DEFRATARGET
The default name of the sidereal parameter to use.

See Also:
Constant Field Values

DEFECLIPTIC

private static final String DEFECLIPTIC
The default name of the sidereal parameter to use.

See Also:
Constant Field Values

DEFACCURACY

private static final double DEFACCURACY
The default name of the sidereal parameter to use.

See Also:
Constant Field Values

ASUN

private static final double ASUN
The constant coefficient.

See Also:
Constant Field Values

BSUN

private static final double BSUN
The linear coefficient.

See Also:
Constant Field Values

CSUN

private static final double CSUN
The quadratic coefficient.

See Also:
Constant Field Values

LAM

private static final double LAM
Constant for excentricity offset.

See Also:
Constant Field Values

NYA

private static final double NYA
Constant coefficient for calculating mean anamoly.

See Also:
Constant Field Values

NYB

private static final double NYB
Linear coefficient for calculating mean anamoly.

See Also:
Constant Field Values

NYC

private static final double NYC
Quadratic coefficient for calculating mean anamoly.

See Also:
Constant Field Values

ra

private TargetDependingParameter ra
The right ascension of the target, degrees.


epsilon

private Value epsilon
The obliqutiy of the ecliptic, degrees.


df

private static final SimpleDateFormat df
The decimal formatter for the hour angle.

Constructor Detail

SolOpposition

public SolOpposition(Map info)
Constructs a new sol opposition object. Note that this global can only function correctly after the ecliptic longitude has been registered.

Method Detail

setValue

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

Specified by:
setValue in interface Value
Throws:
UnsupportedOperationException

registerTarget

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

Specified by:
registerTarget in interface TargetDepending

getForTarget

public Number getForTarget(TargetDefinition star)
Gets the opposition date for a target. This is a long giving a time.

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 date when this target will be in opposition to the sun.

Specified by:
getValue in interface Value

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
As any parameter depending instance we fail if the parameter we depend on is now a different one.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class AbstractParameter

registerParameter

public void registerParameter(Parameter what)
Registers the required additional globals for the solar opposition. For this particular object, the target ecliptical longitude is required.

Specified by:
registerParameter in interface ParameterDepending

calculate

private Long calculate(Number ratarget)
Calculates the required solar longitude for opposition and calls the static longitudeInvert(double, double) method.


longitudeInvert

public static long longitudeInvert(double lamsol,
                                   double acc)
Calculates the date when the sun had the defined solar longitude in the year 2000. This method is static and public to allow Astro to query.

Parameters:
lamsol - The solar ecliptical longitude in radians.
acc - The accuracy of the newton solver.
Returns:
A long specifiying the date in 2000.

getFormatted

public String getFormatted()
Returns the formatted longitude value. It is a string giving the longitude in deg, min, and sec.

Specified by:
getFormatted in interface Parameter
Overrides:
getFormatted in class AbstractParameter

getFormattedFor

public String getFormattedFor(TargetDefinition target)
Returns the formatted longitude value. It is a string giving the longitude in deg, min, and sec.

Specified by:
getFormattedFor in interface TargetDependingParameter
Overrides:
getFormattedFor in class AbstractTargetParameter