Apply interstellar attenuation.


 A custom (joint) prior distribution.

    Source: Fictitious
    Model variant: ST-U
        Two single-temperature, simply-connected circular hot regions with mostly
        unshared parameters.


Implement method for HotRegion with beaming parameters.


Fake telescope response.


 A custom (joint) prior distribution.

    Source: Fictitious
    Model variant: ST-


 A custom calculation of the logarithm of the NICER likelihood.

    We extend the :class:`xpsi.Signal.Signal` class to make it callable.

    We overwrite the body of the __call__ method. The docstring for the
    abstract method is copied.


XTI, and XTI.


Compile arguments for dynamic evaluation.


A subclass of the :class:`xpsi.Signal.Signal` class to make it callable.


A joint prior PDF.


Apply interstellar attenuation model tbnew.


    Loads the wavelengths from the nearest Arc-emission lamp (wavelength calibration) in the db.
    If the traces have shifted (e.g. the instrument was serviced), then we do not load any of this information
    (new wavelengths will be created from scratch in WavelengthCalibrate).


Loads the reference line list for wavelength calibration


    Stage to recalibrate wavelength-calibration (e.g. arc lamp) frames.
    We re-wavelength calibrate from scratch if the image does not have a pre-existing wavelength solution.
    We lightly recalibrate the wavelength calibration if the image has a pre-existing wavelength solution.

    NOTE: Pixels that are uncalibrated (e.g. regions of the CCD chip where there is not actually any spectrum present,
    or if the calibration failed on one or both fibers) are assigned a ZERO wavelength. This is because zeros compress
    well in fits fpack. So a pixel with a Zero means that pixel has an UNDEFINED (uncalibrated) wavelength.


Stage to identify all sharp emission-like features on an Arc lamp frame.


    Performs SVD: Y = USV^\dagger

    PCA has 4 methods:
       - fit(waveforms)
       update class instance with pca fit, done via svd

       - fit_transform()
       do what fit() does, but additionally return the projection onto PC space
       i.e. returns A = U*S

       - inverse_transform(A)
       inverses the decomposition, returns waveforms for an input A, using Z
       returns Y = A*Z^\dagger

       - get_params()
       returns metadata used for fits.
            Number of components (pcs), name of fit ('PCA'), waveform catalog used (if provided)


    Wrapper for sklearn package.  Performs fast ICA (Independent Component Analysis)

    ICA has 4 methods:
       - fit(waveforms)
       update class instance with ICA fit

       - fit_transform()
       do what fit() does, but additionally return the projection onto ICA space

       - inverse_transform(A)
       inverses the decomposition, returns waveforms for an input A, using Z

       - get_params()
       returns metadata used for fits.


    Wrapper for sklearn package.  Performs sparse PCA

    SPCA has 5 methods:
       - fit(waveforms)
       update class instance with ICA fit

       - fit_transform()
       do what fit() does, but additionally return the projection onto ICA space

       - inverse_transform(A)
       inverses the decomposition, returns waveforms for an input A, using Z

       - get_basis()
       returns the basis vectors Z^\dagger

       - get_params()
       returns metadata used for fits.


    Wrapper for sklearn package.  Performs sparse coding

    Sparse Coding, or Dictionary Learning has 5 methods:
       - fit(waveforms)
       update class instance with Sparse Coding fit

       - fit_transform()
       do what fit() does, but additionally return the projection onto new basis space

       - inverse_transform(A)
       inverses the decomposition, returns waveforms for an input A, using Z^\dagger

       - get_basis()
       returns the basis vectors Z^\dagger

       - get_params()
       returns metadata used for fits.


    Multivar objects combine the settings in a Catalog, DesignMatrix and Basis object.
    It performs the regression, and has methods

    .predict()
        Predicts waveforms given a new set of physical parameters

    .reconstruct()
        Reconstructs the waveforms in the original Catalog object

    .summary()
        Prints a summary of hypothesis tests encoded into the design matrix
        Also shows diagnostics of the fit, and metadata about the settings used to
        produce it

    .get_waveforms()
        Returns the original core-collapse waveforms as a numpy array


    Catalog Object
    Holds waveforms, catalog meta data.  Does transformations.  When Catalog object is
         instantiated with a path, it loads waveforms at that directory.
    Catalog objects have 4 methods:

       - fit_transform(typeof)
         typeof equals one of ['time','fourier','spectrogram','amplitudephase']
         transforms raw waveforms (in case of 'time' does no transformation)

       - get_params()
         returns dictionary of catalog metadata

       - get_normalization()
         returns the normalization constant used

       - get_catalog()
         return a dictionary of waveforms, where the name is the key

       - set_name(name)
         give catalog name (default is the waveform file name)


Lensing projection: single source. The default is z_source = 1.


lensing projection: source distribution from Oguri & Takada 2011


lensing projection: source distribution from Hand et al 2013


lensing projection: source distribution from Das Errard Spergel 2013


lensing projection: CIB source distribution from Schmidt Menard Scranton+15
   the values of z0 and alpha are in table 2
   approximate calculation: assumes that the CIB monopole redshift distribution
   is the relevant source distribution for CIB lensing


lensing projection: CIB source distribution from Pullen+17
   these have been digitized from figure 6
   nu should be 353, 545 or 857 (in GHz)
   approximate calculation: assumes that the CIB monopole redshift distribution
   is the relevant source distribution for CIB lensing


CIB projection: from Planck XXIII 2015, Planck XXX 2013
   the split between projection kernel and profile is
   somewhat arbitrary here, given that there isn't a well-defined 3d quantity.
   I could have put all the z-dependence in the profile,
   and make the projection kernel trivial


Projected density field of tracers
   requires defining b(z) and dn/dz(z)


Projected number density of CMASS DR12 galaxies


Projected number density of WISE galaxies


Projected number density of LSST gold galaxies,
   From the LSST Science book, chapter 3 and 13.


Projected number density of LSST source galaxies,
   used for shear measurements,
   as in Schaan Krause Eifler +16.


Non-Linear Matter Power spectrum
   Based on fits by Takahashi et al (2012)
   arXiv:1208.2701v2
   adapted from Simone Ferraro's code


Measured CIB power spectra from Planck13 XXX


   def DeltaVir(self, z):
      """Overdensity wrt mean for virialized halo at z
      from Bullock et al 2001, from Bryan & Norman 1998
      usual 18*pi**2 if OmM=1.
      gives 337 at z=0 for OmM= 0.3
      Omega = rhocrit(z)/rho_matter(z)
      """
      Omega = self.OmM*(1.+z)**3
      Omega /= self.OmM*(1.+z)**3 + (1. - self.OmM)
      x = Omega - 1.
      Dvir = 18*np.pi**2 + 82.*x - 39.*x**2
      # convert between rho_m(z) and rho_crit(z)
      Dvir /= Omega
      return Dvir


   #!!!!!!! Wrong on the axis ly=0: does not satisfy f(-l)=f(l)* there,
   # which means that the real-space map will be complex.
   #!!!!!!! Also, the modulus should not be Gaussian, but Rayleigh, and with mean non-zero!!!
   def genGRF(self, fCl, test=False):

      # flatten the Fourier data,
      # and put in it the value of Cl
      dataFourier = np.array(map(fCl, self.l.flatten()))
      dataFourier = np.nan_to_num(dataFourier)
      # rescale by finite volume
      dataFourier *= self.sizeX*self.sizeY
      # reshape it
      dataFourier = dataFourier.reshape(np.shape(self.l))

      if test:
         print dataFourier[0,0]
         # plot Fourier power map
         self.plotFourier(dataFourier=self.l**2 * np.abs(dataFourier))
         # plot Fourier power
         plt.plot(self.l.flatten(), self.l.flatten()**2 * np.abs(dataFourier.flatten()), 'k.')
         plt.show()

      # for each ell vector,
      # generate a Gaussian random number with variance = cl
      f = lambda var: np.random.normal(0., scale=np.sqrt(var)+1.e-16) * np.exp(1j*np.random.uniform(0., 2.*np.pi))
      dataFourier = np.array(map(f, dataFourier.flatten()))
      # reshape it
      dataFourier = dataFourier.reshape(np.shape(self.l))

      if test:
         print dataFourier[0,0]
         # plot Fourier map
         self.plotFourier(dataFourier=dataFourier)
         self.plotFourier(dataFourier=self.l**2 * np.abs(dataFourier)**2)
         # plot Fourier power
         plt.plot(self.l.flatten(), self.l.flatten()**2 * np.abs(dataFourier.flatten())**2, 'k.', alpha=0.1)
         plt.show()

      if test:
         print dataFourier[0,0]
         data = self.inverseFourier()
         self.plot(data=data)
         self.plotFourier(dataFourier=dataFourier)

      return dataFourier


Class representing a single test case


Context manager for tempfile.mkdtemp() so it's usable with "with" statement.


Main class that interfaces with the MySQL database.


Class that contains the metadata for one frame.
       This is mostly information stored in the database of
       input images that we do not maintain.


Starts up a thread to run a pair of functions in series


Base lightcurve class which allows for standard binning, flattening, loading, etc.
    Typically for objects observed by multiple sectors, campaigns, missions, etc. the `multilc` daughter class should be used instead.


A flexible lightcurve class built from multiple individual lightcurves
       - i.e. a combination of TESS sectors, or an ensemble of both CoRoT, K2 and TESS data

    Example:
    mylc=lc(203311200,'k2')
    mylc.


The core MonoTools model class

    Raises:
        ValueError: [description]

    Returns:
        [type]: [description]


An orbit representing a long-period planet transiting a common central

    This orbit is parameterized by the observables of a transiting system,
    period, phase, duration, and impact parameter.

    Args:
        t0: The midpoint time of a reference transit for each planet in days.
        b: The impact parameters of the orbits.
        duration: The durations of the transits in days.
        r_star: The radius of the star in ``R_sun``.


An orbit representing a long-period planet transiting a common central

    This orbit is parameterized by the observables of a transiting system,
    period, phase, duration, and impact parameter.

    Args:
        t0: The midpoint time of a reference transit for each planet in days.
        b: The impact parameters of the orbits.
        duration: The durations of the transits in days.
        r_star: The radius of the star in ``R_sun``.
        maxper_span: The ratio of max period divided by the span between first and last t0


The core target class which represents an individual star


SNR class. A class for signal-to-noise computation.


Defaults are currently ARTS observing properties.


RFIm class. A class for radio interference mitigation.


interactive prompt objects for printing the license text, a list of
    contributors and the copyright notice.


Define the built-in 'help'.
    This is a wrapper around pydoc.help (with a twist).


    Exception class indicating a problem while executing a management
    command.

    If this exception is raised during the execution of a management
    command, it will be caught and turned into a nicely-printed error
    message to the appropriate output stream (i.e., stderr); as a
    result, raising this exception (with a sensible description of the
    error) is the preferred way to indicate that something has gone
    wrong in the execution of a command.


repeats incoming queue messages to subscribed queues


A container for constant strings representing different coordinate
    systems.


    Wrapper around pywcs.WCS.

    This is primarily to preserve API compatibility with the earlier,
    home-brewed python-wcslib wrapper. It includes:

      * A fix for the reference pixel lying at the zenith;
      * Raises ValueError if coordinates are invalid.


Represents a numeric value with a known small uncertainty (error,
    standard deviation...).

    Numeric operators are overloaded to work with other Uncertain or
    numeric objects.  The uncertainty (error) must be small. Otherwise
    the linearization employed here becomes wrong.


Accessing dict keys like an attribute.


A container class for objects.

    What sort of objects? Well, anything that has a position and we
    want to keep lists of, really. So detections (ie, an individual
    source measurement on an image), sources (ie all the detections of
    a given object in a given image stack) and lightcurves (ie, all
    the sources associated with a given object through time).

    You probably don't want to use this on it's own: see ExtractionResults,
    TargetList or source for more useful derived classes.


Container for the results of running source extraction on an
    ImageData object


Decorator to cache the results of methods.

    Examples in e.g. image.py::

        @Memoize
        def _grids(self):
            return self.__grids()
        grids = property(fget=_grids, fdel=_grids.delete)


Generic mini-ORM object

    Derived objects will need to implement __init__, which for
    practical reasons is split up in __init__ and _init_data: the
    latter is called at the end __init__, so a derived __init__ would
    have super(Derived, self).__init__() at the start and
    super(Derived, self)._init_data() at the end.

    __init__ takes care of setting the id, the supplied `data` dictionary
    and the connection to the database.

    _init_data sets the actual data either from the database (in case
    of a supplied id) or from the `data` dictionary.


Class corresponding to the dataset table in the database


Class corresponding to the images table in the database


Class corresponding to the extractedsource table in the database


An object representing a database connection.


Ensure that the default config files get parsed as expected


    Check that we retrieve the correct position for objects in images centred
    on the North Celestial Pole.

    At the NCP (dec=90), our coordinate system becomes ambiguous. We avoid the
    problem by subtracting an infintesimal quantity from the reference dec,
    such that it is never quite 90 degrees.

    See discussion at issue #4599.


Some sanity checks because of issue #2787.

    Previously, 1 was added or subtracted in the
    pixel <-> sky conversion, resulting in positions
    being one pixel off in both x and y


Verify calculation of standard deviation


Verify sigma-clip algorithm


These tests will check whether null detections are picked up across bands


A quick sanity check


These tests will check that monitoringlist sources are associated only amongst themselves.


    Various basic test-cases of the transient-detection logic.

    In these simple cases we just have one source, fixed image properties,
    and identical min/max image RMS values.

    As a result, we can only test for type 1 / 2 transients here, i.e.
    -type 1: single-epoch, bright enough that we would previously have seen it
        wherever in the image it lies, or
    -type 2: multi-epoch, identified by variability, possibly from forced-fits.

    (Type 0 is a possible single-epoch transient, that might just be a steady
    source fluctuating in a high-RMS region, or might be real transient
    if it's seen in the low-RMS region).


    These unit-tests enumerate the possible cases where we process an image
    with a lower RMS value, and see a new source. Is it a transient, or
    just a steady source that was lost in the noise before?


    We expect to see some steady sources in only one frequency band,
    due to steep spectral indices. We don't want to misclassify these as
    transient without any proof of variability!


    If we have several previous images with non-detections at a position,
    and then we find a new source, we should store the ID of the image with
    the best previous upper limits, so we can later run queries to see how
    decisively 'new' (i.e. how much brighter than previous limits)
    the new source is.


    By testing a field with multiple sources, we at least go some way
    to ensuring there is no misclassification in the SQL queries
    when we have multiple transient candidates in play.


These tests will check the statistical fluxes of a 1-to-1 source associations


    These tests will check the 1-to-many source associations, i.e. two extractedsources
    have the same one counterpart in the runningcatalog


    These tests will check the many-to-1 source associations, i.e. one extractedsource
    that has two (or more) counterparts in the runningcatalog.


    These tests will check the many-to-many source associations, i.e. many extractedsources
    that has two (or more) counterparts in the runningcatalog.


This is a very simple function,
    but it's worth a quick check for numerical consistency,
    since we are utilising two different functions to give the same thing.
    (And if nothing else it enforces a check on future code alterations ).

    For known results, we use pairs of tuples; structure is:
        ( (ra, decl), (x,y,z) )


Test whether skyregions are correctly associated to runcat sources


Check assocsky updates are made correctly when the runningcatalog forks.


    These tests will check the 1-to-1 source associations, i.e. an extractedsource
    has exactly one counterpart in the runningcatalog


    Tests that association and related calculations happen correctly when a
    source is seen in multiple skyregions.


    These tests will check the many-to-many source associations,
    i.e. many extractedsources that has two (or more) counterparts in the
    runningcatalog.

    Here we are effectively checking the behaviour of the graph 'pruning'
    query; _flag_many_to_many_tempruncat(), and also the way those flagged
    associations are then dealt with, e.g. in
    _insert_1_to_many_basepoint_assoc and _insert_1_to_many_assoc.


    To run these tests you need to enable TKP_TESTDBMANAGMENT.

    This is potentially dangerous, since it will create and destroy databases.

    This test expects a test_management db, other connection parameters can be
    set using TKP_DBUSER, TKP_DBPASSWORD, TKP_DBHOST and TKP_DBPORT.


    diskmint.parameters is the object for DiskMINT model
    to keep all the parameters that are needed.

    Here we have two modes to set up the parameters

    1. directly set up the parameters in Python code as changing the attributes
    2. read in a csv file to set up the parameters.


Mission Simulation (backbone) class

    This class is responsible for instantiating all objects required
    to carry out a mission simulation.

    Args:
        scriptfile (string):
            Full path to JSON script file.  If not set, assumes that dictionary has been
            passed through specs.
        nopar (bool):
            Ignore any provided ensemble module in the script or specs and force the
            prototype :py:class:`~EXOSIMS.Prototypes.SurveyEnsemble`. Defaults True
        verbose (bool):
            Input to :py:meth:`~EXOSIMS.util.vprint.vprint`, toggling verbosity of
            print statements. Defaults True.
        logfile (str of None):
            Path to the log file. If None, logging is turned off.
            If supplied but empty string (''), a temporary file is generated.
        loglevel (str):
            The level of log, defaults to 'INFO'. Valid levels are: CRITICAL,
            ERROR, WARNING, INFO, DEBUG (case sensitive).
        checkInputs (bool):
            Validate inputs against selected modules. Defaults True.
        **specs (dict):
            :ref:`sec:inputspec`

    Attributes:
        StarCatalog (StarCatalog module):
            StarCatalog class object
        PlanetPopulation (PlanetPopulation module):
            PlanetPopulation class object
        PlanetPhysicalModel (PlanetPhysicalModel module):
            PlanetPhysicalModel class object
        OpticalSystem (OpticalSystem module):
            OpticalSystem class object
        ZodiacalLight (ZodiacalLight module):
            ZodiacalLight class object
        BackgroundSources (BackgroundSources module):
            Background Source class object
        PostProcessing (PostProcessing module):
            PostProcessing class object
        Completeness (Completeness module):
            Completeness class object
        TargetList (TargetList module):
            TargetList class object
        SimulatedUniverse (SimulatedUniverse module):
            SimulatedUniverse class object
        Observatory (Observatory module):
            Observatory class object
        TimeKeeping (TimeKeeping module):
            TimeKeeping class object
        SurveySimulation (SurveySimulation module):
            SurveySimulation class object
        SurveyEnsemble (SurveyEnsemble module):
            SurveyEnsemble class object
        modules (dict):
            Dictionary of all modules, except StarCatalog
        verbose (bool):
            Boolean used to create the vprint function, equivalent to the
            python print function with an extra verbose toggle parameter
            (True by default). The vprint function can be accessed by all
            modules from EXOSIMS.util.vprint.
        seed (int):
            Number used to seed the NumPy generator. Generated randomly
            by default.
        logfile (str):
            Path to the log file. If None, logging is turned off.
            If supplied but empty string (''), a temporary file is generated.
        loglevel (str):
            The level of log, defaults to 'INFO'. Valid levels are: CRITICAL,
            ERROR, WARNING, INFO, DEBUG (case sensitive).


    Simple Rejection Sampler for arbitrary distributions defined
    via a PDF encoded as a function (or lambda function)

    Args:
        f (function):
            Probability density function.  Must be able to operate
            on numpy ndarrays.  Function does not need to be
            normalized over the sampling interval.
        xMin (float):
            Minimum of interval to sample (inclusive).
        xMax (float):
            Maximum of interval to sample (inclusive).

    Attributes:
        f, xMin, xMax
            As above

    Notes:
        If xMin == xMax, return values will all exactly equal xMin.
        To sample call the object with the desired number of samples.


    Class that facilitates the comparison of the input script fiel for EXOSIMS and the
    outspec for a simulation. CheckScript highlights any differences between the two.

    Args:
        scriptfile (str):
            Full path to scriptfile
        outspec (dict):
            outspec dictionary


Template format for adding singleRunPostProcessing to any plotting utility
    singleRunPostProcessing method is a required method with the below inputs to
    work with runPostProcessing.py


    Approximate Inverse Transform Sampler for arbitrary distributions
    defined via a PDF encoded as a function (or lambda function)

    Args:
        f (function):
            Probability density function.  Must be able to operate
            on numpy ndarrays.  Function does not need to be
            normalized over the sampling interval.
        xMin (float):
            Minimum of interval to sample (inclusive).
        xMax (float):
            Maximum of interval to sample (inclusive).
        nints (int):
            Number of intervals to use in approximating CDF.
            Defaults to 10000

    Attributes:
        f, xMin, xMax
            As above

    Notes:
        If xMin == xMax, return values will all exactly equal xMin.
        To sample call the object with the desired number of samples.


    Decorator. Caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned
    (not reevaluated).

    Code taken directly from the PythonDecoratorLibrary:
        https://wiki.python.org/moin/PythonDecoratorLibrary

    Args:
        func (function):
            Function or instance method to memoize

    Attributes:
        func (function):
            The memoized function or instance method
        cache (dict):
            Dictionary with key-value pairs consisting of function arguments-
            function evaluations


Template format for adding multiRunPostProcessing to any plotting utility
    multiRunPostProcessing method is a required method with the below inputs to work
    with runPostProcessing.py


Simulated Universe module based on SAG13 Planet Population module.

    Attributes:
        earthPF (bool):
            Determines whether to use just Earth's phase function or not


Simulated Universe module based on Dulz and Plavchan occurrence rates.
    attributes:
        earthPF (boolean):
            indicates whether to use Earth's phase function or not


Simulated Universe with copies of the solar system planets assigned to all
    stars


    Simulated universe implementation inteded to work with the Kepler-like
    planetary population implementations.

    Args:
        specs:
            user specified values

    Notes:
        The occurrence rate in these universes is set entirely by the radius
        distribution.


    Simulated universe implementation inteded to work with the Known RV planet
    planetary population and target list implementations.

    Args:
        specs:
            user specified values


Simulated Universe module based on Dulz and Plavchan occurrence rates.


KasdinBraems Optical System class

    This class contains all variables and methods necessary to perform
    Optical System Module calculations in exoplanet mission simulation using
    the model from Kasdin & Braems 2006.

    Args:
        PSF (~numpy.ndarray(float)):
            Default point spread function suppression system. Only used when not
            set in starlight suppression system definition. Defaults to np.ones((3,3))
        **specs:
            user specified values


Nemati Optical System class

    This class contains all variables and methods necessary to perform
    Optical System Module calculations in exoplanet mission simulation using
    the model from Nemati 2014.

    Args:
        k_samp (float):
            Default coronagraphic intrinsice sampling. Only used if not set in
            instrument definition. Defaults to 0.25.
            TODO: move to starlight suppresion system.
        Nlensl (float):
            Total lenslets covered by PSF core.  Only used when not set
            in science instrument definition. Only applies for spectrometers.
            Defaults to 5
        lam_d (float):
            Default instrument design wavelength (in nm).  Only used when not set
            in science instrument definition. Defaults to 500
        lam_c (float):
            Default instrument critical wavelength (in nm).  Only used when not set
            in science instrument definition. Defaults to 500
        MUF_thruput (float):
            Model uncertainty factor core throughput.  Only used when not set
            in science instrument definition. Defaults to 0.91
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        default_vals_extra2 (dict):
            Dictionary of input values to be filled in as defaults in the instrument,
            starlight supporession system and observing modes. These values are specific
            to this module.


r"""Nemati Optical System class

    Optical System Module based on [Nemati2014]_.

    Args:
        CIC (float):
            Default clock-induced-charge (in electrons/pixel/read).  Only used
            when not set in science instrument definition. Defaults to 1e-3
        radDos (float):
            Default radiation dose.   Only used when not set in mode definition.
            Specific defintion depends on particular optical system. Defaults to 0.
        PCeff (float):
            Default photon counting efficiency.  Only used when not set
            in science instrument definition. Defaults to 0.8
        ENF (float):
            Default excess noise factor.  Only used when not set
            in science instrument definition. Defaults to 1.
        ref_dMag (float):
            Reference star :math:`\Delta\mathrm{mag}` for reference differential
            imaging.  Defaults to 3.  Unused if ``ref_Time`` input is 0
        ref_Time (float):
            Faction of time used on reference star imaging. Must be between 0 and 1.
            Defaults to 0
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        default_vals_extra (dict):
            Dictionary of input values to be filled in as defaults in the instrument,
            starlight supporession system and observing modes. These values are specific
            to this module.
        ref_dMag (float):
            Reference star :math:`\Delta\mathrm{mag}` for reference differential
            imaging. Unused if ``ref_Time`` input is 0
        ref_Time (float):
            Faction of time used on reference star imaging.


SLSQPScheduler

    This class implements a continuous optimization of integration times
    using the scipy minimize function with method SLSQP.  ortools with the CBC
    linear solver is used to find an initial solution consistent with the constraints.
    For details see Keithly et al. 2019. Alternatively: Savransky et al. 2017 (SPIE).

    Args:
        **specs:
            user specified values

    Notes:
        Due to the time costs of the current comp_per_inttime calculation in
        GarrettCompleteness this should be used with BrownCompleteness.

        Requires ortools


randomWalkScheduler2

    This class implements a random walk scheduler that selects the
    next target at random from the pool of currently available targets.

    This is useful for mapping out the space of possible mission outcomes
    for a fixed population of planets in order to validate other schedulers.

    The random walk will attempt to first choose from occulter targets before
    defaulting back to the general target list.

    Args:
        occHIPs (iterable nx1):
            List of star HIP numbers to initialize occulter target list.
        **specs:
            user specified values


tieredScheduler_DD - tieredScheduler Dual Detection

    This class implements a version of the tieredScheduler that performs dual-band
    detections


tieredScheduler

    This class implements a tiered scheduler that independently schedules the
    observatory while the starshade slews to its next target.

    Args:
        coeffs (iterable 7x1):
            Cost function coefficients: slew distance, completeness, intTime,
            deep-dive least visited ramp, deep-dive unvisited ramp, unvisited ramp,
            and least-visited ramp
        occHIPs (iterable nx1):
            List of star HIP numbers to initialize occulter target list.
        topstars (integer):
            Number of HIP numbers to recieve preferential treatment.
        revisit_wait (float):
            Wait time threshold for star revisits. The value given is the fraction of a
            characterized planet's period that must be waited before scheduling a
            revisit.
        revisit_weight (float):
            Weight used to increase preference for coronograph revisits.
        GAPortion (float):
            Portion of mission time used for general astrophysics.
        int_inflection (boolean):
            Calculate integration time using the pre-calculated integration time curves.
            Default is False.
        GA_simult_det_fraction (float):
            Fraction of detection time to be considered as GA time.
        promote_hz_stars (boolean):
            Flag that allows promotion of targets with planets in the habitable zone
            to the occulter target list.
        phase1_end (int):
            Number of days to wait before the end of phase 1, when phase 1 ends,
            target promotion begins.
        n_det_remove (int):
            Minimum number of visits with no detections required to filter off star
        n_det_min (int):
            Minimum number of detections required for promotion
        occ_max_visits (int):
            Number of maximum visits to a star allowed by the occulter.
        max_successful_chars (int):
            Maximum number of successful characterizations on a given star before
            it is removed from the target list.
        max_successful_dets (int):
            Maximum number of successful detections on a given star before
            it is removed from the target list.
        nmax_promo_det (int):
            Number of detection on a star required to be promoted regardless of
            detection occurance times.
        lum_exp (int):
            Exponent used in the luminosity weighting function.
        tot_det_int_cutoff (float):
            Number of total days the scheduler is allowed to spend on detections.
        **specs:
            user specified values


linearJScheduler_DDPC - linearJScheduler Dual Detection Parallel
    Charachterization

    This scheduler inherits from the LJS, but is capable of taking in two detection
    modes and two chracterization modes. Detections can then be performed using a
    dual-band mode, while characterizations are performed in parallel.


coroOnlyScheduler - Coronograph Only Scheduler

    This scheduler inherits directly from the prototype SurveySimulation module.

    The coronlyScheduler operates using only a coronograph. The scheduler makes
    detections until stars can be promoted into a characterization list, at which
    point they are charcterized.

    Args:
        revisit_wait (float):
            Wait time threshold for star revisits. The value given is the fraction of a
            characterized planet's period that must be waited before scheduling a
            revisit.
        revisit_weight (float):
            Weight used to increase preference for coronograph revisits.
        n_det_remove (integer):
            Number of failed detections before a star is removed from the target list.
        n_det_min (integer):
            Minimum number of detections required for promotion to char target.
        max_successful_chars (integer):
            Maximum number of successful characterizions before star is taken off
            target list.
        max_successful_dets (integer):
            Maximum number of successful detections before star is taken off target
            list.
        lum_exp (int):
            The exponent to use for luminosity weighting on coronograph targets.
        promote_by_time (bool):
            Only promote stars that have had detections that span longer than half
            a period.
        detMargin (float):
            Acts in the same way a charMargin. Adds a multiplyer to the calculated
            detection time.
        **specs:
            user specified values


linearJScheduler_orbitChar

    This class implements a varient of the linear cost function scheduler described
    in Savransky et al. (2010).

    It inherits directly from the protoype SurveySimulation class.

    The LJS_orbitChar scheduler performs scheduled starshade visits to both detect
    and characterize targets. Once a target is detected, it will be subsequently
    characterized. If the characterization is successful, that taget will be marked
    for further detections to characeterize it's orbit.

    Args:
        coeffs (iterable 6x1):
            Cost function coefficients: slew distance, completeness, least visited known
            RV planet ramp, unvisited known RV planet ramp, least visited ramp,
            unvisited ramp
        revisit_wait (float):
            Wait time threshold for star revisits. The value given is the fraction of a
            characterized planet's period that must be waited before scheduling a
            revisit.
        n_det_remove (int):
            Number of failed detections before a star is removed from the target list.
        n_det_min (int):
            Minimum number of detections required for promotion to char target.
        max_successful_dets (int):
            Maximum number of successful detections before star is taken off target
            list.
        max_successful_chars (int):
            Maximum number of successful characterizations on a given star before
            it is removed from the target list.
        det_only (bool):
            Run the sim only performing detections and no chars.
        char_only (bool:
            Run the sim performing only chars, particularly for precursor RV using
            known_rocky.
        specs (dict):
            :ref:`sec:inputspec`


KnownRVSurvey

    Survey Simulation module based on Know RV planets

    This class uses estimates of delta magnitude (int_dMag) and instrument
    working angle (int_WA) for integration time calculation, specific to
    the known RV planets.

    Args:
        **specs:
            user specified values


linearJScheduler_3DDPC - linearJScheduler 3 Dual Detection Parallel
    Charachterization

    This scheduler inherits from the LJS_DDPC, but is capable of taking in six detection
    modes and six  characterization modes. Detections can then be performed using a
    dual-band mode that is selected from the best available mode-pair, while
    characterizations are performed in parallel.


cbytScheduler - Completeness-by-time Scheduler

    This class implements a Scheduler that selects the current highest
    Completeness/Integration Time.

    Args:
        **specs:
            user specified values


linearJScheduler

    This class implements the linear cost function scheduler described
    in [Savransky2010]_

    Args:
        coeffs (iterable 6x1):
            Cost function coefficients: slew distance, completeness, least visited
            planet ramp, unvisited known RV planet ramp, least visited ramp, unvisited
            ramp
        revisit_wait (float):
            The time required for the scheduler to wait before a target may be revisited
        find_known_RV (boolean):
            A flag that turns on the ability to identify known RV stars. The stars with
            known rocky planets have their int_comp value set to 1.0.
        specs (dict):
            :ref:`sec:inputspec`


occulterJScheduler

    This class inherits linearJScheduler and works best when paired with the
    SotoStarshade Observatory class.

    Args:
        nSteps (integer 1x1):
            Number of steps to take when calculating the cost function.
        useAngles (bool):
            Use interpolated dV angles.
        **specs:
            user specified values


randomWalkScheduler

    This class implements a random walk scheduler that selects the
    next target at random from the pool of currently available targets.

    This is useful for mapping out the space of possible mission outcomes
    for a fixed population of planets in order to validate other schedulers.


linearJScheduler_det_only - linearJScheduler Detections Only

    This class implements the linear cost function scheduler described
    in Savransky et al. (2010).

    This scheduler inherits from the linearJScheduler module but performs only
    detections.

    Args:
        specs:
            user specified values


Stark Zodiacal Light class

    This class contains all variables and methods necessary to perform
    Zodiacal Light Module calculations in exoplanet mission simulation using
    the model from Stark et al. 2014.


Mennesson Zodiacal Light class


PostProcessing2 class

    Updated PostProcessing det_occur function that utilized BackgroundSource
    module GalaxiesFaintStars to calculate FA probability.


Planet density models based on Fortney & Marley, albedo models based on
    Cahoy.  Intended for use with the Kepler-like planet population modules.

    Args:
        **specs:
            user specified values

    Attributes:

    Notes:
    1. The calculation of albedo is based solely on the semi-major axis
    and uses a uniform distribution of metallicities to interpolate albedo from
    the grid in Cahoy et al. 2010.


Planet M-R relation model based on the best-fit model to a planet sample
    with homogenous stellar parameters from SWEET-cat as described in
    Sousa et al. (2024)


Planet M-R relation model based on modification of the FORECASTER
    best-fit model (Chen & Kippling 2016) as described in Savransky et al. (2019)

    This modification forces all planets below hydrogen burning to have a maximum
    radius of 1 R_jupiter and also adds the Saturn density as an explicit point
    in the model


Planet M-R relation model based on the FORECASTER software, Chen & Kippling 2016.

    This module requires to download the fitting_parameters.h5 file from the
    FORECASTER GitHub repository at https://github.com/chenjj2/forecaster
    and add it to the PlanetPhysicalModel directory.

    Args:
        **specs:
            user specified values


    GalaxiesFaintStars class

    This class calculates the total number background sources in number per square
    arcminute, including galaxies and faint stars.


Target list based on Gaia catalog inputs.

    Args:
        **specs:
            user specified values


Target list based on population of known RV planets from IPAC.
    Intended for use with the KnownRVPlanets family of modules.

    Args:
        **specs:
            :ref:`sec:inputspec`

    .. warning:
        fillPhotometry and getKnownPlanets are dissallowed inputs and will be set
        to False if present in the input specification.


Target list in which star positions may be obtained in heliocentric equatorial
    or ecliptic coordinates.

    Args:
        **specs:
            user specified values


Parallelized suvey ensemble based on IPython parallel (ipcluster)


    Population of Jupiter twins (11.209 R_Earth, 317.83 M_Eearth, 1 p_Earth)
    On eccentric orbits (0.7 to 1.5 AU)*5.204.
    Numbers pulled from nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html

    This implementation is intended to enforce this population regardless
    of JSON inputs.  The only inputs that will not be disregarded are erange
    and constrainOrbits.


Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth)
    On circular Habitable zone orbits (0.7 to 1.5 AU)

    Note that these values may not be overwritten by user inputs.
    This implementation is intended to enforce this population regardless
    of JSON inputs.


Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth)
    On circular Habitable zone orbits (0.75 to 1.77 AU)

    Note that these values may not be overwritten by user inputs.
    This implementation is intended to enforce this population regardless
    of JSON inputs.


Planet Population module based on occurrence rate tables from Shannon Dulz and
    Peter Plavchan.

    NOTE: This assigns constant albedo based on radius ranges.

    Attributes:
        SAG13coeffs (float 4x2 ndarray):
            Coefficients used by the SAG13 broken power law. The 4 lines
            correspond to Gamma, alpha, beta, and the minimum radius.
        Gamma (float ndarray):
            Gamma coefficients used by SAG13 broken power law.
        alpha (float ndarray):
            Alpha coefficients used by SAG13 broken power law.
        beta (float ndarray):
            Beta coefficients used by SAG13 broken power law.
        Rplim (float ndarray):
            Minimum radius used by SAG13 broken power law.
        SAG13starMass (astropy Quantity):
            Assumed stellar mass corresponding to the given set of coefficients.
        mu (astropy Quantity):
            Gravitational parameter associated with SAG13starMass.
        Ca (float 2x1 ndarray):
            Constants used for sampling.
        ps (float nx1 ndarray):
            Constant geometric albedo values.
        Rb (float (n-1)x1 ndarray):
            Planetary radius break points for albedos in earthRad.
        Rbs (float (n+1)x1 ndarray):
            Planetary radius break points with 0 padded on left and np.inf
            padded on right


    Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth)
    On eccentric habitable zone orbits (0.7 to 1.5 AU).

    This implementation is intended to enforce this population regardless
    of JSON inputs.  The only inputs that will not be disregarded are erange
    and constrainOrbits.


Population based on Kepler radius distribution with RV-like semi-major axis
    distribution with exponential decay.

    Args:
        **specs:
            user specified values

    Attributes:
        smaknee (float):
            Location (in AU) of semi-major axis decay point (knee).
            Not an astropy quantity.
        esigma (float):
            Sigma value of Rayleigh distribution for eccentricity.

    Notes:
    1. The gen_mass function samples the Radius and calculates the mass from
    there.  Any user-set mass limits are ignored.
    2. The gen_albedo function samples the sma, and then calculates the albedos
    from there. Any user-set albedo limits are ignored.
    3. The Rprange is fixed to (1,22.6) R_Earth and cannot be overwritten by user
    settings (the JSON input will be ignored)
    4. The radius piece-wise distribution (from Fressin et al 2012) provides
    the normalization required to get the proper overall eta.  The gen_radius
    method provided here normalizes in order to return exactly the number of
    samples requested.  A second method (gen_radius_nonorm) is provided for
    generating the simulated universe population. The latter assumes a poisson
    distribution for occurences in each bin.
    5.  Eccentricity is assumed to be Rayleigh distributed with a user-settable
    sigma parameter (defaults to value from Fressin et al 2012).


Planet Population module based on SAG13 occurrence rates.

    NOTE: This assigns constant albedo based on radius ranges.

    Attributes:
        SAG13coeffs (float 4x2 ndarray):
            Coefficients used by the SAG13 broken power law. The 4 lines
            correspond to Gamma, alpha, beta, and the minimum radius.
        Gamma (float ndarray):
            Gamma coefficients used by SAG13 broken power law.
        alpha (float ndarray):
            Alpha coefficients used by SAG13 broken power law.
        beta (float ndarray):
            Beta coefficients used by SAG13 broken power law.
        Rplim (float ndarray):
            Minimum radius used by SAG13 broken power law.
        SAG13starMass (astropy Quantity):
            Assumed stellar mass corresponding to the given set of coefficients.
        mu (astropy Quantity):
            Gravitational parameter associated with SAG13starMass.
        Ca (float 2x1 ndarray):
            Constants used for sampling.
        ps (float nx1 ndarray):
            Constant geometric albedo values.
        Rb (float (n-1)x1 ndarray):
            Planetary radius break points for albedos in earthRad.
        Rbs (float (n+1)x1 ndarray):
            Planetary radius break points with 0 padded on left and np.inf
            padded on right


Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth)
    On circular Habitable zone orbits (0.7 to 1.5 AU)

    .. warning::

        Note that these values may not be overwritten by user inputs.
        This implementation is intended to enforce this population regardless
        of the :ref:`sec:inputspec`.

    Args:
        eta (float):
            Occurrence rate.
        specs (dict):
            :ref:`sec:inputspec`


    Population based on Kepler radius distribution with RV-like semi-major axis
    distribution with exponential decay.

    NOTE: This is an exact clone of KeplerLike1, but uses (approximate)
    inverse transform sampling instead of simple rejection sampling for
    performance improvements.

    Args:
        **specs:
            user specified values

    Attributes:
        smaknee (float):
            Location (in AU) of semi-major axis decay point (knee).
            Not an astropy quantity.
        esigma (float):
            Sigma value of Rayleigh distribution for eccentricity.

    Notes:
    1. The gen_mass function samples the Radius and calculates the mass from
    there.  Any user-set mass limits are ignored.
    2. The gen_albedo function samples the sma, and then calculates the albedos
    from there. Any user-set albedo limits are ignored.
    3. The Rprange is fixed to (1,22.6) R_Earth and cannot be overwritten by user
    settings (the JSON input will be ignored)
    4. The radius piece-wise distribution provides the normalization required to
    get the proper overall eta.  The gen_radius method provided here normalizes
    in order to return exactly the number of samples requested.  A second method
    (gen_radius_nonorm) is provided for generating the simulated universe
    population. The latter assumes a poisson distribution for occurences in each
    bin.
    5.  Eccentricity is assumed to be Rayleigh distributed with a user-settable
    sigma parameter (defaults to 0.25).


    Population based on occurrence rate tables from Shannon Dulz and Peter Plavchan.

    The data comes as either Period-Radius or semi-major axis-mass pairs.
    If occDataPath is not specified, the nominal Period-Radius table is loaded.

    Args:
        specs:
            user specified values

    Attributes:
        starMass:
            stellar mass in M_sun used to convert period to semi-major axis
        occDataPath:
            path on local disk to occurrence rate table
        esigma (float):
            Sigma value of Rayleigh distribution for eccentricity.

    Notes:
    1. Mass/Radius and semi-major axis are specified in occurrence rate tables.
    User specified values will be ignored.
    2. Albedo is sampled as in KeplerLike1 and KeplerLike2.
    3. Eccentricity is Rayleigh distributed with user defined sigma parameter.


Planet Population module based on SAG13 occurrence rates.

    This is the current working model based on averaging multiple studies.
    These do not yet represent official scientific values.

    Attributes:
        SAG13coeffs (float 4x2 ndarray):
            Coefficients used by the SAG13 broken power law. The 4 lines
            correspond to Gamma, alpha, beta, and the minimum radius.
        Gamma (float ndarray):
            Gamma coefficients used by SAG13 broken power law.
        alpha (float ndarray):
            Alpha coefficients used by SAG13 broken power law.
        beta (float ndarray):
            Beta coefficients used by SAG13 broken power law.
        Rplim (float ndarray):
            Minimum radius used by SAG13 broken power law.
        SAG13starMass (astropy Quantity):
            Assumed stellar mass corresponding to the given set of coefficients.
        mu (astropy Quantity):
            Gravitational parameter associated with SAG13starMass.
        Ca (float 2x1 ndarray):
            Constants used for sampling.


    Population of Earth-Like Planets from Brown 2005 paper

    This implementation is intended to enforce this population regardless
    of JSON inputs.  The only inputs that will not be disregarded are erange
    and constrainOrbits.


Population consisting only of known RV planets.  Eccentricity and sma
    distributions are taken from KeplerLike1 (Rayleigh and power law with
    exponential decay, respectively).  Mass is sampled from power law and
    radius is assumed to be calculated from mass via the physical model.

    The data file read in by this class also provides all of the information
    about the target stars, and so no StarCatalog object is needed (only the
    KnownRvPlanetsTargetList implementation).

    To download a new copy of the data file:

    #. Navigate to the IPAC exoplanet archive at
       http://exoplanetarchive.ipac.caltech.edu/cgi-bin/TblView/nph-tblView?app=ExoTbls&config=planets
    #. Type 'radial' (minus quotes) in the 'Discovery Method' search box and hit enter.
    #. In the 'Download Table' menu select 'VOTable Format', 'Download all Columns' and
       'Download Currently Filtered Rows'.
    #. In the 'Download Table' menu  click 'Download Table'.

    Args:
        **specs:
            user specified values

    Attributes:
        smaknee (float):
            Location (in AU) of semi-major axis decay point (knee).
            Not an astropy quantity.
        esigma (float):
            Sigma value of Rayleigh distribution for eccentricity.
        rvplanetfilepath (string):
            Full path to RV planet votable file from IPAC. If None,
            assumes default file in PlanetPopulation directory of EXOSIMS.
        period (astropy Quantity array):
            Orbital period in units of day.  Error in perioderr.
        planetfile (str):
            Name of input file to use
        tper (astropy Time):
            Periastron time in units of jd.  Error in tpererr.

    Notes:


Integration time-adjusted Completeness.  See [Keithly2021b]_

    Args:
        Nplanets (int):
            number of planets to simulate in IAC
        specs:
            user specified values

    Attributes:
        Nplanets (int):
            Number of planets for initial completeness Monte Carlo simulation
        classpath (str):
            Path on disk to Brown Completeness
        filename (str):
            Name of file where completeness interpolant is stored
        updates (float nx5 numpy.ndarray):
            Completeness values of successive observations of each star in the
            target list (initialized in gen_update)


Analytical Completeness class

    This class contains all variables and methods necessary to perform
    Completeness Module calculations based on Garrett and Savransky 2016
    in exoplanet mission simulation.

    The completeness calculations performed by this method assume that all
    planetary parameters are independently distributed. The probability density
    functions used here are either independent or marginalized from a joint
    probability density function.

    Args:
        order_of_quadrature (int):
            The order of quadrature used in the comp_dmag function's fixed quad
            integration. Higher values will give marginal improvements in the
            comp_calc completeness values, but are slower.
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        updates (nx5 ndarray):
            Completeness values of successive observations of each star in the
            target list (initialized in gen_update)


Completeness class template

    This class contains all variables and methods necessary to perform
    Completeness Module calculations in exoplanet mission simulation.

    Args:
        specs:
            user specified values

    Attributes:
        Nplanets (int):
            Number of planets for initial completeness Monte Carlo simulation
        classpath (str):
            Path on disk to Brown Completeness
        filename (str):
            Name of file where completeness interpolant is stored
        updates (float nx5 ndarray):
            Completeness values of successive observations of each star in the
            target list (initialized in gen_update)


Completeness by planet subtype

    Args:
        binTypes (str):
            string specifying the kopparapuBin Types to use
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        Nplanets (int):
            Number of planets for initial completeness Monte Carlo simulation
        classpath (string):
            Path on disk to Brown Completeness
        filename (str):
            Name of file where completeness interpolant is stored
        updates (float nx5 numpy.ndarray):
            Completeness values of successive observations of each star in the
            target list (initialized in gen_update)
        binTypes (str):
            string specifying the kopparapuBin Types to use


    HWO Mission Star List.  Documentation available at:
    https://exoplanetarchive.ipac.caltech.edu/docs/2645_NASA_ExEP_Target_List_HWO_Documentation_2023.pdf    # noqa: E501

    Args:
        forceNew (bool):
            Run a fresh query even if results exist on disk. Defaults False.


    Imaging Mission Database Star Catalog.

    Args:
        star_data_path (str):
            Full path to pickle file with stellar data


SIMBAD300 Catalog class

    This class populates the star catalog used in EXOSIMS from the SIMBAD300
    catalog.


Fake Catalog class
    This class generates an artificial target list of stars with a logistic
    distribution.

    Args:
        ntargs (int):
            Number of targets
        star_dist (float):
            Distance of the stars from observer
        ra0 (float):
            Reference right ascension
        dec0 (float):
            Reference declination


SIMBAD Catalog class

    This class provides the functions to populate the star catalog used in
    EXOSIMS from the SIMBAD star catalog data.


    Catalog generator class that uses astroquery to get stellar properties from SIMBAD

    Args:
        HIP (list or string):
            List of Hipparcos identifiers (HIP numbers) or path to text file.
        **specs:
            :ref:`sec:inputspec`

    Example file format:

        ```HIP 37279```
        ```HIP 97649```


    EXOCAT Catalog class

    This class populates the star catalog used in EXOSIMS from
    Margaret Turnbull's EXOCAT catalog, retrieved from the
    NASA Exoplanet Archive as a VOTABLE.
    Documentation of fields available at:
    https://exoplanetarchive.ipac.caltech.edu/docs/API_mission_stars.html

    Args:
        catalogpath (str):
            Full path to catalog VOTABLE. If None (default) uses default
            catalogfile in  EXOSIMS.StarCatalog directory.
        wdsfilepath (str):
            Full path to WDS catalog
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        Only StarCatalog prototype attributes are used.


Fake catalog with uniformly spaced stars along with extra additional stars

    lon_sep and lat_sep should be in deg

    Args:
        lat_sep (float):
            Ecliptic latitude separation between the uniformly spaced entries
        lon_sep (float):
            Ecliptic longitude separation between the uniformly spaced entries
        star_dist (float):
            Distance of uniformly spaces stars from observer
        lat_extra (array):
            Additional ecliptic latitude values
        lon_extra (array):
            Corresponding additional ecliptic longitude values
        dist_extra (array):
            Corresponding additional distances from the observer
        specs:
            Additional arguments to be passed to parent class


    Gaia-derived Catalog class

    This class populates the star catalog used in EXOSIMS from
    a dump of Gaia DR2 data.

    Args:
        catalogfile (string):
            Name of catalog FITS Table. Defaults to Glt15Dlt200DSNgt4-result.fits
            Assumed to be in downloads directory.
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        Only StarCatalog prototype attributes are used.


Fake Catalog of stars separated uniformly by angle

    Generate a fake catalog of stars that are uniformly separated.

    Args:
        ntargs (int):
            Sqrt of number of target stars to generate. ntargs by ntargs grid in
            ra and dec.
        star_dist (float):
            Star distance from observer
        specs:
            Additional parameters passed to StarCatalog parent class


StarShade Observatory class
    This class is implemented at L2 and contains all variables, functions,
    and integrators to calculate occulter dynamics.


WFIRST Observatory at L2 implementation.
    Contains methods and parameters unique to the WFIRST mission.


StarShade Observatory class

    This class is implemented at L2 and contains all variables, functions,
    and integrators to calculate occulter dynamics.


Observatory at L2 implementation.
    The orbit method from the Observatory prototype is overloaded to implement
    a space telescope on a halo orbit about the Sun-Earth L2 point. This class

    Orbit is stored in pickled dictionary on disk (generated by MATLAB
    code adapted from E. Kolemen (2008).  Describes approx. 6 month halo
    which is then patched for the entire mission duration).


Roman Space Telescope Observatory. Data is retrieved from JPL Horizons.


StarShade Observatory class
    This class is implemented at L2 and contains all variables, functions,
    and integrators to calculate occulter dynamics.

    Args:
        orbit_datapath (str, optional):
            Full path to reference orbit file
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        rc (ipyparallel.Client):
            Client
        dview (ipyparallel.Client):
            Direct view


r""":ref:`SimulatedUniverse` Prototype

    Args:
        fixedPlanPerStar (int, optional):
            If set, every system will have the same number of planets.
            Defaults to None
        Min (float, optional):
            Initial mean anomaly for all planets.  If set, every planet
            has the same mean anomaly at mission start. Defaults to None
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        lucky_planets (bool):
            Used downstream in survey simulation. If True, planets are
            observed at optimal times. Defaults to False
        commonSystemPlane (bool):
            Planet inclinations are sampled as normally distributed about a
            common system plane. Defaults to False
        commonSystemPlaneParams (list(float)):
            [inclination mean, inclination standard deviation, Omega mean, Omega
            standard deviation] defining the normal distribution of
            inclinations and longitudes of the ascending node about a common
            system plane in units of degrees.  Ignored if commonSystemPlane is
            False. Defaults to [0 2.25, 0, 2.25], where the standard deviation
            is approximately the standard deviation of solar system planet
            inclinations.
        commonSystemnEZ (bool):
            Assume same zodi for planets in the same system. Defaults to True.
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        a (astropy.units.quantity.Quantity):
             Planet semi-major axis (length units)
        BackgroundSources (:ref:`BackgroundSources`):
            BackgroundSources object
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        commonSystemPlaneParams (list):
            2 element list of [mean, standard deviation] in units of degrees,
            describing the distribution of inclinations relative to a common orbital
            plane.  Ignored if commonSystemPlane is False.
        commonSystemPlane (bool):
            If False, planet inclinations are independently drawn for all planets,
            including those in the same target system.  If True, inclinations will be
            drawn from a normal distribution defined by
            commonSystemPlaneParams and added to a single inclination value drawn
            for each system.
        Completeness (:ref:`Completeness`):
            Completeness object
        d (astropy.units.quantity.Quantity):
            Current orbital radius magnitude (length units)
        dMag (numpy.ndarray):
            Current planet :math:`\Delta\mathrm{mag}`
        e (numpy.ndarray):
            Planet eccentricity
        fixedPlanPerStar (int or None):
            If set, every system has the same number of planets, given by
            this attribute
        I (astropy.units.quantity.Quantity):
            Planet inclinations (angle units)
        lucky_planets (bool):
            If True, planets are observed at optimal times.
        M0 (astropy.units.quantity.Quantity):
            Initial planet mean anomaly (at mission start time).
        Min (float or None):
            Input constant initial mean anomaly.  If none, initial
            mean anomaly is randomly distributed from a uniform distribution in
            [0, 360] degrees.
        Mp (astropy.units.quantity.Quantity):
            Planet mass.
        nPlans (int):
            Number of planets in all target systems.
        O (astropy.units.quantity.Quantity):
            Planet longitude of the ascending node (angle units)
        OpticalSystem (:ref:`OpticalSystem`):
            Optical System object
        p (numpy.ndarray):
            Planet geometric albedo
        phi (numpy.ndarray):
            Current value of planet phase function.
        phiIndex (numpy.ndarray):
            Intended for use with input
            'whichPlanetPhaseFunction'='realSolarSystemPhaseFunc'
            When None, the default is the phi_lambert function, otherwise it is Solar
            System Phase Functions
        plan2star (numpy.ndarray):
            Index of host star or each planet.  Indexes attributes of TargetsList.
        planet_atts (list):
            List of planet attributes
        PlanetPhysicalModel (:ref:`PlanetPhysicalModel`):
            Planet physical model object.
        PlanetPopulation (:ref:`PlanetPopulation`):
            Planet population object.
        PostProcessing (:ref:`PostProcessing`):
            Postprocessing object.
        r (astropy.units.quantity.Quantity):
            Current planet orbital radius (3xnPlans). Length units.
        Rp (astropy.units.quantity.Quantity):
            Planet radius (length units).
        s (astropy.units.quantity.Quantity):
            Current planet projected separation. Length units.
        sInds (numpy.ndarray):
            Indices of stars with planets.  Equivalent to unique entries of
            ``plan2star``.
        nEZ (numpy.ndarray):
            Number of exozodi for each planet.
        TargetList (:ref:`TargetList`):
            Target list object.
        v (astropy.units.quantity.Quantity):
            Current orbital velocity vector (3xnPlans). Velocity units.
        w (astropy.units.quantity.Quantity):
            Planet argument of periapsis.
        WA (astropy.units.quantity.Quantity):
            Current planet angular separation (angle units)
        ZodiacalLight (:ref:`ZodiacalLight`):
            Zodiacal light object.

    .. note::

        When generating planets, :ref:`PlanetPopulation` attribute ``eta`` is
        treated as the rate parameter of a Poisson distribution.
        Each target's number of planets is a Poisson random variable
        sampled with :math:`\lambda\equiv\eta`.

    .. warning::

        All attributes described as 'current' are updated only when planets are
        observed.  As such, during mission simulations, these values for different
        planets correspond to different times (bookkept in the survey simulation
        object).


:ref:`BackgroundSources` Prototype

    Args:
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        _outspec (dict):
            :ref:`sec:outspec`


:ref:`SurveySimulation` Prototype

    Args:

        scriptfile (str, optional):
            JSON script file.  If not set, assumes that dictionary has been
            passed through specs. Defaults to None\
        ntFlux (int):
            Number of intervals to split integration into for computing
            total SNR. When greater than 1, SNR is effectively computed as a
            Reimann sum. Defaults to 1
        nVisitsMax (int):
            Maximum number of observations (in detection mode) per star.
            Defaults to 5
        charMargin (float):
            Integration time margin for characterization. Defaults to 0.15
        dt_max (float):
            Maximum time for revisit window (in days). Defaults to 1.
        record_counts_path (str, optional):
            If set, write out photon count info to file specified by this keyword.
            Defaults to None.
        revisit_wait (float, optional):
            If set, it is the minimum time (in days) to wait before revisiting current target. Defaults to None.
        nokoMap (bool):
            Skip generating keepout map. Only useful if you're not planning on
            actually running a mission simulation. Defaults to False.
        nofZ (bool):
            Skip precomputing zodical light minima.  Only useful if you're not
            planning on actually running a mission simulation.  Defaults to False.
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        defaultAddExoplanetObsTime (bool):
            If True, time advancement when no targets are observable will add
            to exoplanetObsTime (i.e., wasting time is counted against you).
            Defaults to True
        find_known_RV (bool):
            Identify stars with known planets. Defaults to False
        include_known_RV (str, optional):
            Path to file including known planets to include. Defaults to None
        make_debug_bird_plots (bool, optional):
            If True, makes completeness bird plots for every observation that
            are saved in the cache directory
        debug_plot_path (str, optional):
            Path to save the debug plots in, must be set if
            make_debug_bird_plots is True
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        absTimefZmin (astropy.time.core.Time):
            Absolute time of local zodi minima
        BackgroundSources (:ref:`BackgroundSources`):
            BackgroundSources object
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        cachefname (str):
            Base filename for cache files.
        charMargin (float):
            Integration time margin for characterization.
        Completeness (:ref:`Completeness`):
            Completeness object
        count_lines (list):
            Photon counts.  Only used when ``record_counts_path`` is set
        defaultAddExoplanetObsTime (bool):
            If True, time advancement when no targets are observable will add
            to exoplanetObsTime (i.e., wasting time is counted against you).
        DRM (list):
            The mission simulation.  List of observation dictionaries.
        dt_max (astropy.units.quantity.Quantity):
            Maximum time for revisit window.
        revisit_wait (astropy.units.quantity.Quantity):
            Minimum time (in days) to wait before revisiting.
        find_known_RV (bool):
            Identify stars with known planets.
        fullSpectra (numpy.ndarray(bool)):
            Array of booleans indicating whether a planet's spectrum has been
            fully observed.
        fZmins (dict):
            Dictionary of local zodi minimum value candidates for each observing mode
        fZtypes (dict):
            Dictionary of type of local zodi minimum candidates for each observing mode
        include_known_RV (str, optional):
            Path to file including known planets to include.
        intTimeFilterInds (numpy.ndarray(ind)):
            Indices of targets where integration times fall below cutoff value
        intTimesIntTimeFilter (astropy.units.quantity.Quantity):
            Default integration times for pre-filtering targets.
        known_earths (numpy.ndarray):
            Indices of Earth-like planets
        known_rocky (list):
            Indices of rocky planets
        known_stars (list):
            Stars with known planets
        koMaps (dict):
            Keepout Maps
        koTimes (astropy.time.core.Time):
            Times corresponding to keepout map array entries.
        lastDetected (numpy.ndarray):
            ntarg x 4. For each target, contains 4 lists with planets' detected
            status (boolean),
            exozodi brightness (in units of 1/arcsec2), delta magnitude,
            and working angles (in units of arcsec)
        lastObsTimes (astropy.units.quantity.Quantity):
            Contains the last observation start time for future completeness update
            in units of day
        logger (logging.Logger):
            Logger object
        modules (dict):
            Modules dictionary.
        ntFlux (int):
            Number of intervals to split integration into for computing
            total SNR. When greater than 1, SNR is effectively computed as a
            Reimann sum.
        nVisitsMax (int):
            Maximum number of observations (in detection mode) per star.
        Observatory (:ref:`Observatory`):
            Observatory object.
        OpticalSystem (:ref:`OpticalSystem`):
            Optical system object.
        partialSpectra (numpy.ndarray):
            Array of booleans indicating whether a planet's spectrum has been
            partially observed.
        PlanetPhysicalModel (:ref:`PlanetPhysicalModel`):
            Planet pysical model object
        PlanetPopulation (:ref:`PlanetPopulation`):
            Planet population object
        PostProcessing (:ref:`PostProcessing`):
            Postprocessing object
        propagTimes (astropy.units.quantity.Quantity):
            Contains the current time at each target system.
        record_counts_path (str, optional):
            If set, write out photon count info to file specified by this keyword.
        seed (int):
            Seed for random number generation
        SimulatedUniverse (:ref:`SimulatedUniverse`):
            Simulated universe object
        StarCatalog (:ref:`StarCatalog`):
            Star catalog object
        starExtended (numpy.ndarray):
            TBD
        starRevisit (numpy.ndarray):
            ntargs x 2. Contains indices of targets to revisit and revisit times
            of these targets in units of day
        starVisits (numpy.ndarray):
            ntargs x 1. Contains the number of times each target was visited
        TargetList (:ref:`TargetList`):
            TargetList object.
        TimeKeeping (:ref:`TimeKeeping`):
            Timekeeping object
        valfZmin (astropy.units.quantity.Quantity):
            Minimum local zodi for each target.
        ZodiacalLight (:ref:`ZodiacalLight`):
            Zodiacal light object.


:ref:`TimeKeeping` Prototype

    This class keeps track of the current mission elapsed time
    for exoplanet mission simulation.  It is initialized with a
    mission duration, and throughout the simulation, it allocates
    temporal intervals for observations.  Eventually, all available
    time has been allocated, and the mission is over.
    Time is allocated in contiguous windows of size "duration".  If a
    requested interval does not fit in the current window, we move to
    the next one.

    Args:
        missionStart (float):
            Mission start date in MJD. Defaults to 60634 (11-20-2024)
        missionLife (float):
            Mission duration (in years). Defaults to 0.1
        missionPortion (float):
            Fraction of mission devoted to exoplanet imaging science.
            Must be between 0 and 1. Defaults to 1
        OBduration (float):
            Observing block length (in days). If infinite, do not
            define observing blocks. Defaults to np.inf
        missionSchedule (str, optional):
            Full path to mission schedule file stored on disk.
            Defaults None.
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        currentTimeAbs (astropy.time.core.Time):
            Current absolute mission time in MJD
        currentTimeNorm (astropy.units.quantity.Quantity):
            Current mission time minus mission start time.
        exoplanetObsTime (astropy.units.quantity.Quantity):
            How much time has been used so far on exoplanet science.
        missionFinishAbs (astropy.time.core.Time):
            Mission end time in MJD
        missionLife (astropy.units.quantity.Quantity):
            Total mission duration
        missionPortion (float):
            Fraction of mission devoted to exoplanet science
        missionStart (astropy.time.core.Time):
            Start time of mission in MJD
        OBduration (astropy.units.quantity.Quantity):
            Observing block length
        OBendTimes (astropy.units.quantity.Quantity):
            Array containing the normalized end times of each observing block
            throughout the mission
        OBnumber (int):
            Index of the current observing block (OB). Each
            observing block has a duration, a start time, an end time, and can
            host one or multiple observations
        OBstartTimes (astropy.units.quantity.Quantity):
            Array containing the normalized start times of each observing block
            throughout the mission


:ref:`ZodiacalLight` Prototype

    Args:
        magZ (float):
            Local zodi brightness (magnitudes per square arcsecond).
            Defaults to 23
        magEZ (float)
            Exozodi brightness (mangitudes per square arcsecond).
            Defaults to 22
        varEZ (float):
            Variance of exozodi brightness. If non-zero treat as the
            variance of a log-normal distribution. If zero, do not
            randomly distribute exozodi brightnesses. Defaults to 0
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        F0V (astropy.units.quantity.Quantity):
            V band zero magnitude spectral flux density
        fEZ0 (astropy.units.quantity.Quantity):
            Default surface brightness of exo-zodiacal light in units of 1/arcsec2
        fZ0 (astropy.units.quantity.Quantity):
             Default surface brightness of zodiacal light in units of 1/arcsec2
        fZMap (dict):
            For each starlight suppression system (dict key), holds an array of the
            surface brightness of zodiacal light in units of 1/arcsec2 for each
            star over 1 year at discrete points defined by resolution
        fZTimes (~astropy.time.Time(~numpy.ndarray(float))):
                Absolute MJD mission times from start to end
        global_min (float):
            The global minimum zodiacal light value
        magEZ (float):
            1 exo-zodi brightness magnitude (per arcsec2)
        magZ (float):
            1 zodi brightness magnitude (per arcsec2)
        varEZ (float):
            Variance of exozodi brightness. If non-zero treat as the
            variance of a log-normal distribution. If zero, do not
            randomly distribute exozodi brightnesses.
        zodi_Blam (numpy.ndarray):
            Local zodi table data (W/m2/sr/um)
        zodi_lam (numpy.ndarray):
            Local zodi table data wavelengths (micrometers)


:ref:`SurveyEnsemble` Prototype

    Args:
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)

    .. important::

        The prototype implementation provides no parallelization.
        See :ref:`SurveyEnsemble` for more info.


r""":ref:`PlanetPopulation` Prototype

    Args:
        arange (list(float)):
            [Min, Max] semi-major axis (in AU). Defaults to [0.1,100.]
        erange (list(float)):
            [Min, Max] eccentricity. Defaults to [0.01,0.99]
        Irange (list(float)):
            [Min, Max] inclination (in degrees). Defaults to [0.,180.]
        Orange (list(float)):
            [Min, Max] longitude of the ascending node (in degrees).
            Defaults to [0.,360.]
        wrange (list(float)):
            [Min, Max] argument of periapsis. Defaults to [0.,360.]
        prange (list(float)):
            [Min, Max] geometric albedo. Defaults to [0.1,0.6]
        Rprange (list(float)):
            [Min, Max] planet radius (in Earth radii). Defaults to [1.,30.]
        Mprange (list(float)):
            [Min, Max] planet mass (in Earth masses). Defaults to [1.,4131.]
        scaleOrbits (bool):
            Scale orbits by :math:`\sqrt{L}` where :math:`L` is the stellar luminosity.
            This has the effect of matching insolation distnaces and preserving the
            habitable zone of the population.  Defaults to False.
        constrainOrbits (bool):
            Do not allow orbits where orbital radius can exceed the ``arange`` limits.
            Defaults to False
        eta (float):
            Overall occurrence rate of the population.  The expected number of planets
            per target star. Must be strictly positive, but may be greater than 1
            (if more than 1 planet is expected per star, on average). Defaults to 0.1.
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        arange (astropy.units.quantity.Quantity):
            [Min, Max] semi-major axis
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        constrainOrbits (bool):
            Do not allow orbits where orbital radius can exceed the ``arange`` limits.
        erange (numpy.ndarray):
            [Min, Max] eccentricity.
        eta (float):
            Overall occurrence rate of the population.  The expected number of planets
            per target star. Must be strictly positive, but may be greater than 1
            (if more than 1 planet is expected per star, on average).
        Irange (astropy.units.quantity.Quantity):
            [Min, Max] inclination
        Mprange (astropy.units.quantity.Quantity):
            [Min, Max] planet mass
        Orange (astropy.units.quantity.Quantity):
            [Min, Max] longitude of the ascending node
        pfromRp (bool):
            Albedo is dependent on planetary radius
        PlanetPhysicalModel (:ref:`PlanetPhysicalModel`):
            Planet physical model object
        prange (numpy.ndarray):
            [Min, Max] geometric albedo.
        Rprange (astropy.units.quantity.Quantity):
            [Min, Max] planet radius
        rrange (astropy.units.quantity.Quantity):
            [Min, Max] orbital radius
        scaleOrbits (bool):
            Scale orbits by :math:`\sqrt{L}` where :math:`L` is the stellar luminosity.
            This has the effect of matching insolation distnaces and preserving the
            habitable zone of the population.
        wrange (astropy.units.quantity.Quantity):
            [Min, Max] argument of periapsis.


:ref:`PostProcessing` Prototype

    Args:
        FAP (float):
            False Alarm Probability. See [Kasdin2006]_.
            Defaults to 3e-7
        MDP (float):
            Missed Detection Probability. See [Kasdin2006]_.
            Defaults to 1e-3
        ppFact (float or str):
            Post-processing contrast factor, between 0 and 1.  Either a scalar
            float for constant gain, or a string with the full path to a FITS
            file containing a two-column array for separation-dependent
            gain, where the first column contains the angular separation in
            units of arcsec. Defaults to 1.0
        ppFact_char (float or str):
            Same as ppFact, but for spectral characterization. Defaults to 1.0
        FAdMag0 (float or str)
            Minimum delta magnitude that can be obtained by a false alarm: either
            a scalar for constant dMag, or a string with the full path to a FITS
            file containing a two-column array for separation-dependent
            dMag, where the first column contains the angular separation in
            units of arcsec. Defaults to 15
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        BackgroundSources (:ref:`BackgroundSources`):
            BackgroundSources object
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        FAP (float):
            False Alarm Probability.  See [Kasdin2006]_.
        MDP (float):
            Missed Detection Probability.  See [Kasdin2006]_.
        ppFact (callable):
            Post-processing contrast factor, between 0 and 1, parametrized
            by angular separation
        ppFact_char (callable):
            Same as ppFact, but for characterization
        FAdMag0 (callable):
            Minimum delta magnitude that can be obtained by a false alarm parametrized
            by angular separation


:ref:`Completeness` Prototype

    Args:
        minComp (float):
            Minimum completeness for target filtering. Defaults to 0.1.
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        minComp (float):
            Minimum completeness value for inclusion in target list
        PlanetPhysicalModel (:ref:`PlanetPhysicalModel`):
            Planet physical model object
        PlanetPopulation (:ref:`PlanetPopulation`):
            Planet population object
        updates (numpy.ndarray):
            Dynamic completeness updates array for revisists.


:ref:`StarCatalog` Prototype

    Args:
        ntargs (int):
            Number of stars in catalog. Defaults to 1.
        cachedir (str, optional):
            Full path to cachedir.
            If None (default) use default (see :ref:`EXOSIMSCACHE`)
        VmagFill (float):
            Fill value for V magnitudes. Defaults to 0.1. Must be set to non-zero value
            or TargetList will fail to build.
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        catalog_atts (list):
            All star catalog attributes that were copied in
        ntargs (int):
            Number of stars
        Name (~numpy.ndarray(str)):
            Star names
        Spec (~numpy.ndarray(str)):
            Star spectral types
        Umag (~numpy.ndarray(float)):
            U magnitude
        Bmag (~numpy.ndarray(float)):
            B magnitude
        Vmag (~numpy.ndarray(float)):
            V magnitude
        Rmag (~numpy.ndarray(float)):
            R magnitude
        Imag (~numpy.ndarray(float)):
            I magnitude
        Jmag (~numpy.ndarray(float)):
            J magnitude
        Hmag (~numpy.ndarray(float)):
            H magnitude
        Kmag (~numpy.ndarray(float)):
            K magnitude
        BV (~numpy.ndarray(float)):
            B-V Johnson magnitude
        MV (~numpy.ndarray(float)):
            Absolute V magnitude
        BC (~numpy.ndarray(float)):
            Bolometric correction
        L (~numpy.ndarray(float)):
            Stellar luminosity in Solar luminosities
        Binary_Cut (~numpy.ndarray(bool)):
            Boolean where True is a binary star with companion closer than 10 arcsec
        dist (~astropy.units.Quantity(~numpy.ndarray(float))):
            Distance to star in units of pc
        parx (~astropy.units.Quantity(~numpy.ndarray(float))):
            Parallax in units of mas
        coords (astropy.coordinates.SkyCoord):
            SkyCoord object (ICRS frame) containing right ascension, declination, and
            distance to star in units of deg, deg, and pc
        pmra (~astropy.units.Quantity(~numpy.ndarray(float))):
            Proper motion in right ascension in units of mas/year
        pmdec (~astropy.units.Quantity(~numpy.ndarray(float))):
            Proper motion in declination in units of mas/year
        rv (~astropy.units.Quantity(~numpy.ndarray(float))):
            Radial velocity in units of km/s
        cachedir (str):
            Path to cache directory

    .. note::

        The prototype will generate empty arrays for all attributes of size ntargs.
        These can then be either filled in or overwritten by inheriting implementations.


:ref:`PlanetPhysicalModel` Prototype

    Args:
        whichPlanetPhaseFunction (str):
            Name of phase function to use. See :ref:`PlanetPhysicalModel`.
        **specs:
            :ref:`sec:inputspec`

    Attributes:
        _outspec (dict):
            :ref:`sec:outspec`
        cachedir (str):
            Path to the EXOSIMS cache directory (see :ref:`EXOSIMSCACHE`)
        whichPlanetPhaseFunction (str):
            Name of phase function to use.


Solar system ephemerides class

        This class takes the constants in Appendix D.4 of Vallado as inputs
        and stores them for use in defining solar system ephemerides at a
        given time.

        Args:
            a (list):
                semimajor axis list (in AU)
            e (list):
                eccentricity list
            I (list):
                inclination list
            O (list):
                right ascension of the ascending node list
            w (list):
                longitude of periapsis list
            lM (list):
                mean longitude list

        Each of these lists has a maximum of 4 elements. The values in
        these lists are used to propagate the solar system planetary
        ephemerides for a specific solar system planet.

        Attributes:
            a (list):
                list of semimajor axis (in AU)
            e (list):
                list of eccentricity
            I (list):
                list of inclination
            O (list):
                list of right ascension of the ascending node
            w (list):
                list of longitude of periapsis
            lM (list):
                list of mean longitude values

        Each of these lists has a maximum of 4 elements. The values in
        these lists are used to propagate the solar system planetary
        ephemerides for a specific solar system planet.


r"""Test MissionSim class.


    Global TimeKeeping tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


Compare results of Brown and Garrett completeness modules


    Test GarrettCompleteness specific methods not covered in overloaded
    method unittesting.


    Global Completeness tests.
    Applied to all implementations, for overloaded methods only.

    For any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


    Sonny Rappaport, July 2021, Cornell

    This class tests particular methods from SotoStarshade_Ski.


    Global Observatory tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


r"""Set stdout and stderr to redirect to the named streams.

    Used for eliminating chatter to stdout upon module creation.


r"""Mock object to instrument calling of a named `method' within a given `obj'.

    Used in a with-clause.  Requires the named method, obj.method, to be called at
    least once.  Also: check the returned object's method_args attribute to see
    how the method was called.


    Global SurveySimulation tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


TimeKeeping non-prototype class template.

    This class exists to test import of non-EXOSIMS modules using
    the get_module interface.  It presently takes no arguments
    and does nothing besides initialize itself.

    Args:
        \*\*specs:
            user specified values

    Attributes:
        (none)


PlanetPopulation non-prototype class template (error-containing).

    This class exists to test import of non-EXOSIMS modules using
    the get_module interface.  It presently takes no arguments
    and does nothing besides initialize itself.

    It contains an erroroneous _modtype attribute.

    Args:
        \*\*specs:
            user specified values

    Attributes:
        (none)


PlanetPopulation non-prototype class template.

    This class exists to test import of non-EXOSIMS modules using
    the get_module interface.  It presently takes no arguments
    and does nothing besides initialize itself.

    Args:
        \*\*specs:
            user specified values

    Attributes:
        (none)


PlanetPopulation non-prototype class template (error-containing).

    This class exists to test import of non-EXOSIMS modules using
    the get_module interface.  It presently takes no arguments
    and does nothing besides initialize itself.

    The class has an erroneous name: the class implemented here has a different
    name from the module.

    Args:
        \*\*specs:
            user specified values

    Attributes:
        (none)


    Deterministic simulated universe implementation intended to work with the Known RV planet
    population and target list implementations.  Any two runs give the same universe.

    Args:
    \*\*specs:
        user specified values


    Test updated mass-luminosity relationship functionality in
    TargetList.stellar_mass()


r"""Test TargetList.KnownRVPlanetsTargetList class.


    Sonny Rappaport, July 2021, Cornell

    This class tests GaiaCat1's initialization.


    Global StarCatalog tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


    Sonny Rappaport, July 2021, Cornell

    This class tests HIPfromSimbad.


    Sonny Rappaport, August 2021, Cornell

    This class tests particular methods Nemanti_2019.


    Global OpticalSystem tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


r"""Test SimulatedUniverse.KnownRVPlanetsUniverse class.


    Global SimulatedUniverse tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


Tests the CheckScript tool.


Test rejection sampler and inverse transform sampler since both have
    same set up


r"""Test utility functions.


    Tests the get_dir tool.

    Sonny Rappaport, Cornell, July 2021


Tests specifically for DulzPlavchan coverage


r"""Test PlanetPopulation KeplerLike1 class.


    Global PlanetPopulation tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


r"""Test PlanetPopulation KnownRVPlanets class.


    Global PostProcessing tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


r"""Test TimeKeeping class.


r"""Test SurveySimulation class.


r"""Test OpticalSystem class.


r"""Test Observatory class.


r"""Micro-catalog containing stars for testing.

            The class only supplies the attributes needed by the routine under test.


    Global BackgroundSources tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


    Global ZodiacalLight tests.
    Applied to all implementations, for overloaded methods only.

    Any implementation-specific methods, or to test specific new
    method functionality, separate tests are needed.


Designed to replicate the Kopparapu plot


Collate All Unique Detections

    The purpose of this script is to search through all
    pkl files in a given folder and produce NEIDinfo.txt

    To run from within IPython:

    %run collateAllUniqueDetections.py --searchFolder '/full path to/' --outFolder '/outFolder to put csv file'

    A specific example

    %run collateAllUniqueDetections.py --searchFolder '/home/dean/Documents/SIOSlab' --outFolder '/outFolder to put csv file/collatedData_collationDate.csv'


Designed to plot Planned Completeness and Observed Completeness


Template format for adding singleRunPostProcessing to any plotting utility
    singleRunPostProcessing method is a required method with the below inputs to work with runPostProcessing.py


Designed to plot yield plot histograms


Plotting utility to reproduce Completeness Joint PDF


Designed to plot Rp vs a of Planet Population Generated and Planet Population Observed


This plotting utility plots anything pertaining to keepout maps


linearJScheduler_det_only_sotoSS

    This class implements the linear cost function scheduler described
    in Savransky et al. (2010).

    Args:
        coeffs (iterable 4x1):
            Cost function coefficients: slew distance, completeness,
            target list coverage, revisit weight

        **specs:
            user specified values


tieredScheduler_DD_SLSQP - tieredScheduler Dual Detection SLSQP

    This class implements a version of the tieredScheduler that performs dual-band
    detections and uses the SLSQP scheduler as a base for inheritance.