stella.parameter
Class HjdCorrection

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

public class HjdCorrection
extends AbstractTargetValue
implements ParameterDepending, Reloadable

Represents the current heliocentric correction. The light-time correction is calcualted approximately with VSOP87 data. The solar ecliptical longitude, ra, and dec with the current jd are the parameters the hjd depends on. It is also TargetDependingParameter as the correction also depends on the position within the sky of the object:

   r=q/(1+e·cos(λ-ω0)),
   hjd-jd=r/c·(sinδssinδ+cosδcosδscosΔα)
   
The correction returned is in natural time units, i.e. milliseconds and should be added to jd to gain hjd.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  SolDec decsol
          The solar declination.
private  DecTarget dectarget
          The target declination.
private static String DEFDECTARGET
          The default name of the jd parameter.
static String DEFNAME
          The name of this global (jd).
private static String DEFRATARGET
          The default name of the jd parameter.
private static String DEFSOLDEC
          The default name of the jd parameter.
private static String DEFSOLDISTANCE
          The default name of the jd parameter.
private static String DEFSOLRA
          The default name of the jd parameter.
private static DecimalFormat df
          The formatter for the target height.
private  SolDistance distancesol
          The solar longitude.
private static double EXCENTRICITY
          The excentricity of earth's orbit.
static String KEY_DECTARGET
          The name of the object-dec paramter.
static String KEY_RATARGET
          The name of the object-ra paramter.
static String KEY_SOLDEC
          The name of the solar-dec paramter.
static String KEY_SOLDISTANCE
          The name of the solar-longitude paramter.
static String KEY_SOLRA
          The name of the solar-ra paramter.
private static double LIGHTSPEED
          The light speed, in AU/ms.
private static double PERIHELARGUMENT
          The perihel distance in AU.
private static double PERIHELDISTANCE
          The perihel distance in AU.
private  SolRa rasol
          The solar right ascension.
private  RaTarget ratarget
          The target ra.
 
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
HjdCorrection(Map define)
          Constructs a new global representing the heliocentric correction that should be applied to a julian date.
 
Method Summary
private  Double calculate(Number ra, Number dec)
          Calculates the helicentric correction for an object at the given sky position in ms.
 String getFormatted(Object myval)
          Deviates the formatting to the protected version in AbstractParameter.
 Number getForTarget(TargetDefinition target)
          Gets the heliocentric correction for the specified target
static double getHjdCorrection(double d, double solra, double solde, double ra, double de)
          Static access to hjd correction from solar distance, solar right ascension, solar declination, target ra and dec.
 Number getValue()
          Returns the actual hjd in ms as a double.
 void registerParameter(Parameter add)
          Registers the additional parameters needed.
 void registerTarget(TargetDefinition target)
          Registers the target.
 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 jd.
 
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, 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.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.Initializable
init
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_SOLDISTANCE

public static final String KEY_SOLDISTANCE
The name of the solar-longitude paramter.

See Also:
Constant Field Values

KEY_SOLRA

public static final String KEY_SOLRA
The name of the solar-ra paramter.

See Also:
Constant Field Values

KEY_SOLDEC

public static final String KEY_SOLDEC
The name of the solar-dec paramter.

See Also:
Constant Field Values

KEY_RATARGET

public static final String KEY_RATARGET
The name of the object-ra paramter.

See Also:
Constant Field Values

KEY_DECTARGET

public static final String KEY_DECTARGET
The name of the object-dec paramter.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The name of this global (jd).

See Also:
Constant Field Values

DEFSOLDISTANCE

private static final String DEFSOLDISTANCE
The default name of the jd parameter.

See Also:
Constant Field Values

DEFSOLRA

private static final String DEFSOLRA
The default name of the jd parameter.

See Also:
Constant Field Values

DEFSOLDEC

private static final String DEFSOLDEC
The default name of the jd parameter.

See Also:
Constant Field Values

DEFRATARGET

private static final String DEFRATARGET
The default name of the jd parameter.

See Also:
Constant Field Values

DEFDECTARGET

private static final String DEFDECTARGET
The default name of the jd parameter.

See Also:
Constant Field Values

df

private static final DecimalFormat df
The formatter for the target height.


PERIHELDISTANCE

private static final double PERIHELDISTANCE
The perihel distance in AU.

See Also:
Constant Field Values

EXCENTRICITY

private static final double EXCENTRICITY
The excentricity of earth's orbit.

See Also:
Constant Field Values

PERIHELARGUMENT

private static final double PERIHELARGUMENT
The perihel distance in AU.

See Also:
Constant Field Values

LIGHTSPEED

private static final double LIGHTSPEED
The light speed, in AU/ms.

See Also:
Constant Field Values

distancesol

private SolDistance distancesol
The solar longitude.


rasol

private SolRa rasol
The solar right ascension.


decsol

private SolDec decsol
The solar declination.


ratarget

private RaTarget ratarget
The target ra.


dectarget

private DecTarget dectarget
The target declination.

Constructor Detail

HjdCorrection

public HjdCorrection(Map define)
Constructs a new global representing the heliocentric correction that should be applied to a julian date.

Method Detail

setValue

public Number setValue(Number val)
                throws UnsupportedOperationException
Sets the jd. Jd is a read-only variable, therefore this method throws an UnsupportedOperationException.

Specified by:
setValue in interface Value
Throws:
UnsupportedOperationException

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 add)
Registers the additional parameters needed. The helicentric correction needs the solar ecliptical longitude and position (ra, dec) and the target-depending ra/dec.

Specified by:
registerParameter in interface ParameterDepending

registerTarget

public void registerTarget(TargetDefinition target)
Registers the target. Passes the target on to the ra/dec parameters of the target.

Specified by:
registerTarget in interface TargetDepending

getForTarget

public Number getForTarget(TargetDefinition target)
Gets the heliocentric correction for the specified target

Specified by:
getForTarget in interface TargetDependingValue
Specified by:
getForTarget in interface TargetDependingParameter

getValue

public Number getValue()
Returns the actual hjd in ms as a double. The precision should reach ms.

Specified by:
getValue in interface Value

calculate

private Double calculate(Number ra,
                         Number dec)
Calculates the helicentric correction for an object at the given sky position in ms.


getHjdCorrection

public static final double getHjdCorrection(double d,
                                            double solra,
                                            double solde,
                                            double ra,
                                            double de)
Static access to hjd correction from solar distance, solar right ascension, solar declination, target ra and dec. All angles degrees, solar distance in AU. For barycentric correction, the right ascension of the sun and her distance has to be replaced with the appropriate barycentric coordinates.

Parameters:
d - Solar distance in AU.
solra - Right ascension of sun, degrees.
solde - Declination of sun, degrees.
ra - Target ra, degrees.
de - Target de, degrees.
Returns:
HJD-JD in ms.

getFormatted

public String getFormatted(Object myval)
Deviates the formatting to the protected version in AbstractParameter.

Overrides:
getFormatted in class AbstractParameter