bioverse.survey module

class bioverse.survey.Survey(label: str = None, diameter: float = 15.0, t_max: float = 3652.5, t_slew: float = 0.00347)

Bases: dict, Object

Describes an exoplanet survey, including methods for creating simulated datasets. This class should not be called directly; instead use ImagingSurvey or TransitSurvey.

label: str = None
diameter: float = 15.0
t_max: float = 3652.5
t_slew: float = 0.00347
add_measurement(key, idx=None, **kwargs)

Adds a Measurement to the Survey.

Parameters:
  • key (str) – Name of the measured parameter.

  • idx (int) – Position in the measurement sequence. By default, it is placed at the end.

  • **kwargs – Keyword arguments passed to Measurement.__init__().

add_measurements(**m_kwargs)

Adds Multiple Measurement to the Survey.

Parameters:

**m_kwargs – Keyword arguments in terms of measurement name and precision

move_measurement(key, idx)

Moves a Measurement to the designated position in the sequence.

Parameters:
  • key (str) – Name of the measured parameter.

  • idx (int) – Position in the measurement sequence to which to move the Measurement.

quickrun(generator, N_sim=1, method='detectable', **kwargs)

Convenience function that generates a sample, computes the detection yield, and returns a simulated data set.

Parameters:
  • generator (Generator) – Generator used to generate the planet population.

  • N_sim (int, optional) – If greater than 1, simulate the survey this many times and return the combined result.

  • method (str, optional) – Method used for the yield calculation. Default is ‘detectable’, observing all detectable planets without considering exposure time and mission duration.

  • **kwargs – Keyword arguments passed to Generator.generate().

Returns:

  • sample (Table) – Table of all simulated planets.

  • detected (Table) – Table of planets detected by the Survey.

  • data (Table) – Simulated data set produced by the Survey. data.error gives uncertainties on the measurements in data.

observe(y, data=None, error=None, demographics=False)

Returns a simulated data set for a Table of simulated planets.

Parameters:
  • y (Table) – Table containing the set of planets to be observed, usually the detection yield of the survey.

  • data (Table, optional) – Pre-existing Table in which to store the new measurements.

  • error (Table, optional) – Pre-existing Table containing uncertainties on data values.

  • demographics (Bool, optional) – compute some population-level statistics after taking all measurements

Returns:

data – Table of measurements made by the Survey, with one row for each planet observed.

Return type:

Table

compute_overhead_time(d, N_obs=1)

Computes the overheads associated with each observation.

compute_debias(d)

Removes detection biases from the data set (transit mode only).

schedule_observations(d, texp_col='t_exp', N_obs_col='N_obs', debias=False, zero_overhead=False)
set_weight(key, weight, min=None, max=None, value=None)

Adds a new rule for determining target weight. weight can be set for targets whose parameter fall within (min, max) or exactly match value.

Parameters:
  • key (str) – Name of the parameter being checked.

  • weight (float) – Weight of targets that meet the conditions.

  • min (float, optional) – Minimum value of range. Default is -inf.

  • max (float, optional) – Maximum value of range. Default is +inf.

  • value (int or str or bool, optional) – Exact value with which to compare.

compute_weights(d)

Computes the priority weight of each planet in d.

set_reference_observation(**ref_kwargs)
exp_time_scaling_relation(d, t_ref=3.1, wl_eff=0.6, T_st_ref=5788.0, R_st_ref=1.0, D_ref=15.0, d_ref=10.0, R_pl_ref=1.0, H_ref=9, **kwargs)

Computes the exposure time and number of observations required to characterize each planet in d.

d: data table t_ref: exposure time for example psg run (days?) wl_eff: wavelength in um T_st_ref: reference stellar temperature in K R_st_ref: reference stellar radius in R_sun D_ref: reference telescope diameter in m d_ref: reference distance in pc R_pl_ref: reference planet radius in R_earth H_ref: reference atmosphere scale height kwargs: additional keyword arguments (allows us to pass unused kwargs as well)

class bioverse.survey.ImagingSurvey(label: str = None, diameter: float = 15.0, t_max: float = 3652.5, t_slew: float = 0.00347, inner_working_angle: float = 3.5, outer_working_angle: float = 64, contrast_limit: float = -10.6, mode: str = 'imaging')

Bases: Survey

inner_working_angle: float = 3.5
outer_working_angle: float = 64
contrast_limit: float = -10.6
mode: str = 'imaging'
compute_detectable(d, wl_eff=0.5, A_g=0.3)

Computes a simple estimate of the number of detectable planets for an imaging survey. Compares the contrast ratio and projected separation of each planet to the contrast limit and inner/outer working angles of the survey. Planets that satisfy these criteria are considered to be detectable. Not all these planets will actually be observed by a mission.

Parameters:
  • d (Table) – Table of all simulated planets which the survey could attempt to observe.

  • wl_eff (float, optional) – Effective wavelength of observation in microns (used for calculating the IWA/OWA).

  • A_g (float, optional) – Geometric albedo of each planet, ignored if ‘A_g’ is already assigned.

Returns:

yield – Copy of the input Table containing only planets which were detected by the survey.

Return type:

Table

compute_yield(d0, method='detectable', SNR=7, band_width=0.2, wl_eff=0.5, A_g=0.3, zero_overhead=False, **exp_kwargs)

Computes the yield of a survey. Compares whether stars will be observed for long enough duration for planets to be detected at given SNR. Old versions of the yield calculation considering only contrast and separation can be replicated using method=’detectable’

Parameters:
  • d0 (Table) – Table of all simulated planets which the survey could attempt to observe.

  • method (str, optional) –

    Method used for yield calculation. “detectable” implies all detectable planets are observed without consideration of exposure time

    and total mission duration.

    ”exp_time” uses an exposure time calculator to determine if simulated planets were detected.

    Requires survey to have been scheduled in generation or pre-generator

    ”scaling_relation” is a legacy option to use a reference exposure time from PSG calculations

  • wl_eff (float, optional) – Effective wavelength of observation in microns (used for calculating the IWA/OWA).

  • A_g (float, optional) – Geometric albedo of each planet, ignored if ‘A_g’ is already assigned.

  • zero_overhead (bool, optional) – set overhead time to zero

  • exp_kwargs (dict, optional) – Additional keyword arguments for exposure time calculator

Returns:

d – Copy of the input Table containing only planets which were detected by the survey.

Return type:

Table

call_exposure_time_calculator(d, SNR=7, func=<function DI_exposure_time_calculator>, band='Vmag', C_col='contrast', sep_col='ang_sep_mas', texp_col='t_exp', **kwargs)
class bioverse.survey.TransitSurvey(label: str = None, diameter: float = 15.0, t_max: float = 3652.5, t_slew: float = 0.00347, N_obs_max: int = 1000, mode: str = 'transit', d_max: float = nan, P_max: float = nan, min_depth: float = nan, m_G_max: float = nan)

Bases: Survey

N_obs_max: int = 1000
mode: str = 'transit'
d_max: float = nan
P_max: float = nan
min_depth: float = nan
m_G_max: float = nan
compute_detectable(d)

Computes whether planets are detectable for the survey

Parameters:

d (Table) – Table of all simulated planets which the survey could attempt to observe.

Returns:

detectable – Copy of the input table containing only planets which are detectable by the survey.

Return type:

Table

compute_yield(d0, method='detectable', debias=False, zero_overhead=False, **ref_kwargs)

Computes a simple estimate of the detection yield for a transit survey. Currently all detectable transiting planets are considered to be detected.

Parameters:
  • d0 (Table) – Table of all simulated planets which the survey could attempt to observe.

  • method (str, optional) –

    Method used for yield calculation.

    ”detectable” implies all detectable planets are observed without consideration of exposure time and total mission duration. “scaling_relation” uses estimated exposure times from PSG and a scaling relation

  • debias (bool, optional) – Apply debias correction for transiting planets.

  • zero_overhead (bool, optional) – set overhead to zero

  • ref_kwargs (dict, optional) – sets reference observation, updates self.reference

Returns:

yield – Copy of the input table containing only planets which were detected by the survey.

Return type:

Table

class bioverse.survey.Measurement(key, survey, precision=0.0)

Bases: object

Class describing a simple measurement to be applied to a set of planets detected by a Survey.

Parameters:
  • key (str) – Name of the parameter that will be measured.

  • survey (Survey) – Survey associated with this Measurement.

  • precision (str or float, optional) – Precision of measurement, e.g. ‘10%’ or 0.10 units. Default is zero.

measure(detected, data=None, error=None)

Produces the measurement for planets in a Table and places them into a data Table.

Parameters:
  • detected (Table) – Table containing detected planets.

  • data (Table, optional) – Table in which to store the measured values for each planet. If not given, then a new table is created.

  • error (Table, optional) – Table in which to store the measurement uncertainties. Must be given if data is given.

Returns:

  • data (Table) – Table containing the measured values for each planet.

  • error (Table) – Table containing the measurement uncertainties for each planet.

perform_measurement(x)

Simulates measurements of the parameter from a set of true values. Measurements are clipped to +- 5 sigma of the true value to avoid non-physical results.

Parameters:

x (array) – Array of true values on which to perform the measurement.

Returns:

xm – Array of measured values with the same length and type as x.

Return type:

array

bioverse.survey.reset_imaging_survey()

Re-creates the default imaging survey.

bioverse.survey.reset_transit_survey()

Re-creates the default transit survey.

bioverse.survey.prioritize_survey(survey, label)
bioverse.survey.read_scaling_dict(label)