Scripting the Console: basic methods

Running from command line:

java -jar Console.jar script.conscript [arg1 arg2 arg3...]

Running from GUI:

  • Place script in the scripts/ directory. Optionally, add a line at the top of the file prefixed by //#; this will be the title of the menu item assigned to the script
  • The script will appear in the Scripts menu. To rescan the scripts directory, use the “Reload scripts” menu item.

Constants

Orbital elements are stored in double[][] tables of size (nplanets, OESIZE), where OESIZE is a constant representing the number of orbital elements used in the current version of the Console (subject to change in the future).

Each row stores the orbital elements for each planet, and each column represents an element, accessed using one of these predefined numerical constants:

PER, MASS, MA, ECC, LOP, INC, NODE

I/O

I/O can be done with the usual Java I/O classes, or one of these convenience methods:

Screen interaction

output.print(string)
output.println(string)
output.format(format, new Object[] {var1, var2, var3...})
output.pause(prompt)
res = output.yesno(prompt)
res = output.input(prompt, default)

Loading/saving data/fits

  • k.loadData – Loads data specified in a .sys file (star mass, RV data, transits, etc.)
  • k.loadFit/saveFit – Loads (saves) a fit and associated data
  • k.restore/save – Saves the entire current state of the Kernel into a file (binary or XML)
  • k.clone – Returns a copy of the k object, which is independent of the original

RV

Transits

Planets

Integration

Fitting

Error estimation

  • k.errorEst – Estimates uncertainties using bootstrap or MCMC.