Welcome to The Exoplanet Simple Orbit Fitting Toolbox “model“‘s documentation!

Contents:

Examples to show how to use ExoSOFTmodel

Contents:

The primary objects/classes and likelihood function for ExoSOFTmodel

Contents:

class ExoSOFTmodel.model.ExoSOFTdata(epochs_di, epochs_rv, rapa, rapa_err, decsa, decsa_err, rv, rv_err, rv_inst_num, data_mode, pasa=False)[source]

Bases: object

An object to contain all the necessary data arrays and parameters to calculate matching predicted data with the model. All member variables will remain constant throughout.

Notes: -Except for rv_inst_num array, all other arrays must be ndarrays of double

precision floating point numbers (dtype=np.dtype(‘d’)).

-Arrays, epochs_di, rapa, rapa_err, decsa, and decsa_err must all have same length. -Arrays, epochs_rv, rv, rv_err and rv_inst_num must all have same length.

Inputs: rv_inst_num = ndarray of positive signed or unsigned integers, of same length

as epochs_rv, rv, and rv_err.
class ExoSOFTmodel.model.ExoSOFTmodel(sd)[source]

Bases: object

class ExoSOFTmodel.model.ExoSOFTparams(omega_offset_di, omega_offset_rv, vary_tc, tc_equal_to, di_only, low_ecc, range_maxs, range_mins, num_offsets)[source]

Bases: object

  Directly Varried Model Inputs Stored Parameters  
  direct_pars model_in_pars stored_pars  
i Parameter Parameter Parameter units
0 Mass of Primary (m1) m1 m1 Msun

.$$ FILL THIS OUT!!!!

check_range()[source]

Determine if all parameters in the full list are within their allowed ranges. Range arrays corrispond to parameters in: [m1, m2, parallax, long_an, e, to/tc, p, inc, arg_peri, v1,v2,...]

make_model_in()[source]

Convert directly varied parameters into a comprehensive list of those used ans inputs to during model calculations.

model_in_params: [m1,m2,parallax,long_an,e,to,tc,p,inc,arg_peri,arg_peri_di,arg_peri_rv,a_tot_au,K]

make_stored(chi_squared)[source]

Push values in model_in_params, offsets and the resulting chi_squared_3d into an array to be stored on disk during ExoSOFT. Not sure how to make this work with emcee or other tools...

stored_to_direct(pars)[source]

take a set of parameters matching ‘stored_pars’ and make the directly varied versions matching ‘direct_pars’. Note: direct_pars: [m1,m2,parallax,long_an,e OR sqrt(e)*sin(arg_peri),to/tc,p,inc,arg_peri OR sqrt(e)*cos(arg_peri),v1,v2...] stored_pars: [m1,m2,parallax,long_an,e,to,tc,p,inc,arg_peri,a_tot_au,chi_sqr,K,v1,v2...]

ExoSOFTmodel.model.ln_posterior(pars, Model)[source]

Calculates the likelihood for a given set of inputs. Then calculate the natural logarithm of the posterior probability.

-Model is of type ExoSOFTmodel. Currently just holds resulting fit values. -Data is of type ExoSOFTdata, containing all input data and params to produce predicted values of matching units, and arrays for predicted values. -Params is of type ExoSOFTparams, an class containing functions for calculating versions of the ‘pars’ used as model inputs, and a version that would be for storing to disk when ran in ExoSOFT. -Priors is of type ExoSOFTpriors, containing funtions for each parameter’s prior, a function calculate combined prior given list of params, and any variables necessary for those calculations.

Cython tools for ExoSOFTmodel

Contents:

Priors for ExoSOFTmodel

Contents:

class ExoSOFTmodel.priors.ExoSOFTpriors(ecc_prior=True, p_prior=True, inc_prior=True, m1_prior=True, m2_prior=True, para_prior=True, inc_min=0.0, inc_max=180.0, p_min=0.0, p_max=300.0, para_est=0, para_err=0, m1_est=0, m1_err=0, m2_est=0, m2_err=0)[source]

Bases: object

Choices: inclination: (None,True,’sin’,’cos’) True indicates default of ‘sin’ eccentricity: (None,True) True indicates default of ‘2e’ period: (None,True) True indicates default of ‘log’ mass of primary: (None,True,’IMF’,’PDMF’) True indicates default of ‘PDMF’ mass of companion: (None,True, ‘IMF’,’PDMF’,’CMF’) True indicates default of ‘CMF’ parallax: (None,True) True indicates default of ‘gauss’

cmf_prior(m2, m1)[source]

from equation 8 of Metchev & Hillenbrand 2009

ecc_prior_fn(ecc)[source]
gaussian(x, mu, sig)[source]
imf_prior(m)[source]

From table 1 of Chabrier et al. 2003

inc_prior_fn(inc)[source]
m1_prior_fn(mass)[source]
m2_prior_fn(m2, m1)[source]
p_prior_fn(p)[source]
para_prior_fn(para)[source]
pdmf_prior(m)[source]

From table 1 of Chabrier et al. 2003

priors(pars)[source]

Combined priors for a single step in the chain. This can be called to form the priors ratio OR when accounting for the priors when producing the posteriors during post-processing.

Input array needs the first elements to be: [m1, m2, parallax, long_an, e, to, tc, p, inc, arg_peri] This can be the full ‘model_in_pars’, ‘stored_pars’ or a truncated version with just these parameters.

priors_ratio(pars_prop, pars_last)[source]

Calculates the priors ratio.

Input arrays need the first elements to be: [m1, m2, parallax, long_an, e, to, tc, p, inc, arg_peri] This can be the full ‘model_in_pars’ or a truncated version with just these parameters.

test_priors(pars_prop, pars_last)[source]

Just for testing no errors occur while trying to caculate the priors ratio. Nothing returned.

Simple start-up tools for ExoSOFTmodel

Contents:

ExoSOFTmodel.tools.load_di_data(filename)[source]

Load the astrometry data into a numpy array.

file format: title column headers data . . .

Data must be in the columns: obsDate[JD] x[“] x_error[“] y[“] y_error[“] OR if pasa key in settingsAdvanced ==True, then: obsDate[JD] PA[deg] PA_error[deg] SA[“] SA_error[“]

ExoSOFTmodel.tools.load_rv_data(filename)[source]

Load the radial velocity data into a numpy array. Provided jitter values will be added in quadrature with the errors.

file format: title column headers data . . Empty line between data sets data . .

Data must be in the columns: obsDate[JD] RV[m/s] RV_error[m/s] jitter[m/s] datasetNumber[int] NOTE: datasetNumber is optional, if not provided they will be automatically set to 0,1,2... following the order of the data in the file.

If jitter is not provided, it will be assumed zero.
ExoSOFTmodel.tools.load_settings_dict(settings_filename)[source]

A way to load in settings from a settings an ExoSOFT type settings file.

Users can choose to copy and modify the one provided in the ‘examples’ directory to match the system they are working on, or write their own function like this to load in the required parameters/arrays... that comprise all the inputs for ExoSOFTpriors, ExoSOFTdata and ExoSOFTparams.

NOTE: THE DICTIONARY KEY WORDS USED HERE DO NOT WORK FOR OLD EXOSOFT SETTINGS FILES. NEED TO CHANGE ALL OF THEM TO THIS FORMAT EVENTUALLY!!!!

ExoSOFTmodel.tools.make_starting_params(pars, n, scale=0.01)[source]

Creates an array of starting guesses tightly centered on the input parameters.

Indices and tables