DB’s modeling code Tools

Input/Output

moana.dbc.tools.custom_floor(a, precision=0)[source]

Truncate a number at a given digit.

Parameters:
  • a (float) – number to be truncated.

  • precision (int) – precision.

Returns:

Truncated float of a.

Return type:

float

moana.dbc.tools.from_parfile(filename, path='./')[source]

Load instrument properties from a ‘par’ file.

Parameters:
  • filename (str) – name of the parfile.

  • path (str) – path to the parfile

Returns:

A moana.dbc.Dataset object.

Return type:

Dataset

moana.dbc.tools.mass_fration_to_mass_ratio(x)[source]

Compute the planet mass ratio from planet mass ratio.

Parameters:

x (float) – mass fraction. For a two-body problem with masses M1 and M2, the mass fraction is x = M2 / (M1 + M2), with M2 < M1.

Returns:

The corresponding mass ratio, i.e., M2/M1, with M2 < M1.

Return type:

float

Dataset

class moana.dbc.instruments.Dataset(dataset, path='.')[source]

Bases: object

Load and store information about instruments, telescopes and filters.

Parameters:
  • dataset (str) – name of the dataset.

  • path (str) – path to the dataset.

Examples:

If dataset=’OB151670’, then the class loads the file ‘parOB151670’, and the instruments properties are stored in the attribute DBDataset.instruments. The observations files are, for example, OB151670.ogle.

>>> from moana.dataset import Dataset
>>> parfile = Dataset('OB151670')
instruments

pandas.DataFrame with all the parameters of each instrument. Keywords are the same as in the par* files.

Output files

class moana.dbc.io.Output(run, path='./', **kwargs)[source]

Bases: object

Class that load a model, the corresponding data and residuals.

Parameters:
  • run (str) – name of the run for which the files should be loaded.

  • path (str) – path to the output files.

idx_data

line number (int) of the first data in resid file.

param

pandas.Series with model parameters, including flux.

resid

pandas.DataFrame of the data.

compare(model)[source]
load(resid=True, model=True)[source]

Method that load the output files.