Star Populations

The fundamental population unit within vespa is a StarPopulation, from which EclipsePopulation inherits. This is the basic object which keeps track of the properties of a population of stars and enables application of various observational constraints to rule out portions of the population.

For the built-in false positive populations, EBPopulation inherits from Observed_BinaryPopulation, and HEBPopulation inherits from Observed_TriplePopulation. BEBPopulation inherits from BGStarPopulation through BGStarPopulation_TRILEGAL.

class vespa.stars.StarPopulation(stars=None, distance=None, max_distance=1000, convert_absmags=True, name='', orbpop=None, mags=None)[source]

A population of stars.

This object contains information of a simulated population of stars. It has a flexible purpose– it could represent many random realizations of a single system, or it could also represent many different random systems. This is the general base class; subclasses include, e.g., MultipleStarPopulation and BGStarPopulation_TRILEGAL.

The StarPopulation.stars attribute is a pandas.DataFrame containing all the information about all the random realizations, such as the physical star properties (mass, radius, etc.) and observational characteristics (magnitudes in different bands).

The StarPopulation.orbpop attribute stores information about the orbits of the random stars, if such a thing is relevant for the population in question (such as, e.g., a MultipleStarPopulation). If orbits are relevant, then attributes such as StarPopulation.Rsky, StarPopulation.RV, and StarPopulation.dmag() are defined as well.

Importantly, you can apply constraints to a StarPopulation, implemented via the Constraint class. You can constrain properties of the stars to be within a given range, you can apply a ContrastCurveConstraint, simulating the exclusion curve of an imaging observation, and many others.

You can save and re-load StarPopulation objects using StarPopulation.save_hdf() and StarPopulation.load_hdf().

Warning

Support for saving constraints is planned and partially implemented but untested.

Any subclass must be able to be initialized with no arguments, with no calculations being done; this enables the way that StarPopulation.load_hdf() is implemented to work properly.

Parameters:
  • stars – (pandas.DataFrame, optional) Table containing properties of stars. Magnitude properties end with “_mag”. Default is that these magnitudes are absolute, and get converted to apparent magnitudes based on distance, which is either provided or randomly assigned.
  • distance (astropy.units.Quantity, float, or array-like, optional) – If None, then distances of stars are assigned randomly out to max_distance, or by comparing to mags. If float, then assumed to be in parsec. Or, if stars already has a distance column, this is ignored.
  • max_distance (astropy.units.Quantity or float, optional) – Quantity or float, optional Max distance out to which distances will be simulated, according to random placements in volume ($p(d)simd^2$). Ignored if stars already has a distance column.
  • convert_absmags – (bool, optional) If True, then magnitudes in stars will be converted to apparent magnitudes based on distance. If False, then magnitudes will be kept as-is. Ignored if stars already has a distance column.
  • orbpop (orbits.OrbitPopulation) – Describes the orbits of the stars.
RV

Radial velocity difference between “primary” and “secondary” (exact meaning varies)

Rsky

Projected angular distance between “primary” and “secondary” (exact meaning varies)

append(other)[source]

Appends stars from another StarPopulations, in place.

Parameters:other – Another StarPopulation; must have same columns as self.
apply_cc(cc, distribution_skip=False, **kwargs)[source]

Apply contrast-curve constraint to population.

Only works if object has Rsky, dmag attributes

Parameters:
  • cc (ContrastCurveConstraint) – Contrast curve.
  • distribution_skip – This is by default True. To be honest, I’m not exactly sure why. Might be important, might not (don’t remember).
  • **kwargs

    Additional keyword arguments passed to StarPopulation.apply_constraint().

apply_constraint(constraint, selectfrac_skip=False, distribution_skip=False, overwrite=False)[source]

Apply a constraint to the population

Parameters:
  • constraint (Constraint) – Constraint to apply.
  • selectfrac_skip – (optional) If True, then this constraint will not be considered towards diminishing the
apply_trend_constraint(limit, dt, distribution_skip=False, **kwargs)[source]

Constrains change in RV to be less than limit over time dt.

Only works if dRV and Plong attributes are defined for population.

Parameters:
  • limit – Radial velocity limit on trend. Must be astropy.units.Quantity object, or else interpreted as m/s.
  • dt – Time baseline of RV observations. Must be astropy.units.Quantity object; else interpreted as days.
  • distribution_skip – This is by default True. To be honest, I’m not exactly sure why. Might be important, might not (don’t remember).
  • **kwargs

    Additional keyword arguments passed to StarPopulation.apply_constraint().

apply_vcc(vcc, distribution_skip=False, **kwargs)[source]

Applies “velocity contrast curve” to population.

That is, the constraint that comes from not seeing two sets of spectral lines in a high resolution spectrum.

Only works if population has dmag and RV attributes.

Parameters:
  • vcc – Velocity contrast curve; dmag vs. delta-RV.
  • distribution_skip – This is by default True. To be honest, I’m not exactly sure why. Might be important, might not (don’t remember).
  • **kwargs

    Additional keyword arguments passed to StarPopulation.apply_constraint().

bands

Bandpasses for which StarPopulation has magnitude data

constrain_property(prop, lo=-1, hi=1, measurement=None, thresh=3, selectfrac_skip=False, distribution_skip=False)[source]

Apply constraint that constrains property.

Parameters:
  • prop (str) – Name of property. Must be column in self.stars.
  • lo,hi – (optional) Low and high allowed values for prop. Defaults to -np.inf and np.inf to allow for defining only lower or upper limits if desired.
  • measurement – (optional) Value and error of measurement in form (value, error).
  • thresh – (optional) Number of “sigma” to allow for measurement constraint.
  • selectfrac_skip,distribution_skip – Passed to StarPopulation.apply_constraint().
constraint_df

A DataFrame representing all constraints, hidden or not

constraint_piechart(primarylist=None, fig=None, title='', colordict=None, legend=True, nolabels=False)[source]

Makes piechart illustrating constraints on population

Parameters:
  • primarylist – (optional) List of most import constraints to show (see StarPopulation.constraint_stats())
  • fig – (optional) Passed to plotutils.setfig().
  • title – (optional) Title for pie chart
  • colordict – (optional) Dictionary describing colors (keys are constraint names).
  • legend – (optional) bool indicating whether to display a legend.
  • nolabels – (optional) If True, then leave out legend labels.
constraint_stats(primarylist=None)[source]

Returns information about effect of constraints on population.

Parameters:primarylist – List of constraint names that you want specific information on (i.e., not blended within “multiple constraints”.)
Returns:dict of what percentage of population is ruled out by each constraint, including a “multiple constraints” entry.
constraints

Constraints applied to the population.

countok

Boolean array showing which stars pass all count constraints.

A “count constraint” is a constraint that affects the number of stars.

dRV(dt)[source]

Change in RV between two epochs separated by dt

Parameters:dt – Time difference between two epochs, either astropy.units.Quantity or days.
Returns:Change in RV.
distance

Distance to stars.

distok

Boolean array showing which stars pass all distribution constraints.

A “distribution constraint” is a constraint that affects the distribution of stars, rather than just the number.

distribution_skip

Names of constraints that should not be considered for distribution purposes

dmag(band)[source]

Magnitude difference between “primary” and “secondary” in given band

Exact definition will depend on context. Only legit if self.mags is defined (i.e., not None).

Parameters:band – (string) Desired photometric bandpass.
generate(*args, **kwargs)[source]

Function that generates population.

hidden_constraints

Constraints applied to the population, but temporarily removed.

is_ruled_out

Will be True if contraints rule out all (or all but one) instances

classmethod load_hdf(filename, path='')[source]

Loads StarPopulation from .h5 file

Correct properties should be restored to object, and object will be original type that was saved. Complement to StarPopulation.save_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – HDF file with saved StarPopulation.
  • path – Path within HDF file.
Returns:

StarPopulation or appropriate subclass; whatever was saved with StarPopulation.save_hdf().

prophist(prop, fig=None, log=False, mask=None, selected=False, **kwargs)[source]

Plots a 1-d histogram of desired property.

Parameters:
  • prop – Name of property to plot. Must be column of self.stars.
  • fig – (optional) Argument for plotutils.setfig()
  • log – (optional) Whether to plot the histogram of log10 of the property.
  • mask – (optional) Boolean array (length of self.stars) to say which indices to plot (True is good).
  • selected – (optional) If True, then only the “selected” stars (that is, stars obeying all distribution constraints attached to this object) will be plotted. In this case, mask will be ignored.
  • **kwargs

    Additional keyword arguments passed to plt.hist().

prophist2d(propx, propy, mask=None, logx=False, logy=False, fig=None, selected=False, **kwargs)[source]

Makes a 2d density histogram of two given properties

Parameters:
  • propx,propy – Names of properties to histogram. Must be names of columns in self.stars table.
  • mask – (optional) Boolean mask (True is good) to say which indices to plot. Must be same length as self.stars.
  • logx,logy – (optional) Whether to plot the log10 of x and/or y properties.
  • fig – (optional) Argument passed to plotutils.setfig().
  • selected – (optional) If True, then only the “selected” stars (that is, stars obeying all distribution constraints attached to this object) will be plotted. In this case, mask will be ignored.
  • kwargs – Additional keyword arguments passed to plotutils.plot2dhist().
remove_constraint(name)[source]

Remove a constraint (make it “hidden”)

Parameters:name – Name of constraint.
replace_constraint(name, selectfrac_skip=False, distribution_skip=False)[source]

Re-apply constraint that had been removed

Parameters:
save_hdf(filename, path='', properties=None, overwrite=False, append=False)[source]

Saves to HDF5 file.

Subclasses should be sure to define _properties attribute to ensure that all correct attributes get saved. Load a saved population with StarPopulation.load_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – Name of HDF file.
  • path – (optional) Path within HDF file to save object.
  • properties – (optional) Names of any properties (in addition to those defined in _properties attribute) that you wish to save. (This is an old keyword, and should probably be removed. Feel free to ignore it.)
  • overwrite – (optional) Whether to overwrite file if it already exists. If True, then any existing file will be deleted before object is saved. Use append if you don’t wish this to happen.
  • append – (optional) If True, then if the file exists, then only the particular path in the file will get written/overwritten. If False and both file and path exist, then an IOError will be raised. If False and file exists but not path, then no error will be raised.
selected

All stars that pass all distribution constraints.

selectfrac

Fraction of stars that pass count constraints.

selectfrac_skip

Names of constraints that should not be considered for counting purposes

set_maxrad(maxrad, distribution_skip=True)[source]

Adds a constraint that rejects everything with Rsky > maxrad

Requires Rsky attribute, which should always have units.

Parameters:
  • maxrad (astropy.units.Quantity) – The maximum angular value of Rsky.
  • distribution_skip – This is by default True. To be honest, I’m not exactly sure why. Might be important, might not (don’t remember).

Observationally Constrained Star Populations

EBPopulation and HEBPopulation inherit from very similar star population classes: Observed_BinaryPopulation and Observed_TriplePopulation. Both of these take either photometric or spectroscopic observed properties of a star and generate binary or triple populations consistent with those observations.

class vespa.stars.Observed_BinaryPopulation(mags=None, mag_errs=None, Teff=None, logg=None, feh=None, starmodel=None, n=20000.0, ichrone='mist', bands=['g', 'r', 'i', 'z', 'J', 'H', 'K', 'Kepler'], period=None, ecc=None, orbpop=None, stars=None, **kwargs)[source]

A population of binary stars matching observed constraints.

Parameters:
  • mags (dict) – Observed apparent magnitudes
  • Teff,logg,feh – Observed spectroscopic properties of primary star, if available. Format: (value, err).
  • starmodelisochrones.BinaryStarModel. If not passed, it will be generated.
generate(mags=None, mag_errs=None, n=10000.0, ichrone='mist', starmodel=None, Teff=None, logg=None, feh=None, bands=['g', 'r', 'i', 'z', 'J', 'H', 'K', 'Kepler'], orbpop=None, period=None, ecc=None, **kwargs)[source]

Function that generates population.

classmethod load_hdf(filename, path='')[source]

Loads StarPopulation from .h5 file

Correct properties should be restored to object, and object will be original type that was saved. Complement to StarPopulation.save_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – HDF file with saved StarPopulation.
  • path – Path within HDF file.
Returns:

StarPopulation or appropriate subclass; whatever was saved with StarPopulation.save_hdf().

save_hdf(filename, path='', **kwargs)[source]

Saves to HDF5 file.

Subclasses should be sure to define _properties attribute to ensure that all correct attributes get saved. Load a saved population with StarPopulation.load_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – Name of HDF file.
  • path – (optional) Path within HDF file to save object.
  • properties – (optional) Names of any properties (in addition to those defined in _properties attribute) that you wish to save. (This is an old keyword, and should probably be removed. Feel free to ignore it.)
  • overwrite – (optional) Whether to overwrite file if it already exists. If True, then any existing file will be deleted before object is saved. Use append if you don’t wish this to happen.
  • append – (optional) If True, then if the file exists, then only the particular path in the file will get written/overwritten. If False and both file and path exist, then an IOError will be raised. If False and file exists but not path, then no error will be raised.
starmodel_props

Default mag_err is 0.05, arbitrarily

class vespa.stars.Observed_TriplePopulation(mags=None, mag_errs=None, Teff=None, logg=None, feh=None, starmodel=None, n=20000.0, ichrone='mist', bands=['g', 'r', 'i', 'z', 'J', 'H', 'K', 'Kepler'], period=None, ecc=None, orbpop=None, stars=None, **kwargs)[source]

A population of triple stars matching observed constraints.

Parameters:
  • mags (dict) – Observed apparent magnitudes
  • Teff,logg,feh – Observed spectroscopic properties of primary star, if available. Format: (value, err).
  • starmodelisochrones.TripleStarModel. If not passed, it will be generated.
generate(mags=None, mag_errs=None, n=10000.0, ichrone='mist', starmodel=None, Teff=None, logg=None, feh=None, bands=['g', 'r', 'i', 'z', 'J', 'H', 'K', 'Kepler'], orbpop=None, period=None, ecc=None, **kwargs)[source]

Function that generates population.

classmethod load_hdf(filename, path='')[source]

Loads StarPopulation from .h5 file

Correct properties should be restored to object, and object will be original type that was saved. Complement to StarPopulation.save_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – HDF file with saved StarPopulation.
  • path – Path within HDF file.
Returns:

StarPopulation or appropriate subclass; whatever was saved with StarPopulation.save_hdf().

save_hdf(filename, path='', **kwargs)[source]

Saves to HDF5 file.

Subclasses should be sure to define _properties attribute to ensure that all correct attributes get saved. Load a saved population with StarPopulation.load_hdf().

Example usage:

>>> from vespa.stars import Raghavan_BinaryPopulation, StarPopulation
>>> pop = Raghavan_BinaryPopulation(1., n=1000)
>>> pop.save_hdf('test.h5')
>>> pop2 = StarPopulation.load_hdf('test.h5')
>>> pop == pop2
    True
>>> pop3 = Ragahavan_BinaryPopulation.load_hdf('test.h5')
>>> pop3 == pop2
    True
Parameters:
  • filename – Name of HDF file.
  • path – (optional) Path within HDF file to save object.
  • properties – (optional) Names of any properties (in addition to those defined in _properties attribute) that you wish to save. (This is an old keyword, and should probably be removed. Feel free to ignore it.)
  • overwrite – (optional) Whether to overwrite file if it already exists. If True, then any existing file will be deleted before object is saved. Use append if you don’t wish this to happen.
  • append – (optional) If True, then if the file exists, then only the particular path in the file will get written/overwritten. If False and both file and path exist, then an IOError will be raised. If False and file exists but not path, then no error will be raised.
starmodel_props

Default mag_err is 0.05, arbitrarily

Background Star Population

BEBPopulation inherits from BGStarPopulation through BGStarPopulation_TRILEGAL.

class vespa.stars.BGStarPopulation_TRILEGAL(filename=None, ra=None, dec=None, mags=None, maxrad=1800, **kwargs)[source]

Creates TRILEGAL simulation for ra,dec; loads as BGStarPopulation

Parameters:
  • filename – Desired name of the TRILEGAL simulation. Can either have ‘.h5’ extension or not. If filename (or ‘filename.h5’) exists locally, it will be loaded; otherwise, TRILEGAL will be called via the get_trilegal perl script, and the file will be generated.
  • ra,dec – (optional) Sky coordinates of TRILEGAL simulation. Must be passed if generating TRILEGAL simulation and not just reading from existing file.
  • mags ((optional) dict) – (optional) Dictionary of primary star magnitudes (if this is being used to generate a background population behind a particular foreground star). This must be set in order to use the dmag attribute.
  • maxrad – (optional) Maximum distance (arcsec) out to which to place simulated stars.
  • **kwargs

    Additional keyword arguments passed to stars.trilegal.get_trilegal()

class vespa.stars.BGStarPopulation(stars=None, mags=None, maxrad=1800, density=None, **kwargs)[source]

Background star population

This should usually be accessed via the BGStarPopulation_TRILEGAL subclass.

Parameters:
  • stars – (pandas.DataFrame, optional) Properties of stars. Must have ‘distance’ column defined.
  • mags – (optional) Magnitudes of primary (foreground) stars.
  • maxrad – (optional) Maximum distance (arcseconds) of BG stars from foreground primary star.
  • density – (optional) Density in arcsec^{-2} for BG star population.
  • **kwargs

    Additional keyword arguments passed to StarPopulation.

Rsky

Project on-sky separation between primary star and BG stars

dmag(band)[source]

Magnitude difference between primary star and BG stars

Other Star Populations

These are the other StarPopulation classes defined in vespa. Raghavan_BinaryPopulation is particularly useful, which produces a population according to the binary distribution described by the Raghavan (2010) survey.

class vespa.stars.BinaryPopulation(stars=None, primary=None, secondary=None, orbpop=None, period=None, ecc=None, is_single=None, **kwargs)[source]

A population of binary stars.

If vespa.orbits.OrbitPopulation provided via orbpop keyword, that will describe the orbits; if not, then orbit population will be generated. Single stars may be indicated if desired by having their mass set to zero and all magnitudes set to inf.

This will usually be used via, e.g., the Raghavan_BinaryPopulation subclass, rather than instantiated directly.

Parameters:
  • primary,secondary – (pandas.DataFrame) Properties of primary and secondary stars, respectively. These get merged into new stars attribute, with “_A” and “_B” tags.
  • orbpop – (vespa.orbits.OrbitPopulation, optional) Object describing orbits of stars. If not provided, then period and ecc keywords must be provided, or else they will be randomly generated (see below).
  • period,ecc – Periods and eccentricities of orbits. If orbpop not passed, and these are not provided, then periods and eccs will be randomly generated according to the empirical distributions of the Raghavan (2010) and Multiple Star Catalog distributions using utils.draw_raghavan_periods() and utils.draw_eccs().
Plong

Orbital period.

Called “Plong” to be consistent with hierarchical populations that have this attribute mean the longer of two periods.

binaries

Subset of stars that are binaries.

binary_fraction(query='mass_A >= 0')[source]

Binary fraction of stars passing given query

Parameters:query – Query to pass to stars DataFrame.
dmag(band)[source]

Difference in magnitude between primary and secondary stars

Parameters:band – Photometric bandpass.
rsky_distribution(rmax=None, smooth=0.1, nbins=100)[source]

Distribution of projected separations

Returns a simpledists.Hist_Distribution object.

Parameters:
  • rmax – (optional) Maximum radius to calculate distribution.
  • dr – (optional) Bin width for histogram
  • smooth – (optional) Smoothing parameter for simpledists.Hist_Distribution
  • nbins – (optional) Number of bins for histogram
Returns:

simpledists.Hist_Distribution describing Rsky distribution

rsky_lhood(rsky, **kwargs)[source]

Evaluates Rsky likelihood at provided position(s)

Parameters:
singles

Subset of stars that are single.

class vespa.stars.Simulated_BinaryPopulation(M=None, q_fn=None, P_fn=None, ecc_fn=None, n=10000.0, ichrone='mist', qmin=0.1, bands=['g', 'r', 'i', 'z', 'J', 'H', 'K', 'Kepler'], age=9.6, feh=0.0, minmass=0.12, **kwargs)[source]

Simulates BinaryPopulation according to provide primary mass(es), generating functions, and stellar isochrone models.

Parameters:
  • M (float or array-like) – Primary mass(es).
  • q_fn (Callable function.) –

    (optional) Mass ratio generating function. Must return ‘n’ mass ratios, and be called as follows:

    qs = q_fn(n)
    
  • P_fn (Callable function.) –

    (optional) Orbital period generating function. Must return n orbital periods, and be called as follows:

    Ps = P_fn(n)
    
  • ecc_fn (Callable function.) –

    (optional) Orbital eccentricity generating function. Must return n orbital eccentricities generated according to provided period(s):

    eccs = ecc_fn(n,Ps)
    
  • n – (optional) Number of instances to simulate.
  • ichrone (isochrones.Isochrone) – (optional) Stellar model object from which to simulate stellar properties. Default is the default Dartmouth isochrone.
  • bands – (optional) Photometric bands to simulate via ichrone.
  • age,feh – (optional) log(age) and metallicity at which to simulate population. Can be float or array-like
  • minmass – (optional) Minimum mass to simulate. Default = 0.12.
generate(M, age=9.6, feh=0.0, ichrone='mist', n=10000.0, bands=None, **kwargs)[source]

Function that generates population.

Called by __init__ if M is passed.

class vespa.stars.Raghavan_BinaryPopulation(M=None, e_M=0, n=10000.0, ichrone='mist', age=9.5, feh=0.0, q_fn=None, qmin=0.1, minmass=0.12, **kwargs)[source]

A Simulated_BinaryPopulation with empirical default distributions.

Default mass ratio distribution is flat down to chosen minimum mass, default period distribution is from Raghavan (2010), default eccentricity/period relation comes from data from the Multiple Star Catalog (Tokovinin, xxxx).

Parameters:
  • M – Primary mass(es) in solar masses.
  • e_M – (optional) 1-sigma uncertainty in primary mass.
  • n – (optional) Number of simulated instances to create.
  • ichrone (isochrones.Isochrone) – (optional) Stellar models from which to generate binary companions.
  • age,feh – (optional) Age and metallicity of system.
  • name – (optional) Name of population.
  • q_fn

    (optional) A function that returns random mass ratios. Defaults to flat down to provided minimum mass. Must be able to be called as follows:

    qs = q_fn(n, qmin, qmax)
    

    to provide n random mass ratios.

class vespa.stars.TriplePopulation(stars=None, primary=None, secondary=None, tertiary=None, orbpop=None, period_short=None, period_long=None, ecc_short=0, ecc_long=0, **kwargs)[source]

A population of triple stars.

(Primary) orbits (secondary + tertiary) in a long orbit; secondary and tertiary orbit each other with a shorter orbit. Single or double stars may be indicated if desired by having the masses of secondary or tertiary set to zero, and all magnitudes to inf.

Parameters:
  • stars – (optional) Full stars DataFrame. If not passed, then primary, secondary, and tertiary must be.
  • primary,secondary,tertiary – (optional) Properties of primary, secondary, and tertiary stars, in pandas.DataFrame form. These will get merged into a new stars attribute, with “_A”, “_B”, and “_C” tags.
  • orbpop (TripleOrbitPopulation) – (optional) Object describing orbits of stars. If not provided, then the period and eccentricity keywords must be provided, or else they will be randomly generated (see below).
  • period_short,period_long,ecc_short,ecc_long – (array-like, optional) Orbital periods and eccentricities of short and long-period orbits. “Short” describes the close pair of the hierarchical system; “long” describes the separation between the two major components. Randomly generated if not provided.
A_brighter(band='g')[source]

Instances where star A is brighter than (B+C)

BC_brighter(band='g')[source]

Instances where stars (B+C) are brighter than star A

Plong

Longer of two orbital periods in Triple system

binary_fraction(query='mass_A > 0', unc=False)[source]

Binary fraction of stars following given query

dRV(dt, band='g')[source]

Returns dRV of star A, if A is brighter than B+C, or of star B if B+C is brighter

dmag(band)[source]

Difference in magnitudes between fainter and brighter components in band.

Parameters:band – Photometric bandpass.
triple_fraction(query='mass_A > 0', unc=False)[source]

Triple fraction of stars following given query