astro
Class OrbitFit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by vec_math.AbstractFit
                  extended by astro.OrbitFit
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, ModelFitting

public class OrbitFit
extends AbstractFit

An orbit analyser takes radial velocity data and fits an orbit to it. The parameter supplied from the outside is the orbital period, denoted in KEY_PERIOD. On #process, it tries to solve for the orbit, returning the orbit solution at the input times. On visualization, the orbit solution is returned, which is further processed in metadata like in the parental class.

Additionally, the orbit analyser is a function, allowing the calculation of the radial velocity as a function of time once the orbit has been solved.


Nested Class Summary
static class OrbitFit.File
          Reads the rv from a file.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String BARYCENTER
          The name of the barycenter radial velocity.
private static double DEFDERIVATIVE
          If true, use levenberg-marquardt.
private static double DEFPERIOD
          We have to set the period to some default value.
private static String DEFUNITAMPLITUDE
          Default unit.
private static String DEFUNITBARYCENTER
          Default unit.
private static String DEFUNITE
          Default unit.
private static String DEFUNITPERIOD
          Default unit.
private static String DEFUNITPLENGTH
          Default unit.
private static String DEFUNITPTIME
          Default unit.
static String ECCENTRICITY
          The eccentricity of the orbit.
static String KEY_DERIVATIVE
          If harmonic error less, use levenberg-marquardt.
static String KEY_EPSILON
          Default improvement in chi-2 to induce terminating loop.
static String KEY_EXTERNALERROR
          Default external error.
static String KEY_ITER
          Default number of maximum iteration in levenberg-marquardt.
static String KEY_LAMBDA
          Default starting value for the 'fudge factor' boosting hessian.
static String KEY_PERIOD
          This is the main fitting parameter.
static String KEY_TERMINATE
          Default number of maximum improvements, if epsilon is reached.
static String KEY_UNITAMPLITUDE
          Default unit.
static String KEY_UNITBARYCENTER
          Default unit.
static String KEY_UNITE
          Default unit.
static String KEY_UNITPERIOD
          Default unit.
static String KEY_UNITPLENGTH
          Default unit.
static String KEY_UNITPTIME
          Default unit.
private  OrbitModel model
          The data model.
private  List<Variable> orbit
          After successfully solving for the orbit, this is the model fit.
static String PERIHELIONLENGTH
          The name of the length of perihelion constant.
static String PERIHELIONTIME
          The name of the time of perihelion passage constant.
static String PERIOD
          period constant.
static String RMS
          The rms of the solution.
static String RVAMPLITUDE
          The name of the radial velocity amplitude.
 
Fields inherited from class vec_math.AbstractFit
KEY_DEFAULTERROR, KEY_DEFAULTFORMAT, KEY_ERRORFORMAT, KEY_PARAMETERFORMAT
 
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
OrbitFit(Map<String,String> prop)
          An illegal period is the starting value, to determine correct usage.
 
Method Summary
 List<Variable> fit()
          The fit to the orbit data depends from a good estimate of the period.
 DataModel getDataModel()
          Returns the phase model.
 List<Variable> getFittedParameters()
          Returns the fitted parameters.
 DataModel prepareFit(VectorG[] in)
          We try to solve for the orbit, if the period set in the properties is a valid choice.
 boolean setInitialCondition(Variable p)
          We need the period as an initial condition.
 
Methods inherited from class vec_math.AbstractFit
formatError, formatValue, getChi2, getModelParameterErrors, getModelParameterValues, getR2, getRms, init, qualityOfFit, setConstant
 
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 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

PERIHELIONTIME

public static final String PERIHELIONTIME
The name of the time of perihelion passage constant.

See Also:
Constant Field Values

PERIOD

public static final String PERIOD
period constant.

See Also:
Constant Field Values

ECCENTRICITY

public static final String ECCENTRICITY
The eccentricity of the orbit.

See Also:
Constant Field Values

PERIHELIONLENGTH

public static final String PERIHELIONLENGTH
The name of the length of perihelion constant.

See Also:
Constant Field Values

RVAMPLITUDE

public static final String RVAMPLITUDE
The name of the radial velocity amplitude.

See Also:
Constant Field Values

BARYCENTER

public static final String BARYCENTER
The name of the barycenter radial velocity.

See Also:
Constant Field Values

RMS

public static final String RMS
The rms of the solution.

See Also:
Constant Field Values

KEY_PERIOD

public static final String KEY_PERIOD
This is the main fitting parameter.

See Also:
Constant Field Values

KEY_ITER

public static final String KEY_ITER
Default number of maximum iteration in levenberg-marquardt.

See Also:
Constant Field Values

KEY_TERMINATE

public static final String KEY_TERMINATE
Default number of maximum improvements, if epsilon is reached.

See Also:
Constant Field Values

KEY_EPSILON

public static final String KEY_EPSILON
Default improvement in chi-2 to induce terminating loop.

See Also:
Constant Field Values

KEY_LAMBDA

public static final String KEY_LAMBDA
Default starting value for the 'fudge factor' boosting hessian.

See Also:
Constant Field Values

KEY_DERIVATIVE

public static final String KEY_DERIVATIVE
If harmonic error less, use levenberg-marquardt.

See Also:
Constant Field Values

KEY_UNITPTIME

public static final String KEY_UNITPTIME
Default unit.

See Also:
Constant Field Values

KEY_UNITPERIOD

public static final String KEY_UNITPERIOD
Default unit.

See Also:
Constant Field Values

KEY_UNITE

public static final String KEY_UNITE
Default unit.

See Also:
Constant Field Values

KEY_UNITPLENGTH

public static final String KEY_UNITPLENGTH
Default unit.

See Also:
Constant Field Values

KEY_UNITAMPLITUDE

public static final String KEY_UNITAMPLITUDE
Default unit.

See Also:
Constant Field Values

KEY_UNITBARYCENTER

public static final String KEY_UNITBARYCENTER
Default unit.

See Also:
Constant Field Values

KEY_EXTERNALERROR

public static final String KEY_EXTERNALERROR
Default external error.

See Also:
Constant Field Values

DEFPERIOD

private static final double DEFPERIOD
We have to set the period to some default value.

See Also:
Constant Field Values

DEFDERIVATIVE

private static final double DEFDERIVATIVE
If true, use levenberg-marquardt.

See Also:
Constant Field Values

DEFUNITPTIME

private static final String DEFUNITPTIME
Default unit.

See Also:
Constant Field Values

DEFUNITPERIOD

private static final String DEFUNITPERIOD
Default unit.

See Also:
Constant Field Values

DEFUNITE

private static final String DEFUNITE
Default unit.

See Also:
Constant Field Values

DEFUNITPLENGTH

private static final String DEFUNITPLENGTH
Default unit.

See Also:
Constant Field Values

DEFUNITAMPLITUDE

private static final String DEFUNITAMPLITUDE
Default unit.

See Also:
Constant Field Values

DEFUNITBARYCENTER

private static final String DEFUNITBARYCENTER
Default unit.

See Also:
Constant Field Values

model

private OrbitModel model
The data model.


orbit

private List<Variable> orbit
After successfully solving for the orbit, this is the model fit.

Constructor Detail

OrbitFit

public OrbitFit(Map<String,String> prop)
An illegal period is the starting value, to determine correct usage.

Method Detail

setInitialCondition

public boolean setInitialCondition(Variable p)
We need the period as an initial condition.

Specified by:
setInitialCondition in interface ModelFitting
Overrides:
setInitialCondition in class AbstractFit
Returns:
false, if the initial condition does not apply to this model.

prepareFit

public DataModel prepareFit(VectorG[] in)
We try to solve for the orbit, if the period set in the properties is a valid choice.

Parameters:
in - All measures as a time-to-rv-with-error Vector3D array.
Returns:
The rv from the model solution.

fit

public List<Variable> fit()
The fit to the orbit data depends from a good estimate of the period. The period must be set from outside as an initial Condition, or it might be present in the properties of the fitter.
The fit is done in a two-folded approach. First, additional starting values are obtained by fitting a circular orbit to the data. From that, we get the barycentric velocity, the rv amplitude and the length of the perihelion, if we assume perihelion passage time equal to observing time average. If the circular fit was good enough (determined by compring its RMS to the KEY_DERIVATIVE value, we first try a Levenberg-Marquardt solver on the full orbital model, and return, if this converges. If not, or if the RMS of the circular solution was too big, we solve with an Amoeba (Simplex search). The error in the fitted parameters returned are the diagonal elements of the covariance matrix, which is only a very crude estimate of the errors.

Returns:
Non-null, if a fit could be obtained.

getDataModel

public DataModel getDataModel()
Returns the phase model.


getFittedParameters

public List<Variable> getFittedParameters()
Returns the fitted parameters.