/**
 * Generates an HTML structure of form elements and
 * ties it to an onSubmit callback.
 * @param {Array} forms list of config objects, representing form items.
 * @param {String} form.type must match TEXT, TEXT_AREA, or other type listed above.
 * @param {String} form.label arbitrary label for the field.
 * @param {Function} form.validate function returning true or false based on the form input.
 * @param {String} form.error text to display when a form doesn't pass validation.
 * @return {JSX}
 */


/**
 * The Smart-Handoff component directs users to select specific layer products
 * in NASA's Earthdata Search web tool that will proceed in fetching corresponding
 * layer data and granule files that are available for download.
 */


/*
 * A table that updates with image
 * data
 *
 * @class ResolutionTable
 * @extends React.Component
 */


/*
 * DateInputColumn used in DateSelector within
 * Timeline and AnimationWidget
 *
 * @class DateInputColumn
 */


/*
 * @class CopyClipboardTooltip
 * @extends React.PureComponent
 */


/*
 * Change timescale interval (time unit) by selecting from default timescales
 * and custom (if available) in tooltip visible upon hover of current timescale
 * above the LEFT/RIGHT increment arrows (ex: hover over '1 day' for example)
 *
 * @class TimeScaleIntervalChange
 * @extends PureComponent
 */


/*
 * Tooltip appears on hover with clickable timeScales based on subdaily availabilty
 *
 * @class AxisTimeScaleChangeTooltip
 * @extends PureComponent
 */


/*
 * Parent element for timeScale change controls and tooltip
 * on the right side of the timeline
 *
 * @class AxisTimeScaleChange
 * @extends React.Component
 */


/*
 * Up/down arrows for changing timeScale, also wrapper for tooltip
 *
 * @class AxisTimeScaleChangeControls
 * @extends PureComponent
 */


/*
 * Coverage Item Container for individual layer temporal coverage.
 *
 * @class CoverageItemContainer
 */


/*
 * Layer Coverage Container item list.
 *
 * @class CoverageItemList
 */


/*
 * Coverage Line for DOM Element layer coverage.
 *
 * @class CoverageLine PureComponent
 */


/*
 * Timeline Layer Coverage Panel for temporal coverage.
 *
 * @class TimelineLayerCoveragePanel
 */


/*
 * Draggers used in default and A/B comparison
 *
 * @class Dragger
 * @extends PureComponent
 */


/*
 * Dragger container used to conditionally render based on selected dragger
 * this is necessary for svg dragger z-index (ex: allow B to drag over A if B being dragged)
 *
 * @class DraggerContainer
 * @extends PureComponent
 */


/*
 * AxisHoverLine for axis hover
 *
 * @class AxisHoverLine
 * @extends PureComponent
 */


/*
 * Date tooltip for hover and draggers
 *
 * @class DateTooltip
 * @extends Component
 */


/*
 * @class ShareToolTips
 * @extends React.PureComponent
 */


// import safeLocalStorage from '../../util/local-storage';


    Pydantic model class for VisiOmatic pixel values.

    Parameters
    ----------
    values: list[float | None]
        Pixel values.


    Pydantic model class for pixels.

    Parameters
    ----------
    x: int
        x coordinate of the pixel.
    y: int
        y coordinate of the pixel.
    values: list[float, None]
        Pixel values.


    Pydantic model class for VisiOmatic profiles.

    Parameters
    ----------
    profile: list[PixelModel]
        List of pixel models.


    Pydantic tiled model class.

    Parameters
    ----------
    type: str
        Name of the web service.
    version: str
        Version of the web service.
    full_size: List[int]
        Full raster size, FITS style (x comes first).
    tile_size: List[int]
        Tile size, FITS style.
    tile_levels: int
        Number of levels in the image pyramid.
    channels: int
        Number of channels.
    bits_per_channel: int
        Number of bits per pixel.
    brightness:  float
        Relative tile brightness (black level).
    contrast:  float
        Relative tile contrast.
    color_saturation:  float
        Tile color saturation.
    gamma: float
        Tile display gamma.
    quality: int
        JPEG quality (0-100).
    header: dict
        Image header keyword/value pairs.
    images: List[ImageModel]
        List of image model objects.


    Class for the tiled image pyramid to be visualized.

    Parameters
    ----------
    filename: str | ~pathlib.Path,
        Path to the image.
    extnum: int, optional
        Extension number (for Multi-Extension FITS files).
    tilesize: tuple[int, int], optional
        shape of the served tiles.
    minmax: tuple[float, float], optional
        Intensity cuts of the served tiles.
    brightness:  float, optional
        Relative tile black level of the served tiles.
    contrast:  float, optional
        Relative tile contrast of the served tiles.
    color_saturation:  float, optional
        Default color saturation of the served tiles.
    gamma: float, optional
        Display gamma of the served tiles.
    nthreads: int, optional
        Number of compute threads for parallelized operations.


    Custom Least Recently Used (LRU) memory cache.

    Parameters
    ----------
    func: class or func
        Function result or class instantiation to be cached.
    maxsize: int, optional
        Maximum size of the cache.


    Custom, dictionary-based, Least Recently Used (LRU) reader-writer lockable
    cache, shareable across processes.

    Parameters
    ----------
    func: Callable
        Function to be cached.
    name: str, optional
        Name of the lock cache.
    maxsize: int, optional
        Maximum size of the cache.
    shared: bool, optional
        Share dictionary across processes (requires POSIX IPC support)
    removecall: func, optional
        Callback function for removing cached data.
    logger: logging.Logger, optional
        Logger object to display cache handling information.


    Custom reader-writer lock shareable across processes

    See Raynal, Michel (2012), Concurrent Programming: Algorithms, Principles,
    and Foundations, Springer.

    Parameters
    ----------
    name: str, optional
        Name of the lock.


    Pydantic image model class.

    Parameters
    ----------
    size: List[int]
        Image shape, FITS style (x comes first)
    dataslice: List[List[int]]
        Active area slice parameters, FITS style
    detslice: List[List[int]]
        Mosaic area slice parameters, FITS style
    min_max: List[List[float]]
        Lower and upper intensity cuts for each channel
    header: dict
        FITS header dictionary


    Class for the individual images that can be part of a mosaic.

    Parameters
    ----------
    header: ~astropy.io.fits.Header
        Image header.
    data: ~numpy.ndarray
        Image data
    extnum: int
        Position in mosaic or Extension number (for Multi-Extension FITS files).
    minmax: tuple[float,float], optional
        Default intensity cuts.


    Pydantic compatible annotation for validating and serializing AstroPy
    Quantity fields.
    Loosely adapted from pint-quantity by Tyler Hughes <tylerxh111+git@proton.me>

    Examples
    --------
    >>> from typing import Annotated
    >>> from astropy import units as u
    >>> from pydantic import BaseModel
    >>> from .quantity import QuantityAnnotation

    >>> class Coordinates(BaseModel):
    ...     latitude: Annotated[
    ...         u.Quantity, QuantityAnnotation("deg", ge=-90.*u.deg, le=90.*u.deg)
    ...     ]
    ...     longitude: Annotated[u.Quantity, QuantityAnnotation("deg")]
    ...     altitude: Annotated[u.Quantity, QuantityAnnotation("km")]

    >>> # The following instantiation validates
    >>> coord = Coordinates(
    ...     latitude="39.905705 deg",
    ...     longitude="-75.166519 deg",
    ...     altitude="12 m"
    ... )

    >>> coord
    Coordinates(latitude=<Quantity 39.905705 deg>,
    longitude=<Quantity -75.166519 deg>, altitude=<Quantity 0.012 km>)

    >>> f"{coord!r}"
    'Coordinates(latitude=<Quantity 39.905705 deg>,
    longitude=<Quantity -75.166519 deg>, altitude=<Quantity 0.012 km>)'

    >>> coord.model_dump()
    {'latitude': <Quantity 39.905705 deg>, 'longitude': <Quantity -75.166519 deg>,
    'altitude': <Quantity 0.012 km>}

    >>> coord.model_dump(mode="json")
    {'latitude': '39.905705 deg', 'longitude': '-75.166519 deg',
    'altitude': '0.012 km'}

    >>> coord.model_dump_json()
    '{"latitude":"39.905705 deg","longitude":"-75.166519 deg","altitude":"0.012 km"}'

    >>> # The following instantiation does not validate
    >>> coord = Coordinates(
    ...     latitude="99.905705 deg",
    ...     longitude="-75.166519 deg",
    ...     altitude="12 m"
    ... )
    Traceback (most recent call last):
    ...
    pydantic_core._pydantic_core.ValidationError: 1 validation error for Coordinates
    latitude
    Value error, greater than 90.0 deg
    [type=value_error, input_value='99.905705 deg', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/value_error

    Parameters
    ----------
    unit: str
        The unit type of the Pydantic field (e.g., `"m"`, or `"deg"`).
        All input units must be convertible to this unit.
    min_shape: tuple[int], optional
        Minimum number of vector components on each axis.
    max_shape: tuple[int], optional
        Maximum number of vector components on each axis.
    ge: ~astropy.units.Quantity or str, optional
        Lower limit (inclusive).
    gt: ~astropy.units.Quantity or str, optional
        Lower limit (strict).
    le: ~astropy.units.Quantity or str, optional
        Lower limit (inclusive).
    lt: ~astropy.units.Quantity or str, optional
        Lower limit (strict).
    ser_mode: Literal["str", "dict"], optional
        The mode for serializing the field; either `"str"` or `"dict"`.
        By default, in Pydantic's `"python"` serialization mode, fields are
        serialized to a `Quantity`;
        in Pydantic's `"json"` serialization mode, fields are serialized to a `str`.
    strict: bool, optional
        Forces users to specify units; on by default.
        If disabled, a value without units - provided by the user - will be
        treated as the base units of the `QuantityUnit`.


    Manage application settings in groups.

    Settings are stored as Pydantic fields.


    Psrchive Candidate class.

    Parameters
    ----------
    fname: str
        Path to file


    Create a model of an ellipsoidal asteroid and simulates its evolution.

    Model the deformation of an ellipsoidal asteroid over a given trajectory,
    for given model parameters. Modeled under tidal deformation, as well as the
    self-gravitational force, the Coriolis force, and the centrifugal force.

    Attributes
    ----------
    name : str
        The name of the run. The mesh output file will be name.pvd, the log
        name.txt, and the moment of inertia file MoIs_name.csv.
    sizecut : float, [cm]
        The maximum allowable body radius. If the body crosses this threshold,
        the run stops. Set as a ratio of the maximum initial body radius at
        initialization.

    a : float, [m]
        The diameter of the ellipsoid on the x-axis. Twice the semi-axis.
    b : float, [m]
        The diameter of the ellipsoid on the y-axis. Twice the semi-axis.
    c : float, [m]
        The diameter of the ellipsoid on the z-axis. Twice the semi-axis.
    omegavec : list
        A list of length 3, containing the values of the rotation axis. The
        rotation axis is the unit vector parallel to omegavec.
    mu : float, [dyne cm^-2 s]
        The dynamic viscosity of the body in this model.
    rho : float, [g cm^-3]
        The density of the body in this model.
    omega : dolfin.function.function.Function, [s^-1]
        A function over the function space V, storing the rotation vector of
        the asteroid body. Constant over the domain. Stored in a function so
        that vector math can be performed using FEniCS methods.
    period : float, [s]
        The rotational period of the asteroid, in seconds.

    G : dolfin.function.constant.Constant, [cm^3 g^-1 s^-2]
        A Constant equal to 6.67e-8, the gravitational constant in cgs.
    M : dolfin.function.constant.Constant, [g]
        A Constant equal to 2e33, the solar mass in grams, used to compute the
        value of the tidal force.

    t : float, [s]
        The current time in the model simulation.
    dt : float, [s]
        The Euler time step of the model simulation.
    ind : integer
        The number of cycles currently run by the model simulation.
    start_time : float, [s]
        The time when the model was initialized, in seconds in UTC.
    end_time :  float, [s]
        The maximum time in the simulation trajectory. The cutoff point of the
        simulation.
    mint : float, [s]
        The initial timestamp of the trajectory data. This is used so that the
        time can be expressed in a percent, but that the output of the
        simulation can be expressed with time measured from the same origin as
        its input.

    logfile : _io.TextIOWrapper
        File where the run logs are written, '.txt' text file.
    outfile : dolfin.cpp.io.File
        File where the model mesh and functions are saved, '.pvd' ParaView
        file.

    mesh : dolfin.cpp.mesh.Mesh
        The mesh of the body model, the domain over which all the functions
        are defined.

    V : dolfin.function.functionspace.FunctionSpace
        A vector function space over the mesh, for storing vector functions
        (velocity, forces). Of Continuous Galerkin type, order 2.
    Q : dolfin.function.functionspace.FunctionSpace
        A scalar function space over the mesh, for storing scalar functions
        (pressure, distance). Of Continuous Galerkin type, order 1.
    Z : dolfin.function.functionspace.FunctionSpace
        A mixed function space over the mesh, formed from V x Q. Mixed
        functions are necessary to solve the Navier-Stokes equations, and the
        solutions are stored in this space.

    szscale : float
        The allowable increase in the body size. If any axis is larger than
        szscale times the largest semi-major axis, the simulation stops.
    solver : dolfin.cpp.fem.NonlinearVariationalSolver
        Nonlinear solver for the Navier-Stokes equation. This is used to
        compute the solutions to the equations. Various parameters can be
        changed by users via the built-in methods for the solvers. As a
        default, this uses a Newton nonlinear method, with a relaxation para-
        meter of 1.0.

    up : dolfin.function.function.Function, [3*(cm s^-1), dyne cm^-2]
        The function for the velocity and the pressure, over the mixed space Z.
        This is where the Navier-Stokes solutions are stored. Equivalent to
        u x p, as an outer product.
    u_p_ : dolfin.function.function.Function, [3*(cm s^-1), dyne cm^-2]
        A function over the mixed space Z, which stores the previous solution
        to the Navier-Stokes equations. This is used by the Euler
        finite-difference solver, which requires the previous solution.
    u : dolfin.function.function.Function, [cm s^-1]
        A vector function over V, storing the velocity of the model body
        relative to its center of mass. Used for computing the distortion of
        the model body, an output of the Navier-Stokes equations.
    p : dolfin.function.function.Function, [dyne cm^-2]
        A scalar function over Q, storing the pressure of the model body. An
        output of the Navier-Stokes equations.

    ftides : dolfin.function.function.Function, [dyne cm^-3]
        A vector function over V, storing the solar tidal force per unit
        volume at the current time.
    gravity : dolfin.function.function.Function, [dyne cm^-3]
        A vector function over V, storing the gravitational force per unit
        volume due to the asteroid body's own mass.
    centrifugal : dolfin.function.function.Function, [dyne cm^-3]
        A vector function over V, storing the centrifugal force per unit
        volume due to the rotation of the asteroid.
    coriolis : dolfin.function.function.Function, [dyne cm^-3]
        A vector function over V, storing the Coriolis force per unit volume
        due to the model's velocity. Computed using the previous-step's
        velocity.
    forcing : dolfin.function.function.Function, [dyne cm^-3]
        A vector function over V, storing the sum of the various forces, used
        in the Navier-Stokes equations.

    gravsolver : dolfin.cpp.fem.NonlinearVariationalSolver
        Nonlinear solver for the Gaussian gravity formulation. This is used
        to compute the solutions to the equations. Various parameters can be
        changed by users via the built-in methods for the solvers. As a
        default, this uses a Newton nonlinear method, with a relaxation para-
        meter of 1.0.

    gravgs : dolfin.function.function.Function, [3*(dyne cm^-3), N/A]
        A mixed function over Z, storing the the gravitational force over V
        and a superfluous function over Q, which is used to allow for a scalar
        test function. The gravity is computed by solving the Gaussian form.
    gravscale : float
        A scalar constant of 1e-3, created to rescale the gravitational
        constant G to the SI values. This is necessary to maintain stability
        in the solutions to the Gaussian form, and then is used to rescale the
        gravity back to cgs, due to the linearity of the Gaussian form.

    trajectory : scipy.interpolate.fitpack2.UnivariateSpline, [cm]
        A spline fit to the trajectory the simulation is run over. When fed a
        time, returns the heliocentric distance in cm.

    r : dolfin.function.function.Function, [cm]
        A vector function over V, storing the position vectors of each point.
        This is simply the vector from the origin/center of mass to each point
        in the domain.

    umean : dolfin.function.function.Function, [cm s^-1]
        A vector function over V, storing the mean velocity of a certain time
        step, used to normalize the velocity.
    usum : dolfin.function.function.Function, [cm s^-1]
        A vector function over V, the sum of the velocities over rotation
        cycles.
    ucycavg : dolfin.function.function.Function, [cm s^-1]
        A vector function over V, storing the mean velocity over a certain
        number of rotations.

    unit : dolfin.function.function.Function
        A scalar function over Q, which is equal to unity at all points. Used
        to perform integrals over the domain, to find the volume of the body.

    diverged : bool
        A boolean storing whether or not the simulation has diverged, either
        due to a failure in the solver or due to the model body crossing the
        imposed size threshold.
    savesteps : bool
        Whether or not every timestep should be written to the output file, or
        if it should be just the starting and ending states. If True, writes
        all timesteps.

    nsrot : int
        The number of timesteps in each rotation of the body, used to calculate
        dt.
    rtol : float
        The tolerance in the trajectory for the trajectory jump. After a
        certain number of cycles, the simulation takes the average velocity
        and extrapolates the motion of the body forward a longer time. It stops
        the extrapolation either when the CFL criterion is >1 or when the
        heliocentric distance changes by a factor of >rtol.

    times : list, [s]
        A list of the time values used in the simulation.
    MoIs : list, [g cm^2]
        A list of the moments of inertia over the simulation.


The class to structure the response xml string from the cmr API


Parse the xml as a python list


Parse the xml as a python dict


  The "Drainage" object acts to access the modules containing the analysis
  functions and to serve as a container for class-wide scoped variables.


    This class is designed to parse and store the information
    contained in an AMReX particle header file.

    Usage:

        header = AMReXParticleHeader("plt00000/particle0/Header")
        print(header.num_particles)
        print(header.version_string)

    etc...


    fig : matplotlib.figure.Figure
       The figure object that is used to get draw, resize, and any
       other needed events.

    event_source : object, optional
       A class that can run a callback when desired events
       are generated, as well as be stopped and started.

       Examples include timers (see :class:`TimedAnimation`) and file
       system notifications.

    blit : bool, optional
       controls whether blitting is used to optimize drawing.  Defaults
       to ``False``.


Animation using a fixed set of `Artist` objects.

    Before creating an instance, all plotting should have taken place
    and the relevant artists saved.

    Parameters
    ----------
    fig : matplotlib.figure.Figure
       The figure object that is used to get draw, resize, and any
       other needed events.

    artists : list
        Each list entry a collection of artists that represent what
        needs to be enabled on each frame. These will be disabled for
        other frames.

    interval : number, optional
       Delay between frames in milliseconds.  Defaults to 200.

    repeat_delay : number, optional
        If the animation in repeated, adds a delay in milliseconds
        before repeating the animation.  Defaults to ``None``.

    repeat : bool, optional
        Controls whether the animation should repeat when the sequence
        of frames is completed. Defaults to ``True``.

    blit : bool, optional
        Controls whether blitting is used to optimize drawing.  Defaults
        to ``False``.


    Enables use of xarray.plot functions as attributes on a DataArray.
    For example, DataArray.plot.imshow


A class providing some useful methods for affine Transformations


A class for caching source tiles


A class holding info how to tile


A class holding information about a GDAL file or a GDAL fileset


This is an extension for xarray to provide an interface to GDAL capabilities


This is an extension for xarray DataArrays to provide an interface to matplotlib capabilities


This is an extension for xarray Datasets to provide an interface to matplotlib capabilities


This is an extension for xarray to provide an interface to rasterio capabilities


This is the base class for xarray extensions


    Wrapper for :func:`gdal.Dataset` with
    :func:`osr.SpatialReference` object.

    Parameters
    ----------
    grid_file : :obj: str` or :func:`gdal.Dataset`
        The grid file to be wrapped.
    prj_file : :obj:`str`, optional
        Path to projection file.


A class for generating both daily, annual, and annual-anomaly melt maps.

    Stores internal information for creating the maps in order to help facilitate
    ease and re-use of matplotlib base figures, and speed up execution.


r"""
    Stores a look-up table of the roots of the equation

    .. math::
            J_{n-1/2}(\xi_{nl}) J_{n+1/2}(\xi_{nl}) = 0

    which can be accessed through the method :func:`get_xi`.

    These are related to the decay rates through:
    :math:`\gamma_{nl} = -(\xi_{nl})^2`

    which can be access through the method :func:`get_gamma`.

    Parameters
    ----------
    filepath : str
        Path to the file where the lookup table will be stored.
        Default: '.xilookup.npy'
    regenerate : bool
        If True, the original file on hard disk will be overwritten.


    Synchrotron emmission and Faraday rotation observables

    Class properties compute and return a range of observables computed along
    the axis specified in the initialization.

    Parameters
    ----------
    B_field : B_field
        The magnetic field based on which the observables should be computed.
        At the moment, only B_field constructed using a uniform cartesian grid
        is supported
    direction : str
        The coordinate axis parallel to the line-of-sight (i.e. the axis along
        which the integrations are performed).
        Valid values: 'x'/'edge-on', 'y' or 'z'/'face-on'.

    obs_electron_density_function : func
        A function which receives three coordinate arrays r_spherical, theta, phi
        and returns the electron density
    obs_cosmic_ray_function : func
        A function which receives three coordinate arrays r_spherical, theta, phi
        and returns the cosmic ray density
    obs_wavelength_m : float
        The wavelength of used in the synchrotron emission calculations.
        Default: 5 cm
    obs_emissivivty_normalization : float
        Needs to be adjusted


    A single galactic magnetic field component.

    `B_field_component` objects store data for a single galactic magnetic
    field component (e.g. the galactic *halo* magnetic field).

    The properties x, y, z, r_spherical, r_cylindrical, theta and phi return
    the magnetic field along each of these axis (with any required coordinate
    transformation being performed on the fly).

    Parameters
    ----------
    grid : grid_object
        See :class: `galmag.Grid`
    x, y, z, r_spherical, r_cylindrical, theta, phi : 3D array_like
        Values of the magnetic field in coordinates compatible with the grid
        parameter should be supplied at initialization.
        Unused coordinates should be set to None.
        E.g. r_cylindrical=[[..],[..],[..]], z=[[..],[..],[..]],
        phi=[[..],[..],[..]]
    copy : bool
        whether a fresh copy of the field data should be made upon
        initialization. Default: True


    Galactic magnetic field

    `B_field` objects store data for the whole galactic magnetic field.

    Individual galactic magnetic field components (e.g. disk or halo) are
    stored as attributes containing `B_field_component` objects.

    The properties x, y, z, r_spherical, r_cylindrical, theta and phi return
    the magnetic field along each of these axis. These are actually the sum of
    all the galactic components available.

    A disk or halo component can be added using the `add_disk_field` and
    `add_halo_field` methods.

    A custom new magnetic field component can be set using the
    `set_field_component` method. Alternatively, the custom component can be
    added during initialization as an extra keyword
    (i.e. B_field.set_field_component(name, component) is equivalent to
    B_field(..., name=component).

    Parameters
    ----------
    box : 3x2-array_like
         Box limits
    resolution : 3-array_like
         containing the resolution along each axis.
    grid_type : str, optional
        Choice between 'cartesian', 'spherical' and 'cylindrical' *uniform*
        coordinate grids. Default: 'cartesian'
    dtype : numpy.dtype, optional
        Data type used. Default: np.dtype(np.float)


    Defines a 3D grid object for a given choice of box dimensions
    and resolution.

    Calling the attributes does the conversion between different coordinate
    systems automatically.

    Parameters
    ----------
    box : 3x2-array_like
         Box limits
    resolution : 3-array_like
         containing the resolution along each axis.
    grid_type : str, optional
        Choice between 'cartesian', 'spherical' and 'cylindrical' *uniform*
        coordinate grids. Default: 'cartesian'


    Base class for B-field generators

    Note
    ----
    This class does not work on its own.


    Generator for the halo field

    Parameters
    ----------
    box : 3x2-array_like
         Box limits
    resolution : 3-array_like
         containing the resolution along each axis.
    grid_type : str, optional
        Choice between 'cartesian', 'spherical' and 'cylindrical' *uniform*
        coordinate grids. Default: 'cartesian'
    dtype : numpy.dtype, optional
        Data type used. Default: np.dtype(np.float)


    Generator for the disk field

    Parameters
    ----------
    box : 3x2-array_like
         Box limits
    resolution : 3-array_like
         containing the resolution along each axis.
    grid_type : str, optional
        Choice between 'cartesian', 'spherical' and 'cylindrical' *uniform*
        coordinate grids. Default: 'cartesian'
    dtype : numpy.dtype, optional
        Data type used. Default: np.dtype(np.float)


A class for making figures from prospector results files.
    Usually you'll want to subclass this and add specific plot making methods,
    But this class contains useful methods for generating and caching
    posterior SED predictions etc.

    :param show: list of strings
        The names of the parameters (or transformed parameters) to show in
        posterior or corner plots

    :param results_file: string

    :param n_seds: int
       Number of SED samples to generate.  if < 1, generate no SEDs.
       If 0, only generate the SEDs for the most probably sample

    :param prior_samples: int
        Number of prior samples to tale when computing the prior probability
        distributions numerically

    :param nufnu: bool
        Whether to plot fluxes in nufnu

    :param microns: bool
        Whether to plot wavelength as mictons


    This is the base model class that holds model parameters and information
    about them (e.g. priors, bounds, transforms, free vs fixed state).  In
    addition to the documented methods, it contains several important
    attributes:

    * :py:attr:`params`: model parameter state dictionary.
    * :py:attr:`theta_index`: A dictionary that maps parameter names to indices (or rather
      slices) of the parameter vector ``theta``.
    * :py:attr:`config_dict`: Information about each parameter as a dictionary keyed by
      parameter name for easy access.
    * :py:attr:`config_list`: Information about each parameter stored as a list.

    Intitialization is via, e.g.,

    .. code-block:: python

       model_dict = {"mass": {"N": 1, "isfree": False, "init": 1e10}}
       model = ProspectorParams(model_dict, param_order=None)

    :param configuration:
        A list or dictionary of model parameters specifications.


A dict-like that only returns copies of the dictionary values.
    It also includes a dictionary of information describing each entry in the
    directory.


    A class that creates and holds information about a specific
    kernel, and can generate samples from it.

    From https://github.com/kartheikiyer/GP-SFH

    Attributes
    ----------
    tarr: fiducial time array used to draw samples
    kernel: accepts an input function as an argument,
        of the format:

            def kernel_function(delta_t, **kwargs):
                ... function interior ...
                return kernel_val[array of len(delta_t)]

    Methods
    -------
    get_covariance_matrix
        [although this has double for loops for maximum flexibility
        with generic kernel functions, it only has to be computed once,
        which makes drawing random samples super fast once it's computed.]
    sample_kernel
    plot_samples
    plot_kernel
    [to-do] condition on data


A subclass of :py:class:`ProspectorParams` that passes the models
    through to an ``sps`` object and returns spectra and photometry, including
    optional spectroscopic calibration, and sky emission.

    This class performs most of the conversion from intrinsic model spectrum to
    observed quantities, and additionally can compute MAP emission line values
    and penalties for marginalization over emission line amplitudes.


AGN acceration disk continuum model.
    For details, see Wang et al. 2024: https://ui.adsabs.harvard.edu/abs/2024arXiv240302304W/abstract


    This class implements a SFH prior that is determined by hyper-parameters
    that in turn have their own prior distributions.


Encapsulate the priors in an object.  Each prior should have a
    distribution name and optional parameters specifying scale and location
    (e.g. min/max or mean/sigma).  These can be aliased at instantiation using
    the ``parnames`` keyword. When called, the argument should be a variable
    and the object should return the ln-prior-probability of that value.

    .. code-block:: python

        ln_prior_prob = Prior(param=par)(value)

    Should be able to sample from the prior, and to get the gradient of the
    prior at any variable value.  Methods should also be avilable to give a
    useful plotting range and, if there are bounds, to return them.

    Parameters
    ----------
    parnames : sequence of strings
        A list of names of the parameters, used to alias the intrinsic
        parameter names.  This way different instances of the same Prior can
        have different parameter names, in case they are being fit for....

    Attributes
    ----------
    params : dictionary
        The values of the parameters describing the prior distribution.


A simple uniform prior, described by two parameters

    :param mini:
        Minimum of the distribution

    :param maxi:
        Maximum of the distribution


Uniform distribution between two bounds, renamed for backwards compatibility
    :param mini:
        Minimum of the distribution

    :param maxi:
        Maximum of the distribution


A simple gaussian prior.

    :param mean:
        Mean of the distribution

    :param sigma:
        Standard deviation of the distribution


A Gaussian prior clipped to some range.

    :param mean:
        Mean of the normal distribution

    :param sigma:
        Standard deviation of the normal distribution

    :param mini:
        Minimum of the distribution

    :param maxi:
        Maximum of the distribution


Like log-normal, but the distribution of natural log of the variable is
    distributed uniformly instead of normally.

    :param mini:
        Minimum of the distribution

    :param maxi:
        Maximum of the distribution


A Beta distribution.

    :param mini:
        Minimum of the distribution

    :param maxi:
        Maximum of the distribution

    :param alpha:

    :param beta:


A log-normal prior, where the natural log of the variable is distributed
    normally.  Useful for parameters that cannot be less than zero.

    Note that ``LogNormal(np.exp(mode) / f) == LogNormal(np.exp(mode) * f)``
    and ``f = np.exp(sigma)`` corresponds to "one sigma" from the peak.

    :param mode:
        Natural log of the variable value at which the probability density is
        highest.

    :param sigma:
        Standard deviation of the distribution of the natural log of the
        variable.


A log-normal prior, where the natural log of the variable is distributed
    normally.  Useful for parameters that cannot be less than zero.

    LogNormal(mode=x, sigma=y) is equivalent to
    LogNormalLinpar(mode=np.exp(x), sigma_factor=np.exp(y))

    :param mode:
        The (linear) value of the variable where the probability density is
        highest. Must be > 0.

    :param sigma_factor:
        The (linear) factor describing the dispersion of the log of the
        variable.  Must be > 0


A normal distribution including a skew parameter

    :param location:
        Center (*not* mean, mode, or median) of the distribution.
        The center will approach the mean as skew approaches zero.

    :param sigma:
        Standard deviation of the distribution

    :param skew:
        Skewness of the distribution


A Student's T distribution

    :param mean:
        Mean of the distribution

    :param scale:
        Size of the distribution, analogous to the standard deviation

    :param df:
        Number of degrees of freedom


This base class allows for 1-d noise models without any special kernels
    for covariance matrix construction, but with possibility for outliers.


This class allows for 1D (diagonal) kernels


This object allows for 1d or 2d covariance matrices constructed from
    kernels.


This is a class that wraps the fsps.StellarPopulation object, which is
    used for producing SSPs.  The ``fsps.StellarPopulation`` object is accessed
    as ``SSPBasis().ssp``.

    This class allows for the custom calculation of relative SSP weights (by
    overriding ``all_ssp_weights``) to produce spectra from arbitrary composite
    SFHs. Alternatively, the entire ``get_galaxy_spectrum`` method can be
    overridden to produce a galaxy spectrum in some other way, for example
    taking advantage of weight calculations within FSPS for tabular SFHs or for
    parameteric SFHs.

    The base implementation here produces an SSP interpolated to the age given
    by ``tage``, with initial mass given by ``mass``.  However, this is much
    slower than letting FSPS calculate the weights, as implemented in
    :py:class:`FastSSPBasis`.

    Furthermore, smoothing, redshifting, and filter projections are handled
    outside of FSPS, allowing for fast and more flexible algorithms.

    :param reserved_params:
        These are parameters which have names like the FSPS parameters but will
        not be passed to the StellarPopulation object because we are overriding
        their functionality using (hopefully more efficient) custom algorithms.


Subclass of :py:class:`SSPBasis` that implements a "nonparameteric"
    (i.e. binned) SFH.  This is accomplished by generating a tabular SFH with
    the proper form to be passed to FSPS. The key parameters for this SFH are:

      * ``agebins`` - array of shape ``(nbin, 2)`` giving the younger and older
        (in lookback time) edges of each bin in log10(years)

      * ``mass`` - array of shape ``(nbin,)`` giving the total stellar mass
        (in solar masses) **formed** in each bin.


A subclass of :py:class:`SSPBasis` for combinations of N composite
    stellar populations (including single-age populations). The number of
    composite stellar populations is given by the length of the ``"mass"``
    parameter. Other population properties can also be vectors of the same
    length as ``"mass"`` if they are independent for each component.


AGN acceration disk continuum model.
    For details, see Wang et al. 2024: https://ui.adsabs.harvard.edu/abs/2024arXiv240302304W/abstract
    Note that this only works with non-param SFH.


This is a hack to make the minimization function pickleable (for MPI)
    even though it requires many arguments.  Ripped off from emcee.


Data to be predicted (and fit)

    Attributes
    ----------
    flux :
    uncertainty :
    mask :
    noise :


    As for Spectrum, but account for pixelization effects when pixels
    undersample the instrumental LSF.


    As for Spectrum, but predictions for this object type will not include
    polynomial fitting or fitting of the emission line strengths (previously fit
    and cached emission luminosities will be used.)


A mixin class that allows for optimization of a Chebyshev response
    function given a model spectrum.


This is a mixin class that generates the
    multiplicative response vector as a Chebyshev polynomial described by the
    ``poly_param_name`` parameter of the model, which may be free (fittable)


Test appropriate SuomiNet data files are included with the package


Test the Kitt Peak config file for the correct years and SuomiNet ids


Test that the pwv_atm module returns data for the correct years


Tests for the _get_local_data function


Test data is downloaded correctly by _download_suomi_data_for_year


Test the conversion of SuomiNet datetime format to timestamps


Test file parsing by create_pwv_models._read_file


Tests for pwv_kpno.atm_model.create_pwv_atm_model


Tests for pwv_kpno._update_pwv_model._linear_regression


Tests for pwv_kpno._update_pwv_model._create_new_pwv_model


Test update_models function for raised errors due to bad arguments


Test that the Settings class raises errors when appropriate


Tests for the function blackbody.sed


Tests for the function blackbody.magnitude


Tests for the function blackbody.zp_bias


Test that _check_date_time_args raises the appropriate errors

    _check_date_time_args is responsible for checking the arguments for both
    pwv_kpno.pwv_atm.measured_pwv and pwv_kpno.pwv_atm.modeled_pwv


Tests for the 'pwv_atm.measured_pwv' function


Tests for the 'pwv_atm.modeled_pwv' function


Tests for the pwv_date function


Test pwv_kpno.transmission for raised errors due to bad arguments


Test pwv_kpno.transmission for the expected returns


Tests for the error propagation of pwv_kpno.pwv_atm.trans_for_pwv


Represents pwv_kpno settings for a particular geographical site

    An overview of the current package settings can be accessed by printing
    this object.

    Attributes:
        site_name       : The current site being modeled
        available_sites : A list of built in sites that pwv_kpno can model
        receivers       : A list of SuomiNet receivers used by this site
        primary_rec     : The SuomiNet id code for the primary GPS receiver
        supplement_rec  : Same as receivers but without the primary receiver

    Methods:
        set_site           : Configure pwv_kpno to model a given site
        export_site_config : Save the current site's configuration data to file


The ConfigBuilder class is used to build config files for a custom site

    Default wavelengths and cross sections are provided by MODTRAN estimates
    and range from 3,000 to 12,000 Angstroms in 0.05 Angstrom increments.

    Attributes:
        data_cuts         (dict): Specifies cuts for SuomiNet data
        site_name          (str): Desired name of the custom site
        primary_rec        (str): SuomiNet ID code for the primary GPS receiver
        supplement_rec    (list): List of id codes for supplemental receivers
        wavelength     (ndarray): Array of wavelengths in Angstroms (optional)
        cross_section  (ndarray): Array of PWV cross sections in cm^2 (optional)

    Methods:
        save_to_ecsv : Create a custom config file <site_name>.ecsv


A custom build extension for adding compiler-specific options.


Container for 3D spatial values.


    SimulatedVariables hold the observed and latent values
    from a population synth variable as well as its selection.

    The array displays as the observed values. The latent values
    can be accessed with x.latent

    Subsets of selected and non-selected values can be accessed:

    x.selected
    x.non_selected

    which return a SimulatedVariable that is a subset of the values.

    Math operations applied to the object will be applied to the observed
    and latent values.


Colored log formatter.


Transform standard python Queue instance to iterable one


Intended to keep information about integrated radiance for given params.


Buffers for parameters loaded from external files in singleton format


General object for storing attributes of modelled objects.


Object for handling attributes of Star objects.


Object for handling attributes of System objects.


General object for handling system models at a given time or photometric phase.


    Container carrying non-static properties of Star object (properties which vary from phase to phase) and also
    all properties set during creation of the parent BinarySystem.
    Method `from_properties_container` or `from_star_instance` has to be used to create container properly.
    Following parameters are gathered from Star object

    'mass', 't_eff', 'synchronicity', 'albedo', 'discretization_factor', 'name', 'spots'
    'polar_radius', 'equatorial_radius', 'gravity_darkening', 'surface_potential', 'atmosphere',
    'pulsations', 'metallicity', 'polar_log_g', 'critical_surface_potential', 'side_radius'

    If you are experienced user, you can create instance directly by calling

    >>> from elisa.base.container import StarContainer
    >>> kwargs = {}
    >>> inst = StarContainer(**kwargs)

    and setup static parameter latter of not at all if not necessary for further use. However, the StarContainer
    instance is intialized within a given PositionContainer during its initialization.

    Bellow are optional input parameters of StarContainer.
    kwargs: Dict;
    :**kwargs options**:

        * **points** * -- numpy.array;
        * **normals** * -- numpy.array;
        * **indices** * -- numpy.array;
        * **faces** * -- numpy.array;
        * **temperatures** * -- numpy.array;
        * **log_g** * -- numpy.array;
        * **coverage** * -- numpy.array;
        * **face_centres** * -- numpy.array;
        * **metallicity** * -- float;
        * **areas** * -- numpy.array;
        * **potential_gradient_magnitudes** * -- numpy.array;
        * **ld_cfs** * -- numpy.array;
        * **normal_radiance** * -- numpy.array;
        * **los_cosines** * -- numpy.array;

    Output parameters (obtained by applying given methods upon container).

    :points: numpy.array;

    ::

        Numpy array of points that form surface of Body.
        Input dictionary has to be in shape::
            points = numpy.array([[x1 y1 z1],
                                  [x2 y2 z2],
                                   ...
                                  [xN yN zN]])

        where xi, yi, zi are cartesian coordinates of vertice i.

    :normals: numpy.array; Array containing normalised outward facing normals
              of corresponding faces with same index

    ::

            normals = numpy_array([[normal_x1, normal_y1, normal_z1],
                                   [normal_x2, normal_y2, normal_z2],
                                    ...
                                   [normal_xn, normal_yn, normal_zn]]

    :faces: numpy.array;

    ::

        Numpy array of triangles that will create surface of body.
        Triangles are stored as list of indices of points.

            numpy.array([[vertice_index_k, vertice_index_l, vertice_index_m]),
                         [...]),
                          ...
                         [...]])

    :temperatures: numpy.array; Array of temeratures of corresponding faces.

    ::
            numpy.array([t_eff1, ..., t_effn])

    :log_g: numpy.array; Array of log_g (gravity) of corresponding faces.

    ::

        numpy.array([log_g1, ..., log_gn])

    :coverage: numpy.array; surface area of each triangle visible to the observer
    :indices: numpy.array; Indices of visible faces when darkside_filter is applied.
    :face_centres: numpy.array; row-wise geometrical centres of each triangle
    :metallicity: float;
    :areas: numpy.array; surface areas corresponing to each surface triangle
    :potential_gradient_magnitudes: numpy.array;
    :inverse_point_symmetry_matrix: numpy.array; row-wise, set of vectors that map base symmetry quadrant points
                                                 (octant in case of single star) to all others quadrants, each row
                                                 contains indices of points in given quadrant which order corresponds to
                                                 the order of points in the 1st quadrant (octant)
    :base_symmetry_points_number: int; number of first n surface points stored in StarContainer.points that are located
                                       on a symmetrical part of the surface. E.g.:

                                        ::

                                            StarContainer.points[:StarContainer.base_symmetry_points_number]

                                       will select surface points from one quarter (eighth) of the star in case of
                                       binary (single) star system
    :base_symmetry_faces_number: int; number of first n triangles stored in StarContainer.faces located in the 1st
                                      quadrant (octant). E.g.:

                                       ::

                                            StarContainer.temperatures[:StarContainer.base_symmetry_faces_number]

                                      will return surface temperatures only from triangles int the 1st quadrant
                                      (octant) in case of binary (single) star system.
    :face_symmetry_vector: numpy.array; array that maps each surface triangle to the symmetrical surface triangle
                                        located in the 1st quadrant. Array contains indices between 0 and
                                        `base_symmetry_faces_number`.
    :base_symmetry_points: numpy.array;
    :base_symmetry_faces: numpy.array;
    :polar_potential_gradient_magnitude: numpy.array;
    :ld_cfs: numpy.array;
    :normal_radiance: numpy.array;
    :los_cosines: numpy.array;


    Child class of elisa.base.body.Body representing `Star`.

    Class can be imported directly:
    ::

        from elisa import Star

    Mandatory `Star` arguments if the instance is a component of the `SingleSystem`:

        :param mass: float; If mass is int, np.int, float, np.float, program assumes solar mass as it's unit.
                        If mass astropy.unit.quantity.Quantity instance, program converts it to default units.
        :param t_eff: float; Accepts value in any temperature unit. If your input is without unit,
                         function assumes that supplied value is in K.
        :param polar_log_g: float; log_10 of the polar surface gravity

    following optional arguments are also available:

        :param metallicity: float; log[M/H] default value is 0.0
        :param gravity_darkening: float; gravity darkening factor, if not supplied, it is interpolated from Claret 2003
                                         based on t_eff
        :param limb_darkening_coefficients: Union[float, dict]; optional limb darkening coefficients
                                            used for the whole star useful in case the modelled star is outside the
                                            supported range of atmospheric parameters. Limb darkening coefficients can
                                            be supplied as dict {passband: ld_coefs}. If unused, elisa will
                                            interpolate the values from supplied limb-darkening tables.

    After initialization of the SingleSystem, following additional attributes of the Star instance are available:

        :critical_potential: float; potential of the star required to fill its Roche lobe
        :equivalent_radius: float; radius of a sphere with the same volume as a component (in SMA units)
        :polar_radius: float; radius of a star towards the pole of the star
        :equatorial_radius: float; radius of a star towards the pole of the star

    Mandatory `Star` arguments if the instance is a component of the `BinarySystem`:

        :param mass: float; If mass is int, np.int, float, np.float, program assumes solar mass as it's unit.
                            If mass astropy.unit.quantity.Quantity instance, program converts it to default units.
        :param t_eff: float; Accepts value in any temperature unit. If your input is without unit,
                             function assumes that supplied value is in K.
        :param surface_potential: float; generalized surface potential (Wilson 79)
        :param synchronicity: float; synchronicity F (omega_rot / omega_orb), equals 1 for synchronous rotation
        :param albedo: float; surface albedo, value from <0, 1> interval

    following mandatory arguments are also available:

        :param metallicity: float; log[M/H] default value is 0.0
        :param gravity_darkening: float; gravity darkening factor, if not supplied, it is interpolated from Claret 2003
                                         based on t_eff

    After initialization of the `BinarySystem`, following additional attributes of the `Star` instance are available:

        :critical_potential: float; potential of the star required to fill its Roche lobe
        :equivalent_radius: float; radius of a sphere with the same volume as a component (in SMA units)
        :filling_factor: float: calculated as (Omega_{inner} - Omega) / (Omega_{inner} - Omega_{outter})

                            :filling factor < 0: component does not fill its Roche lobe
                            :filling factor = 0: component fills preciselly its Roche lobe
                            :1 > filling factor > 0: component overflows its Roche lobe
                            :filling factor = 1: upper boundary of the filling factor, higher value would lead to
                                                 the mass loss trough Lagrange point L2

        Radii at periastron (in SMA units)
            :polar_radius: float; radius of a star towards the pole of the star
            :side_radius: float; radius of a star in the direction perpendicular to the pole and direction of a
                                 companion
            :backward_radius: float; radius of a star in the opposite direction as the binary companion
            :forward_radius: float; radius of a star towards the binary companion, returns numpy.nan if the system is
                                    over-contact

    Optional parameters of `Star` instances can be defined with the following arguments:
        :param spots: List[Dict[str, float]]; Spots definitions. Order in which the spots are defined will determine the
                                          layering of the spots (spot defined as first will lay bellow any subsequently
                                          defined overlapping spot). Example of spots definition:

        ::

            [
                 {"longitude": 90,
                  "latitude": 58,
                  "angular_radius": 15,
                  "temperature_factor": 0.9},
                 {"longitude": 85,
                  "latitude": 80,
                  "angular_radius": 30,
                  "temperature_factor": 1.05},
                 {"longitude": 45,
                  "latitude": 90,
                  "angular_radius": 30,
                  "temperature_factor": 0.95},
             ]

        :param pulsations: List[Dict[str, float]]; to be added soon
        :param atmosphere: str; atmosphere to use for given object instance, available atmosphere models:

            - `castelli`, `castelli-kurucz`, `ck` or `ck04`: atmosphere models in Castelli-Kurucz, 2004
            - `kurucz`, `k` or `k93`: atmosphere models in Kurucz, 1993

    After initialization, `Star` instance after initialization within the given `System` has its spot initialized in a
    `star_instance.spots` attribute as a list containing elisa.base.spot.Spot containers.


Abstract class that defines bodies modelled by this package.


    Abstract class defining System.
    Following arguments are implemented as common any of child instances.


    Spot object container. It is available as a list item of a `Star.spots` attribute after the initialization of the
    host system. This spot class is producing a circular spot at a specified coordinates with a temperature difference
    between the spot and the host star described by the `temperature_factor` defined as
    t_eff,spot/t_eff,star.

    Input parameters:

    :param longitude: Union[(numpy.)int, (numpy.)float, astropy.unit.quantity.Quantity];
                      Expecting value in degrees or as astropy units instance.
    :param latitude: Union[(numpy.)int, (numpy.)float, astropy.unit.quantity.Quantity];
                     Expecting value in degrees or as astropy units instance.
    :param angular_radius: Union[(numpy.)int, (numpy.)float, astropy.unit.quantity.Quantity];
            `              Expecting value in degrees or as astropy units instance.
    :param temperature_factor: Union[(numpy.)int, (numpy.)float];
    :param discretization_factor: Union[(numpy.)int, (numpy.)float, astropy.unit.quantity.Quantity];
                                  Spot discretization_factor (mean angular size of spot face).
                                  Expecting value in degrees or as astropy units instance.

    Output parameters that describing the spot:

    :boundary: numpy.array; points at the spot/star
    :boundary_center: float; geometrical centre of the spot boundary
    :center: float; coordinates of the spot centre
    :points: numpy.array; surface points belonging to spot
    :normals: numpy.array; outward facing normal vectors of surface elements belonging to the spot
    :faces: numpy.array; surface element (triangle) simplices
    :face_centres: numpy.array; centers of spot surface elements
    :areas: numpy.array; areas of spot surface elements
    :potential_gradient_magnitudes: numpy.array;
    :temperatures: numpy.array; effective temperatures of surface elements
    :log_g: numpy.array; surface gravity distribution over the surface elements


Abstract class that defines framework for (orbital) motion of the System instances.


    Class to store and calculate necessary properties of the binary system based on the user provided parameters.
    Child class of elisa.base.system.System.

    Class can be imported directly:
    ::

        >>> from elisa import BinarySystem

    After initialization, apart from the attributes already defined by the user with the arguments, user has access to
    the following attributes:

        :mass_ratio: float; secondary mass / primary mass
        :semi_major_axis: float; semi major axis of system in physical units
        :morphology: str; morphology of the system:

                      :`detached`: both components are not filling their respective Roche lobes,
                      :`semi-detached`: one of the components is filling its Roche lobe,
                      :`double-contact`: both components fill their Roche lobes,
                      :`over-contact`: components are physically connected with a ''neck'')

    `BinarySystem' requires instances of elisa.base.star.Star in `primary` and `secondary` argument with following
    mandatory arguments:

        :param mass: float; If mass is int, np.int, float, np.float, program assumes solar mass as it's unit.
                            If mass astropy.unit.quantity.Quantity instance, program converts it to default units.
        :param t_eff: float; Accepts value in any temperature unit. If your input is without unit,
                             function assumes that supplied value is in K.
        :param surface_potential: float; generalized surface potential (Wilson 79)
        :param synchronicity: float; synchronicity F (omega_rot / omega_orb), equals 1 for synchronous rotation

    following optional arguments are also available:

        :param metallicity: float; log[M/H] default value is 0.0
        :param gravity_darkening: float; gravity darkening factor, if not supplied, it is interpolated
                                         from Claret 2003 based on t_eff

        :param albedo: float; surface albedo, value from <0, 1> interval, if not supplied,
                              Claret 2001 will be used for interpolation
        :param limb_darkening_coefficients: Union[float, dict]; optional limb darkening coefficients
                                            used for the whole star useful in case the modelled star is outside the
                                            supported range of atmospheric parameters. Limb darkening coefficients can
                                            be supplied as dict {passband: ld_coefs}. If unused, elisa will
                                            interpolate the values from supplied limb-darkening tables.

    Each component instance will after initialization contain following attributes:

        :critical_surface_potential: float; potential of the star required to fill its Roche lobe
        :equivalent_radius: float; radius of a sphere with the same volume as a component (in SMA units)
        :filling_factor: float: calculated as (Omega_{inner} - Omega) / (Omega_{inner} - Omega_{outter})

                            :filling factor < 0: component does not fill its Roche lobe
                            :filling factor = 0: component fills preciselly its Roche lobe
                            :1 > filling factor > 0: component overflows its Roche lobe
                            :filling factor = 1: upper boundary of the filling factor, higher value would lead to
                                                 the mass loss trough Lagrange point L2

        Radii at periastron (in SMA units)
            :polar_radius: float; radius of a star towards the pole of the star
            :side_radius: float; radius of a star in the direction perpendicular to the pole
                                 and direction of a companion
            :backward_radius: float; radius of a star in the opposite direction as the binary companion
            :forward_radius: float; radius of a star towards the binary companion,
                                    returns numpy.nan if the system is over-contact

    The BinarySystem can be initialized either by using valid class arguments, e.g.:
    ::

        >>> from elisa import BinarySystem
        >>> from elisa import Star
        >>> from astropy import units as u

        >>> primary = Star(
        >>>     mass=2.15 * u.solMass,
        >>>     surface_potential=3.6,
        >>>     synchronicity=1.0,
        >>>      t_eff=10000 * u.K,
        >>>     gravity_darkening=1.0,
        >>>     discretization_factor=5,  # angular size (in degrees) of the surface elements
        >>>     albedo=0.6,
        >>>     metallicity=0.0,
        >>> )

        >>> secondary = Star(
        >>>     mass=0.45 * u.solMass,
        >>>     surface_potential=5.39,
        >>>     synchronicity=1.0,
        >>>     t_eff=8000 * u.K,
        >>>     gravity_darkening=1.0,
        >>>     albedo=0.6,
        >>>     metallicity=0,
        >>> )
        >>>
        >>> bs = BinarySystem(
        >>>     primary=primary,
        >>>     secondary=secondary,
        >>>     argument_of_periastron=58 * u.deg,
        >>>     gamma=-30.7 * u.km / u.s,
        >>>     period=2.5 * u.d,
        >>>     eccentricity=0.0,
        >>>     inclination=85 * u.deg,
        >>>     primary_minimum_time=2440000.00000 * u.d,
        >>>     phase_shift=0.0,
        >>>     distance=162 * u.pc
        >>> )

    or by using the BinarySystem.from_json(<dict>) function that accepts various parameter combination in form of
    dictionary such as:
    ::

        >>> data = {
        >>>     "system": {
        >>>         "inclination": 90.0,
        >>>         "period": 10.1,
        >>>         "argument_of_periastron": 90.0,
        >>>         "gamma": "0.0 m / s",  # you can define quantity using string representation of the astropy units
        >>>         "eccentricity": 0.3,
        >>>         "primary_minimum_time": 0.0,
        >>>         "phase_shift": 0.0,
        >>>         "distance": "152 pc"
        >>>     },
        >>>     "primary": {
        >>>         "mass": 2.15,
        >>>         "surface_potential": 3.6,
        >>>         "synchronicity": 1.0,
        >>>         "t_eff": 10000.0,
        >>>         "gravity_darkening": 1.0,
        >>>         "discretization_factor": 5,
        >>>         "albedo": 1.0,
        >>>         "metallicity": 0.0,
        >>>         "atmosphere": "ck04"
        >>>     },
        >>>     "secondary": {
        >>>         "mass": 0.45,
        >>>         "surface_potential": 5.39,
        >>>         "synchronicity": 1.0,
        >>>         "t_eff": 8000.0,
        >>>         "gravity_darkening": 1.0,
        >>>         "albedo": 1.0,
        >>>         "metallicity": 0.0,
        >>>         "atmosphere": "black_body"
        >>>     }
        >>> }
        >>>
        >>> binary = BinarySystem.from_json(data)

    See documentation for `from_json` method for details.

    The orbit of the binary system can be modelled using function
    `calculate_orbital_motion(phases)`. E.g.:
    ::

        >>> binary.calculate_orbital_motion(np.linspace(0, 1))

    The class contains substantial plotting capability in the BinarySystem.plot module that contains following
    functions (further info in: see elisa.binary_system.graphics.plot):

        - orbit(args): plots an orbit of the binary system
        - equipotential(args): xy, yz, zx cross-sections of equipotential surface
        - mesh(args): 3D mesh (scatter) plot of the surface points
        - wireframe(args): wire frame model of the selected system components
        - surface(args): plot models of the binary components with various surface
                         colormaps (gravity_acceleration, temperature, radiance, ...)

    Plot function can be called as function of the plot module. E.g.:
    ::

        >>> binary.plot.surface(phase=0.1, colormap='temperature'))

    Similarly, an animation of the orbital motion can be produced using BinarySystem.animation module and its function
    `orbital_motion(*args)`.

    List of valid input system arguments:

    :param primary: elisa.base.star.Star; instance of primary component
    :param secondary: elisa.base.star.Star; instance of secondary component
    :param inclination: Union[float, astropy.unit.quantity.Quantity]; Inclination of the system.
                        If unit is not supplied, value in degrees is assumed.
    :param period: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity]; Orbital period of binary
                   star system. If unit is not specified, default period unit is assumed (days).
    :param eccentricity: Union[(numpy.)int, (numpy.)float]; from <0, 1> interval
    :param argument_of_periastron: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity];
    :param gamma: Union[float, astropy.unit.quantity.Quantity]; Center of mass velocity.
                  Expected type is astropy.units.quantity.Quantity, numpy.float or numpy.int
                  otherwise TypeError will be raised. If unit is not specified, default velocity unit is assumed (m/s).
    :param phase_shift: float; Phase shift of the primary eclipse with respect to the ephemeris.
                               true_phase is used during calculations, where: true_phase = phase + phase_shift.;
    :param primary_minimum_time: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity];
    :param additional_light: float; fraction of light that does not originate from the `BinarySystem`
    :param distance: float: distance between system and the observer


    Object for handling models of a binary system at given orbital position.
    Use functions OrbitalPositionContainer.from_binary_system or
    BinarySystem.build_container to correctly initialize this container.


    Structure designed to store orbital positions on (nearly) symmetrical orbital positions around apsidal line.
    The symmetrical counterparts are stored in the same positions within 'body' and 'mirror' position arrays.
    Corresponding `body` and `mirror` items share the same bindary system model which saves computational time.
    !!! BEWARE, THIS IS MUTABLE !!!

    :param body: numpy.array; N x 5 array containing row-wise orbital positions used as templates
                             (they will be evaluated exactly)
    :param mirror: numpy.array; N x 5 array containing row-wise orbital positions mirrored from corresponding
                               `body` orbital positions using symmetry along apsidal line.


    Object representing orbit of a binary system. Accessible as an attribute of an BinarySystem object

    Input parameters:

    :param period: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity]; Orbital period of binary
                   star system. If unit is not specified, default period unit is assumed (days).
    :param inclination: ; Union[float, astropy.units.Quantity]; If unitless values is supplied, default unit
                          suppose to be radians.
    :param eccentricity: Union[(numpy.)int, (numpy.)float];
    :param argument_of_periastron: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity]; If unit is
                                   not supplied, value in radians is assumed.
    :param phase_shift: float;

    Output parameters:

    :periastron_distance: float; Distance in periastron (in unit of semi major axis (a = a1 + a2) of relative motion)
    :periastron_phase: float; true (not photometric but computed from mean anomaly) phase of periastron.


    Universal plot interface for binary system class, more detailed documentation for each value of descriptor is
    available in graphics library.

    available plot methods::

        `orbit` - plots orbit in orbital plane
        `equipotential` - plots crossections of surface Hill planes in xy,yz,zx planes
        `mesh` - plot surface points
        `wireframe` - wire frame model of the binary
        `surface` - plot stellar surfaces


    Standalone class to compute binary components center of mass radial velocity via astro-community parameters.

    Community parameters::

        ``asini`` -- semi_major_axis * sin(inclination)
        ``eccentricit``
        ``argument_of_periastron``
        ``period``
        ``true_anomaly``
        ``gamma``
        ``mass_ratio``

    Input (initialization) parameters

    :param eccentricity: Union[(numpy.)int, (numpy.)float];
    :param argument_of_periastron: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity];
    :param period: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity]; Orbital period of binary
                   star system. If unit is not specified, default period unit is assumed (days).


    Universal plot interface for Observer class, more detailed documentation for each value of descriptor is
    available in graphics library.

    Available methods::

        `orbit` - plots orbit in orbital plane


Pulsation mode data container.


    Abstract class defining fitting task.  This structure aims to provide a framework for solving inverse problem for
    one object that embeds observed data and fitting methods and provides unified output from fitting methods along with
    capability to visualize the resulting fit.

    :param name: str; arbitrary name of instance
    :param data: Dict; data to bwe analyzed with the Analytics task instance


Fitting task class aimed to fit light curves of eclipsing binary stars.


    Fitting task class aimed to fit radial velocity (RV) curves of eclipsing binary stars. For now, the method
    support only kinematic method for calculation of radial velocities (regarding stars as point masses).


Evaluating whether the observational data in elisa.tasks.RVBinaryAnalyticsTask are supplied in valid form.


Evaluating whether the observational data in elisa.tasks.LCBinaryAnalyticsTask are supplied in valid form.


Class with common methods used during an LC fit.


Class for LC fitting using the MCMC method.


Class for LC fitting using the Least-Squares method.


Graphics module for visualization of MCMC sampling results.


Graphics functions for visualization of LC fit result.


    General framework for solution of the inverse problem in ELISa.

    Slotted attributes:

        :constrained: Dict; list of constrained model parameters in flat JSON format
        :discretization: int; discretization factor for primary component
        :fitable: Dict; list of optimized model parameters in flat JSON format
        :fixed: Dict; list of constant model parameters in flat JSON format
        :initial_vector: List; array of starting values for variable parameters
        :interp_treshold: int; Above this total number of datapoints, curve will be interpolated
                               using model containing `interp_treshold` equidistant points per epoch.
        :normalization: Dict[str, tuple]; normalization boundaries of variable parameters
                                          {parameter@name: (min, max), ...}
        :num_of_points: Dict[str, int]; number of points of observations in each passband
        :observer: elisa.observer.observer.Observer; Observer instance
        :x_data: Dict[str, numpy.array]; phases or times of observations in each filter
        :x_data_reduced: numpy.array; phases or times of observations grouped from all filters without duplicate phases
        :x_data_reducer: Dict[str, numpy.array]; x_data[passband] = x_data_reduced[x_data_reducer[passband]]
        :y_data: Dict[str, numpy.array]; fluxes in each filter
        :y_err: Dict[str, numpy.array]; observational errors of y_data
        :atmosphere_model: Union[dict(), None]: atmosphere models for each component {component: atm_model, ...}
        :limb_darkening_coefficients: Union[dict(), None]: custom limb-darkening coefficients used for components
                                      in format {component: {passband: ld_coeffs, }, }


Abstract implementation of the RV fit.


Abstract implementation the LC fitting.


Module for handling of the MCMC chain and the sampler.


General framework for MCMC sampling of binary systems.


LC fit class implementing an MCMC method.


    MCMC fitting implementation for light curves of over-contact binaries.
    It keeps eye on values of potentials - keep it same for primary and secondary component.


MCMC fitting implementation for light curves of detached binaries.


RV fit class implementing an MCMC method using kinematic method.


General class for solving inverse problem in case of LC data.


Optimization class for solving an inverse problem for overcontact systems.


Optimization class for solving an inverse problem for detached systems.


Class for fitting radial velocities using kinematic method.


Class with common methods used during an RV fit.


Class for RV fitting using the MCMC method.


Transforming various input time series x,y and y_err to numpy.array format.


Making sure that time and RV units are convertible to the ELISa's base units.


Making sure that time and LC units are convertible to the ELISa's base units.


Abstract class dedicated to store any synthetic or (primarily) observational data.


    Child class of elisa.analytics.dataset.base.Dataset class storing radial velocity measurement.
    RVData instance can be initialized in two different ways:

    - directly in code, using numpy arrays as x and y values, astropy.units to specify corresponding units and a
      reference magnitude of the object. Example:

      ::

        from elisa import RVData

        lc_data = RVData(x_data, x_unit, y_data, y_err, y_unit)

    - loading directly from a file:

      ::

        rv_data = RVData.load_from_file(
            filename,
            x_unit, y_unit,
            data_columns = (0, 1, 2)  # column indices containing x_data, y_data, y_err arrays
        )

    Input parameters:

    :param x_data: numpy.array; times of observation or photometric phases
    :param y_data: numpy.array; radial velocities
    :param y_err: numpy.array; radial velocity errors - optional
    :param x_unit: astropy.unit.Unit; if `None` or `astropy.unit.dimensionless_unscaled` is given,
                                      the `x_data are regarded as photometric phases, otherwise if unit is convertible
                                      to days, the `x_data` are regarded to be in JD
    :param y_unit: astropy.unit.Unit; velocity unit of the observed radial velocities and its errors


        Child class of elisa.analytics.dataset.base.Dataset class storing light curves.
        LCData instance can be initialized in two different ways:

        - directly in code, using numpy arrays as x and y values, astropy.units to specify corresponding units and a
          reference magnitude of the object. Example:

          ::

            from elisa import LCData

            lc_data = LCData(x_data, x_unit, y_data, y_err, y_unit, reference_magnitude)

        - loading directly from a file:

          ::

            lc_data = LCData.load_from_file(
                filename,
                x_unit, y_unit,
                reference_magnitude,
                data_columns = (0, 1, 2)  # column indices containing x_data, y_data, y_err arrays
            )

        Input parameters:

        :param x_data: numpy.array; times of observation or photometric phases
        :param y_data: numpy.array; light curves supplied in normalized fluxes or magnitudes
        :param y_err: numpy.array; light curve errors - optional
        :param x_unit: astropy.unit.Unit; if `None` or `astropy.unit.dimensionless_unscaled` is given,
                                          the `x_data` are regarded as phases, otherwise if unit is convertible
                                          to days, the `x_data` are regarded to be in JD
        :param y_unit: astropy.unit.Unit; unit of the observed flux and its errors
        :param reference_magnitude: if the input light curve is in magnitudes, the user have to provide a reference
                                    magnitude to use during magnitude to relative flux conversion


Module that handles conversion of binary system parameters units.


Module that handles conversion of component's parameters units.


Module that handles conversion of spot's parameters units.


Module that handles unit conversion of nuisance fit parameters.


Module that handles unit conversion of pulsation mode parameters.


Auxiliary handler for fit parameters that ensures that each parameter attribute is present in the results.


    Object designed for storing attributes of fit parameter.

    :param transform_cls: callable; class used to transform user fit parameters into default units
    :param kwargs: Dict; fit parameter attributes
    :**kwargs**:
        * **param**: str; parameter name
        * :value: float; value assigned to the fit parameter
        * :unit: astropy.unit.Unit; unit assigned to the `value`
        * :fixed: bool; if True, the parameter value will be fixed during the fit procedure
        * :constraint: Union[None, str]; enables to constrain the parameter value to the different variable
                                         fit parameter using mathematical expression. Here is the example of
                                         the constraining the semi_major_axis parameter to the value of
                                         inclination::

                                            'constraint': '12.528 / sin(system@inclination)'

                                         Each fit parameter definition can contain either
                                         `fixed` or `constraint` attribute at the same time.
        * :min: Union[None, float]; minimum allowed value for the parameter
        * :max: Union[None, float]; maximum allowed value for the parameter, `max` > `min`
        * :sigma: Union[None, float]; standard deviation of the normal prior distribution for given parameter,
                                      usefull only in case of MCMC method


Abstract object for handling sets of initial fit parameters.


Object for handling spot-related fit parameters.


Object for handling pulsation mode-related fit parameters.


Object for handling component-related fit parameters.


    Object for handling auxiliary `nuisance` fit parameters used during the MCMC fit to produce a
    realistic estimations of confidence intervals.


Object for handling binary system-related fit parameters.


Handling of fit results in standard JSON format.


Convex 2D Shape


    Class to store and calculate necessary properties of the single star system based on the user provided parameters.
    Child class of elisa.base.system.System.

    Class can be imported directly:
    ::

        from elisa import SingleSystem

    After initialization, apart from the attributes already defined by the user with the arguments, user has access to
    the following attributes:

        :angular_velocity: float; angular velocity of the stellar rotation

    `SingleSystem' requires instance of elisa.base.star.Star in `star` argument with the following
    mandatory arguments:

        :param mass: float; If mass is int, np.int, float, np.float, program assumes solar mass as it's unit.
                            If mass astropy.unit.quantity.Quantity instance, program converts it to default units.
        :param t_eff: float; Accepts value in any temperature unit. If your input is without unit,
                             function assumes that supplied value is in K.
        :param polar_log_g: float; log_10 of the polar surface gravity

    following optional arguments are also available:

        :param metallicity: float; log[M/H] default value is 0.0
        :param gravity_darkening: float; gravity darkening factor, if not supplied, it is interpolated from Claret 2003
                                         based on t_eff
        :param limb_darkening_coefficients: Union[float, dict]; optional limb darkening coefficients
                                            used for the whole star useful in case the modelled star is outside the
                                            supported range of atmospheric parameters. Limb darkening coefficients can
                                            be supplied as dict {passband: ld_coefs}. If unused, elisa will
                                            interpolate the values from supplied limb-darkening tables.

    Each component instance will after initialization contain following attributes:

        :critical_surface_potential: float; potential of the star required to fill its Roche lobe
        :equivalent_radius: float; radius of a sphere with the same volume as a component
        :polar_radius: float; radius of a star towards the pole of the star
        :equatorial_radius: float; radius of a star towards the pole of the star

    The SingleSystem can be initialized either by using valid class arguments, e.g.:
    ::

        from astropy import units as u

        from elisa.single_system.system import SingleSystem
        from elisa.base.star import Star

        star = Star(
            mass=1.0*u.solMass,
            t_eff=5772*u.K,
            gravity_darkening=0.32,
            polar_log_g=4.43775*u.dex(u.cm/u.s**2),
            metallicity=0.0,
            discretization_factor=2
        )

        system = SingleSystem(
            star=star,
            gamma=0*u.km/u.s,
            inclination=90*u.deg,
            rotation_period=25.380*u.d,
            reference_time=0.0*u.d,
            distance = 153*u.pc
        )

    or by using the SingleSystem.from_json(dict) function that accepts various parameter combination in form of
    dictionary such as:
    ::

        data = {
            "system": {
                "inclination": 90.0,
                "rotation_period": 10.1,
                "gamma": '10000 K',  # you can define quantity using a string representation of the astropy quantities
                "reference_time": 0.5,
                "phase_shift": 0.0,
                "distance": 64  # pc
            },
            "star": {
                "mass": 1.0,
                "t_eff": 5772.0,
                "gravity_darkening": 0.32,
                "discretization_factor": 5,
                "metallicity": 0.0,
                "polar_log_g": "4.43775 dex(cm.s-2)"   # you can use logarithmic units using json/dict input
            }
        }

        single = SingleSystem.from_json(data)

    See documentation for `from_json` method for details.

    The rotation of the binary system can be modelled using function
    `calculate_lines_of_sight(phases)`. E.g.:
    ::

        single_instance.calculate_lines_of_sight(np.linspace(0, 1))

    The class contains substantial plotting capability in the SingleSystem.plot module that contains following
    functions (further info in: see elisa.single_system.graphics.plot):

        - equipotential(args): zx cross-sections of equipotential surface
        - mesh(args): 3D mesh (scatter) plot of the surface points
        - wireframe(args): wire frame model of the star
        - surface(args): plot model of the star with various surface colormaps (gravity_acceleration,
          temperature, radiance, ...)

    Plot function can be called as function of the plot module. E.g.:
    ::

        single_instance.plot.surface(phase=0.1, colormap='temperature)

    Similarly, an animation of the orbital motion can be produced using SingleSystem.animation module and its function
    `rotational_motion(*args)`.

    List of valid system arguments:

    :param star: elisa.base.star.Star; instance of the single star
    :param inclination: Union[float, astropy.unit.quantity.Quantity]; Inclination of the system.
                        If unit is not supplied, value in degrees is assumed.
    :param rotational_period: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity]; Orbital period of
                              binary star system. If unit is not specified, default period unit is assumed (days).
    :param reference_time: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity];
    :param phase_shift: float; Phase shift of the primary eclipse with respect to the ephemeris.
                               true_phase is used during calculations, where: true_phase = phase + phase_shift.
    :param additional_light: float; fraction of light that does not originate from the `BinarySystem`
    :param gamma: Union[float, astropy.unit.quantity.Quantity]; Center of mass velocity.
                  Expected type is astropy.units.quantity.Quantity, numpy.float or numpy.int
                  otherwise TypeError will be raised. If unit is not specified, default velocity unit is assumed (m/s).
    :param distance: float: distance between system and the observer


    Object for handling models of a single star system at given orbital position.
    Use functions SinglePositionContainer.from_single_system or
    SingleSystem.build_container to correctly initialize this container.


    Universal plot interface for binary system class, more detailed documentation for each value of descriptor is
    available in graphics library::

        `equipotential` - plots crossection of surface Hill planes in xz plane
        `wireframe` - wire frame model of the star
        `mesh` - plot surface points
        `surface` - plot stellar surfaces


    Model which represents rotational motion of the single system as apparent orbital motion of the observer.

    :param rotational_period: Union[(numpy.)float, (numpy.)int, astropy.units.quantity.Quantity];
    :param inclination: Union[float, astropy.units.Quantity]; If unitless values is supplied, default unit
                          suppose to be radians.


Requre just methods to pass.


testing whether right number of triangles and total surface area is visible to the observer


    Scale used by the Planck collaboration to plot Temperature power spectra:
    base-10 logarithmic up to l=50, and linear from there on.

    Care is taken so non-positive values are not plotted.


    Testing Class and its wrapper classy on different cosmologies

    To run it, do
    ~] nosetest test_class.py

    It will run many times Class, on different cosmological scenarios, and
    everytime testing for different output possibilities (none asked, only mPk,
    etc..)


    Reduced Wavelet Scattering Transform (RWST) class contains the output of the RWST of an image or a batch of images.
    This contains the corresponding coefficients and helps to handle and to plot these coefficients.


    Wavelet Scattering Transform (WST) class contains the output of the WST of an image or a batch of images.
    This contains the corresponding coefficients and helps to handle and to plot these coefficients.


Wavelet Scattering Transform (WST) operator.


Reduced Wavelet Scattering Transform (RWST) operator.


Base class for filters.


    Gabor filter.

    We make sure that the gabor filters have an (approximate?) unit L1-norm.


Base class for wavelets.


    Morlet Wavelet.

    We make sure that the wavelets have zero-mean and an (approximate?) unit L1-norm.


Base class for the definition of a RWST model, i.e. a model of the angular dependencies of the WST coefficients.


Usual RWST model (without additional terms).


RWST model that takes into account additional terms such as lattice terms and S2Iso3 term.


    Class: madys.ModelHandler

    Class that handles data and metadata of the files in the /isochrone path.
    Input:
    - model_grid: string, required. Selected isochrone grid model. Use ModelHandler.available() to return a list of available models.
    - resolve: bool, optional. If True, searchs for the location of the correct file. If False, it recovers it from the dictionary 'stored_data'. Default: False.

    Attributes:
    - file: string. Full path to the local file corresponding to model_grid;
    - age_range: 2-element list. Minimum and maximum age of the grid [Myr].
    - mass_range: 2-element list. Minimum and maximum age mass of the grid [M_sun].
    - header: string. Verbose description of the model_grid.
    - feh: float. [Fe/H] of the grid.
    - he: float. Helium content of the grid.
    - afe: float. Alpha enhancement [a/Fe] of the grid.
    - v_vcrit: float. Rotational velocity of the grid.
    - fspot: float. Fraction of stellar surface covered by star spots.
    - B: int. Whether magnetic fields are included (1) or not (0) in the grid.

    Built-in methods:

    1) __repr__
    Returns self.header.

    Methods (use help() to have more detailed info):

    1) get_contents
    Returns the full or part of the content of self.file, i.e. the data+metadata associated to a model_grid.

    2) get_data
    Wrapper for get_contents() that only returns the data associated to a model_grid.

    3) available
    Prints info about locally available models.

    4) download_model
    Given a model grid, it downloads it.


    Class: madys.SampleObject

    Class that creates, handles and obtains physical parameters for lists of n young stellar and substellar objects.
    Check the documentation for additional details on general functioning, customizable settings and various examples.

    An instance can be initialized in two modes, differing in the shape of input data:
     (mode 1) uses just a list of targets;
     (mode 2) uses a Table containing both the target list and photometric data.
    Parameters that are only used in mode 1 are labeled with (1), and similarly for mode 2. Parameters common to both modes are not labeled.
    Starting from v1.1.0, an additional init mode exists, mediated by the function import_from_file(), that recovers data from a previous execution.

    Input:
    - file (1): string or list, required. It can be either:
        - a string, giving the full path to the file containing target names;
        - a list of IDs. Gaia IDs must begin by 'Gaia DR2 ' or 'Gaia DR3'.
    - file (2): astropy Table, required. Table containing target names and photometric data. See documentation for examples of valid inputs.
    - ext_map: string, required. Extinction map used. Select one among 'leike', 'stilism' and None. Not required (set to None) if ebv is provided.
    - mock_file: string, optional. Only used if file is a list or a table. Full path to a fictitious file, used to extract the working path and to name the outputs after it. If not set and verbose>=1, verbose changes to 0.
    - surveys (1): list, optional. List of surveys where to extract photometric data from. Default: ['gaia','2mass'].
    - id_type (1): string, required. Type of IDs provided: must be one among 'DR2','DR3','HIP' or 'other'.
    - ebv: float or numpy array, optional. If set, uses the i-th element of the array as E(B-V) for the i-th star. Default: not set, computes E(B-V) through the map instead.
    - ebv_err: float or numpy array, optional. Error on ebv, it should have its same type. If not set or None, no error is assumed. Default: not set.
    - max_tmass_q (1): worst 2MASS photometric flag ('ph_qual') still considered reliable. Possible values, ordered by decreasing quality: 'A','B','C','D','E','F','U','X'. For a given choice, excludes all measurements with a lower quality flag. Default: 'A'.
    - max_wise_q (1): worst ALLWISE photometric flag ('ph_qual2') still considered reliable. Possible values, ordered by decreasing quality: 'A','B','C','U','Z','X'. For a given choice, excludes all measurements with a lower quality flag. Default: 'A'.
    - verbose: int, optional. Degree of verbosity of the various tasks performed by MADYS. It can be:
        - 0: no file is saved, nothing is printed on the screen;
        - 1: a .csv file with retrieved information is saved (1), few info are printed on the screen;
        - 2: in addition to the output of 1, a log file is created;
        - 3: in addition to the output of 2, .csv files are created when executing SampleObject.get_params().
      Default: 2. However, if file is a list or a table and mock_file is not set, it is forcingly set to 0.

    Attributes:
    - file: string. Corresponding to either 'file' (1) or 'mock_file' (2).
    - verbose: int. Corresponding to input 'verbose'.
    - path: string. Working path, where all inputs and outputs are present.
    - log_file: string. Name of the log_file. Open it for details on the process outcome.
    - phot_table: astropy Table. It contains all input (1) or retrieved (2) data.
    - good_phot (1): astropy Table. Same as 'phot_table', but with discarded photometry being masked.
    - quality_table (1): astropy Table. It contains all information (e.g., photometric flags) needed to assess the quality and the acceptance/rejection of photometric measurements.
    - abs_phot: numpy array. Absolute magnitudes in the required filters.
    - abs_phot_err: numpy array. Errors on absolute magnitudes in the required filters.
    - abs_phot: numpy array. Apparent magnitudes in the required filters.
    - abs_phot_err: numpy array. Errors on apparent magnitudes in the required filters.
    - par: numpy array. Parallaxes of the objects.
    - par_err: numpy array. Errors on parallaxes.
    - ebv: float or numpy array. Corresponding to input 'ebv' or to computed E(B-V) reddening.
    - ebv_err: float or numpy array. Corresponding to input 'ebv_err'.
    - filters: list. Set of filters, given either by the filters of 'surveys' (1) or by column names (2).
    - surveys: list. Surveys used to extract photometric data.
    - mode: int. The execution mode.
    - ID: astropy Table. Original set of IDs.
    - GaiaID: astropy Table. Gaia IDs (original or recovered). If original, they can come from DR3 or DR2. If recovered, they always come from DR3.
    - log_file: Path object. Full path to the log file. It only exists if verbose>=2.

    Built-in methods:

    1) __getitem__
    SampleObject instances can be indexed like numpy arrays.
    Have a look at the documentation for additional details.

    2) __len__
    The len of a SampleObject instance is equal to the number of objects in the original list.

    3) __repr__
    Returns a string 's' corresponding to the user's input.
    It can be executed through eval(s).

    4) __str__
    Returns a verbose representation of the calling sequence.

    4) __eq__
    Two SampleObject instances are considered equal if the queried objects (as specified by the attribute ID) are the same.
    Two instances with the same object names but a different order will yield False in the comparison. This is done to avoid
    possible misinterpretations of the results based on indexing.

    Methods (use help() to have more detailed info):

    1) get_params
    Estimates age, mass, radius, Teff and logg for each object in the sample by comparison with isochrone grids.

    2) CMD
    Draws a color-magnitude diagram (CMD) containing both the measured photometry and a set of theoretical isochrones.

    3) plot_photometry
    Similar to CMD, but draws only photometric data over an existing figure.

    4) interstellar_ext
    Computes the reddening/extinction in a custom band, given the position of a star.

    5) extinction
    Converts one or more B-V color excess(es) into absorption(s) in the required photometric band.

    6) app_to_abs_mag
    Turns one or more apparent magnitude(s) into absolute magnitude(s).

    7) plot_2D_ext
    Plots the integrated absorption in a given region of the sky, by creating a 2D projection at constant distance of an extinction map.

    8) ang_dist
    Computes the angular distance between two sky coordinates or two equal-sized arrays of positions.

    9) export_to_file
    Exports the instance to a .h5 file. Complementary to import_from_file(), which performs the opposite operation.

    10) import_from_file
    Alternative initializer for the class. It imports the instance from a .h5 file. Complementary to export_to_file(), which performs the opposite operation.

    11) merge
    Merges two or more SampleObject instances into a single one.