Build hooks to setup UV and export a requirements.txt for building

    This will be unnecessary after UV support is built-in in aws-lambda-python-alpha,
    https://github.com/aws/aws-cdk/issues/31238


HLS-VI historical processing CDK stack.


Deployment settings for HLS-VI historical processing.


AWS Batch compute environment and queues.


Athena table for querying granule processing event logs


An AWS Batch job running a Docker container


Potential outcomes for granule processing

    Individual jobs may succeed or fail in various ways, but ultimately
    the processing of a granule may only be a success or failure.


Potential outcomes for a compute job (e.g., with AWS Batch)

    This enum describes a job attempt of processing a granule. Failures of a
    job may be retryable due to infrastructure or ephemeral issues.


Event message for granule processing jobs


HLS-VI processing job attempt details


Log granule processing details

    The granule logger describes outcomes from "granule processing events"
    by using S3 as a store for logs and outcome breadcrumbs. In order to
    predictably list or search for information about our granule processing
    system this organizes log information into a set of prefixes based on
    information:

    ```
    ./logs/outcome={outcome}/acquisition_date={YYYY-MM-DD}/granule_id={GRANULE_ID}/
    ```

    This organizes logs by outcome ("success" or "failure") first as we anticipate
    wanting to search and analyze jobs that have "failed" more than the successes.

    Within each prefix job attempts are organized by the attempt. For example:

    ```
    ./logs/outcome=failure/acquisition_date={YYYY-MM-DD}/granule_id={GRANULE_ID}/attempt=1.json
    ./logs/outcome=success/acquisition_date={YYYY-MM-DD}/granule_id={GRANULE_ID}/attempt=2.json
    ```

    When a successful attempt has been logged, any previous attempts that had failures
    are removed from the failure prefix and reorganized into the "success" prefix to
    help prune the prefix containing failures.


Records progression through a granule inventory file


Records progress through all granule inventory files


Tracks progress through HLS inventory


Type hint for AWS Batch job change events


Container for accessing properties about an AWS Batch job details


A high level client for interfacing with AWS Batch


A row from the inventory report text file

    Each row contains:

    * Granule ID
    * Beginning Date Time
        * If the status is not "published" this may be a `\\N` character
        * If published this will be `%Y-%m%-d\\ %H:%M:%S.%f+00`
    * Status => {completed, failed, queued}
    * Published: true | false


AWS credentials permitting direct S3 access


Tests for JobDetail


Mock paginating through AWS Batch ListJobs


Tests for AwsBatchClient


Tests for InventoryProgress


Tests for InventoryTracking


Tests for GranuleTrackerService


Tests for GranuleId


A basic log posterior function class.


Test the routines to calculate the normalized projected distance (z) assuming zero eccentricity.


Uniform limb darkening parameterization


Linear limb darkening parameterization


Quadratic limb darkening parameterization


Triangular quadratic parametrization by Kipping (2013)

    Kipping, D. MNRAS, 435 (3) pp. 2152-2160, 2013


A base class to model flux contamination (blending) in transit light curves.

    A base class to model flux contamination (blending) in transit light curves.

    Notes
    -----
    This class does not implement all the necessary functionality, and is not meant to be used as-is.


Third light contamination based on black body approximation.

    This class offers a simple black-body model for flux contamination in which the target star and the contaminant(s)
    are approximated as black bodies with effective temperatures Tt, Tc1, Tc2, ..., Tcn.


A class that models flux contamination based on stellar spectrum models.


Constant unity transmission.


Filter with a transmission of 1 inside the minimum and maximum wavelengths and 0 outside.


Interpolated tabulated filter.


Transit model for a gravity-darkened fast-rotating oblate star.

    Transit model for a gravity-darkened fast-rotating oblate star following Barnes (ApJ, 2009, 705).


Transit model with quadratic limb darkening (Mandel & Agol, ApJ 580, L171-L175 2002).


Exoplanet transit light curve model


Exoplanet transit over a uniform disk (Mandel & Agol, ApJ 580, L171-L175 2002).


    OpenCL implementation of the transit light curve model with quadratic limb darkening by Mandel and Agol (2002).

    This class implements the quadratic transit model by Mandel & Agol (ApJ 580, L171-L175, 2002) in OpenCL. The class
    can replace `pytransit.QuadraticModel` directly, and offers in most cases a significant performance boost with some
    drawbacks (see the notes below).

    Notes
    ----
    - All the calculations are done in **single precision**. This can affect the results when modelling extremely shallow
      transits, and will certainly affect the model if the times are given in JD. The times should be given relative to
      some constant epoch that maximises the precision (see `pytransit.lpf.lpf.BaseLPF` for an example).


Transit LPF for multiplanet systems.


Radial velocity model.


Class for exoplanet transit modelling.


Log posterior function for TTV estimation for a single planet.


Log posterior function for TDV estimation.

    A log posterior function for TDV estimation. Each light curve represents a single transit, and
    is given a separate free transit centre parameter. The average orbital period and (one) transit
    zero epoch are assumed as known.

    Notes: The number of parameters can grow large with Kepler short-period planets.


Contaminated TESS LPF

    This class implements a log posterior function for a TESS light curve that allows for unknown flux contamination.
    The amount of flux contamination is not constrained.


Log posterior function that combined TESS light curve with ground-based transit light curves.

    Example log posterior function to model a TESS light curve jointly with with ground-based light curves observed in
    arbitrary passbands. The TESS light curve is assumed to contain an unknown amount of light contamination, and the
    ground-based observations are assumed to all be contaminated by an identical source, but the contamination follows
    a physical passband-dependent model.

    **Note:** This LPF is meant to be inherited by an LPF that implements the `read_data` method.


Contaminated TESS LPF for multiplanet systems

    This class implements a log posterior function for a TESS light curve that allows for unknown flux contamination.
    The amount of flux contamination is not constrained.


    Implements the differential evolution optimization method by Storn & Price
    (Storn, R., Price, K., Journal of Global Optimization 11: 341--359, 1997)

    :param fun:
       the function to be minimized

    :param bounds:
        parameter bounds as [npar,2] array

    :param npop:
        the size of the population (5*D - 10*D)

    :param  f: (optional)
        the difference amplification factor. Values of 0.5-0.8 are good in most cases.

    :param c: (optional)
        The cross-over probability. Use 0.9 to test for fast convergence, and smaller
        values (~0.1) for a more elaborate search.

    :param seed: (optional)
        Random seed

    :param maximize: (optional)
        Switch setting whether to maximize or minimize the function. Defaults to minimization.


Cosmology calculation object.


Base class for different models.

    The parameter to the models are provided by a dict mapping the
    parameter name to a Param object.


This is a form of the model without any gravitational
    potential parameters.

    Density, temperature and abunance are all separately fit.


This is a form of the model assuming hydrostatic
    equilibrium. The temperature is calculated from the density and
    pressure computed from the mass model.

    The Pout_logergpcm3 parameter is the outer pressure in log10 erg/cm^3.


This is a form of the model assuming hydrostatic equilibrium,
    but parameterising using the entropy (K), not density.

    As the gas mass can't be calculated directly, the routine iterates
    a number of times to get the density, updating the potential each
    time.

    The Pout_logergpcm3 parameter is the outer pressure in log10 erg/cm^3.


Internal object to use ForkQueue to evaluate multiple profiles
    simultaneously.


For running Markov Chain Monte Carlo.


Parametrize a profile.


A flat profile.


A profile made of bins with a parameter for every N bin.


A binned component using a prior that the values shouldn't jump
    by more than the factor given.


Base class for components with bins which can move.


A profile with control points, using interpolation to find the
    values in between.

    The radii of the control points are parameters (XX_r_999 in log kpc)


Radial profile which has to rise inwards.


Binned data with movable radii.


Interpolated model parametrized in bins, where the value is interpolated between a and b.


Component where bins have increasing widths.
    Not sure this is very useful.

    Adds _dw_* parameters which are delta-widths


An increasing-inward log component.


A profile with control points, using interpolation to find the
    values in between.

    The radii of the control points are model parameters XX_r_YYY (in
    log kpc), where YYY is the index of the annulus 000...999.  The y
    values (XX_YYY) are gradients in log (cm^-3 log kpc^-1).

    This model forces the density profile to increase inwards.


Beta model.

    Model parameters are XX_n0 (log base 10), XX_beta and XX_rc (log10 kpc)


Double beta model.

    Model parameters are XX_n0_N (log base 10), XX_beta_N and XX_rc_N (log10
    kpc), where N is 1 and 2


Density model from Vikhlinin+06, Eqn 3.

    Modes:
    'double': all components
    'single': only first component
    'betacore': only first two terms of first component

    Densities and radii are are log base 10


Temperature model from McDonald+14, equation 1

    Radii are are log base 10


Geometric information about the annuli on the sky.


Count profile in a band.


Hacky lockfile class.


Write to a file, renaming to final name when finished.


Class wraps behaviour of mbproj1.


Base class for forking workers.


Execute function in remote forked process.


Execute function in multiple forked processes.


Base class for parameters.


Model parameter with minimum and maximum value.


Parameter linked to another parameter.

    :param otherpar: other Param to link to


Parameter with a Gaussian/normal prior.


Class to help fitting model, by keeping track of thawed parameters.


Base mass component.


NFW profile.
    Useful detals here:
    http://nedwww.ipac.caltech.edu/level5/Sept04/Brainerd/Brainerd5.html
    and Lisa Voigt's thesis

    Model parameters are nfw_logconc (log10 concentration) and
    nfw_r200_logMpc (log10 r200 in Mpc)


NFW profile which is a function of mass at some overdensity

    Useful detals here:
    http://nedwww.ipac.caltech.edu/level5/Sept04/Brainerd/Brainerd5.html
    and Lisa Voigt's thesis

    This version parameterizes M (for some given overdensity) instead of R200

    Model parameters are nfw_logconc (log10 concentration) and
    nfw_M_logMsun (log10 Msun at overdensity)


Generalised NFW.

    This is an NFW with a free inner slope (alpha).

    rho(r) = rho0 / ( (r/rs)**alpha * (1+r/rs)**(3-alpha) )

    For details see Schmidt & Allen (2007)
    http://adsabs.harvard.edu/doi/10.1111/j.1365-2966.2007.11928.x

    Model parameters are gnfw_logconc (log10 concentration),
    gnfw_r200_logMpc (log10 r200 in Mpc) and gnfw_alpha (alpha
    parameter; 1 is standard NFW).


King potential.

    This is the modified Hubble potential, where
    rho = rho0 / (1+(r/r0)**2)**1.5

    r0 = sqrt(9*sigma**2/(4*Pi*G*rho0))

    We define rho in terms of r0 and sigma

    Model parameters are king_sigma_logkmps (sigma in log10 km/s)
    and king_rcore_logkpc (rcore in log10 kpc).


Point mass.

    Model parameter is pt_M_logMsun, which is point mass in log solar
    masses.


Parametrise mass density using interpolation.

    Model parameters are arb_rho_YYY (mass density in log10 g cm^-3)
    and arb_r_YYY (radii in log10 kpc) for annuli YYY.


Multi-component mass profile made up CmptMass objects.


Object caches count rates for temperatures, densities and
    metallicities.


A helper to get count rates for temperature and densities.


    Wrapper of a GoFish imagecube class containing the emission surface
    extraction methods.

    Args:
        path (str): Relative path to the FITS cube.
        FOV (optional[float]): Clip the image cube down to a specific
            field-of-view spanning a range ``FOV``, where ``FOV`` is in
            [arcsec].
        velocity_range (optional[tuple]): A tuple of the minimum and maximum
            velocity in [m/s] to cut the cube down to.
        restfreq (optional[float]): A user-specified rest-frame frequency in
            [Hz] that will override the one found in the header.


    A container for the emission surface returned by ``detect_peaks``. This
    class has been designed to be created by the ``get_emission_surface``
    function and not by the user.

    Args:
        r_f (array): Radial position of the front surface in [arcsec].
        z_f (array): Vertical position of the front surface in [arcsec].
        I_f (array): Intensity along the front surface in [Jy/beam].
        T_f (array): Brightness temperature along the front surface in [K].
        v (array): Intrinsic velocity in [m/s].
        x (array): Distance along the major axis the point was extracted in
            [arcsec].
        y_n (array): Distance along the minor axis of the near peak for the
            front surface in [arcsec].
        y_f (array): Distance along the minor axis of the far peak for the
            front surface in [arcsec].
        r_b (array): Radial position of the back surface in [arcsec].
        z_b (array): Vertical position of the back surface in [arcsec].
        I_b (array): Intensity along the back surface in [Jy/beam].
        T_b (array): Brightness temperature along the back surface in [K].
        y_n_b (array): Distance along the minor axis of the near peak for the
            back surface in [arcsec].
        y_f_b (array): Distance along the minor axis of the far peak for the
            back surface in [arcsec].
        v_chan (array): The velocity of the channel the point was extracted
            from in [m/s].
        chans (tuple): A tuple of the first and last channels used for the
            emission surface extraction.
        rms (float): Noise in the cube in [Jy/beam].
        x0 (float): Right ascencion offset used in the emission surface
            extraction in [arcsec].
        y0 (float): Declination offset used in the emission surface extraction
            in [arcsec].
        inc (float): Inclination of the disk used in the emission surface
            extraction in [deg].
        PA (float): Position angle of the disk used in the emission surface
            extraction in [deg].
        vlsr (float): Systemic velocity of the system in [m/s].
        r_min (float): Minimum disk-centric radius used in the emission surface
            extraction in [arcsec].
        r_max (array): Maximum disk-centric radius used in the emission surface
            extraction in [arcsec].
        data (array): The data used to extract the emission surface in
            [Jy/beam].
        masks (array): A tuple of the near and far masks used to extract the
            emission surface [bool].


    Class that models surface deformation.

    Based off of:

    https://github.com/matthew-gaddes/SyInterferoPy

    and

    Okada, Surface deformation due to shear and tensile faults in a half-space,
    Bulletin of the Seismological Society of America (1985): 1135-1154


Dataset Generator for sequencially passing files from storange into the model.


Estimate the log(mag) vs mag uncertainty for G, G_BP, G_RP based on Gaia EDR3 photometry.


Tests for the local functions.


 sfh_wrapper class.  EzGal wraps this class around the sfh function.  It takes care of the
	details of passing or not passing parameters


 object = ezal.zf_grid( zf, zs, rest, obs )

	This object class stores grid information calculated by astro_filter.astro_filter for a particular formation redshift.
	It creates and stores interpolation objects to quickly calculate mags and kcors as a function of redshift.


 dust_wrapper class.  EzGal wraps this class around the dust function.  It takes care of the
	details of passing or not passing parameters


callable-object implementation of the Charlot and Fall (2000) dust law


callable-object implementation of the Calzetti et al. (2000) dust law


 ezgal.weight class

	Used to apply weights to EzGal model objects through multiplication


 model = ezgal.ezgal( model_file, is_ised=False, is_fits=False,
    is_ascii=False, has_masses=False, units='a', age_units='gyrs')

    Class for converting galaxy seds as a function of age to magnitudes as a
    function of redshift.
    Reads in bc03 ised files as well as ascii files, effectively replacing
    cm_evolution from the bc03 src files
    Specify a model file.  It should be a bc03 ised file, an ascii file, or a
    model file created with this class (which are stored as fits).
    See ezgal._load_ascii for information on formatting/units for ascii files
    This will automatically try to dtermine which type of file you have passed
    it.  If this fails, you can specify it manually with the is_* flags.

    units, age_units, and has_masses apply only for ascii files.  See
    ezgal._load_ascii()


 csp integrator: a class used to perform CSP integration and return SEDs as a function of age
	for arbitrary star formation histories and dust laws.  This uses csp_region_integrator objects
	to do the actual integration and split up the integral in the case of break points


 model = ezgal.ezgal_light( model_file )

	Stripped down ezgal class for working on systems with only a basic python installation.
	Will only work with ezgal ascii model files


 filter = ezgal.astro_filter( filename, units='a', cosmology=None )

    Loads a filter response curve for use with ezgal
    The file should be a two column ascii files with filter response curves.
    First column should be wavelength (or frequency), second column should be
    total response (fraction).
    By default units are assumed to be angstroms.  Use units='value' To specify
    non-default units.
    To specify units of hertz, set units='Hz' (case-insensitive)
    To specify alternate units (for wavelength) see code list in
    ezgal.utils.to_meters()


filter = ezgal.astro_filter_light( filename, units='a', cosmology=None )


Brute-force spherical harmonic transforms.


    Class to build a network of multiple detectors.

    The functions defined within this class allow to get e.g. the *network* SNR and Fisher matrix.

    :param dict(GWSignal, ...) signals: Dictionary containing one or multiple individual detector objects.
    :param bool, optional verbose: Boolean specifying if the code has to print additional details during execution.


    Implementation of ``SciPy`` 's :py:class:`RegularGridInterpolator` in a ``JAX`` usable way. Essentially ``numpy`` in the original code is changed to ``jax.numpy`` because of assignement issues, arising when using ``vmap`` and ``jacrev``. We also changed the ``+=`` syntax which creates issues in ``JAX``.

    NOTE: ``bounds_error=True`` still does not work with ``vmap`` and jacrev``.


    A context manager for doing a "deep suppression" of stdout and stderr in
    Python, i.e. will suppress all print, even if the print originates in a
    compiled C/Fortran sub-function.
       This will not suppress raised exceptions, since exceptions are printed
    to stderr just before a script exits, and after the context manager has
    exited.

    Full credit goes to https://stackoverflow.com/questions/11130156/suppress-stdout-stderr-print-from-python-functionsorator


    Dummy class used to convert what the configparser read
    into what the argparser create.


    Abstract class to compute waveforms

    :param str objType: The kind of system the wf model is made for, can be ``'BBH'``, ``'BNS'`` or ``'NSBH'``.
    :param float fcutPar: The cut frequency factor of the waveform. This can either be given in :math:`\\rm Hz`, as for :py:class:`gwfast.waveforms.TaylorF2_RestrictedPN`, or as an adimensional frequency (Mf), as for the IMR models.
    :param bool, optional is_newtonian: Boolean specifying if the waveform is a simple Newtonian inspiral.
    :param bool, optional is_tidal: Boolean specifying if the waveform includes tidal effects.
    :param bool, optional is_HigherModes: Boolean specifying if the waveform includes the contribution of sub-dominant (higher-order) modes.
    :param bool, optional is_chi1chi2: Boolean specifying if, in the aligned spins only case, the individual spins are used in place of the ``'chiS'`` and ``'chiA'`` combinations.
    :param bool, optional is_Precessing: Boolean specifying if the waveform includes spin-precession effects.
    :param bool, optional is_LAL: Boolean specifying if the waveform comes from the ``LAL`` library.
    :param bool, optional is_prec_ang: Boolean specifying if, in the precessing spin case, the angular variables of the spins are used, namely ``'thetaJN'``, ``'chi1'``, ``'chi2'``, ``'tilt1'``, ``'tilt2'``, ``'phiJL'``, ``'phi12'``.
    :param bool, optional is_eccentric: Boolean specifying if the waveform includes orbital eccentricity.
    :param bool, optional is_holomorphic: Boolean specifying if the waveform function is holomorphic (needed for derivatives handling).
    :param bool, optional apply_fcut: Boolean specifying if the waveform has to be cut at the chosen maximum frequency specified by ``fcutPar`` (as in ``LAL``) or not.


    Leading order inspiral only waveform model.

    Relevant references: `M. Maggiore -- Gravitational Waves Vol. 1 <https://global.oup.com/academic/product/gravitational-waves-9780198570745?q=Michele%20Maggiore&lang=en&cc=it>`_, chapter 4.

    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`.


    Wrapper for using `LAL <https://wiki.ligo.org/Computing/LALSuite>`_ waveforms.

    :param str approximant: Name of the waveform model to use, as reported in ``LAL``. If an invalid name is provided, the code will list the names of all the available Fourier domain approximants.
    :param float, optional fcutPar: The cut frequency factor of the waveform as an adimensional frequency (Mf).
    :param bool, optional is_tidal: Boolean specifying if the waveform includes tidal effects.
    :param bool, optional is_HigherModes: Boolean specifying if the waveform includes the contribution of sub-dominant (higher-order) modes.
    :param bool, optional is_Precessing: Boolean specifying if the waveform includes spin-precession effects.
    :param bool, optional is_eccentric: Boolean specifying if the waveform includes orbital eccentricity.
    :param float, optional fRef_ecc: The reference frequency for the provided eccentricity, :math:`f_{e_{0}}`.
    :param float, optional fRef: Reference frequency of the waveform, in :math:`\\rm Hz`. If not provided, the minimum of the frequency grid will be used.
    :param bool, optional compute_sequence: Boolean to specify which ``LAL`` function to use among :py:class:`SimInspiralChooseFDWaveformSequence` (``True``) and :py:class:`SimInspiralChooseFDWaveform` (``False``).
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    Wrapper for using TEOBResumSPA waveforms.

    Relevant references:
        [1] `arXiv:1406.6913 <https://arxiv.org/abs/1406.6913>`_

        [2] `arXiv:1506.08457 <https://arxiv.org/abs/1506.08457>`_

        [3] `arXiv:1806.01772 <https://arxiv.org/abs/1806.01772>`_

        [4] `arXiv:1904.09550 <https://arxiv.org/abs/1904.09550>`_

        [5] `arXiv:2001.09082 <https://arxiv.org/abs/2001.09082>`_

        [6] `arXiv:2012.00027 <https://arxiv.org/abs/2012.00027>`_

        [7] `arXiv:2104.07533 <https://arxiv.org/abs/2104.07533>`_

    :param list(list) modes: List of modes to use in the waveform, each one being a list of two elements, representing :math:`l` and :math:`m`, respectively.
    :param float, optional fcutPar: The cut frequency factor of the waveform as an adimensional frequency (Mf).
    :param bool, optional is_tidal: Boolean specifying if the waveform includes tidal effects.
    :param bool, optional is_Precessing: Boolean specifying if the waveform includes spin-precession effects.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    TaylorF2 restricted PN waveform model, with coefficients up to 3.5 PN. The amplitude is thus the same as in Newtonian approximation, and the model is valid only in the *inspiral*.

    This model can include both the contribution of tidal effects at 5 and 6 PN and the contribution of eccentricity up to 3 PN.

    Relevant references:
        [1] `arXiv:0907.0700 <https://arxiv.org/abs/0907.0700>`_

        [2] `arXiv:1107.1267 <https://arxiv.org/abs/1107.1267>`_

        [3] `arXiv:1402.5156 <https://arxiv.org/abs/1402.5156>`_

        [4] `arXiv:1601.05588 <https://arxiv.org/abs/1601.05588>`_

        [5] `arXiv:1605.00304 <https://arxiv.org/abs/1605.00304>`_

    :param float fHigh: The cut frequency factor of the waveform, in :math:`\\rm Hz`. By default this is set to two times the *Innermost Stable Circular Orbit*, ISCO, frequency of a remnant Schwarzschild BH having a mass equal to the total mass of the binary, see :py:data:`gwfast.gwfastGlobals.f_isco`. Another useful value, whose coefficient is provided in :py:data:`gwfast.gwfastGlobals.f_qK`, is the limit of the quasi-Keplerian approximation, defined as in `arXiv:2108.05861 <https://arxiv.org/abs/2108.05861>`_ (see also `arXiv:1605.00304 <https://arxiv.org/abs/1605.00304>`_), which is more conservative than two times the Schwarzschild ISCO.
    :param bool, optional is_tidal: Boolean specifying if the waveform has to include tidal effects.
    :param bool, optional use_3p5PN_SpinHO: Boolean specifying if the waveform has to include the quadratic- and cubic-in-spin contributions at 3.5 PN, which are not included in ``LAL``.
    :param bool, optional phiref_vlso: Boolean specifying if the reference frequency of the waveform has to be set to the *Last Stable Orbit*, LSO, frequency.
    :param bool, optional is_eccentric: Boolean specifying if the waveform has to include orbital eccentricity.
    :param float, optional fRef_ecc: The reference frequency for the provided eccentricity, :math:`f_{e_{0}}`.
    :param str, optional which_ISCO: String specifying if the waveform has to be cut at two times the ISCO frequency of a remnant Schwarzschild (non-rotating) BH or of a Kerr BH, as in `arXiv:2108.05861 <https://arxiv.org/abs/2108.05861>`_ (see in particular App. C), with the fits from `arXiv:1605.01938 <https://arxiv.org/abs/1605.01938>`_. The Schwarzschild ISCO can be selected passing ``'Schw'``, while the Kerr ISCO passing ``'Kerr'``. NOTE: the Kerr option pushes the validity of the model to the limit, and is not the default option.
    :param bool, optional use_QuadMonTid: Boolean specifying if the waveform has to include the spin-induced quadrupole due to tidal effects, with the fits from `arXiv:1608.02582 <https://arxiv.org/abs/1608.02582>`_.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    IMRPhenomD waveform model.

    Relevant references:
        [1] `arXiv:1508.07250 <https://arxiv.org/abs/1508.07250>`_

        [2] `arXiv:1508.07253 <https://arxiv.org/abs/1508.07253>`_

    :param float, optional fRef: Reference frequency of the waveform, in :math:`\\rm Hz`. If not provided, the minimum of the frequency grid will be used.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    IMRPhenomD_NRTidalv2 waveform model.

    Relevant references:
        [1] `arXiv:1508.07250 <https://arxiv.org/abs/1508.07250>`_

        [2] `arXiv:1508.07253 <https://arxiv.org/abs/1508.07253>`_

        [3] `arXiv:1905.06011 <https://arxiv.org/abs/1905.06011>`_

    :param float, optional fRef: Reference frequency of the waveform, in :math:`\\rm Hz`. If not provided, the minimum of the frequency grid will be used.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    IMRPhenomHM waveform model.

    Relevant references:
        [1] `arXiv:1508.07250 <https://arxiv.org/abs/1508.07250>`_

        [2] `arXiv:1508.07253 <https://arxiv.org/abs/1508.07253>`_

        [3] `arXiv:1708.00404 <https://arxiv.org/abs/1708.00404>`_

        [4] `arXiv:1909.10010 <https://arxiv.org/abs/1909.10010>`_

    :param float, optional fRef: Reference frequency of the waveform, in :math:`\\rm Hz`. If not provided, the minimum of the frequency grid will be used.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


    IMRPhenomNSBH waveform model

    The inputs labelled as 1 refer to the BH (e.g. ``'chi1z'``) and with 2 to the NS (e.g. ``'Lambda2'``)

    Relevant references:
        [1] `arXiv:1508.07250 <https://arxiv.org/abs/1508.07250>`_

        [2] `arXiv:1508.07253 <https://arxiv.org/abs/1508.07253>`_

        [3] `arXiv:1509.00512 <https://arxiv.org/abs/1509.00512>`_

        [4] `arXiv:1905.06011 <https://arxiv.org/abs/1905.06011>`_

    :param float, optional fRef: Reference frequency of the waveform, in :math:`\\rm Hz`. If not provided, the minimum of the frequency grid will be used.
    :param bool, optional verbose: Boolean specifying if the code has to print additional details during execution.
    :param kwargs: Optional arguments to be passed to the parent class :py:class:`WaveFormModel`, such as ``is_chi1chi2``.


Class to compute population models, collecting mass, spin, and redshift distributions.


    Class to compute population models in which the mass, spin and redshift distributions are independent.

    :param list parameters: List containing the parameters of the population model.
    :param dict hyperparameters: Dictionary containing the hyperparameters of the population model as keys and their fiducial value as entry.
    :param dict priorlims_parameters: Dictionary containing the parameters of the population model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.
    :param dict kwargs: Keyword arguments passed to the constructor of the population model.


    Class to compute population models in which the mass and redshift distributions are independent.

    :param list parameters: List containing the parameters of the population model.
    :param dict hyperparameters: Dictionary containing the hyperparameters of the population model as keys and their fiducial value as entry.
    :param dict priorlims_parameters: Dictionary containing the parameters of the population model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.
    :param dict kwargs: Keyword arguments passed to the constructor of the population model.


    Class to compute population models in which we only consider the mass distribution for the FIM but keep the and redshift distribution for sampling.

    :param list parameters: List containing the parameters of the population model.
    :param dict hyperparameters: Dictionary containing the hyperparameters of the population model as keys and their fiducial value as entry.
    :param dict priorlims_parameters: Dictionary containing the parameters of the population model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.
    :param dict kwargs: Keyword arguments passed to the constructor of the population model.


r"""
    Class to compute the population Fisher matrix Gamma_Lambda.


    Implementation of ``SciPy`` 's :py:class:`RegularGridInterpolator` in a ``JAX`` usable way. Essentially ``numpy`` in the original code is changed to ``jax.numpy`` because of assignment issues, arising when using ``vmap`` and ``jacrev``. We also changed the ``+=`` syntax which creates issues in ``JAX``.

    NOTE: ``bounds_error=True`` still does not work with ``vmap`` and jacrev``.


    Abstract class to compute redshift distributions.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the redshift model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the redshift model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Power-law redshift distribution of the form :math:`(1+z)^{k_z-1}`.

    Parameters:
        * k_z: Power-law index of the redshift evolution of the merger rate.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Redshift distribution assuming a Madau-Dickinson profile for the star formation rate.

    Parameters:
        * alpha_z: Power-law index governing the rise of the star formation rate at low redshift.
        * beta_z: Power-law index governing the decline of the star formation rate at high redshift.
        * zp: Redshift at which the star formation rate peaks.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Redshift distribution assuming a Madau-Dickinson profile for the star formation rate and a time delay between formation and merger with :math:`P(t_d)\propto t_d^{\alpha_{\tau}}`.

    Parameters:
        * alpha_z: Power-law index governing the rise of the star formation rate at low redshift.
        * beta_z: Power-law index governing the decline of the star formation rate at high redshift.
        * zp: Redshift at which the star formation rate peaks.
        * alpha_tau: Power-law index governing the time delay distribution.
        * tau_min: Minimum time delay between formation and merger, in :math:`{\\rm Myr}`.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.
    :bool, optional verbose: Boolean specifying if the code has to print additional details during execution.


    Abstract class to compute spin distributions.

    :param list parameters: List containing the parameters of the spin model.
    :param dict hyperparameters: Dictionary containing the hyperparameters of the spin model as keys and their fiducial value as entry.
    :param dict priorlims_parameters: Dictionary containing the parameters of the spin model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Default spin model

    Parameters:
        * alpha_chi: alpha shape parameter of the Beta distribution for the spin magnitudes.
        * beta_chi: beta shape parameter of the Beta distribution for the spin magnitudes.
        * zeta_chi: Mixing fraction of mergers from the truncated Gaussian component for spin orientations.
        * sigma_t_chi: Width of the truncated Gaussian component for spin orientations.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the spin model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the spin model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Independent Flat spin model with fixed absolute value

    Parameters:
        * abs_chi: maximum absolute value of the spin

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the spin model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the spin model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Independent Flat spin model

    Parameters:
        * min_chi: minimum value of the spin
        * max_chi: maximum value of the spin

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the spin model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the spin model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Independent truncated Gaussian spin model.

    Parameters:
        * mu_chi: mean of the truncated Gaussian distribution for the spin.
        * sigma_chi: standard deviation of the truncated Gaussian distribution for the spin.

    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the spin model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the spin model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Abstract class to compute mass distributions.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Truncated mass model

    Parameters:
        * alpha_m: Spectral index for the power-law of the primary mass distribution
        * beta_q: Spectral index for the power-law of the mass ratio distribution
        * m_min: Minimum mass of the power-law component of the mass distribution.
        * m_max: Maximum mass of the power-law component of the mass distribution.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Broken Power-Law model.

    Parameters:
        * alpha_m_1: Spectral index for the power-law of the primary mass distribution below m_break.
        * alpha_m_2: Spectral index for the power-law of the primary mass distribution above m_break.
        * beta_q: Spectral index for the power-law of the mass ratio distribution.
        * m_min: Minimum mass of the mass distribution.
        * m_max: Maximum mass of the mass distribution.
        * b_m: The fraction of the way between m_min and m_max at which the primary mass distribution breaks.
        * delta_m: Width of the smoothing component.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Power-Law+Peak model.

    Parameters:
        * alpha_m: Spectral index for the power-law of the primary mass distribution
        * beta_q: Spectral index for the power-law of the mass ratio distribution
        * m_min: Minimum mass of the power-law component of the mass distribution.
        * m_max: Maximum mass of the power-law component of the mass distribution.
        * lambda_peak: Ratio of the power-law to Gaussian component.
        * delta_m: Width of the smoothing component.
        * mu_m: Mean of the Gaussian component.
        * sigma_m: Standard deviation of the Gaussian component.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Multi Peak model.

    Parameters:
        * alpha_m: Spectral index for the power-law of the primary mass distribution
        * beta_q: Spectral index for the power-law of the mass ratio distribution
        * m_min: Minimum mass of the power-law component of the mass distribution.
        * m_max: Maximum mass of the power-law component of the mass distribution.
        * lambda_m: Fraction of systems in the Gaussian components.
        * lambda_1_m: Fraction of systems in the Gaussian components belonging to the lower-mass component.
        * delta_m: Width of the smoothing component.
        * mu_m_1: Mean of the lower-mass Gaussian component.
        * sigma_m_1: Standard deviation of the lower-mass Gaussian component.
        * mu_m_2: Mean of the higher-mass Gaussian component.
        * sigma_m_2: Standard deviation of the higher-mass Gaussian component.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Truncated mass model

    Parameters:
        * alpha_m: Spectral index for the power-law of the primary mass distribution.
        * beta_q: Spectral index for the power-law of the mass ratio distribution.
        * m_min: Minimum mass of the power-law component of the mass distribution.
        * m_max: Maximum mass of the power-law component of the mass distribution.
        * sigma_l: Width of the lower filter of the mass distributions.
        * sigma_h: Width of the upper filter of the mass distributions.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


    Power-Law+Peak model.

    Parameters:
        * alpha_m: Spectral index for the power-law of the primary mass distribution
        * beta_q: Spectral index for the power-law of the mass ratio distribution
        * m_min: Minimum mass of the power-law component of the mass distribution.
        * m_max: Maximum mass of the power-law component of the mass distribution.
        * lambda_peak: Ratio of the power-law to Gaussian component.
        * sigma_l: Width of the lower filter of the mass distributions.
        * sigma_h: Width of the upper filter of the mass distributions.
        * mu_m: Mean of the Gaussian component.
        * sigma_m: Standard deviation of the Gaussian component.

    :param list parameters: List containing the parameters of the mass model.
    :param dict, optional hyperparameters: Dictionary containing the hyperparameters of the mass model as keys and their fiducial value as entry.
    :param dict, optional priorlims_parameters: Dictionary containing the parameters of the mass model as keys and their prior limits value as entry, given as a tuple :math:`(l, h)`.


Class to generate the desired population of events.


Execute the specified python code and insert the output into the document


Container for handling query to Millennium Simulation database


Raised if parsing of yaml file fails for any reason.


Raised if BibTex entry cannot be found online by doi


Stores a BibTeX entry as a dictionary in plain style and provides methods to convert the entry to BibTeX and BibLaTeX.

    Methods:
        - set_key: set the key of a BibTexEntry (stored in entry['ID'])
        - bibtex: return entry as dictionary in BibTeX style
        - biblatex: return entry as dictionary in BibLaTeX stlye
        - as_str: return entry as string in desired format
        - get_abstract: return entry['abstract'] as string in desired format

    Properties:
        - key: the key of a BibtexEntry (stored in entry['ID'])


    all descendants have to have a 'name' property
    This class mainly exist to be able to type hint
    appropriate arguments for indexing containers
    that use the name(s) of the contained objects
    as index.


    An immutable and therefore hashable set of objects with a name attribute, which will
    be used to index the objects in the set.
    It is very much like a dictionary with the difference that the names of its elements have
    itself a meaning. (not only as keys in a dict)
    We need it to access Computers and Mvars quickly (for which we need dict features) and cache the results
    of computations involving arguments of this type (for which purpose it has to be hashable and immutable)


Pickler subclass used by multiprocessing.


Picklable wrapper for a handle.


python's Pickler extended to interpreter sessions


python's Unpickler extended to interpreter sessions and more types


Test class for DataGaussCov.


Test class for NcmDataGaussCov with update covariance.


Test class for NcmDataDist2D.


Test class for NcmDataPoisson.


Test class for NcmDataGaussDiag.


Test class for NcmDataGaussDiag with update covariance.


Test class for serialization.


Test class for serialization with container properties.


Test class for NcmDataDist1D.


Test function for the ODE.

    It describes the right-hand side of the equation $y_x = f(y,x)$.


Test class for IntegralND.


Test class for NcmCSQ1D.


Test class for NcmDataGauss.


Test class for NcmDataGauss with update covariance.


Planck 18 primordial model.


NumCosmo cosmology class.

    Class to handle cosmological calculations using NumCosmo. The class is a wrapper
    around the NumCosmo cosmology, distance, and power-spectrum classes.


Coordinates mapping.

    Dictionary to map the coordinates to the name of the columns in the
    astropy.table.Table.

    :param RA: Right Ascension.
    :param DEC: Declination.
    :param z: Redshift.


Selection criteria for the best candidate.


Distance method to use in the matching.

    :param ANGULAR_SEPARATION: Angular separation between the objects.
    :param QUERY_RADIUS: 3d distance rescaled using the query object radii.
    :param MATCH_RADIUS: 3d distance rescaled using the match object radii.
    :param MIN_RADIUS: 3d distance rescaled using the minimum of the query and match
        object radii.
    :param MAX_RADIUS: 3d distance rescaled using the maximum of the query and match
        object radii.


Sky match mask.

    :param mask: Boolean mask of filtered matches.


Sky match best candidates.

    :param query_filter: Boolean array to filter the query for which we have a best
        candidate.
    :param indices: Array with the best candidates indices.


Class to store the results of the sky match.


Class to match objects in the sky halo-halo, cluster-halo, cluster-cluster.


Enum for GObject enums.


Enum for item types.


This struct tries to emulate gi.TypeInfo.


A simplified interface for the sampling catalogs.


Fit algorithm for Ncm.Fit.


Fit messages for Ncm.Fit.


Fit gradient type for Ncm.Fit.


Fit MC resample type for Ncm.Fit.


Apply style to anything that looks like an email.


Renders human readable transfer speed.


Class implementing logging functions for Ncm.Fit.


Possible linear matter power spectrum models.


A simplified interface for the ensemble sampler NcmFitESMCMC using APES.


Possible walkers for ensemble samplers.


Possible SNIa data sets ids.


Possible BAO data sets ids.


Possible Hubble data sets ids.


Common options for the run command.


Computes the best fit of the model to the data.


Load the experiment file and computes the likelihood once.


Generate Planck 2018 experiment.


Generate JPAS 2024 forecast experiment.


Generate LSST cluster weak lensing experiment.


Generate QSpline experiment.


Generate XCDM experiment.


Compute theory vectory for a given experiment.


Compute the Fisher matrix of the model to the data.


Computes the Fisher matrix of the model to the data and the bias.


Analyzes the results of a MCMC run.


Calibrate the APES sampler using a given catalog.


Plots the corner plot of the catalog.


Visual Heidelberger and Welch.


Get best-fit parameters.


Initial sampler to use for the MCMC.


Parallel sampler to use for the MCMC.


Computes the MCMC using APES.


Computes the Monte Carlo Analysis.


Load an experiment file.

    Common block for commands that load an experiment. All commands that load an
    experiment should inherit from this class.


r"""Truncated Multivariate Normal Distribution.

    Create a normal distribution :math:`X  \sim N ({\mu}, {\Sigma})` subject to linear
    inequality constraints :math:`lb < X < ub` and sample from it using minimax
    tilting. Based on the MATLAB implemention by the authors (reference below).

    :param np.ndarray mu: (size D) mean of the normal distribution
        :math:`\mathbf {\mu}`.
    :param np.ndarray cov: (size D x D) covariance of the normal distribution
        :math:`\mathbf {\Sigma}`.
    :param np.ndarray lb: (size D) lower bound constrain of the multivariate normal
        distribution :math:`\mathbf lb`.
    :param np.ndarray ub: (size D) upper bound constrain of the multivariate normal
        distribution :math:`\mathbf ub`.
    :param Union[int, None] seed: a random seed.

    Note that the algorithm may not work if 'cov' is close to being rank deficient.

    Reference:
    Botev, Z. I., (2016), The normal law under linear restrictions: simulation and
    estimation via minimax tilting, Journal of the Royal Statistical Society
    Series B, 79, issue 1, p. 125-148,

    Example:
        >>> d = 10  # dimensions
        >>>
        >>> # random mu and cov
        >>> mu = np.random.rand(d)
        >>> cov = 0.5 - np.random.rand(d ** 2).reshape((d, d))
        >>> cov = np.triu(cov)
        >>> cov += cov.T - np.diag(cov.diagonal())
        >>> cov = np.dot(cov, cov)
        >>>
        >>> # constraints
        >>> lb = np.zeros_like(mu) - 2
        >>> ub = np.ones_like(mu) * np.inf
        >>>
        >>> # create truncated normal and sample from it
        >>> n_samples = 100000
        >>> samples = TruncatedMVN(mu, cov, lb, ub).sample(n_samples)

    Reimplementation by Paul Brunzema


Possible non-linear matter power spectrum models.


Ellipticity coordinate system.


Mass definition for the halo mass summary.


Galaxy redshift source distribution parameters.


Galaxy redshift source distribution types.


Galaxy shape Gaussian parameters.


Galaxy shape source distribution types.


Halo density profile types.


Cluster position parameters.


Galaxy distribution parameters.

    The galaxy distribution is defined by the minimum and maximum values of right
    ascension and declination, and the galaxy density. The galaxy density is given in
    deg^-2.


Cluster model parameters.


Galaxy distribution model parameters.


Planck 18 baseline data combinations.


J-Pas 2024 Super Sample Covariance types.


Mass-observable relation types.


CCL cosmology parameters.


Class for functions comparison.


Data for a catalog.


Possible interpolation methods Ncm.StatsDist.


Possible interpolation kernels for Ncm.StatsDist.


Cross validation methods for Ncm.StatsDist.


A simple python example model.


Example of defining a new MSetFunc to be used in a MCMC analysis.


A simple data class for the SLine model.


A simple data class for the SLine model based on Ncm.DataGaussCov.


    A parser for losoto parset files.

    Parameters
    ----------
    parsetFile : str
        Name of the parset file.


    Create an h5parm object.

    Parameters
    ----------
    h5parmFile : str
        H5parm filename.
    readonly : bool, optional
        if True the table is open in readonly mode, by default True.
    complevel : int, optional
        compression level from 0 to 9 when creating the file, by default 5.
    complib : str, optional
        library for compression: lzo, zlib, bzip2, by default zlib.

    Notes
    -----
    An `h5parm` object may be used in a ``with`` context. However, be aware
    that the underlying HDF5 file object will be closed as soon as you exit
    the context. To re-open the HDF5 file object, you need to create a new
    ``with`` context using the current `h5parm` object.
    Calling `h5parm.open()` explicitly is *not* recommended, because it is
    not exception-safe.


    Create a solset object

    Parameters
    ----------
    solset : pytables group
        The solution set pytables group object


    Parameters
    ----------
    soltab : pytables Table obj
        Pytable Table object.
    useCache : bool, optional
        Cache all data in memory, by default False.
    **args : optional
        Used to create a selection.
        Selections examples:
        axisName = None # to select all
        axisName = xxx # to select ONLY that value for an axis
        axisName = [xxx, yyy, zzz] # to selct ONLY those values for an axis
        axisName = 'xxx' # regular expression selection
        axisName = {min: xxx} # to selct values grater or equal than xxx
        axisName = {max: yyy} # to selct values lower or equal than yyy
        axisName = {min: xxx, max: yyy} # to selct values greater or equal than xxx and lower or equal than yyy


        This class is a working thread which load parameters from a queue and
        return in the output queue


context manager used to time the operations


    A parser class which re-calibrates the hipparcos 2 data according to Brandt et al. 2022

    This is a monstrous parser class because well it is doing a lot.

    Note that this "Parser" class actually refits the data. This is programmatically poorly set up,
    in the sense that we parse the data and fit it, mixing this class with an AstrometricFitter class... For now,
    this is OK because the objective of this class is mainly so other users can save and inspect the recalibrated
    hipparcos 2 IAD.


    A factory method for HipparcosRereductionDVDBook and HipparcosRereductionJavaTool. It detects
    which format the IAD is in, then chooses and returns the appropriate parser.


    Base class for parsing Hip1, Hip2 and Gaia data. self.epoch, self.covariance_matrix and self.scan_angle are saved
    as pandas.DataFrame. use .values (e.g. self.epoch.values) to call the ndarray version.


    General wrapper for the different fitting and parsing classes.

    :param use_catalog_parallax_factors: True if you want to load and use the hipparcos catalog parallax factors given
    with the IAD, or the gaia parallax factors shipped with the GOST scanning law.
    Set to False if you want to recompute the parallax factors. Default is False.

    data_choice hip2or21 will attempt to see if the input data file is Hip2 (DVD) or Hip21 (java tool), then proceed accordingly.


    :param inverse_covariance_matrices: ndarray of length epoch times with the 2x2 inverse covariance matrices
                                        for each epoch
    :param epoch_times: 1D array
                        array with each epoch. If these are years, then the returned proper motions will
                         be in Angle/year as well. The unit of epoch_times should be the same as central_epoch_ra
                         and central_epoch_dec.
    :param parallactic_pertubations: dict
           {'ra_plx': array-like, 'dec_plx': array-like}
           the pertubations from parallactic motion. e.g. central_ra + parallactic_pertubations['ra_plx']
           would give the skypath (in RA) of the object throughout the time observed, from parallax alone.
    :param fit_degree: int.
                       number of degrees in polynomial fit. fit_degree=1 with parallax would be a five parameter
                       fit. fit_degree=2 with parallax would be a 7 parameter fit.


    A faster version of AstrometricFitter. Can not return errors or the chisquared. Roughly 30 times faster
    per call of fit_line than AstrometricFitter.


    Tests the computation of the parallax factors anew, as well as tests the basis transformations from along-scan
    to ra and dec.


Unit test suite for platesolv().


Unit tests for fit_circle.


Test suite for fit_ellipse().


Unit test suite for fresnelprop()


Unit test suite for fresnelprop_fp() and get_fp().


Unit test suite for do_fft() and do_ifft().


    Test successful and failed loads
    Test default exception behavior


    Unit test suite for pad_crop()

    This will have lots of special cases to handle odd/even sizing and
    truncating vs. non-truncating


Test suite for offcenter_crop().


Unit test suite for xyzern()


Test all the methods of conjugate.


Test suite for valid function inputs.


Test all normal use cases.


Unit tests for psffit.


Unit tests for calc_offset_quadratic.


Unit tests for calc_offset_linear.


Unit tests for bound_value.


Test functionality and inputs of flatten().


Test all the supporting methods of conjugate.


Unit tests for gainmap.py.


Unit tests for inputs failures of gainmap.py.


Unit tests for function to generate a DM probe


Unit tests for function to generate a DM sine


Unit tests for function to generate a DM grid


Unit tests for function to generate a Zernike polynomial on a grid


Unit test suite for do_mft() and do_imft().


Unit test suite for do_offcenter_mft().


Unit test suite for _interval().


Unit tests for combining frames with bad pixel maps


Unit tests for frame cropping


Test the algorithm for amplitude masks as it will be used.


Test the algorithm for complex-valued masks as it will be used.


Integration tests of occastro's stellar offset estimation.


Integration tests of occastro's spot separation estimation.


Test suite for fit_unmasked_pupil().


    Test that fit_pupil_zernikes operates correctly.

    Since fit_pupil_zernikes only calls functions that have their own unit tests,
    we just run one generated example with offsets, etc and check for correct
    result.


    For each check, test with valid and invalid inputs for all three inputs.

    Test valid here as well since most other functions rely on these for
    error checking


Unit tests for cropping math


Unit test suite for dmhtoph().


Unit test suite for volts_to_dmh().


Unit test suite for dmh_to_volts().


Test the methods of darkhole.


Tests for valid YAML inputs of gen_dark_hole_from_yaml().


Unit tests for gm_util.py.


    Unit test suite for calc_complex_occulter().

    Compares against values from the commercial package the Essential Macleod.


Perform unit tests for AMPTHRESH.


Unit and integration tests.


Tests for resampling influence function


    Tests for the main fitting method

    x Test inputs
    x Test with/without defaults
    x Check output is same size as input
    Convolve a setting with a (compact) function and see if we can back it out


    Test the precomputation is done right

    x success
    fails on bad inputs
    builds a known shape (1 poke? 3?)
    x accepts square and rect


Unit tests for shapes.circle().


Unit tests for shapes.ellipse().


Unit tests for shapes.rectangle().


Unit tests for shapes.simple_pupil().


Test that masks are generated as expected.


Unit tests for fit_z_induced_spm_shear.


Unit tests for fit_lyot_stop_mag_clocking.


Unit tests for fit_pupil_mask_offsets and
    fit_shaped_pupil_mask_offsets.


Test suite for compute_norm_factor().


Test suite for coarsely_locate_pupil_offset_once().


Test suite for coarsely_locate_pupil_offset().


Test suite for compute_lateral_offsets.


Test all the supporting methods of maskgen.


Test suite for testing correct Cartesian to polar
    coordinate conversions.


Error for exiting code sections


    This is the master calibration class. Turn this into a metaclass so one cannot instantiate directly;
    it is an abstract class.


    Proxy system model.

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to
    psm_kwargs: dict (unpacked)
        Specfic arguments for the target PSM


    PSM based on linear regression.

    Attributes
    ----------
    lat: float
        Latitude of associated proxy site
    lon: float
        Longitude of associated proxy site
    elev: float
        Elevation/depth of proxy sitex
    corr: float
        Correlation of proxy record against calibration data
    slope: float
        Linear regression slope of proxy/calibration fit
    intercept: float
        Linear regression y-intercept of proxy/calibration fit
    R: float
        Mean-squared error of proxy/calibration fit

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to
    psm_data: dict
        Pre-calibrated PSM dictionary containing current associated
        proxy site's calibration information

    Raises
    ------
    ValueError
        If PSM is below critical correlation threshold.


    PSM based on linear regression w.r.t. temperature or precipitation

    **Important note: This class assumes that all linear PSMs have been
                      pre-calibrated w.r.t. to temperature and precipitation,
                      using the "LinearPSM" class defined above.
                      No attempts at calibration are performed here!
                      The following code only assigns PSM linear regression
                      parameters to individual proxies from fits to temperature
                      OR precipitation/moisture according to a measure of
                      "goodness-of-fit" criteria (here, MSE of the resisduals).

    Attributes
    ----------
    sensitivity: string
        Indicates the sensitivity (temperature vs moisture) of the proxy record
    lat: float
        Latitude of associated proxy site
    lon: float
        Longitude of associated proxy site
    elev: float
        Elevation/depth of proxy site
    corr: float
        Correlation of proxy record against calibration data
    slope: float
        Linear regression slope of proxy/calibration fit
    intercept: float
        Linear regression y-intercept of proxy/calibration fit
    R: float
        Mean-squared error of proxy/calibration fit

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to
    psm_data: dict
        Pre-calibrated PSM dictionary containing current associated
        proxy site's calibration information

    Raises
    ------
    ValueError
        If PSM is below critical correlation threshold.


    PSM based on bivariate linear regression w.r.t. temperature AND precipitation/moisture

    Attributes
    ----------
    lat: float
        Latitude of associated proxy site
    lon: float
        Longitude of associated proxy site
    elev: float
        Elevation/depth of proxy site
    corr: float
        Correlation of proxy record against calibration data
    slope: float
        Linear regression slope of proxy/calibration fit
    intercept: float
        Linear regression y-intercept of proxy/calibration fit
    R: float
        Mean-squared error of proxy/calibration fit

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to
    psm_data: dict
        Pre-calibrated PSM dictionary containing current associated
        proxy site's calibration information

    Raises
    ------
    ValueError
        If PSM is below critical correlation threshold.


    Horizontal interpolator as a PSM.
    Interpolator is a distance-weighted average of surrounding gridpoint values,
    with weights determined by exponentially-decaying function calculated using
    a user-defined influence radius.

    Attributes
    ----------
    RadiusInfluence: float
        Distance-scale used the calculation of exponentially-decaying weights in interpolator (in km)
    sensitivity: string
        Indicates the sensitivity (temperature vs moisture) of the proxy record
        Here set to "None" as this information is irrelevant, but given for
        compatibility with other PSM classes
    lat: float
        Latitude of associated proxy site
    lon: float
        Longitude of associated proxy site
    elev: float
        Elevation/depth of proxy site
    R: float
        Obs. error variance associated to proxy site

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to

    Raises
    ------
    ValueError
        ...


    ...

    Attributes
    ----------

    ...

    lat: float
        Latitude of associated proxy site
    lon: float
        Longitude of associated proxy site
    elev: float
        Elevation/depth of proxy site
    R: float
        Obs. error variance associated to proxy site

    Parameters
    ----------
    config: LMR_config
        Configuration module used for current LMR run.
    proxy_obj: BaseProxyObject like
        Proxy object that this PSM is being attached to.

    Raises
    ------
    ValueError
        ...


    High-level manager to handle loading proxies from multiple sources and
    randomly sampling the proxies.

    Attributes
    ----------
    all_proxies: list(BaseProxyObject like)
        A list of all proxy objects loaded for current reconstruction
    all_ids_by_group: dict{str: list(str)}
        A dictionary holding list of proxy site ids for each proxy type loaded.
    ind_assim: list(int)
        List of indices (pretaining to all_proxies)to be assimilated during the
        reconstruction.
    ind_eval: list(int)
        List of indices of proxies withheld for verification purposes.

    Parameters
    ----------
    config: LMR_config
        Configuration module for current LMR run
    data_range: list(int)
        A two int list defining the beginning and ending time of the
        reconstruction


    Class defining attributes and methods for descendant proxy objects.

    Attributes
    ----------
    id: str
        Proxy site id
    type: str
        Proxy type
    start_yr: int
        Earliest year that data exists for this site
    end_yr: int
        Latest year that data exists for this site
    values: pandas.DataFrame
        Proxy record with time (in years) as the index
    lat: float
        Latitude of proxy site
    lon: float
        Longitude of proxy site
    elev: float
        Elevation/depth of proxy site
    time: ndarray
        List of times for which proxy contains valid data
    psm_obj: BasePSM like
        PSM for this proxy
    psm: function
        Exposed psm mapping function from the psm_obj

    Parameters
    ----------
    config: LMR_config
        Configuration module for current LMR run
    pid -> id
    prox_type -> type
    start_yr
    end_yr
    lat
    lon
    elev
    values
    time

    Notes
    -----
    All proxy object classes should descend from the BaseProxyObject abstract
    class.


    High-level parameters for the PSM builder

    Attributes
    ----------
    lmr_path: str
        Absolute path to central directory where the data (analyses (GISTEMP, HadCRUT...) and proxies)
        are located
    anom_reference_period: tuple(int)
        Reference time period w.r.t. which calibration data anomalies are defined
    calib_period: tuple(int)
        Time period considered for the calibration
    psm_type: str
        Indicates the type of PSM to calibrate. For now, allows 'linear' or 'bilinear'


    Parameters for proxy data

    Attributes
    ----------
    use_from: list(str)
        A list of keys for proxy classes to load from.  Keys available are
        stored in LMR_proxy_pandas_rework.
    proxy_frac: float
        Fraction of available proxy data (sites) to assimilate


        Parameters for PAGES2kv1 Proxy class

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data
        datafile_proxy: str
            Absolute path to proxy records file
        metafile_proxy: str
            Absolute path to proxy meta data
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        proxy_blacklist : list
            A blacklist on proxy records, to eliminate specific records from
            processing
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of measuremant
            tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        simple_filters: dict{'str': Iterable}
            List mapping Pages2k metadata sheet columns to a list of values
            to filter by.


        Parameters for LMRdb proxy class

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data
        datafile_proxy: str
            Absolute path to proxy records file
        metafile_proxy: str
            Absolute path to proxy meta data
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of measuremant
            tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        simple_filters: dict{'str': Iterable}
            List mapping proxy metadata sheet columns to a list of values
            to filter by.


    Parameters for PSM classes

    Attributes
    ----------
    avgPeriod: str
        PSM calibrated on annual or seasonal data: allowed tags are 'annual' or 'season'


        Parameters for the linear fit PSM.

        Attributes
        ----------
        datatag_calib: str
            Source of calibration data for PSM
        datadir_calib: str
            Absolute path to calibration data
        datafile_calib: str
            Filename for calibration data
        dataformat_calib: str
            Data storage type for calibration data
        pre_calib_datafile: str
            Absolute path to precalibrated Linear PSM data
        psm_r_crit: float
            Usage threshold for correlation of linear PSM


        Parameters for the bilinear fit PSM.

        Attributes
        ----------
        datatag_calib_T: str
            Source of calibration temperature data for PSM
        datadir_calib_T: str
            Absolute path to calibration temperature data
        datafile_calib_T: str
            Filename for calibration temperature data
        dataformat_calib_T: str
            Data storage type for calibration temperature data
        datatag_calib_P: str
            Source of calibration precipitation/moisture data for PSM
        datadir_calib_P: str
            Absolute path to calibration precipitation/moisture data
        datafile_calib_P: str
            Filename for calibration precipitation/moisture data
        dataformat_calib_P: str
            Data storage type for calibration precipitation/moisture data
        pre_calib_datafile: str
            Absolute path to precalibrated Linear PSM data
        psm_r_crit: float
            Usage threshold for correlation of linear PSM


This is the master class for the prior data. Inherent to create classes for each prior source.


    Generic object for loading in dictionaries from yaml files,
    and a convenience function for returning loaded information.


    Loads and stores the datasets.yml file and return dictionaries of file
    specifications for each dataset. Information used by psm, prior,
    and forecaster configuration classes.


    Loads and stores the grid_def.yml file and returns dictionaries of
    information necessary to construct a given grid in ESMpy regridding.


    Parameters for reconstruction realization manager LMR_wrapper.

    Attributes
    ----------
    multi_seed: list(int), None
        List of RNG seeds to be used during a reconstruction for each
        realization.  This overrides the 'core.seed' parameter.
    iter_range: tuple(int)
        Range of Monte-Carlo iterations to perform
    param_search: dict{str: Iterable} or None
        Names of configuration parameters to iterate over when performing a
        reconstruction experiment

    Example
    -------
    The param_search dictionary should use the configuration object attribute
    syntax as the key to reference which parameters to iterate over. The
    value should be some iterable object of values to be covered in the
    parameter search::
        param_search = {'core.hybrid_a': (0.6, 0.7, 0.8),
                        'core.inf_factor': (1.1, 1.2, 1.3)}


    High-level parameters of LMR_driver_callable.

    Notes
    -----
    curr_iter attribute is created during initialization

    Attributes
    ----------
    nexp: str
        Name of reconstruction experiment
    lmr_path: str
        Absolute path for the experiment
    online_reconstruction: bool
        Perform reconstruction with (True) or without (False) cycling
    clean_start: bool
        Delete existing files in output directory (otherwise they will be used
        as the prior!)
    use_precalc_ye: bool
        Use pre-existing files for the psm Ye values.  If the file does not
        exist and the required state variables are missing the reconstruction
        will quit.
    recon_period: tuple(int)
        Time period for reconstruction
    nens: int
        Ensemble size
    loc_rad: float
        Localization radius for DA (in km)
    inflation_fact : float
        Covariance inflation factor
    seed: int, None
        RNG seed.  Passed to all random function calls. (e.g. prior and proxy
        record sampling)  Overridden by wrapper.multi_seed.
    datadir_output: str
        Absolute path to working directory output for LMR
    archive_dir: str
        Absolute path to LMR reconstruction archive directory
    write_posterior_Ye: bool
        Flag to indicate whether the analysis_Ye.pckl is to be generated
        or not (large file containing full information on the posterior
        proxy estimates (assimilated proxy records).


    Parameters for proxy data

    Attributes
    ----------
    use_from: list(str)
        A list of keys for proxy classes to load from.  Keys available are
        stored in LMR_proxy_pandas_rework.
    proxy_frac: float
        Fraction of available proxy data (sites) to assimilate
    proxy_timeseries_kind: string
        Type of proxy timeseries to use. 'anom' for animalies or 'asis'
        to keep records as included in the database.
    proxy_availability_filter: boolean
        True/False flag indicating whether filtering of proxy records
        according to data availability over reconstruction period is
        to be performed. If True, only proxies with data covering the
        reconstruction period are retained for assimilation.
        Condition on record completeness is controlled with the next
        config. parameter (see just below).
    proxy_availability_fraction: float
        Minimum threshold on the fraction of available proxy annual data
        over the reconstruction period. i.e. control on the fraction of
        available data that a recors must have in order to be assimilated.


        Parameters for PAGES2kv1Proxy class

        Notes
        -----
        proxy_type_mappings and simple_filters are creating during instance
        creation.

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data *or* None if using default lmr_path
        datafile_proxy: str
            proxy records filename
        metafile_proxy: str
            proxy metadata filename
        dataformat_proxy: str
            File format of the proxy data files
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        proxy_order: list(str):
            Proxy types to be assimilated and
            order of assimilation.
        proxy_psm_type: dict{str:str}
            Association between proxy type and psm type.
        proxy_assim2: dict{ str: list(str)}
            Maps proxy type and measurement to our proxy type keys.
            Uses dictionary with structure {<<proxy type>>: [.. list of measurement
            tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        simple_filters: dict{'str': Iterable}
            List mapping Pages2k metadata sheet columns to a list of values
            to filter by.
        proxy_blacklist: list(str)
            A list of proxy ids to prevent from being used in the reconstruction
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )


        Parameters for LMRdb proxy class

        Notes
        -----
        proxy_type_mappings and simple_filters are creating during instance
        creation.

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data *or* None if using default lmr_path
        datafile_proxy: str
            proxy records filename
        metafile_proxy: str
            proxy metadata filename
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        database_filter: list(str)
            List of databases from which to limit the selection of proxies.
            Use [] (empty list) if no restriction, or ['db_name1', db_name2'] to
            limit to proxies contained in "db_name1" OR "db_name2".
            Possible choices are: 'PAGES1', 'PAGES2', 'LMR_FM'
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of
            measuremant tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        proxy_psm_type: dict{str:str}
            Association between proxy type and psm type.
        simple_filters: dict{'str': Iterable}
            List mapping proxy metadata sheet columns to a list of values
            to filter by.


        Parameters for NCDCdtda proxy class

        Notes
        -----
        proxy_type_mappings and simple_filters are creating during instance
        creation.

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data *or* None if using default lmr_path
        datafile_proxy: str
            proxy records filename
        metafile_proxy: str
            proxy metadata filename
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float or tuple)
            List of proxy time resolutions to use.
            If tuple, indicates a *range* of resolutions.
        database_filter: list(str)
            List of databases from which to limit the selection of proxies.
            Use [] (empty list) if no restriction, or ['db_name1', db_name2'] to
            limit to proxies contained in "db_name1" OR "db_name2".
            Possible choices are: 'PAGES1', 'PAGES2', 'LMR'
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of
            measuremant tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        proxy_psm_type: dict{str:str}
            Association between proxy type and psm type.
        simple_filters: dict{'str': Iterable}
            List mapping proxy metadata sheet columns to a list of values
            to filter by.


    Parameters for PSM classes

    Attributes
    ----------
    avgPeriod: str
        Indicates use of PSMs calibrated on annual or seasonal data:
        allowed tags are 'annual' or 'season'


        Parameters for the linear fit PSM.

        Attributes
        ----------
        datatag_calib: str
            Source key of calibration data for PSM
        datadir_calib: str
            Absolute path to calibration data *or* None if using default
            lmr_path
        datafile_calib: str
            Filename for calibration data
        dataformat_calib: str
            Data storage type for calibration data
        pre_calib_datafile: str
            Absolute path to precalibrated Linear PSM data *or* None if using
            default LMR path
        varname_calib: str
            Variable name to use from the calibration dataset
        psm_r_crit: float
            Usage threshold for correlation of linear PSM


        Parameters for the linear fit PSM, calibrated against
        temperature OR moisture.

        Attributes
        ----------
        datatag_calib_T: str
            Source of temperature calibration data for linear PSM
        datadir_calib_T: str
            Absolute path to temperature calibration data *or* None if using
            default lmr_path
        datafile_calib_T: str
            Filename for temperature calibration data
        datatag_calib_P: str
            Source of precipitation calibration data for linear PSM
        datadir_calib_P: str
            Absolute path to precipitation calibration data *or* None if using
            default lmr_path
        datafile_calib_P: str
            Filename for precipitation calibration data
        dataformat_calib: str
            Data storage type for calibration data
        pre_calib_datafile_T: str
            Absolute path to precalibrated Linear temperature PSM data
        pre_calib_datafile_P: str
            Absolute path to precalibrated Linear precipitation PSM data
        psm_r_crit: float
            Usage threshold for correlation of linear PSM


        Parameters for the horizontal interpolator PSM.

        Attributes
        ----------
        radius_influence : real
            Distance-scale used the calculation of exponentially-decaying
            weights in interpolator (in km)
        datadir_obsError: str
            Absolute path to obs. error variance data
        filename_obsError: str
            Filename for obs. error variance data
        dataformat_obsError: str
            String indicating the format of the file containing obs. error
            variance data
            Note: note currently used by code. For info purpose only.
        datafile_obsError: str
            Absolute path/filename of obs. error variance data


        Parameters for the Bayesian regression PSM for uk37 proxies.

        Attributes
        ----------
        radius_influence : real
            Distance-scale used the calculation of exponentially-decaying
            weights in interpolator (in km)
        datadir_obsError: str
            Absolute path to obs. error variance data
        filename_obsError: str
            Filename for obs. error variance data
        dataformat_obsError: str
            String indicating the format of the file containing obs. error
            variance data
            Note: note currently used by code. For info purpose only.
        datafile_obsError: str
            Absolute path/filename of obs. error variance data


    Parameters for the ensemble DA prior

    Attributes
    ----------
    prior_source: str
        Source of prior data
    datadir_prior: str
        Absolute path to prior data *or* None if using default LMR path
    datafile_prior: str
        Name of prior file to use
    dataformat_prior: str
        Datatype of prior container ('NCD' for netCDF, 'TXT' for ascii files).
        Note: Currently not used.
    state_variables: dict.
       Dict. of the form {'var1': 'kind1', 'var2':'kind2', etc.} where 'var1', 'var2', etc.
       (keys of the dict) are the names of the state variables to be included in the state
       vector and 'kind1', 'kind2' etc. are the associated "kind" for each state variable
       indicating whether anomalies ('anom') or full field ('full') are desired.
    detrend: bool
        Indicates whether to detrend the prior or not. Applies to ALL state variables.
    avgInterval: dict OR list(int)
        dict of the form {'type':value} where 'type' indicates the type of averaging
        ('annual' or 'multiyear').
        If type = 'annual', the corresponding value is a
        list of integers indficsting the months of the year over which the averaging
        is the be performed (ex. [6,7,8] for JJA).
        If type = 'multiyear', the list is composed of a single integer indicating
        the length of the averaging period, in number of years
        (ex. [100] for prior returned as 100-yr averages).
        -OR-
        List of integers indicating the months over which to average the annual prior.
        (as 'annual' above).
    regrid_method: str
        String indicating the method used to regrid the prior to lower spatial resolution.
        Allowed options are:
        1) None : Regridding NOT performed.
        2) 'spherical_harmonics' : Original regridding using pyspharm library.
        3) 'simple': Regridding through simple inverse distance averaging of surrounding grid points.
        4) 'esmpy': Regridding using the ESMpy package. Includes bilinear and
           higher-order patch fit regridding.
    regrid_resolution: int
        Integer representing the triangular truncation of the lower resolution grid (e.g. 42 for T42).
        Not used for 'esmpy' regrid_method.
    esmpy_interp_method: str
        Which ESMpy regridding method to use.  Currently supports bilinear or
        higher-oder patch fit interpolation regridding.
    esmpy_regrid_to: str
        A grid defined in grid_def.yml to use as the regridding target.
        Currently supports 't42' and 'reg_4x5deg'.
    state_variables_info: dict
        Defines which variables represent temperature or moisture.
        Should be modified only if a new temperature or moisture state variable is added.


An instanceable container for all the configuration objects.


    High-level parameters of reconstruction experiment

    Attributes
    ----------
    nexp: str
        Name of reconstruction experiment
    lmr_path: str
        Absolute path for the experiment
    verif_period: list(int)
        Time period over which verification is applied
    iter_range: list(int)
        Number of Monte-Carlo iterations to consider
    datadir_input: str
        Absolute path to working directory output for LMR
    datadir_output: str
        Absolute path to directory where verification results are written
    write_full_verif_dict: boolean
        Whether to write the full eval python dictionary to output directory


        Parameters for PagesProxy class

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data
        datafile_proxy: str
            Absolute path to proxy records file
        metafile_proxy: str
            Absolute path to proxy meta data
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        proxy_blacklist : list
            A blacklist on proxy records, to eliminate specific records from
            processing
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of measuremant
            tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        simple_filters: dict{'str': Iterable}
            List mapping Pages2k metadata sheet columns to a list of values
            to filter by.


        Parameters for NCDC proxy class

        Attributes
        ----------
        datadir_proxy: str
            Absolute path to proxy data
        datafile_proxy: str
            Absolute path to proxy records file
        metafile_proxy: str
            Absolute path to proxy meta data
        dataformat_proxy: str
            File format of the proxy data
        regions: list(str)
            List of proxy data regions (data keys) to use.
        proxy_resolution: list(float)
            List of proxy time resolutions to use
        proxy_blacklist : list
            A blacklist on proxy records, to eliminate specific records from
            processing
        database_filter: list(str)
            List of databases from which to limit the selection of proxies.
            Use [] (empty list) if no restriction, or ['db_name1', db_name2'] to limit to
            proxies contained in "db_name1" OR "db_name2".
            Possible choices are: 'PAGES1', 'PAGES2', 'LMR_FM'
        proxy_order: list(str):
            Order of assimilation by proxy type key
        proxy_assim2: dict{ str: list(str)}
            Proxy types to be assimilated.
            Uses dictionary with structure {<<proxy type>>: [.. list of measuremant
            tags ..] where "proxy type" is written as
            "<<archive type>>_<<measurement type>>"
        proxy_type_mapping: dict{(str,str): str}
            Maps proxy type and measurement to our proxy type keys.
            (e.g. {('Tree ring', 'TRW'): 'Tree ring_Width'} )
        simple_filters: dict{'str': Iterable}
            List mapping proxy metadata sheet columns to a list of values
            to filter by.


    Parameters for PSM classes

    Attributes
    ----------
    avgPeriod: str
        Indicates use of PSMs calibrated on annual or seasonal data: allowed tags are 'annual' or 'season'


        Parameters for the linear fit PSM.

        Attributes
        ----------
        datatag_calib_T: str
            Source of temperature calibration data for linear PSM
        datadir_calib_T: str
            Absolute path to temperature calibration data *or* None if using
            default lmr_path
        datafile_calib_T: str
            Filename for temperature calibration data
        datatag_calib_P: str
            Source of precipitation calibration data for linear PSM
        datadir_calib_P: str
            Absolute path to precipitation calibration data *or* None if using
            default lmr_path
        datafile_calib_P: str
            Filename for precipitation calibration data
        dataformat_calib: str
            Data storage type for calibration data
        pre_calib_datafile_T: str
            Absolute path to precalibrated Linear temperature PSM data
        pre_calib_datafile_P: str
            Absolute path to precalibrated Linear precipitation PSM data
        psm_r_crit: float
            Usage threshold for correlation of linear PSM


    Given the target and a channel dict, it propagates the target light over the channels

    Parameters
    ----------
    channels: dict
        main payload. Default is None
    target: Target

    Returns
    -------
    QTable:
        return the output table of propagated signal

    Examples
    --------


    Given the target and a channel dict, it propagates the target foreground light over the channels

    Parameters
    ----------
    channels: dict
        main payload. Default is None
    target: Target

    Returns
    -------
    QTable:
        return the output table of propagated signal

    Examples
    --------


    It estimate the zodiacal radiance in the target direction for a specific wl range

    Parameters
    -----------
    zodi: dict
        zodiacal foreground description
    target: Target
        target class
    wl_range: (float, float)
        wavelength range to investigate. (wl_min, wl_max)

    Returns
    -------
    Target:
        updated target class


    It estimate the foreground radiance in the target direction for a specific wl range

    Parameters
    -----------
    foreground: dict
        foreground description
    target: Target
        target class
    wl_range: (float, float)
        wavelength range to investigate. (wl_min, wl_max)

    Returns
    -------
    Target:
        updated target class


    It estimate the foreground radiance in the target direction for a specific wl range

    Parameters
    -----------
    foregrounds: dict
        foregrounds description
    target: Target
        target class
    wl_range: (float, float)
        wavelength range to investigate. (wl_min, wl_max)

    Returns
    -------
    Target:
        updated target class


    Reads the xml file with payload description and return an object with attributes related to the input data

    Parameters
    ----------
    filename: string
        input xml file location
    config_path: string (optional)
        on-run setting for ConfigPat. Default is None.

    Returns
    -------
    dict:
        parsed xml input file

    Raises
    ------
        IOError
            if the indicated file is not found or the format is not supported

    Examples
    --------
    >>> loadOptions = LoadOptions()
    >>> options = loadOptions(filename = 'path/to/file.xml')


Base class for tasks.


    Parameters
    ----------
    target: Target
        target to prepare
    channel : dict
        channel to analyse
    payload : dict
        payload description

    Returns
    -------
    Target:
        same target with table attribute updated


    Parameters
    ----------
    target: Target
        target to prepare
    channels : dict
        channel list to analyse

    Returns
    -------
    Target:
        same target with table attribute updated


    Initialize and build an instrument

    Parameters
    ----------
    type: str
        instrument class
    name: str
        instrument name
    description: dict
        instrument description dictionary
    payload: dict
        main payload. Default is None
    write: bool
        set to True to write the built dict to file. Default is None
    output: str
        output object

    Returns
    -------
    Instrument:
        return the built instrument class

    Raises
    ------
        KeyError
            if the indicated instrument class is not supported

    Examples
    --------
    >>> buildInstrument = BuildInstrument()
    >>> instrument = buildInstrument(type='photometer', name='Phot',
    >>>                              description=payload['channel']['Phot'],
    >>>                              payload=payload, write=False, output=None)


    Initialize and build all the channels in the payload

    Parameters
    ----------
    payload: dict
        main payload. Default is None
    write: bool
        set to True to write the built dict to file. Default is None
    output: str
        output object
    Returns
    -------
    dict:
        return a dict of built Instrument classes

    Examples
    --------
    >>> buildChannels = BuildChannels()
    >>> channels = buildChannels(payload=payload, write=False, output=None)


    Loads payload and channels from dict

    Parameters
    ----------
    input: dict
        main dictionary

    Returns
    -------
    dict:
        payload dict
    dict:
        return a dict of built Instrument classes

    Examples
    --------
    >>> loadPayload = LoadPayload()
    >>> channels = loadPayload(input=input)