systemic
Class KernelList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Kernel>
              extended by systemic.KernelList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Kernel>, java.util.Collection<Kernel>, java.util.List<Kernel>, java.util.RandomAccess

public class KernelList
extends java.util.ArrayList<Kernel>

A collection of Kernel objects, usually representing the output of bootstrap or MCMC. Each Kernel object may contain orbital elements corresponding to the element of a particular chain.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
KernelList()
           
 
Method Summary
 Kernel average()
          Returns a Kernel, the orbital elements (and voffs) of which represent the average (set by setAverageType(int)) of the corresponding orbital element.
 KernelList clone()
          Returns a clone of the list.
 java.util.ArrayList<double[][]> getAllElements()
          Returns an ArrayList containing the orbital elements of each item.
 int getAverageType()
          Returns the current numerical average (0 = mean, 1 = median).
 int getNOffsets()
          Returns the number of offsets in each Kernel
 int getNPlanets()
          Returns the number of planets in each Kernel
 double[] getParSlice(int index, java.lang.String what)
          Returns an array of doubles with the parameters derived for each model for planet index / offset index
 Kernel percentile(double p)
           
 java.lang.Object[] predictTransits(double time1, double time2, int intMethod)
           
 void printSummary()
          Prints a summary table to the standard output.
protected  void readBinary(java.io.FileInputStream fos)
           
protected  void readXML(java.io.FileInputStream fos)
           
 void reduce()
          Reduces the size in memory (and on disk) of the Kernel list, losing some data (e.g.
 void restore(java.lang.String fn, int type)
          Reads the contents of a previously saved Kernel list, in binary (type = 0) or XML (type = 1) format.
 void save(java.lang.String fn, int type)
          Saves the list to a file, using a binary (type = 0) or XML (type = 1) format.
protected  void saveBinary(java.io.FileOutputStream fos)
           
protected  void saveXML(java.io.FileOutputStream fos)
           
 void setAverageType(int averageType)
          Sets the numerical average (0 = mean, 1 = median)
 Kernel stdDev()
          Returns a Kernel, the orbital elements (and voffs) of which represent the standard deviation of the corresponding orbital element.
 KernelList subset(int step)
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

KernelList

public KernelList()
Method Detail

save

public void save(java.lang.String fn,
                 int type)
          throws java.io.FileNotFoundException,
                 java.io.IOException
Saves the list to a file, using a binary (type = 0) or XML (type = 1) format.

Parameters:
fn - File path
type - Output format
Throws:
java.io.FileNotFoundException
java.io.IOException

saveBinary

protected void saveBinary(java.io.FileOutputStream fos)
                   throws java.io.IOException
Throws:
java.io.IOException

saveXML

protected void saveXML(java.io.FileOutputStream fos)
                throws java.io.IOException
Throws:
java.io.IOException

readXML

protected void readXML(java.io.FileInputStream fos)

readBinary

protected void readBinary(java.io.FileInputStream fos)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

restore

public void restore(java.lang.String fn,
                    int type)
             throws java.io.FileNotFoundException,
                    java.io.IOException,
                    java.lang.ClassNotFoundException
Reads the contents of a previously saved Kernel list, in binary (type = 0) or XML (type = 1) format.

Parameters:
fn - Path of file to be read.
type - File format.
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

printSummary

public void printSummary()
Prints a summary table to the standard output.


getAverageType

public int getAverageType()
Returns the current numerical average (0 = mean, 1 = median).

Returns:

setAverageType

public void setAverageType(int averageType)
Sets the numerical average (0 = mean, 1 = median)

Parameters:
averageType -

getNOffsets

public int getNOffsets()
Returns the number of offsets in each Kernel

Returns:

getNPlanets

public int getNPlanets()
Returns the number of planets in each Kernel

Returns:

reduce

public void reduce()
Reduces the size in memory (and on disk) of the Kernel list, losing some data (e.g. RV/transits data generated from bootstrap).


clone

public KernelList clone()
Returns a clone of the list.

Overrides:
clone in class java.util.ArrayList<Kernel>
Returns:

getAllElements

public java.util.ArrayList<double[][]> getAllElements()
Returns an ArrayList containing the orbital elements of each item.

Returns:

stdDev

public Kernel stdDev()
Returns a Kernel, the orbital elements (and voffs) of which represent the standard deviation of the corresponding orbital element.

Returns:

average

public Kernel average()
Returns a Kernel, the orbital elements (and voffs) of which represent the average (set by setAverageType(int)) of the corresponding orbital element.

Returns:

percentile

public Kernel percentile(double p)
Parameters:
p -
Returns:

subset

public KernelList subset(int step)
Parameters:
step -
Returns:

getParSlice

public double[] getParSlice(int index,
                            java.lang.String what)
Returns an array of doubles with the parameters derived for each model for planet index / offset index

Parameters:
index -
what - is one of: "P", "M", "e", "MA", "LOP", "INC", "NODE", "OFFS"
Returns:

predictTransits

public java.lang.Object[] predictTransits(double time1,
                                          double time2,
                                          int intMethod)
Parameters:
time1 -
time2 -
intMethod -
Returns: