stella.xml
Class PhaseCoherentMerit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.AbstractMerit
                  extended by stella.xml.AbstractPhaseMerit
                      extended by stella.xml.PhaseCoherentMerit
All Implemented Interfaces:
Serializable, Cloneable, EndpointDefining, Meriting, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class PhaseCoherentMerit
extends AbstractPhaseMerit
implements EndpointDefining

A class defining a time-slot merit that allows observation of a target that requires phase-coherent observations. This merit is rather complex. It consits of a superposition of Gauss-curves, each one is centered at an 'ideal' phase observation. Again, the KEY_WIDTH defines the sharpness of this curve. The parameter KEY_AIMN points to the the number of phase-coherent observations that should be made on the target, the period is given with the #KEY_PERIOD key. So far, so easy. To allow for an increased probability for target choosing as soon as at least some observations has been made, the KEY_AUGMENT parameter is introduced. If set to one, the probability increased such that the merit is area-conserving in phase space. Another difficult thing is the determination whether an observation made really fulfills the requirement of phase coherence. The KEY_OFFSET key helps here. If an observation made is in phase-space within one of the calculated phase-centered pick times, this observation is said to be successfully centered at the required phase. The resulting formula reads as

   ts(t)=∑ki(x-μi)1/ne-((x-μi)/width)²
   
The parameters ki, x, and μi are evaluated according to
   μi=i/Naim,
   ki=augment·Naim/(Naim-N) | 0,
   x=((t-tfirst)%P)/P,
   
where x is adjusted so that x-μi > 0. The actually successful observations, N is increased if
   |((tobs-tfirst)%P)/P|<offset
   
In this case, ki=0.
Note that the first observation is scheduled width a constant merit. Phase coherent observation only sets in after the first observation has been made.
This merit can be combined with a ConstantMerit or a OneObservationMerit to further constrain target picking.
This merit also incorporates the EndpointDefining interface. The isCompleted(stella.ParameterClustering, stella.TargetDefinition) method returns true as soon as all phase-requested observations have been made.

See Also:
Serialized Form

Nested Class Summary
static class PhaseCoherentMerit.Random
          A test class for the phase coherent merit.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static int DEFAIMN
          Default value for the required phase-points.
private static double DEFAUGMENT
          The default artificial increase of probabilty after some observations.
private static double DEFCOMPLETENESS
          Default completeness level.
private static double DEFMAXPERIODS
          Default value for maximum number of periods.
private static double DEFOFFSET
          Default value for the maximum offset in phase space.
private static double DEFPRIOR
          Default value for the merit returned prior to first successful obs.
private static int DEFSHARP
          Default value for the sharpness.
private static double DEFWIDTH
          Default value for the width in phase space.
static String KEY_AIMN
          The number of phase points to observe.
static String KEY_ATPHASES
          Observe at these distinct phases.
static String KEY_AUGMENT
          The key linked to artificial increase of late observations.
static String KEY_COMPLETENESS
          Completeness level if program was not finished after some periods.
static String KEY_MAXPERIODS
          The number of periods passed until completeness applies.
static String KEY_OFFSET
          The maximum phase-offset allowed for a successful phase-coherent obs.
static String KEY_PRIOR
          The merit returned if no observation has been made.
static String KEY_SHARP
          The sharpness of the rise, i.e.
static String KEY_STARTFRAC
          If this property is set, we only start at frac-jd around it.
static String KEY_WIDTH
          The key linked to width of the observation intervall in phase space.
private  List<Double> phases
          The phases were we want to observe.
private static long serialVersionUID
           
 
Fields inherited from class stella.xml.AbstractPhaseMerit
KEY_HJDCORRECTION, KEY_JD, KEY_PERIODDAY, KEY_ZEROPHASE
 
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
PhaseCoherentMerit(Map prop)
          Constructs a phase-coherent merit.
 
Method Summary
private  double calculate(double phi, double[] ki, double sigma, int sharp)
          Calculates the merit at the given phase, which must be between zero and one.
 double getMerit(ParameterClustering set, TargetDefinition target, Collection ignore, long within)
          Calculates the actual time slot merit.
private  double getMeritFromNumbers(double current, double periodspan, List<Double> looked, String debugname)
          To test this complicated merit, we have transferred all the calculations into this method that does not need any target descriptions or sets.
 void init()
          Generates the list of phases we want to observe.
 boolean isCompleted(ParameterClustering set, TargetDefinition target)
          Check, if the observation is complete.
 
Methods inherited from class stella.xml.AbstractPhaseMerit
getDaysSinceT0, getHjd, getHjd, getPhase, getPhase, getT0
 
Methods inherited from class stella.AbstractMerit
createMerit, getInitializer, initMerit
 
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 stella.Meriting
getInitializer, initMerit
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

KEY_AIMN

public static final String KEY_AIMN
The number of phase points to observe.

See Also:
Constant Field Values

KEY_ATPHASES

public static final String KEY_ATPHASES
Observe at these distinct phases.

See Also:
Constant Field Values

KEY_STARTFRAC

public static final String KEY_STARTFRAC
If this property is set, we only start at frac-jd around it.

See Also:
Constant Field Values

KEY_OFFSET

public static final String KEY_OFFSET
The maximum phase-offset allowed for a successful phase-coherent obs.

See Also:
Constant Field Values

KEY_AUGMENT

public static final String KEY_AUGMENT
The key linked to artificial increase of late observations.

See Also:
Constant Field Values

KEY_WIDTH

public static final String KEY_WIDTH
The key linked to width of the observation intervall in phase space.

See Also:
Constant Field Values

KEY_PRIOR

public static final String KEY_PRIOR
The merit returned if no observation has been made.

See Also:
Constant Field Values

KEY_MAXPERIODS

public static final String KEY_MAXPERIODS
The number of periods passed until completeness applies.

See Also:
Constant Field Values

KEY_COMPLETENESS

public static final String KEY_COMPLETENESS
Completeness level if program was not finished after some periods.

See Also:
Constant Field Values

KEY_SHARP

public static final String KEY_SHARP
The sharpness of the rise, i.e. n .

See Also:
Constant Field Values

DEFOFFSET

private static final double DEFOFFSET
Default value for the maximum offset in phase space.

See Also:
Constant Field Values

DEFAUGMENT

private static final double DEFAUGMENT
The default artificial increase of probabilty after some observations.

See Also:
Constant Field Values

DEFAIMN

private static final int DEFAIMN
Default value for the required phase-points.

See Also:
Constant Field Values

DEFWIDTH

private static final double DEFWIDTH
Default value for the width in phase space.

See Also:
Constant Field Values

DEFPRIOR

private static final double DEFPRIOR
Default value for the merit returned prior to first successful obs.

See Also:
Constant Field Values

DEFMAXPERIODS

private static final double DEFMAXPERIODS
Default value for maximum number of periods.

See Also:
Constant Field Values

DEFCOMPLETENESS

private static final double DEFCOMPLETENESS
Default completeness level.

See Also:
Constant Field Values

DEFSHARP

private static final int DEFSHARP
Default value for the sharpness.

See Also:
Constant Field Values

phases

private List<Double> phases
The phases were we want to observe.

Constructor Detail

PhaseCoherentMerit

public PhaseCoherentMerit(Map 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()
Generates the list of phases we want to observe.

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

getMerit

public double getMerit(ParameterClustering set,
                       TargetDefinition target,
                       Collection ignore,
                       long within)
Calculates the actual time slot merit. The current time is substracted from the first successful observation of the target. The remaining value is used in a multiple Gauss-curve in phase space to calculate a merit.

Specified by:
getMerit in interface Meriting
Parameters:
set - Current observing conditions.
target - The actual target.
ignore - The list of targetes relevant to the actual target.
within - The relevant time span in ms.

getMeritFromNumbers

private double getMeritFromNumbers(double current,
                                   double periodspan,
                                   List<Double> looked,
                                   String debugname)
To test this complicated merit, we have transferred all the calculations into this method that does not need any target descriptions or sets.

Parameters:
current - The time for evaluation.
within - The time span used for evaluation
t0 - The time of the first successful observation, defining the zero point.
times - A list of all successfule observing times without the first

calculate

private double calculate(double phi,
                         double[] ki,
                         double sigma,
                         int sharp)
Calculates the merit at the given phase, which must be between zero and one.

Parameters:
phi - The merit phase
ki - The individual slot coefficients
sigma - Width of individual peak.
sharp - The power in the Hoerl-like function.

isCompleted

public boolean isCompleted(ParameterClustering set,
                           TargetDefinition target)
Check, if the observation is complete. Again, this is done by matching the target number of observations to successful observations at specific phase slots. As this check is done in the merit calculation, this method returns true if the merit vanishes.

Specified by:
isCompleted in interface EndpointDefining