stella.xml
Class AbstractPhaseMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.AbstractMerit
          extended by stella.xml.AbstractPhaseMerit
All Implemented Interfaces:
Serializable, Cloneable, Meriting, Initializable, PropertyBearing
Direct Known Subclasses:
PhaseAvoidanceMerit, PhaseCoherentMerit, PhaseFillerMerit, PhaseMerit

public abstract class AbstractPhaseMerit
extends AbstractMerit

An abstract class that calculates the current phase of an object. This can be acheived either by setting the KEY_ZEROPHASE to the HJD of phase zero, otherwise the first successful observation will be used to define the zero phase.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private static String DEFHJDCORRECTION
          Default hjd correction parameter name.
private static String DEFJD
          Default jd parameter name.
static String KEY_HJDCORRECTION
          The key pointing to the name of the jd parameter.
static String KEY_JD
          The key pointing to the name of the jd parameter.
static String KEY_PERIODDAY
          The period of the observation, days.
static String KEY_ZEROPHASE
          The jd defining zero phase.
private static long serialVersionUID
           
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractPhaseMerit(Map<String,String> prop)
          Constructs a phase-coherent merit.
 
Method Summary
protected  double getDaysSinceT0(TargetDefinition target, ParameterClustering set)
          Calculates the days from phase zero.
protected  double getHjd(Date when, TargetDefinition target)
          Returns the HJD of the stated ms time for this target.
protected  double getHjd(long ms, TargetDefinition target)
          Returns the HJD of the stated ms time for this target.
protected  double getPhase(TargetDefinition target, long time)
          Returns the phase at the stated date.
protected  double getPhase(TargetDefinition target, ParameterClustering set)
          Returns the current phase.
protected  double getT0(TargetDefinition target)
          Calculates the phase zero in JD.
 void init()
          We have to have a period now.
 
Methods inherited from class stella.AbstractMerit
createMerit, getInitializer, initMerit
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, 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 stella.Meriting
getMerit
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

KEY_PERIODDAY

public static final String KEY_PERIODDAY
The period of the observation, days.

See Also:
Constant Field Values

KEY_ZEROPHASE

public static final String KEY_ZEROPHASE
The jd defining zero phase.

See Also:
Constant Field Values

KEY_JD

public static final String KEY_JD
The key pointing to the name of the jd parameter.

See Also:
Constant Field Values

KEY_HJDCORRECTION

public static final String KEY_HJDCORRECTION
The key pointing to the name of the jd parameter.

See Also:
Constant Field Values

DEFJD

private static final String DEFJD
Default jd parameter name.

See Also:
Constant Field Values

DEFHJDCORRECTION

private static final String DEFHJDCORRECTION
Default hjd correction parameter name.

See Also:
Constant Field Values
Constructor Detail

AbstractPhaseMerit

protected AbstractPhaseMerit(Map<String,String> prop)
Constructs a phase-coherent merit. At least the period should be stated in the target definition. Proper creation should be done using the AbstractMerit.createMerit(java.util.Map) method. This create method also takes care of proper parameter overloading.

Method Detail

init

public void init()
We have to have a period now.

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

getT0

protected double getT0(TargetDefinition target)
Calculates the phase zero in JD. If the phase zero is undefined, we use the first successful observation of this target and calculate the HJD of the center of that observation.


getDaysSinceT0

protected double getDaysSinceT0(TargetDefinition target,
                                ParameterClustering set)
Calculates the days from phase zero. If the phase zero is undefined, we use the first successful observation of this target and calculate the HJD of the center of that observation.


getHjd

protected double getHjd(Date when,
                        TargetDefinition target)
Returns the HJD of the stated ms time for this target.


getHjd

protected double getHjd(long ms,
                        TargetDefinition target)
Returns the HJD of the stated ms time for this target.


getPhase

protected double getPhase(TargetDefinition target,
                          long time)
Returns the phase at the stated date.


getPhase

protected double getPhase(TargetDefinition target,
                          ParameterClustering set)
Returns the current phase.