|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsystemic.Kernel
public class Kernel
| Field Summary | |
|---|---|
static int |
OESIZE
Number of orbital elements per planet. |
java.lang.Object |
tagData
|
| Constructor Summary | |
|---|---|
Kernel()
|
|
| Method Summary | |
|---|---|
int |
addPlanet(double[] plels)
|
void |
addRVDataSet(double[][] rvSet,
java.lang.String name)
Adds a new RV dataset |
void |
addRVDataSet(java.lang.String fileName)
Adds a new RV dataset from ASCII table fileName. |
boolean |
calculate()
Calculates Chi^2 and residuals for the current fit, given the loaded data. |
void |
clearRVDataSets()
Removes all RV datasets. |
Kernel |
clone()
Creates a new, independent copy of the object. |
KernelList |
errorEst(int method,
int steps,
boolean[][] icFit,
boolean[] voFit,
java.lang.Object[] opts)
Launches one of the error estimation algorithms. |
static double[] |
ftest(Kernel k1,
Kernel k2,
int what)
Computes the result of f-test test for two models, represented by kernel objects k1 and k2 (see Numerical Recipes). |
double[][] |
getAltElements()
Returns an matrix containing extra orbital elements of the system (K, n, a, Ptr, Tperi) for each planet. |
double |
getChiSqr()
Returns the combined (RV + transits) χ^2 (call after calculate()). |
double[] |
getChiSqrAll()
Returns an array of χ^2 statistics. |
boolean |
getCloseEncounter()
Returns true if a close encounter happened during the last integration. |
double[][] |
getCompiledData()
Returns a table containing all the RV datasets compiled with their respective velocity offsets and sorted by JD. |
java.lang.String[] |
getDataNames()
Returns a list of all the loaded RV datasets names. |
java.util.ArrayList<double[][]> |
getDataSets()
Returns a list of all the loaded RV datasets. |
java.util.ArrayList<double[][]> |
getDataSetsCopy()
Returns a copy of all the loaded RV datasets. |
double[] |
getElementColumn(int i)
Returns an array containing the i-th orbital element for all planets. |
double[][] |
getElements()
Returns an matrix containing the orbital elements of the system (P, M, MA, e, LOP, i, node, Rp) for each planet. |
double[] |
getElementsA()
Returns an array containing the orbital elements of the system (P, M, MA, e, LOP, i, node, Rp, ...) for each planet. |
static Kernel |
getGUIState()
If the systemic GUI is open, returns a new independent Kernel object representing the state currently loaded in the GUI (e.g. |
double |
getInitialEpoch()
|
int |
getIntMethod()
Returns the integration method in use |
double |
getJitter()
Returns the required jitter for the current model (call after calculate()). |
double |
getLambda()
Returns the weight factor λ. |
double |
getMstar()
Returns stellar mass (grams) |
java.lang.String[] |
getNames()
|
int |
getNOffsets()
Returns the number of RV datasets currently loaded. |
java.lang.String[] |
getNotes()
|
int |
getNPlanets()
Returns the number of planets in the current system. |
transitsBag |
getObsTransits()
Returns a transitsBag collection containing all loaded transits. |
transitsBag |
getObsTransitsCopy()
Returns a transitsBag collection containing all loaded transits. |
double[][] |
getPowerSpectrum(boolean useWeights)
|
static double[][] |
getPowerSpectrum(double[][] data,
boolean useWeights)
Returns the power spectrum of the given double array. |
double[][] |
getPredRV()
|
transitsBag |
getPredTransits()
|
double[][] |
getPredTrPos()
|
java.lang.String |
getPrimaryTele()
Returns the name of the primary telescope used as global stellar offset. |
double |
getRMS()
Returns the radial velocity RMS for the current model (call after calculate()). |
double[][] |
getRVResiduals()
|
static double[][] |
getSamplingSpectrum(double[][] data)
Returns the power spectrum of the window |
StellarSystem |
getSys()
Undocumented |
SystemData |
getSystemData()
Returns information about the stellar host. |
double[] |
getVoffs()
Returns an array containing the velocity offsets. |
double[][] |
getXYZ()
Returns the current cartesian coordinates. |
double[][] |
getXYZ(boolean cgs)
|
double[][] |
integrate(double startTime,
double endTime,
double dt,
boolean continued)
Integrates a system forward in time. |
double[][] |
integrate(double startTime,
double endTime,
double dt,
boolean continued,
java.lang.Object[] opts)
|
double[][] |
integrateAdv(double startTime,
double endTime,
double dt,
double orbSample,
boolean continued,
java.lang.Object[] options)
UNDOCUMENTED |
transitsBag |
integrateTransits(double startTime,
double endTime,
double dt,
boolean continued)
Returns the predicted transits between startTime and endTime in a transitsBag object. |
boolean |
isCoplanar()
|
boolean |
isFitWithTransits()
Whether the chi^2 budget in calculate() and the minimization routines will include transits. |
boolean |
isPredictTransits()
Whether calculate() will predict transits (getPredTransits() will return the predicted transits within the window of the observed transits). |
boolean |
lm(int[][] icFit,
int[] voFit)
Deprecated. Use minimize(int, boolean[][], boolean[], java.lang.Object[]) instead |
java.lang.Object[][] |
loadCustomIntegrators()
Loads all the integrators specified by integrators.ini |
boolean |
loadData(java.lang.String fileName)
Loads observations (.sys files and associated .vels and .tds files) from fileName. |
boolean |
loadFit(java.lang.String fileNm)
Opens a fit. |
boolean |
loadFit(java.lang.String fileNm,
java.lang.String tab)
UNDOCUMENTED |
java.lang.Object |
minimize(int method,
boolean[][] icFit,
boolean[] voFit,
java.lang.Object[] pars)
Attempts to locate a best-fit model using the current orbital elements as the starting point. |
void |
printElements()
Prints all orbital elements to the standard output. |
void |
printElements(java.io.Writer w)
Prints all orbital elements to the specified Writer object. |
void |
printState()
Prints a summary of the loaded data and orbital elements. |
protected void |
readBinary(java.io.FileInputStream fos)
|
protected void |
readBinary(java.io.FileInputStream fos,
java.io.ObjectInputStream xenc)
|
protected void |
readXML(java.io.FileInputStream fos)
|
protected void |
readXML(java.io.FileInputStream fos,
java.beans.XMLDecoder xenc)
|
protected void |
reduce()
|
void |
restore(java.lang.String fn,
int type)
Restores a Kernel object from a previously saved snapshot (created using save()) |
MCMC |
sa(int steps,
double T,
double alpha,
boolean[][] icFit,
boolean[] voFit,
double[] bm,
double[] bmv,
double[] cmin,
double[] cmax,
java.lang.Object[] pars)
Deprecated. Use minimize(int, boolean[][], boolean[], java.lang.Object[]) instead |
void |
save(java.lang.String fn,
int type)
Saves the entire state of the Kernel object into a file. |
protected void |
saveBinary(java.io.FileOutputStream fos)
|
protected void |
saveBinary(java.io.FileOutputStream fos,
java.io.ObjectOutputStream xenc)
|
protected void |
saveXML(java.io.FileOutputStream fos)
|
protected void |
saveXML(java.io.FileOutputStream fos,
java.beans.XMLEncoder xenc)
|
void |
setCartesian(double[][] xyzEls)
|
void |
setCoplanar(boolean c)
|
void |
setElements(double[][] elements)
Sets the orbital elements of the system for each planet (see getElements for description). |
void |
setFitWithTransits(boolean fitWithTransits)
Sets whether the chi^2 budget in calculate() and the minimization routines will include transits. |
void |
setInitialEpoch(double epoch)
Sets the epoch for the orbital elements. |
void |
setIntMethod(int integrationMethod)
Sets the integration method used by all the methods in this class. |
void |
setLambda(double lambda)
Sets the weight factor for χ^2_TR: χ^2 = 1/NDATA (χ^2_RV + λχ^2_TR). |
void |
setMstar(double starMass)
Sets stellar mass (grams). |
void |
setNames(java.lang.String[] planetNames)
|
void |
setNotes(java.lang.String[] planetNotes)
|
void |
setObsTransits(java.lang.String fileName,
int flag)
Loads a transitsBag collection of transits from a file. |
void |
setObsTransits(transitsBag tr)
Loads a transitsBag collection of transits. |
void |
setPredictTransits(boolean predictTransits)
Activates transit prediction when calculate() is called. |
void |
setPrimaryTele(java.lang.String primaryTele)
Sets the name of the primary telescope used as global stellar offset. |
void |
setSystemData(SystemData data)
|
void |
setTransitingPlanet(int tp)
Sets the transiting planet. |
Bootstrap |
setupBootstrap(int steps)
Deprecated. (use errorEst(int, int, boolean[][], boolean[], java.lang.Object[]) instead) |
void |
setVoffs(double[] vOffsets)
Sets the velocity offsets for each RV dataset. |
void |
sortElements()
|
void |
sortElementsByPnum()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.Object tagData
public static int OESIZE
| Constructor Detail |
|---|
public Kernel()
| Method Detail |
|---|
public boolean isPredictTransits()
public static Kernel getGUIState()
public void save(java.lang.String fn,
int type)
throws java.io.FileNotFoundException,
java.io.IOException
fn - Name of the filetype - 0 -> binary format, 1 -> XML
java.io.FileNotFoundException
java.io.IOException
protected void saveBinary(java.io.FileOutputStream fos)
throws java.io.IOException
java.io.IOExceptionprotected void reduce()
protected void saveBinary(java.io.FileOutputStream fos,
java.io.ObjectOutputStream xenc)
throws java.io.IOException
java.io.IOExceptionprotected void saveXML(java.io.FileOutputStream fos)
protected void saveXML(java.io.FileOutputStream fos,
java.beans.XMLEncoder xenc)
protected void readXML(java.io.FileInputStream fos)
protected void readXML(java.io.FileInputStream fos,
java.beans.XMLDecoder xenc)
protected void readBinary(java.io.FileInputStream fos)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected void readBinary(java.io.FileInputStream fos,
java.io.ObjectInputStream xenc)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void restore(java.lang.String fn,
int type)
throws java.io.FileNotFoundException,
java.io.IOException,
java.lang.ClassNotFoundException
fn - File nametype - type of the snapshot (0 = binary, 1 = XML)
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundExceptionpublic void setPredictTransits(boolean predictTransits)
predictTransits - public java.lang.String getPrimaryTele()
public void setPrimaryTele(java.lang.String primaryTele)
primaryTele - String indicating the name of the primary telescope (must be
equal to one of the strings returned by getDataNames())
public static double[] ftest(Kernel k1,
Kernel k2,
int what)
k1 - First modelk2 - Second modelwhat - public double getInitialEpoch()
public int getIntMethod()
public void setInitialEpoch(double epoch)
epoch - in JD.public boolean isFitWithTransits()
public void setFitWithTransits(boolean fitWithTransits)
fitWithTransits - public double[][] getElements()
public double[][] getAltElements()
public double[] getElementsA()
public double[] getElementColumn(int i)
i - column number (see getElements)
public double[] getVoffs()
public void setElements(double[][] elements)
elements - the matrixpublic void setCartesian(double[][] xyzEls)
public void sortElements()
public void sortElementsByPnum()
public void setNames(java.lang.String[] planetNames)
public java.lang.String[] getNames()
public void setNotes(java.lang.String[] planetNotes)
public java.lang.String[] getNotes()
public void setVoffs(double[] vOffsets)
vOffsets - public void setMstar(double starMass)
starMass - (grams)public double getMstar()
public void setIntMethod(int integrationMethod)
integrationMethod - public int getNOffsets()
public int getNPlanets()
public SystemData getSystemData()
public void setSystemData(SystemData data)
public boolean loadData(java.lang.String fileName)
fileName - the path of the .sys file
public static double[][] getPowerSpectrum(double[][] data,
boolean useWeights)
data - (time, measurement, error)useWeights - include RV errors in the calculation
public static double[][] getSamplingSpectrum(double[][] data)
data -
public double[][] getPowerSpectrum(boolean useWeights)
useWeights -
public StellarSystem getSys()
public double[][] integrate(double startTime,
double endTime,
double dt,
boolean continued)
startTime - endTime - dt - (only for RK -- for other integrators stepsize is determined automatically)continued -
public double[][] integrate(double startTime,
double endTime,
double dt,
boolean continued,
java.lang.Object[] opts)
public double[][] integrateAdv(double startTime,
double endTime,
double dt,
double orbSample,
boolean continued,
java.lang.Object[] options)
startTime - endTime - dt - orbSample - continued - options -
public void setTransitingPlanet(int tp)
tp -
public transitsBag integrateTransits(double startTime,
double endTime,
double dt,
boolean continued)
startTime - endTime - dt - continued -
public double[][] getXYZ()
public double[][] getXYZ(boolean cgs)
public boolean loadFit(java.lang.String fileNm)
fileNm -
public boolean loadFit(java.lang.String fileNm,
java.lang.String tab)
fileNm - tab -
public void printElements()
public void printElements(java.io.Writer w)
throws java.io.IOException
java.io.IOExceptionpublic void printState()
public final int addPlanet(double[] plels)
public void addRVDataSet(double[][] rvSet,
java.lang.String name)
rvSet - table of RVs; each row contains time, RV and sigma.name - public final void addRVDataSet(java.lang.String fileName)
| JD | Date of measurement [JD] |
|---|---|
| RV | Radial velocity measurement [m/s] |
| sigma | Sigma of measurement [m/s] |
fileName - ASCII table containing a RV datasetpublic final void clearRVDataSets()
public final Bootstrap setupBootstrap(int steps)
errorEst(int, int, boolean[][], boolean[], java.lang.Object[]) instead)
steps -
public final KernelList errorEst(int method,
int steps,
boolean[][] icFit,
boolean[] voFit,
java.lang.Object[] opts)
method - 0 = bootstrap, 1 = MCMCsteps - number of models to be computedicFit - boolean matrix of size npl x OESIZE; elements set to false correspond to
orbital elements to keep fixed.voFit - boolean array of size ndatasets, as above.opts - Array of property Name/Value pairs:
| BOOTSTRAP | |
| BURN | (int) number of models to use for burn-in |
| TRIALS | (int) number of trial fits to compute for each bootstrap realization; to be used in conjunction with BURN |
public final double[][] getCompiledData()
public final boolean calculate()
public boolean getCloseEncounter()
public void setCoplanar(boolean c)
public boolean isCoplanar()
public java.lang.Object minimize(int method,
boolean[][] icFit,
boolean[] voFit,
java.lang.Object[] pars)
method - (0 = Levenberg-Marquardt, 1 = Simulated annealing, 2 = AMOEBA)icFit - boolean matrix of size npl x OESIZE; elements set to true correspond to
orbital elements to minimize on.voFit - boolean array of size ndatasets, as above.pars - Array of property Name/Value pairs:
| SIMULATED ANNEALING | |
| "STEPS" | (integer) Number of iterations |
| "T" | (double) initial temperature |
| "ALPHA" | (double) slope of temperature scheduler function |
| "BM" | (double[]) flat array of length npl x OESIZE; each element corresponds to the βμ (characteristic step size) for the orbital element. |
| "BMV" | (double[]) flat array of length ndata, as above. |
| "CMIN"/"CMAX" | (double[]) flat array of length npl x OESIZE; gives min/max constraint for the corresponding orbital element. A value of Double.NaN implies no constraint. |
| "LOG" | (boolean[]) flat array of length npl x OESIZE; each element set to true implies the step will be logarithmic for the corresponding orbital element |
| AMOEBA | |
| "MAXITER" | (double) maximum number of iterations |
Example:
kernel.minimize(1, icFit, voFit, new Object[] { "STEPS", 1000, "ALPHA", 1., "BM", bm });
public MCMC sa(int steps,
double T,
double alpha,
boolean[][] icFit,
boolean[] voFit,
double[] bm,
double[] bmv,
double[] cmin,
double[] cmax,
java.lang.Object[] pars)
minimize(int, boolean[][], boolean[], java.lang.Object[]) instead
steps - T - alpha - icFit - voFit - bm - bmv - cmin - cmax - pars -
public boolean lm(int[][] icFit,
int[] voFit)
minimize(int, boolean[][], boolean[], java.lang.Object[]) instead
icFit - voFit - public transitsBag getObsTransits()
public transitsBag getObsTransitsCopy()
public java.util.ArrayList<double[][]> getDataSets()
public java.lang.String[] getDataNames()
public java.util.ArrayList<double[][]> getDataSetsCopy()
public void setObsTransits(transitsBag tr)
tr - transitsBag collection.
public void setObsTransits(java.lang.String fileName,
int flag)
fileName - table of central transits (in the format JD sigma flag, where
flag = 1 for primary transit or 2 for secondary eclipse).flag - reserved for future usepublic double[][] getPredRV()
public double[][] getPredTrPos()
public transitsBag getPredTransits()
public double[][] getRVResiduals()
public final double getChiSqr()
public final double getRMS()
public final double getJitter()
public final double[] getChiSqrAll()
public void setLambda(double lambda)
lambda - public double getLambda()
public Kernel clone()
clone in class java.lang.Objectpublic java.lang.Object[][] loadCustomIntegrators()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||