Skip to content

Input data

João Faria edited this page May 22, 2019 · 4 revisions

kima fits Keplerian curves to a set of RV measurements.
It does it very well (in our unbiased opinion 😊), but that's all it does. Here is how to provide it with input data.

Single instrument data

By default, the inputs to kima are timeseries of RV measurements.
A typical RV data file will have three columns

time   RV   RVerror
...    ...  ...

These columns can be space (), TAB (), or comma (,) separated.
(you can even mix separators in the same file! but why would you?)
The file can actually have more columns; kima will read the first 3.

Regarding units, the times should be in days. The RVs and RV errors can either be given in m/s or in km/s, but both should be in the same units. In the kima_setup.cpp file, you'll need to set the units as an option to the load function:

// either
load(datafile, "ms", 0);
// or
load(datafile, "kms", 0);

The third (optional) argument to the load function tell kima how many lines to skip in the header of the file. The default is 2.

Multi instrument

In multi instrument mode (when multi_instrument = true), kima can load RV data from more than one instrument. There are two options:

  • one single file with a fourth column indicating the instrument
  • multiple files, one for each instrument

With the first option, kima expects a file like this

time   RV   RVerror inst
...    ...  ...     ...

where the fourth column should have integer numbers identifying the instruments.

If using multiple files, all of them should have the same 3-column structure.

To load the data in multi instrument mode use the load_multi function

datafiles = {"file1", "file2"};
load_multi(datafiles, "ms", 2);

// OR (don't do both!)

datafile = "file3_4columns.txt";
load_multi(datafile, "ms", 1);

For more details, check out the multi_instrument example here.

Activity correlations

A brand-new feature is the ability to consider linear correlations with activity indicators, such as CCF indicators or spectral indices. To do this, kima needs to read an extra timeseries (or multiple timeseries) of the same size as the RV data.

Imagine a data file structured like this

time   RV   RVerror bis  a   b   fwhm
...    ...  ...     ...  ... ... ...

where the columns bis and fwhm represent the activity indicators we are interested in including in the model. The a and b columns are to be ignored. Using the load function, we can write

datafile = "file.txt";

indicators = {"BISECTOR", "", "", "fwhm"};

load(datafile, "ms", 1, indicators);

The indicators vector contains the names of the activity indicators we want to use. As you can see, these don't necessarily need to match the column names! When you need to skip a column in the file, just add a "" to the vector.

Note that setting the vector like this

indicators = {"BISECTOR", "", ""};
indicators = {"BISECTOR"};
indicators = {"bis"};

would ignore the fwhm column.

As of kima v3, the use of activity correlations is still experimental.


In the future, kima might be able to use other kinds of data, but for now these are the options.
Feel free to contribute to help us with the development. Any help is greatly appreciated.