Miscellaneous Utilities

Utilities for loading data, checking for known planets, etc.

rvsearch.utils.GaussianDiffFunc(inp_list)[source]

Function to use in the HIRES gamma offset prior. :param inp_list: pair of floats, the difference of which we want to

constrain with a Gaussian prior. Hard-coded params, derived empirically from HIRES analysis.

rvsearch.utils.cartesian_product(*arrays)[source]

Generate a cartesian product of input arrays.

Parameters

arrays (arrays) – 1-D arrays to form the cartesian product of.

Returns

cartesian product of input arrays

Return type

array

rvsearch.utils.derive(post, synthchains, mstar, mstar_err=0.0)[source]

Derive physical parameters from posterior samples

Parameters
  • post (radvel.Posterior) – RadVel posterior object

  • synthchains (DataFrame) – MCMC chains in the RadVel synth basis

  • mstar (float) – stellar mass in solar units

  • mstar_err (float) – (optional) uncertainty on stellar mass

rvsearch.utils.initialize_default_pars(instnames=['inst'], times=None, linear=True, fitting_basis='per tc secosw sesinw k')[source]

Set up a default Parameters object.

None of the basis values are free params, for the initial 0-planet fit. Remember to reset .vary to True for all relevant params.

Parameters
  • instnames (list) – codes of instruments used

  • times (array) – optional, timestamps of observations.

  • linear (bool) – Determine whether to optimize gammas linearly.

  • fitting_basis – optional

Returns

Parameters object

rvsearch.utils.initialize_post(data, params=None, priors=[], linear=True, decorrs=None)[source]

Initialize a posterior object with data, params, and priors. :param data: a pandas dataframe. :param params: a list of radvel parameter objects. :param priors: a list of priors to place on the posterior object. :param decorrs: a list of decorrelation vectors.

Returns

post (radvel Posterior object)

rvsearch.utils.read_from_csv(filename, binsize=0.0, verbose=True)[source]

Read radial velocity data from a csv file into a Pandas dataframe.

Parameters
  • filename (string) – Path to csv file

  • binsize (float) – Times in which to bin data, in given units

  • verbose (bool) – Notify user if instrument types not given?

rvsearch.utils.read_from_vst(filename, verbose=True)[source]

Read radial velocity data from a vst file into a Pandas dataframe.

Parameters
  • filename (string) – Path to csv file

  • verbose (bool) – Notify user if instrument types not given?

Note

Only relevant for HIRES users.

rvsearch.utils.scrape(starlist, star_db_name=None, filename='system_props.csv')[source]

Take data from completed searches and compile into one dataframe.

Parameters
  • starlist (list) – List of starnames to access in current directory

  • star_db_name (string [optional]) – Filename of star properties dataframe

  • filename (string) – Path to which to save dataframe

Note

If specified, compute planet masses and semi-major axes.

rvsearch.utils.window(times, freqs, plot=False)[source]

Function to generate, and plot, the window function of observations.

Parameters

time – times of observations in a dataset. FOR SEPARATE TELESCOPES?