stella.xml
Class PhaseFillerMerit

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.PhaseFillerMerit
All Implemented Interfaces:
Serializable, Cloneable, EndpointDefining, Meriting, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class PhaseFillerMerit
extends AbstractPhaseMerit
implements EndpointDefining

A class that tries to match observations such, that phase gaps are minimized. It is intended for targets that have an unknown period at observation start, but later, when a period has been established, the gaps in phase space are gradually filled. For that, we do the following: The current number of successful observations is used to construct a number of phase slots in a way that the number of slots exceeds the number of successful observations by at least one, but not more than KEY_PHASESLOTS. On all these phase slots, that have already a successful observation in it, the corresponding merit is set to zero. If an observation is timed to fall in a non-null phase slot, a gaussian peaking at the center of the slot and having a full-width half maximum according to KEY_PHASEFWHM (in multiples of slot width) is evaluated. The maximum merit is one.
The merit is end-point defining either if the maximum number of observation has been reached, KEY_MAXOBS, and the number of open slots is less then KEY_PHASESLOTS. If the phase uncertainty exceeds the current slot width, the endpoint is also reached. Zero in KEY_MAXOBS means unlimited number of observations.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static int DEFMAXOBS
          Default unlimited number of observations.
private static double DEFPHASEFWHM
          Default value for the width in phase space.
private static double DEFPHASESHIFT
          Default maximum phase shift.
private static int DEFPHASESLOTS
          Default increase in phase slots.
static String KEY_MAXOBS
          Observe at these distinct phases.
static String KEY_PHASEFWHM
          The key linked to FWHM of the observation intervall in phase space.
static String KEY_PHASESHIFT
          If the uncertainty shifts the phase more than this, we stop.
static String KEY_PHASESLOTS
          The number of phase points to observe.
static String KEY_UNCERTAINTY
          If set, the uncertainty in the period as a fraction of the period.
private  double[] phases
          The list of phases we want to observe at.
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
PhaseFillerMerit(Map<String,String> prop)
          Constructs a phase-coherent merit.
 
Method Summary
private  void clearPhases(HistoryAware target, int back)
          Grabs a target and goes backward through its success list, deleting on the way all phases already observed.
private static double forPhase(double phase, double peak, double sig)
          Calculates the merit at the current phase for the given peak location and shape.
 double getMerit(ParameterClustering set, TargetDefinition target, Collection ignore, long within)
          Calculates the actual time slot merit.
 boolean isCompleted(ParameterClustering set, TargetDefinition target)
          Check, if the observation is complete, which is the case if the number of unfilled period slots is less then KEY_PHASESLOTS and if the total number of successful observations is at least equal to KEY_MAXOBS.
private  boolean uncertainty(ParameterClustering set, TargetDefinition target)
          Return true if the relative phase shift exceed the limit.
 
Methods inherited from class stella.xml.AbstractPhaseMerit
getDaysSinceT0, getHjd, getHjd, getPhase, getPhase, getT0, init
 
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_PHASESLOTS

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

See Also:
Constant Field Values

KEY_MAXOBS

public static final String KEY_MAXOBS
Observe at these distinct phases.

See Also:
Constant Field Values

KEY_UNCERTAINTY

public static final String KEY_UNCERTAINTY
If set, the uncertainty in the period as a fraction of the period.

See Also:
Constant Field Values

KEY_PHASESHIFT

public static final String KEY_PHASESHIFT
If the uncertainty shifts the phase more than this, we stop.

See Also:
Constant Field Values

KEY_PHASEFWHM

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

See Also:
Constant Field Values

DEFPHASESLOTS

private static final int DEFPHASESLOTS
Default increase in phase slots.

See Also:
Constant Field Values

DEFMAXOBS

private static final int DEFMAXOBS
Default unlimited number of observations.

See Also:
Constant Field Values

DEFPHASEFWHM

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

See Also:
Constant Field Values

DEFPHASESHIFT

private static final double DEFPHASESHIFT
Default maximum phase shift.

See Also:
Constant Field Values

phases

private double[] phases
The list of phases we want to observe at.

Constructor Detail

PhaseFillerMerit

public PhaseFillerMerit(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

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.

clearPhases

private void clearPhases(HistoryAware target,
                         int back)
Grabs a target and goes backward through its success list, deleting on the way all phases already observed. The caller ensures that we have at least the number of successful observations requested for deletion.


forPhase

private static final double forPhase(double phase,
                                     double peak,
                                     double sig)
Calculates the merit at the current phase for the given peak location and shape.

Parameters:
phase - The merit phase
peak - The individual phase peak.
sigma - Width of individual peak.

isCompleted

public boolean isCompleted(ParameterClustering set,
                           TargetDefinition target)
Check, if the observation is complete, which is the case if the number of unfilled period slots is less then KEY_PHASESLOTS and if the total number of successful observations is at least equal to KEY_MAXOBS. If maxobs is zero, the only completeness criterium is the uncertainty criterium (which may also stop observations if maxobs is not reached): This is done by matching the phase shift due to period uncertainties to the maximum allowed phase shift.

Specified by:
isCompleted in interface EndpointDefining

uncertainty

private boolean uncertainty(ParameterClustering set,
                            TargetDefinition target)
Return true if the relative phase shift exceed the limit.