        This function returns the number of SNe Ia occuring within a given time
        interval using the Vogelsberger et al. (2013) delay-time distribution
        function.

        Arguments
        =========

          timemin : Lower boundary of the time interval.
          timemax : Upper boundary of the time interval.


        This function returns the rate of SNe Ia using the delay-time distribution
        of Vogelsberger et al. (2013) at a given time

        Arguments
        =========

          tt : Age of the stellar population
          fac1 : Minimum age for the stellar population to host SNe Ia


        This function returns the lower mass boundary of the SN Ia progenitors
        from a given stellar population age.

        Arguments
        =========

          t_s : Age of the considered stellar population


        This function returns the number of white dwarfs, at a given time, which
        had stars of a given initial mass as progenitors.  The number is
        normalized to a stellar population having a total mass of 1 Mo.

        Arguments
        =========

          m : Initial stellar mass of the white dwarf progenitors
          t : Age of the considered stellar population


        This function returns the rate of SNe Ia, at a given stellar population
        age, coming from stars having a given initial mass.  It uses the delay-
        time distribution of Maoz & Mannucci (2012).

        Arguments
        =========

          m : Initial stellar mass of the white dwarf progenitors
          t : Age of the considered stellar population


        This function returns the rate of SNe Ia, at a given stellar population
        age, coming from all the possible progenitors.  It uses the delay-time
        distribution of Maoz & Mannucci (2012).

        Arguments
        =========

          t : Age of the considered stellar population


        This function returns the total number of SNe Ia (per Mo formed) and
        white dwarfs for a given time interval.  It uses the delay-time
        distribution of Maoz & Mannucci (2012).

        Arguments
        =========

          timemin : Lower limit of the time (age) interval
          timemax : Upper limit of the time (age) interval


        This function returns the rate of SNe Ia, at a given stellar population
        age, coming from stars having a given initial mass. It uses the exponential
        delay-time distribution of Wiersma et al. (2009).

        Arguments
        =========

          m : Initial stellar mass of the white dwarf progenitors
          t : Age of the considered stellar population


        This function returns the total number of SNe Ia (per Mo formed) and
        white dwarfs for a given time interval.  It uses the exponential delay-
        time distribution of Wiersma et al. (2009).

        Arguments
        =========

          timemin : Lower limit of the time (age) interval
          timemax : Upper limit of the time (age) interval


        This function normalizes the SN Ia rate of a gaussian.

        Argument
        ========

          lifetime_min : Minimum stellar lifetime.


        This function returns the rate of SNe Ia, at a given stellar population
        age, coming from stars having a given initial mass.  It uses a gaussian
        delay-time distribution similar to Wiersma09.

        Arguments
        =========

          m : Initial stellar mass of the white dwarf progenitors
          t : Age of the considered stellar population


        This function returns the total number of SNe Ia (per Mo formed) and
        white dwarfs for a given time interval.  It uses the gaussian delay-
        time distribution of Wiersma et al. (2009).

        Arguments
        =========

          timemin : Lower limit of the time (age) interval
          timemax : Upper limit of the time (age) interval


        This function normalizes the SN Ia rate of a gaussian (similar to Wiersma09).

        Argument
        ========

          lifetime_min : Minimum stellar lifetime.


        This function normalizes the SN Ia rate of Maoz or any power law.

        Argument
        ========

          lifetime_min : Minimum stellar lifetime.


        This function returns the total number of SNe Ia (per Mo formed) for
        a given time interval.  It uses an input DTD polynomial function of
        any order.

        Arguments
        =========

          timemin : Lower limit of the time (age) interval
          timemax : Upper limit of the time (age) interval


        This function normalizes the polynomial input DTD function.  Can
        be any polynomial order.


        Finds and returns the list of indices for isotopes of
        element 'elem'. Also returns a list of the indices for
        H and He to facility metallicity calculations.

        Arguments
        =========

        elem  : a string identifying the element requested.

        Returns 2 lists
        =========

        indices of isotopes of elem,
        indices of isotopes of H and He


        Compute the metal fraction for a list of elements.
        The metal fraction is defined as mass_element/mass_metals.

        Arguments
        =========

        elem     : the name of the element to use. All isotopes
                   will be found.
        t_step   : the indx of the time step to do the calculation.
                   if t_step = -1, or not specified, the last
                   time_step is used

        Returns
        =========

        mass fraction of metals for all isotopes identified by
        i_iso_list as a single number


        This function returns, using the IMF, the number or the mass of all
        the stars within a certain initial stellar mass interval.

        Arguments
        =========

          mmin : Lower mass limit of the interval.
          mmax : Upper mass limit of the interval.
          inte : 1 - Return the number of stars.
                 2 - Return the stellar mass.
                 0 - Return the number of stars having a mass 'mass'
                -1 - Return the IMF proportional constant when normalized to 1 Mo.
          mass : Mass of a star (if inte == 0).


        This function returns the number of stars having a certain stellar mass
        with a Salpeter IMF or a similar power law.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the total mass of stars having a certain initial
        mass with a Salpeter IMF or a similar power law.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the number of stars having a certain stellar mass
        with a log normal IMF with characteristic mass self.imf_pop3_char_mass.

        Arguments
        =========

          mass : Stellar mass.

          ** future add, sigma... assuming sigma = 1 for now **


        This function returns the total mass of stars having a certain initial
        mass with a log normal IMF with characteristic mass self.imf_pop3_char_mass.

        Arguments
        =========

          mass : Stellar mass.

          ** future add, sigma... assuming sigma = 1 for now **


        This function returns the number of stars having a certain stellar mass
        with a custom IMF.

        Arguments
        =========

          mass : Stellar mass.
          ci : File containing the custom IMF.


        This function returns the total mass of stars having a certain stellar
        mass with a custom IMF.

        Arguments
        =========

          mass : Stellar mass.
          ci : File containing the custom IMF.


        This function returns the number of stars having a certain stellar mass
        with a Chabrier IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the total mass of stars having a certain stellar
        mass with a Chabrier IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the number of stars having a certain stellar mass
        with a Kroupa et al. (1993) IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the total mass of stars having a certain stellar
        mass with a Kroupa et al. (1993) IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the number of stars having a certain stellar mass
        with a Kroupa IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the integration of the Kroupa (2001)
        IMF. Number of stars.

        Arguments
        =========

          mmin : Lower-boundary mass of the integration
          mmax : Upper-boundary mass


        This function returns the total mass of stars having a certain stellar
        mass with a Kroupa IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the number of stars having a certain stellar mass
        with a Ferrini, Pardi & Penco (1990) IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the total mass of stars having a certain stellar
        mass with a Ferrini, Pardi & Penco (1990) IMF.

        Arguments
        =========

          mass : Stellar mass.


        This function returns the closest available metallicity grid point
        for a given Z.  It always favours the lower boundary.

        Arguments
        =========

          Z : Current metallicity of the gas reservoir.
          Z_grid : Available metallicity grid points.


        This function returns yields that are corrected for the difference
        between the initial abundances used in the stellar model calculations
        and the ones in the gas reservoir at the moment of star formation.
        See Wiersma et al. (2009) for more information on this approach.
        Note that tabulated net yields are not required for this approach.

        Arguments
        =========

          mgal_t : Current mass of the gas reservoir (for 'wiersma' setting).
          ytables : Ojbect containing the yield tables.
          Z_gridpoint : Metallicity where the correction is made.
          m_stars : Stellar mass grid point at metallicity Z_gridpoint.


        This function calculates and returns the coefficients of the linear fit
        regarding the total mass ejected as a function of the initial mass at
        the low-mass end of massive stars (up to 15 Mo).

        Arguments
        =========

          m_stars : Stellar mass grid point at a specific metallicity.
          yields : Stellar yields at a specific metalliticy


        Returns the metallicity of the gas reservoir at step i.
        Metals are defined as everything heavier than lithium.

        Argument
        ========

          i : Index of the timestep


This function converts isotope yields in elements and returns the result.


Return current time.  This is for keeping track of the computational time.


        Distribute the SSP ejecta.  The SSP that forms during this step
        is treated by interpolating SYGMA results that were kept in memory.
        The SSp still deposit its ejecta in the upcoming timesteps, as in the
        original chem_evol.py class.

        Argument
        ========

          i : Index of the current timestep


        Interpolate all the isotope for each step to create a SSP with the
        wanted metallicity.  The ejecta is scale to the mass of the SSP.

        Arguments
        =========

          i : Index of the current timestep


        This function interpolates with the Steffen 1990 algorithm, adding
        linear extra points at both ends of the interval.

        Argument
        ========

            x_arr: coordinate array
            y_arr: 1-D or 2-D numpy array for interpolation
            xx: value for which y_arr must be interpolated
            indx: interpolation index such that
                x_arr[indx] < xx < x_arr[indx + 1].
                The minimum value is 0 and the maximum is len(x_arr) - 1.
            interp_list: list holding the interpolation coefficients.
                it should have the same size and dimensions as y_arr and
                initialized to None.
            return_coefs: If True, return the calculated interp_list[indx]
                instead of returning the interpolated y_arr


Create the tree itself


        Wrapper for search_left
        Search for the rightmost index lower or equal than value


Search for the rightmost index lower or equal than value


        This function checks for incompatible input entries, and stops
        the simulation if needed.


        Calculate the number of core-collapse SNe that will occur
        in total per units of stellar mass formed.


Run all stellar populations at all metallicties.


Calculate parameters that will be used when the IFM is randomly sampled.


Refine the timesteps and increase the sizes of relevant arrays if needed.


        This function increases the number of timesteps if the star formation
        will eventually consume all the gas, which occurs when dt > (t_star/sfe).


        Calculate the average mass fraction returned by stellar populations.
        This refers to the ratio between the ejected mass and the initial
        stellar population mass.


        This function declares the arrays used to follow the evolution of the
        galaxy regarding its growth and the exchange of gas with its surrounding.


        This function sets the properties of the selected galaxy, such as its
        SFH, its total mass, and its stellar mass.


See copy_sfr_input() for more info.


        Calculate the star formation efficiency and the initial mass of gas
        for a closed box model, given the final gas mass and the current
        stellar mass.


        Return the final mass of gas, given the initial mass of the gas
        reservoir and the star formation efficiency.  The function uses
        a simple star formation law in the form of SFR(t) = sfe * M_gas(t)


        This function reads a SFH input file and interpolates its values so it
        can be inserted in the array "sfr_input", which contains the SFR for each
        OMEGA timestep.

        Note
        ====

          The input file does not need to have constant time step lengths, and
          does not need to have the same number of timesteps as the number of
          OMEGA timesteps.

        Important
        =========

          In OMEGA and SYGMA, t += timestep[i] is the first thing done in the main
          loop.  The loop calculates what happened between the previous t and the
          new t.  This means the mass of stars formed must be SFR(previous t) *
          timestep[i].  Therefore, sfr_input[i] IS NOT the SFR at time t +=
          timestep[i], but rather the SFR at previous time which is used for the
          current step i.

        Argument
        ========

          path_sfh_in : Path of the input SFH file.


        This function generates a random SFH. This should only be used for
        testing purpose in order to look at how the uncertainty associated to the
        SFH can affects the results.

        The self.rand_sfh sets the maximum ratio between the maximum and the
        minimum values for the SFR.  This parameter sets how "bursty" or constant
        a SFH is.  self.rand_sfh = 1 means a constant SFH.


        This function fills the arrays used to follow the evolution of the
        galaxy regarding its growth and the exchange of gas with its surrounding.


        This function returns the age of the Universe at a given redshift.

        Argument
        ========

          z_gttfz : Redshift that needs to be converted into age.


        This function returns the redshift of a given Universe age.

        Argument
        ========

          t_gtzft : Age of the Universe that needs to be converted into redshift.


        This function calculates the redshift associated to every timestep
        assuming that 'tend' represents redshift zero.


        Create a SSP with SYGMA for each metallicity available in the yield tables.
        Each SSP has a total mass of 1 Msun, is it can easily be re-normalized.


        Calculate the interpolation coefficients of each isotope between the
        different metallicities for every timestep considered in the SYGMA
        simulations.  ejecta = a * log(Z) + b

        self.ej_x[Z][step][isotope][0 -> a, 1 -> b], where the Z index refers
        to the lower metallicity boundary of the interpolation.


        This functions calculates the mass of the dark matter halo at each
        timestep.


        This function interpolates the DM masses from an input array
        and add the masses to the corresponding OMEGA step


        This function interpolates the R_vir from an input array
        and add the radius to the corresponding OMEGA step


        This function calculates and returns the fit coefficients for the
        interpolation of the evolution of the dark matter mass as a function
        of time.


This function calculates the star formation timescale at every timestep.


        This function calculates the mass of the gas reservoir at every
        timestep using a classical star formation law.


        This function interpolates the gas masses from an input array
        and add the masses to the corresponding OMEGA step


        This function calculates the mass-loading factor and the mass of outflow
        at every timestep.


        This function adds the stellar ejecta of external galaxies that
        just merged in the mdot array of the current galaxy.  This function
        assumes that the times and the number of timesteps of the merging
        galaxies are different from the current galaxy.

        Notes
        =====

            i_ext : Step index in the "external" merging mdot array
            i_cur : Step index in the "current" galaxy mdot array
            t_cur_prev : Lower time limit in the current i_cur bin
            t_cur : Upper time limit in the current i_cur bin

            M_dot_ini has an extra slot in the isotopes for the time,
            which is t = 0.0 for i_ext = 0.


        This function calculates the evolution of the chemical abundances of a
        galaxy as a function of time.

        Argument
        ========

          mass_sampled : Stars sampled in the IMF by an external program.
          scale_cor : Envelope correction for the IMF.


        This function calculates the evolution of one single step in the
        chemical evolution.

        Argument
        ========

          i : Index of the timestep.
          sfr_rs : Input star formation rate [Mo/yr] for the step i.
          m_added : Mass (and composition) added for the step i.
          m_lost : Mass lost for the step i.
          no_in_out : Cancel the open box "if" statement if True
          f_esc_yields: Fraction of non-contributing stellar ejecta
          mass_sampled : Stars sampled in the IMF by an external program.
          scale_cor : Envelope correction for the IMF.


        This function samples randomly the IMF using a Monte Carlo
        approach and returns an array with all masses sampled (not
        in increasing or decreasing orders).

        Argument
        ========

          m_pop : Mass of the considered stellar population


        This function calculates the mass fraction of the gas reservoir that
        is converted into stars at a given timestep.

        Argument
        ========

          i : Index of the timestep.
          sfr_rs : Star formation rate [Mo/yr] for the timestep i


        This function convert the instantaneous outflow rate (vs SFR) into a delayed
        rate where Mout follows the number of CC SNe.

        Argument
        ========

          i : Index of the timestep.


        This function calculates and returns the inflow mass at a given timestep

        Argument
        ========

          i : Index of the timestep.
          m_tot_current : Total mass of the gas reservoir at step i


        fractional contribution from each stellar source towards the galactic total relative to solar

        Parameters
        ----------

        species : array of strings
             isotope or element name,
             e.g. ['H-1','He-4','Fe','Fe-56']
             default = ['all']
        sources : array of strings
             specifies the stellar sources to plot,
             e.g. ['agb','massive','1a']
        cycle : float
             specifies cycle number to plot,
             e.g. 'cycle=-1' will plot last cycle
        solar_ref : string
             the solar abundances used as a reference
             default is Asplund et al. 2009
             'Asplund_et_al_2009'
             'Anders_Grevesse_1989'
             'Grevesse_Noels_1993'
             'Grevesse_Sauval_1998'
             'Lodders_et_al_2009'
        yscale: string
             choose y axis scale
             'log' or 'linear'

        Examples
        ---------

        >>> s.plot(['all']['agb','massive','1a'],
               cycle=-1, solar_ref='Lodders', yscale='log')


        mass evolution (in Msun) of an element or isotope vs time.

        Parameters
        ----------

        specie : string
             isotope or element name, in the form 'C' or 'C-12'
        source : string
             Specifies if yields come from
             all sources ('all'), including
             AGB+SN1a, massive stars. Or from
             distinctive sources:
             only agb stars ('agb'), only
             SN1a ('SN1a'), or only massive stars
             ('massive')
        norm : boolean
             If True, normalize to current total ISM mass
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure
        show_legend : boolean
             Default True. Show or not the legend

        Examples
        ----------

        >>> s.plot('C-12')


        Plots mass fraction of isotope or element
        vs either time or other isotope or element.

        Parameters
        ----------
        xaxis : string
            either 'age' for time
            or isotope name, in the form e.g. 'C-12'
        yaxis : string
            isotope name, in the same form as for xaxis

        source : string
            Specifies if yields come from
            all sources ('all'), including
            AGB+SN1a, massive stars. Or from
            distinctive sources:
            only agb stars ('agb'), only
            SN1a ('SN1a'), or only massive stars
            ('massive')

        norm : string
            if 'no', no normalization of mass fraction
            if 'ini', normalization ot initial abundance
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------

        >>> s.plot_massfrac('age','C-12')


        Plots elements in spectroscopic notation:

        Parameters
        ----------

        xaxis : string
            Elements spectroscopic notation e.g. [Fe/H]
            if 'age': time evolution in years
        yaxis : string
                Elements in spectroscopic notation, e.g. [C/Fe]
        source : string
                If yields come from
                all sources use 'all' (include
                AGB+SN1a, massive stars.)

                If yields come from distinctive source:
                only agb stars use 'agb', only
                SN1a ('SN1a'), or only massive stars
                ('massive')

        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> plt.plot_spectro('[Fe/H]','[C/Fe]')


        Plots gas mass in fraction of total mass vs time.

        Parameters
        ----------

        norm : string
            normalization, either 'no' for no normalization (total gass mass in solar masses),

            for normalization to the initial gas mass (mgal) with 'ini',
            for normalization to the current total gas mass 'current'.
            The latter case makes sense when comparing different
            sources (see below)

        source : string
            specificies if yields come from
            all sources ('all'), including
            AGB+SN1a, massive stars. Or from
            distinctive sources:
            only agb stars ('agb'), only
            SN1a ('sn1a'), or only massive stars
            ('massive')
        log : boolean
            if true plot logarithmic y axis
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> s.plot_totmasses()


        Plots the SN1a distribution:
        The evolution of the number of SN1a and SN2
        #Add numbers/dt numbers/year...

        Parameters
        ----------
        rate : boolean
            if true, calculate rate [1/century]
            else calculate numbers
        fraction ; boolean
            if true, ignorate rate and calculate number fraction of SNIa per WD
        rate_only : string
            if empty string, plot both rates (default)

            if 'sn1a', plot only SN1a rate

            if 'sn2', plot only SN2 rate
        xaxis: string
            if 'time' : time evolution
            if 'redshift': experimental! use with caution; redshift evolution
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> s.plot_sn_distr()


            Writes data into a text file. data entries
            can have different lengths


        Plots the star formation rate over time.
        Shows fraction of ISM mass which transforms into stars.

        Parameters
        ----------

        fraction : boolean
           if true: fraction of ISM which transforms into stars;
           else: mass of ISM which goes into stars

        source : string
            either 'all' for total star formation rate; 'agb' for AGB and 'massive' for massive stars
            WARNING! Do not use in OMEGA, only use it in SYGMA.

        marker : string
            marker type
        shape : string
            line shape type
        fig: figure id

        Examples
        ----------
        >>> s.star_formation_rate()


Time to redshift conversion


        Function checks if either of shape,color,marker
        is set. If not then assign in each case
        a unique property related to the source ('agb','massive'..)
        to the variable and returns all three


        This function plots the mass-loading factor, which is the ratio
        between the mass outflow rate and the star formation rate, as a
        function of time.

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
                Font size of the legend.

        Examples
        ----------

        >>> o1.plot_mass_loading(label='Mass-Loading Factor')


        This function plots the mass outflow rate as a function of time
        in units of [Mo/yr].

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
                Font size of the legend.

        Examples
        ----------

        >>> o1.plot_outflow_rate(label='Outflow Rate')


        This function plots the mass inflow rate as a function of time
        in units of [Mo/yr].

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
             Font size of the legend.

        Examples
        ----------

        >>> o1.plot_inflow_rate(label='Inflow Rate')


        This function plots the dark matter halo mass of the galaxy as a
        function of time.

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
             Font size of the legend.

        Examples
        ----------

        >>> o1.plot_dark_matter(label='Dark Matter')


        This function plots the star formation timescale as a function of time
        in units of [yr].

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
             Font size of the legend.

        Examples
        ----------

        >>> o1.plot_sf_timescale(label='Star Formation Timescale')


        This function plots the redshift a function of time.

        Parameters
        ----------

        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
             Font size of the legend.

        Examples
        ----------

        >>> o1.plot_redshift(label='Redshift')


        This function plots the evolution of an isotopic ratio as a function
        of time, as a function of an abundance ratio, or as a function of
        another isotopic ratio.  Isotopic ratios are given in the
        delta notation and abundances ratios are given in spectroscopic notation.

        Parameters
        ----------

        return_x_y : boolean
             If False (default), show the plot.  If True, return two arrays containing
             the X and Y axis data, respectively.
        grain_notation : boolean
             If False (default), show mass ratio.  If True, show ratio in the delta notation
        xaxis : string
             X axis, either 'age', an abundance ratio such as '[Fe/H]', or an
             isotopic ratio such as 'C-12/C-13'.
        yaxis : string
             Y axis, isotopic ratio such as 'C-12/C-13'.
        solar_ab : string
             Path to the solar abundances used to normalize abundance ratios.
        solar_iso : string
             Path to the solar isotopes used to normalize the isotopic ratios.
        fig : string, float
             Figure name.
        source : string
            Specificies if yields come from
            all sources ('all') or from
            distinctive sources:
            only AGB stars ('agb'), only
            SN Ia ('sn1a'), or only massive stars ('massive')
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
             Font size of the legend.

        Examples
        ----------

        >>> o1.plot_iso_ratio(xaxis='[Fe/H]', yaxis='C-12/C-13')


        This function plots the stellar metallicity distribution function (MDF),
        or the distribution function of any other abundance ratio.

        Parameters
        ----------

        return_x_y : boolean
             If False, show the plot.  If True, return two arrays containing
             the X and Y axis data, respectively.
        axis_mdf : string
             Abundance ratio for the distribution such as '[Fe/H]' or '[Mg/H]'.
        dx : float
             Bin resolution of the distribution.
        solar_ab : string
             Path to the solar abundances used to normalize abundance ratios.
        sigma_gauss : float
             Each point in the MDF can be associated with a gaussian. This implies
             that in reality, the metallicity should have a certain dispersion
             when stars form at each timestep (instead of using only a single
             average value).  The sigma_guass parameter sets the sigma value eac
             gaussian function.
        nb_sigma : float
             When sigma_gauss is greater than zero, nb_sigma is the number of
             sigma by which the X axis range is expanded.
        norm : boolean
             Normalize the MDF is True
             Default : True
        fig : string, float
             Figure name.
        marker : string
             Figure marker.
        shape : string
             Line style.
        color : string
             Line color.
        label : string
             Figure label.
        fsize : 2D float array
             Figure dimension/size.
        fontsize : integer
             Font size of the numbers on the X and Y axis.
        rspace : float
             Extra space on the right for the legend.
        bspace : float
             Extra space at the bottom for the Y axis label.
        labelsize : integer
             Font size of the X and Y axis labels.
        legend_fontsize : integer
                Font size of the legend.

        Examples
        ----------

        >>> o1.plot_mdf(axis_mdf='[Fe/H]', sigma_gauss=0.2)


        def plot_abun(self, fig=20, age=9.2e9,\
        solar_norm=False, iso_on=False,\
        list_elem=[], list_iso=[],return_x_y=False, over_plot_solar=False,\
        solar_ab_m='yield_tables/iniabu/iniab2.0E-02GN93.ppn', species_labels=True,f_y_annotate=0.9,\
        marker='o',marker_s='^',shape='',shape_s='-', color='b', color_s='r', label='Prediction',label_s='solar',fsize=[10,4.5],\
        fontsize=14,rspace=0.6,bspace=0.15,labelsize=15,\
        legend_fontsize=14, markersize=5):


        This function calculates the basic galaxy properties and put the
        relevant information in a folder


        This function calculates the evolution of the ejecta released by simple
        stellar populations as a function of time.


        This function calculates the percentage of gas mass which transforms into
        stars at every timestep, and then returns the result in an array.


        Writes out evolution of stellar parameter such as luminosity and kinetic energy.
        Stellar parameter quantities are available via <sygma instance>.stellar_param_attrs.

        Table structure:

        &Age &Quantity1 &Quantity2 ...

        &0.000E+00 &0.000E+00 &0.000E+00

        &0.000E+00 &0.000E+00 &0.000E+00

        Parameters
        ----------

        table_name : string,optional
          Name of table. If you use a notebook version, setting a name
          is not necessary.

        path : string
                directory where to save table.

        interact: bool
                If true, saves file in current directory (notebook dir) and creates HTML link useful in ipython notebook environment

        Examples
        ----------

        >>> s.write_evol_table(table_name='testoutput.txt')


        Plots the evolution of stellar parameter as provided as input in stellar parameter table (stellar_param_table variable).

        Parameters
        ----------

        quantity: string

                Name of stellar parameter of interest. Check for available parameter via <sygma instance>.stellar_param_attrs

        Examples
        ----------

        >>> s.plot_stellar_param(quantity='Ekin_wind')


        Plots the metal fraction defined as the sum of all isotopes except
        H1, H2, H3, He3, He4, Li6, Li7.

        Parameters
        ----------

        source : string
             Specifies if yields come from

             all sources ('all'), including
             AGB+SN1a, massive stars. Or from

             distinctive sources:

             only agb stars ('agb'),

             only SN1a ('SN1a')

             only massive stars ('massive')

        Examples
        ----------

        >>> s.plot_metallicity(source='all')


        Plots the yield table quantities such as lifetimes versus initial mass as given in yield input tables.

        Parameters
        ----------

        xaxis : string
             if 'mini': use initial mass
             if 'time': use lifetime
        iniZ  : float
              Metallicity of interest
        masses: list
              List of initial masses to be plotted

        table: string
              Yield table

        Examples
        --------

        >>> s.plot_table_param(quantity='Lifetime')


        Plots the remnant masses versus initial mass given in yield tables.

        Parameters
        ----------

        xaxis : string
             if 'mini': use initial mass; if of the form [specie1/specie2] use spec. notation of
        yaxis : string

        iniZ : float
             Metallicity to choose.

        Examples
        ----------

        >>> s.plot_table_remnant(iniZ=0.02)


        Plots total mass ejected by stars (!). To distinguish between the total mass of yields from the table and fitted total mass

        Parameters
        ----------

        plot_imf_mass_ranges : boolean
                If true plots the initial mass ranges for which yields are consider.

        Examples
        ----------

        >>> s.plot_yield_mtot()


Plots yields vesus either initial mass or [X/Y].
        Parameters
        ----------
        yaxis: list
            specifies a list of isotopes or elements with 'C-12' or 'C'. If chosen spectrographic notation use
            form [specie3/specie4]. e.g ['C-12', 'O-16'], ['C', 'O'], ['[C/Fe]', '[O/Fe]']

        xaxis: string
            use 'mini' for initial mass, use [specie1/specie2] for spectrographic notation
        Z: float
            specifies metallicity to be plotted
        masses: list
            specifies the masses to be plotted
        solar_abunds: string
            solar abundance for spectroscopic notation
            default: yield_tables/iniabu/iniab2.0E-02GN93.ppn


                Plots net yields as calculated in the code when using netyields_on=True.

                To be used only with net yield input.

        Parameters
        ----------

        species : string
                Isotope ratio in spectroscopic notation.

        Examples
        ----------

        >>> s.plot_net_yields(species='[C-12/Fe-56]')


        Mass ratio of two species indicated by species_ratio over time.
        Choice can either be elemental ratio or isotopic ratios.
        Masses of species are in solar masses.
        Note: Similar to plot_mass but with ratios of masses.

        Parameters
        ----------

        specie : string
             ratio of element or isotope, e.g. 'C/O', 'C-12/O-12'
        xaxis  : string
             if 'age' : time evolution
             if '[Fe/H]' : use [Fe/H]
        source : string
             Specifies if yields come from
             all sources ('all'), including
             AGB+SN1a, massive stars. Or from
             distinctive sources:
             only agb stars ('agb'), only
             SN1a ('SN1a'), or only massive stars ('massive')
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure
        logy : bool
             if yes, choose yaxis in log scale

        Examples
        ----------

        >>> s.plot_mass_ratio('C-12')


        mass evolution (in Msun) of an element or isotope vs time.
        Note: Used in WENDI.

        Parameters
        ----------

        specie : string
             1) isotope or element name, in the form 'C' or 'C-12'
        source : string
             Specifies if yields come from
             all sources ('all'), including
             AGB+SN1a, massive stars. Or from
             distinctive sources:
             only agb stars ('agb'), only
             SN1a ('SN1a'), or only massive stars
             ('massive')
        norm : string
            if 'no', no normalization
            If 'current', normalize to current total amount of specie

        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------

        >>> s.plot_mass(specie='C')


        Use the function plot_mass multiple times
        Mass evolution (in Msun) of an element or isotope vs time.

        Parameters
        ----------

        yaxis : array
             isotopes or element names, in the form 'C' or 'C-12'
        source : string
             Specifies if yields come from
             all sources ('all'), including
             AGB+SN1a, massive stars. Or from
             distinctive sources:
             only agb stars ('agb'), only
             SN1a ('SN1a'), or only massive stars
             ('massive')
        norm : boolean
             If True, normalize to current total ISM mass
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------


        Plots mass fraction of isotope or element
        vs time.

        Parameters
        ----------
        xaxis : string
            either 'age' for time
        yaxis : string
            isotope name, in the same form as for xaxis

        source : string
            Specifies if yields come from
            all sources ('all'), including
            AGB+SN1a, massive stars. Or from
            distinctive sources:
            only agb stars ('agb'), only
            SN1a ('SN1a'), or only massive stars
            ('massive')

        norm : string
            if 'no', no normalization of mass fraction
            if 'ini', normalization ot initial abundance
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------

        >>> s.plot_massfrac('age','C-12')


        Plots elements in spectroscopic notation.
        Note: Used in WENDI.

        Parameters
        ----------

        xaxis : string
            Spectroscopic notation of elements e.g. [Fe/H]
            if 'age': time evolution in years
        yaxis : string
                Elements in spectroscopic notation, e.g. [C/Fe]
        source : string
                If yields come from
                all sources use 'all' (include
                AGB+SN1a, massive stars.)

                If yields come from distinctive source:
                only agb stars use 'agb', only
                SN1a ('SN1a'), or only massive stars
                ('massive')

        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> plt.plot_spectro('[Fe/H]','[C/Fe]')


        EXPERIMENTAL: DO NOT USE
        Plots abundance distribution of stable isotopes
        of certain time t (X/X_sol vs A).:

        Parameters
        ----------

        t : float
            default end of the simulation tend
        x_axis :  string
            only 'A' setting, mass number, possible
        solar_norm : boolean
            if true, normalize to solar value
        linest : string
            linestyle
        makre1 : string
            for marker
        y_range : list
            contains min and max

        Examples
        ----------
        >>> s.plot_abu_distr()


        Plots either gas or star mass as fraction of total mass
        vs time.
        Note: Used in WENDI.

        Parameters
        ----------

        mass : string
            either 'gas' for ISM gas mass
            or 'stars' for gas locked away in stars (total gas - ISM gas)

        norm : string
            normalization, either 'no' for no normalization (total gas mass in solar masses),

            for normalization to the initial gas mass (mgal) with 'ini',

            for normalization to the current total gas mass 'current'.
            The latter case makes sense when comparing different
            sources (see below)

        source : string
            specifies if yields come from
            all sources ('all'), including
            AGB+SN1a, massive stars. Or from
            distinctive sources:
            only agb stars ('agb'), only
            SN1a ('sn1a'), or only massive stars
            ('massive')
        log : boolean
            if true plot logarithmic y axis
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> s.plot_totmasses()


        Plots the SN1a distribution:

        The evolution of the number of SN1a and SN2

        Parameters
        ----------
        rate : boolean
            if true, calculate rate [1/century]
            else calculate numbers
        fraction ; boolean
            if true, ignorate rate and calculate number fraction of SNIa per WD
        rate_only : string
            if empty string, plot both rates (default)

            if 'sn1a', plot only SN1a rate

            if 'sn2', plot only SN2 rate
        xaxis: string
            if 'time' : time evolution
            if 'redshift': experimental! use with caution; redshift evolution
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> s.plot_sn_distr()


        Plots the star formation rate over time.
        Shows fraction of ISM mass which transforms into stars.

        Parameters
        ----------

        fraction : boolean
                if true: fraction of ISM which transforms into stars;
                else: mass of ISM which goes into stars

        source : string
                either 'all' for total star formation rate; 'agb' for AGB and 'massive' for massive stars

        marker : string
                marker type
        shape : string
                line shape type
        fig: figure id

        Examples
        ----------
        >>> s.star_formation_rate()


        Plots yield contribution (Msun) of a certain mass range
        versus initial mass. Each stellar ejecta in one mass range
        is represented by the same yields, yields from certain stellar simulation.
        Be aware that a larger mass range means also a larger amount
        of yield for that range.
        Note: Used in WENDI.

        Parameters
        ----------
        specie : string
            Element or isotope name in the form 'C' or 'C-12'
        rebin : change the bin size to uniform mass intervals of size 'rebin'
            default 0, bin size is defined by ranges of (stellar) yield inputs
        log : boolean
            if true, use log yaxis
        label : string
             figure label
        marker : string
             figure marker
        shape : string
             line style
        color : string
             color of line
        fig : string,float
             to name the plot figure

        Examples
        ----------
        >>> s.plot_mass_range_contribution(specie='C')


        Internal function in order to get standardized figure font sizes.
        It is used in the plotting functions.


                Writes data into a text file. data entries
                can have different lengths


        Writes out evolution of the SSP accummulated ejecta in fraction of total mass of the SSP in the following format
        (each timestep in a line):

        &Age       &H-1       &H-2  ....

        &0.000E+00 &1.000E+00 &7.600E+08 & ...

        &1.000E+07 &1.000E+00 &7.600E+08 & ...

        ....

        This method has a notebook and normal version. If you are
        using a python notebook the function will
        open a link to a page containing the table.

        Parameters
        ----------
        table_name : string,optional
          Name of table. If you use a notebook version, setting a name
          is not necessary.
        elements : array
                Containing the elements with the name scheme 'H','C'
        isotopes : array
                If elements list empty, ignore elements input and use isotopes input; Containing the isotopes with the name scheme 'H-1', 'C-12'
        interact: bool
                If true, saves file in current directory (notebook dir) and creates HTML link useful in ipython notebook environment

        Examples
        ----------

        >>> s.write_evol_table(elements=['H','C','O'],table_name='testoutput.txt')


        Return an array of isotopic yields, in sync with the
        self.isotopes array

        Arguments
        =========

            model_label: Model (M,Z) at which the yields are requested
            isotopes: If empty, use self.isotopes for Yields and Xo
                      If provide Yields and X0 will follow that list
            field: "Yields" or "X0"


        Create and return the label of a model

        Arguments
        =========

            M: Mass of the model
            Z: Initial metallicity of the model


Split a yields line from a yields table, and remove "&"


Return all lines from a file


Declare general parameters for reading yields tables


        Create a new dictionary entry for the yields of a new model

        Argument
        ========

            model_label: name of the new model found in the yields table file
            iso_provided: True if the list of isotopes is pre-defined


        Add yields of a specific isotopes to the self.table dictionary

        Argument
        ========

            table: yields table dictionary
            model_label: name of the new model found in the yields table file
            iso_provided: True if the list of isotopes is pre-defined


        From the table dictionary, extract the list of masses
        and metallicities available in the yields table file


        Check whether the initial composition of the models
        are provided, and whether they add up to 1.0.


        Make sure the final remnant masses and the total
        ejected masses are provided and consistent


        Read the mass- and metallicity-dependent yields table
        and store all the relevant properties


        Read the metallicity-dependent yields table
        and store all the relevant properties


Read the initial abundance file and store abundances and isotopes


Split a iniabu-file line into isotope and abundance


        Return the list of abundance of the iniabu file

        Argument
        ========

            isotopes: List of isotope requested


        Allows to add more parameter to the parameter table.
        dcols=['Test1'], data=[[....]]


Add extra code to ipython notebooks


        Generate a copy of this object

        Returns:
            :class:`SpecObj`:


Check whether the input coordinate or coordinates are inside of the
        stream footprint.

        Parameters
        ----------
        c : `~astropy.coordinates.SkyCoord`
            Either a scalar coordinate or a set of coordinates to check.

        Returns
        -------
        in_footprint : bool, `numpy.ndarray`
            Either a boolean (for scalar input) or a boolean array (for
            multiple coordinates) specifying which of the input coordinates are
            inside of the stream footprint.


Plot the footprint polygon

        Parameters
        ----------
        frame : `~astropy.coordinates.BaseCoordinateFrame` subclass instance (optional)
            The coordinate frame to generate points in.
        ax : `~matplotlib.axes.Axes` (optional)
            The matplotlib axes object to plot on. If not specified, this will
            plot on the current axes object.
        wrap_angle : `~astropy.coordinates.Angle` (optional)
            The angle to wrap the longitude coordinate at. Specify this if you
            are having issues with the polygon wrapping around 360 deg.
        autolim : bool (optional)
            Determine and set the axes limits automatically to show the whole
            polygon.
        **kwargs
            All other keyword arguments are passed to
            `~matplotlib.patches.Polygon`.

        Returns
        -------
        fig : `~matplotlib.figure.Figure`
        ax : `~matplotlib.axes.Axes`


Convert a one-dimenstional list of SkyCoord to string for Gaia's query format (from DataCarpentry)


    Create the Polygon Footprint from the celestial track. The polygon is created by shifting the track in phi2 by a given width.

    Inputs:
    =======

    SkyCoordTrack: track SkyCoord object from a MWStreams library stream (mws[st].track)

    frame: None. Astropy coordinate frame to set up the polygon by offsetting the track by a given width.
           The default is to use the Track6D's own stream frame Track6D.stream_frame

    Parameters
    ==========

    phi2_offset: astropy.Quantity object
     The offset in phi2 that will be applied to the track to create the polygon footprint (default 0)

    width: astropy.Quantity object
     The total width of the polygon footprint to be created around track+phi2_offset


  Compute angular momentum for each point in the track.
        By default it returns the spherical components of the angular momentum in the heliocentric and galactocentric reference
        frames at rest w.r.t. the GSR. Set return_cartesian = True to get cartesian components

       	Parameters:
      	=======

	track : SkyCoord object

        return_cartesian : If True returns cartesian coordinates. If False, returns spherical coords (astropy format mod, lat, lon)

        Returns:
	========

        L : list object with compoments of angular momentum vector. By default returns spherical components modulus, lat, lon


         Returns all unique instances of the StreamNames in the library (a stream can have multiple tracks)

         Returns
         =======

         array


         Returns TrackNames available in the library (when On_only=False, equivalent to MWStreams.summary['TrackName'])

         Parameters:
         ===========

         On_only: True/False
                  If True it returns only the names for the active tracks

         Returns
         =======

         array


     Plot a Mollweide sky projection map of the current MWStreams library object in the selected coordinate frame.
     Note: requires Basemap library

     Parameters
     ==========

             track : SkyCoord object

         ax=None

         frame : Astropy astropy.coordinates.baseframe instance
                 Coordinate frame to be used in sky plot

         C_attribute : name of SkyCoord object attribute (in selected reference frame)
                       to pass plt.scatter as auxiliary column c
                       e.g. 'distance', 'pm_b' if frame=ac.Galactic

         plot_names : str ['ID','track_name','stream_name','stream_shortname']

         plot_colorbar: Bool
                        If C_attribute is passed, plot_colorbar=True by default

         invert_axis : Bool
                       Invert longitude axis, set to True by default to follow usual plotting convention for l/ra

         show_legend: Bool
                      Show legend at the bottom of the plot. Legend attributes can be passed via the legend_kwds dict

         basemap_kwds : dict
                        Keywords to instantiate Basemap projection. Default, Molweide projection

         mlabels_kwds: dict  - default=dict(meridians=np.arange(0.,360.,30.), color=(0.65,0.65,0.65),linewidth=1., laxmax=90.)
                       Meridian labelling keyword attributes to be passed to Basemap

         plabels_kwds: dict - default=dict(circles=np.arange(-75,75,15.), color=(0.65,0.65,0.65),linewidth=1.,
                          labels=[0,1,1,0], labelstyle='+/-' )
                       Parallel labelling keyword attributes to be passed to Basemap

         scat_kwds : dict - default scat_kwds=dict(marker='.', s=30, alpha=0.8) [defaults change if C_attribute is passed]
                     Plotting keyword attributes to be passed to plt.scatter

         annot_kwds : dict
                      Text and arrow attributes to be passed to annotate

         legend_kwds : dict
                       Legend attributes to be passed to plt.legend

         cb_kwds : dict - default = dict(label=C_attribute,  shrink=0.5)
                   Colorbar attributes to be passed to plt.colorbar

         exclude_streams: list of stream TrackNames
                          TrackNames for streams *not* to be included in the plot

         include_only: list of stream TrackNames
                       Only the TrackNames provided in this list will be plotted

         plot_On_only: False
                       Plot only a single (default) track for each stream (i.e. On attribute == True). The default is to plot
		       everything in the current library object

         return_basemap_m : False
                            Return Basemap projection function

         verbose: False
                  Not doing anything right now if set to True

     Returns
     =======

     	ax

     	ax : Current axes object


Writes the verbose output of the task listobs.


function to split corrected data for any field


Get a dictionary of context variables used across multiple templates.


    Get a string for use as a stream ID.

    The idea is to create a stream ID that is largely human-readable
    (hence the timestamp), and compact, but will not repeat if multiple packets
    are generated within a small timespan (within reason).
    To do this, we assume that only a single machine
    is generating alerts in a given stream. This means we can generate
    a uuid1() hexstring and throw away the static bytes which are derived from the
    machine's MAC address. This way we reduce the UUID hex length from
    32 chars to 12.


    Create a basic empty VOEvent with valid author details

    Args:
        substream (str): Comes after the domain, before the #
            E.g. 'ALARRM-REQUEST' or 'TEST-TRIGGER'
        stream_id (str):  ID within this stream, may be some combination
            of timestamp and / or unique ID.
        role (str): Voevent role
        date (datetime): 'Author date' to assign, typically current time
            at VOEvent generation.


    Returns [x] if x is not already a list.

    Used to make functions accept either scalar or array inputs -
    simply `listify` a variable to make sure it's in list format.


Ensure parent directory exists, so you can write to `filename`.


Unit-checked conversion from voeventparse.Position2D -> astropysics FK5


    Removes any unhelpful characters (e.g. #,/,<space>,%) from a string.

    We pass:
        -Letters ([A-Za-z])
        -digits ([0-9]),
        -hyphens ("-"),underscores ("_"), colons (":"), and periods (".")
        -Plus symbol ('+')

    We replace '\', '/','#', and <space> by underscore.


    Process the voevent using the 'voevent_logic'

    i.e. the function defined in
    `fourpisky.scripts.process_voevent`.


Ingest the voevent into a local instance of voeventdb.


        Derive a feed-specific identifier for a given event.

        Args:
            event_data: Feed specific datastructure, typically just a dictionary.


        Derive a feed-specific identifier for a given event.

        Args:
            event_data: Feed specific datastructure, typically just a dictionary.

        NB feed id should contain timestamp prefix followed by underscore,
        we use this for deduplication.
        (Even if the event details are updated the timestamp should remain the
        same.)


    Restructure an array of cells into a list of dictionaries

    Since parsing to this stage is robust, we also perform bad-row excision here.


        Compute the hash of byte-range from pre-assigned content.

        (Used for testing.)


Dict mapping feed-specific event-id to relevant data.


Generate a feed-specific id from an event-datastructure


Use self.content to extract list of event-datastructures.


Default implementation simply removes non-allowed characters.


        Uses a local voeventdb to check for previously broadcast events.

        We assume that the currently configured stream_ivorn_prefix is the same
        as any previously broadcast voevents in the database. Therefore we
        can do an efficient lookup by calculating the relevant IVORN-prefix
        for each event in the `event_id_data_map` of this class.


Create swift feeds for recent BAT_GRB alerts


Convert a SWIFT-VOevent style boolean string ('true'/'false') to a bool.


Returns None if all ok, otherwise returns 'reason for rejection' string.


Send email using a Gmail SMTP login.


    Send an email using the Sendgrid API.

    Sendgrid has no storage equivalent of a 'sent' folder,
    so we always BCC a copy to the gmail login with the
    "+sent" alias suffix.


Defines the default delivery method


Trivial wrapper about main to create a command line interface entry-point.


    Checks feeds against their 'last-seen' hash, processes if changed.

    Identifies any 'new' events (not found in local db), generates VOEvents
    and sends them to the local broker.

    Args:
        hashdb_path: path to use for the 'last-seen' hash-database
        logfile: path to use for logfile.

    Returns:


     Trivial wrapper about main to create a command line interface entry-point.

     (This preserves main for use as a regular function for use elsewhere
     e.g. testing, and also provide a sensible location to initialise logging.)


Decorator that make functions not be called faster than


Used to return the 'job complete' log message in the master thread.


    K-corrections calculator in Python. See http://kcor.sai.msu.ru for the
    reference. Available filter-colour combinations must be present in the
    `coeff` dictionary keys.

    @type   filter_name: string
    @param  filter_name: Name of the filter to calculate K-correction for, e.g.
                         'u', 'g', 'r' for some of the SDSS filters, or 'J2',
                         'H2', 'Ks2' for 2MASS filters (must be present in
                         `coeff` dictionary)
    @type      redshift: float
    @param     redshift: Redshift of a galaxy, should be between 0.0 and 0.5 (no
                         check is made, however)
    @type   colour_name: string
    @param  colour_name: Human name of the colour, e.g. 'u - g', 'g - r',
                         'V - Rc', 'J2 - Ks2' (must be present in `coeff` dictionary)
    @type  colour_value: float
    @param colour_value: Value of the galaxy's colour, specified in colour_name
    @rtype:              float
    @return:             K-correction in specified filter for given redshift and
                         colour
    @author:             Chilingarian, I., Melchior. A.-L., and Zolotukhin, I.
    @license:            Simplified BSD license, see http://kcor.sai.msu.ru/license.txt

    Usage example:

        >>> calc_kcor('g', 0.2, 'g - r', 1.1)
        0.52097139759999922
        >>> calc_kcor('Ic', 0.4, 'V - Ic', 2.0)
        0.310069919999993
        >>> calc_kcor('H', 0.5, 'H - K', 0.1)
        -0.14983142499999502


Returns the MapID for the night-time lights trend map.


Returns details about the polygon with the passed-in ID.


Returns a series of brightness over time for the polygon.


Returns an ee.Feature for the polygon with the given ID.


Responds with the result of the handle_function or errors, if any.


Returns the map ID of an image for the requested year.

    HTTP Parameters:
      year: The year of the image, in "YYYY" format.

    Returns:
      A dictionary with two keys: mapid and token.


Kicks off export of an image for the specified year and region.

    HTTP Parameters:
      coordinates: The coordinates of the polygon to export.
      filename: The final filename of the file to create in the user's Drive.
      client_id: The ID of the client (for the Channel API).
      year: The year of the image, in "YYYY" format.


Exports an image for the year and region, gives it to the user.

    This is called by our trusted export handler and runs as a separate
    process.

    HTTP Parameters:
      email: The email address of the user who initiated this task.
      filename: The final filename of the file to create in the user's Drive.
      client_id: The ID of the client (for the Channel API).
      task: The pickled task to poll.
      temp_file_prefix: The prefix of the temp file in the service account's
          Drive.
      user_id: The ID of the user who initiated this task.


Returns the night-time lights image for a given year.

  Args:
    year: The year for which to retrieve an image.

  Returns:
    An ee.Image with lights for the given year.


Returns a likely-to-be unique string.


Sends a message to the client using the Channel API.

  Args:
    client_id: The ID of the client to message.
    filename: The name of the exported file the message is about.
    params: The params to send in the message (as a Dictionary).


Crops and formats the image for export.

  Args:
    image: The image to make exportable.
    coordinates: The coordinates to crop the image to.

  Returns:
    The export-ready image.


Moves the files with the prefix to the user's Drive folder.

  Copies and then deletes the source files from the app's Drive.

  Args:
    temp_file_prefix: The prefix of the temp files in the service account's
      Drive.
    email: The email address of the user to give the files to.
    user_id: The ID of the user to give the files to.
    filename: The name to give the files in the user's Drive.

  Returns:
    A link to the files in the user's Drive.


Grants the email address write access to the file with the given ID.

    Note: "writer" access is required to create a copy of a file.

    Args:
      file_id: The ID of the file to which to grant access.
      email: The email address to grant access.


Copies the file with the ID in the user's root folder with the title.

    Args:
      origin_file_id: The ID of the file to copy.
      copy_title: The title to give to the created file.

    Returns:
      The file ID of the copy.


Returns the Drive file ID of the first file found with the prefix.

    Args:
      prefix: The prefix of the title of the file to identify.

    Returns:
      A list of Drive file objects that match the prefix.


Deletes the file with the given ID.

    Args:
      file_id: The ID of the file to delete.


Gets the map id associated with an EE asset and its vis params.


Gets the Earth Engine dataset metadata from cloud storage.


Gets the corresponding Earth Engine asset for a given dataset/params.


Gets table visualization asset and visualization parameters.


Serves a WMTS tile from Earth Engine.


Compute hillshade for the given illumination az, el.


A function to compute Soil Adjusted Vegetation Index.


Imports API functions to this class.


Returns the area of the feature's default geometry.

    Area of points and line strings is 0, and the area of multi geometries is
    the sum of the areas of their components (intersecting areas are counted
    multiple times).

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in square meters.


Returns a feature containing the bounding box of the geometry.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in this projection. Otherwise it
        will be in EPSG:4326.


Returns the input buffered by a given distance.

    If the distance is positive, the geometry is expanded, and if the distance
    is negative, the geometry is contracted.

    Args:
      distance: The distance of the buffering, which may be negative. If no
        projection is specified, the unit is meters. Otherwise the unit is in
        the coordinate system of the projection.
      maxError: The maximum amount of error tolerated when approximating the
        buffering circle and performing any necessary reprojection. If
        unspecified, defaults to 1% of the distance.
      proj: If specified, the buffering will be performed in this projection and
        the distance will be interpreted as units of the coordinate system of
        this projection. Otherwise the distance is interpereted as meters and
        the buffering is performed in a spherical coordinate system.


Returns a point at the center.

    Returns a feature containing the point at the center of the
    highest-dimension components of the geometry of a feature. Lower-dimensional
    components are ignored, so the centroid of a geometry containing two
    polygons, three lines and a point is equivalent to the centroid of a
    geometry containing just the two polygons.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in this projection. Otherwise it
        will be in EPSG:4326.


Returns the point on the right input that is nearest to the left input.

    If either input is empty, null is returned. If both inputs are unbounded, an
    arbitrary point is returned. If one input is unbounded, an arbitrary point
    in the bounded input is returned.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns the points on the right input that are nearest to the left input.

    Returns a dictionary containing up to two entries representing a point on
    each input feature's geometry that is closest to the geometry of the other
    input. If either geometry is empty, an empty dictionary is returned. If both
    geometries are unbounded, the dictionary has an arbitrary point for both
    'left' and 'right'. If one geometry is unbounded, the dictionary has an
    arbitrary point contained in the bounded geometry for both 'left' and
    'right'.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if the geometry is contained in the geometry of another.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      A Boolean.


Returns true if the geometry contains the geometry of another.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      A Boolean.


Returns the convex hull of the original geometry.

    The convex hull of a single point is the point itself, the convex hull of
    collinear points is a line, and the convex hull of everything else is a
    polygon. Note that a degenerate polygon with all vertices on the same line
    will result in a line segment.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns a feature containing the cut lines.

    Converts LineString, MultiLineString, and LinearRing geometries into a
    MultiLineString by cutting them into parts no longer than the given distance
    along their length.

    All other geometry types will be converted to an empty MultiLineString.

    Args:
      distances: Distances along each LineString to cut the line into separate
        pieces, measured in units of the given proj, or meters if proj is
        unspecified.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: Projection of the result and distance measurements, or EPSG:4326 if
        unspecified.


Returns the geometry of the feature minus the 'right' geometry.

    Returns a feature with the properties of the 'left' feature, and the
    geometry that results from subtracting the 'right' geometry from the 'left'
    geometry.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation. The properties of this object are ignored.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if and only if the feature geometries are disjoint.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      A Boolean.


Returns a feature containing the union of the geometry of a feature.

    This leaves single geometries untouched, and unions multi geometries.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the union will be performed in this projection.
        Otherwise it will be performed in a spherical coordinate system.


Returns the minimum distance between the geometries of two features.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.
      spherical: If true, the calculation will be done on the unit sphere. If
        false, the calculation will be elliptical, taking earth flattening into
        account. Ignored if proj is specified. Default is false.


Returns the geometry of a given feature in a given projection.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the geometry will be in this projection. If
        unspecified, the geometry will be in its default projection.
      geodesics: If true, the geometry will have geodesic edges. If false, it
        will have edges as straight lines in the specified projection. If null,
        the edge interpretation will be the same as the original geometry. This
        argument is ignored if proj is not specified.


Returns a dictionary of Histogram Error Ring Statistic (HERS) arrays.

    Creates a dictionary of Histogram Error Ring Statistic (HERS) descriptor
    arrays from square array properties of an element. The HERS radius is taken
    to be the array's (side_length - 1) / 2.

    Args:
      selectors: The array properties for which descriptors will be created.
        Selected array properties must be square, floating point arrays.
        Defaults to all array properties.
      buckets: The number of HERS buckets. Defaults to 100.
      peakWidthScale: The HERS peak width scale. Defaults to 1.0.


Returns the ID of a given element within a collection.

    Objects outside collections are not guaranteed to have IDs.


Returns the intersection of the geometries with right.

    Returns a feature containing the intersection of the geometries of two
    features, with the properties of the left feature.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation. The properties of this object are ignored.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Feature.


Returns true if and only if the feature geometries intersect.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      A Boolean.


Returns the length of the linear parts of the geometry of a feature.

    Polygonal parts are ignored. The length of multi geometries is the sum of
    the lengths of their components.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in meters.


Returns the length of the perimeter of the polygonal parts of the geometry of a given feature.

    The perimeter of multi geometries is the sum of the perimeters of their
    components.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in meters.


Returns a feature with the selected properties.

    Selects properties from a feature by name or RE2-compatible regex and
    optionally renames them.

    Args:
      propertySelectors: A list of names or regexes specifying the properties to
        select.
      newProperties: Optional new names for the output properties. Must match
        the number of properties selected.
      retainGeometry: When false, the result will have a NULL geometry.


Returns a feature with geometry simplified to within an error margin.

    Note that this does not respect the error margin requested by the consumer
    of this algorithm, unless maxError is explicitly specified to be null.

    This overrides the default Earth Engine policy for propagating error
    margins, so regardless of the geometry accuracy requested from the output,
    the inputs will be requested with the error margin specified in the
    arguments to this algorithm. This results in consistent rendering at all
    zoom levels of a rendered vector map, but at lower zoom levels (i.e., zoomed
    out), the geometry won't be simplified, which may harm performance.

    Args:
      maxError: The maximum amount of error by which the result may differ from
        the input.
      proj: If specified, the result will be in this projection. Otherwise it
        will be in the same projection as the input. If the error margin is in
        projected units, the margin will be interpreted as units of this
        projection.


Returns a feature containing the symmetric difference with right.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation. The properties of this object are ignored.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns an array from the given properties of an object.

    The properties must all be numbers.

    Args:
      properties: The property selectors for each array element.


Transforms the geometry of a feature to a specific projection.

    Args:
      proj: The target projection. Defaults to EPSG:4326. If this has a
        geographic CRS, the edges of the geometry will be interpreted as
        geodesics. Otherwise they will be interpreted as straight lines in the
        projection.
      maxError: The maximum projection error.

    Returns:
      An ee.Feature.


Returns a feature containing the union of the geometries of two features.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation. The properties of this object are ignored.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if the geometries of right are within a specified distance.

    Args:
      right: The feature containing the geometry used as the right operand of
        the operation.
      distance: The distance threshold. If a projection is specified, the
        distance is in units of that projected coordinate system, otherwise it
        is in meters.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      A Boolean.


Combines two dictionaries.

    In the case of duplicate key names, the output will contain the value of the
    second dictionary unless overwrite is false. Null values in both
    dictionaries are ignored / removed.

    Args:
      second: The other dictionary to merge in.
      overwrite: If true, this keeps the value of the original dictionary.
        Defaults to true.

    Returns:
      An ee.Dictionary.


Returns true if the dictionary contains the given key.

    Args:
      key: A string to look for in the dictionary.

    Returns:
      An ee.Boolean.


Returns a dictionary from two parallel lists of keys and values.

    Args:
      keys: A list of keys.
      values: A list of values.


Map an algorithm over a dictionary.

    The algorithm is expected to take 2 arguments, a key from the existing
    dictionary and the value it corresponds to, and return a new value for the
    given key. If the algorithm returns null, the key is dropped.

    Args:
      baseAlgorithm: A function taking key, value and returning the new value.

    Returns:
      An ee.Dictionary with new values for each key.


Returns a dictionary with the specified keys removed.

    Args:
      selectors: A list of key names or regular expressions of key names to
        remove.
      ignoreMissing: Ignore selectors that don't match at least 1 key. Defaults
        to false.

    Returns:
      An ee.Dictionary.


Rename elements in a dictionary.

    Args:
      from: A list of keys to be renamed.
      to: A list of the new names for the keys listed in the 'from' parameter.
        Must have the same length as the 'from' list.
      overwrite: Allow overwriting existing properties with the same name.

    Returns:
      An ee.Dictionary.


Returns a dictionary with only the specified keys.

    Args:
      selectors: A list of keys or regular expressions to select.
      ignoreMissing: Ignore selectors that don't match at least 1 key.
        Defaults to false.

    Returns:
      An ee.Dictionary.


Returns numeric values of a dictionary as an array.

    If no keys are specified, all values are returned in the natural ordering of
    the dictionary's keys. The default 'axis' is 0.

    Args:
      keys: An optional list of keys to subselect.
      axis: How to interpret values that are ee.Arrays. Defaults to 0.

    Returns:
      An ee.Array.


Creates an image of constants from values in a dictionary.

    The bands of the image are ordered and named according to the names
    argument. If no names are specified, the bands are sorted
    alpha-numerically.

    Args:
      names: The order of the output bands.

    Returns:
      An ee.Image.


Returns the values of a dictionary as a list.

    If no keys are specified, all values are returned in the natural ordering of
    the dictionary's keys.

    Args:
      keys: An optional list of keys to subselect.

    Returns:
      An ee.Array.


Encodes the object in a format compatible with Serializer.

    Args:
      encoder: A function that can be called to encode the components of
          an object.

    Returns:
      The encoded form of the object.


Encodes the object as a ValueNode.

    Args:
      encoder: A function that can be called to encode the components of
          an object.

    Returns:
      The encoded form of the object.


Encodes the function in a format compatible with Serializer.

    Args:
      encoder: A function that can be called to encode the components of
          an object.

    Returns:
      The encoded form of the function.


Encodes the function as a FunctionInvocation.

    Args:
      encoder: A function that can be called to encode the components of
          an object. Returns a reference to the encoded value.

    Returns:
      The encoded form of the function.


Returns a Reducer that returns 1 if all inputs are not 0.

    Otherwise, it returns 0.

    Where applicable, the output name is "all".


Returns a Reducer that returns 1 if any of its inputs are not 0.

    Otherwise, it returns 0.

    Where applicable, the output name is "any".


Returns an ee.Reducer that computes a histogram of the inputs.

    The output is a Nx2 array of the lower bucket bounds and the counts (or
    cumulative counts) of each bucket and is suitable for use per-pixel.

    Args:
      maxBuckets: The maximum number of buckets to use when building a
        histogram; will be rounded up to a power of 2.
      minBucketWidth: The minimum histogram bucket width, or null to allow any
        power of 2.
      maxRaw: The number of values to accumulate before building the initial
        histogram.
      cumulative: When true, generates a cumulative histogram.


Returns a Reducer that computes the bitwise-and summation of its inputs.

    Where applicable, the output name is "bitwiseAnd".


Returns a Reducer that computes the bitwise-or summation of its inputs.

    Where applicable, the output name is "bitwiseOr".


Returns a centered covariance reducer.

    Creates a reducer that reduces some number of 1-D arrays of the same length
    N to a covariance matrix of shape NxN.

    WARNING: this reducer requires that the data has been mean centered.


Returns a circular standard deviation reducer.

    Returns a reducer that computes the (weighted) circular standard deviation
    of its inputs, which are expected to be in radians, using the formula
    sqrt(-2 * ln(R)).

    Where applicable, the output name is "circularStdDev".


Returns a circular variance Reducer.

    Returns a Reducer that computes the (weighted) circular variance of its
    inputs, which are expected to be in radians.

    Where applicable, the output name is "circularVariance".


Returns a Reducer that runs two reducers in parallel.

    The combined reducer's outputs will be those of reducer1 followed by those
    of reducer2, where the output names of reducer2 are prefixed with the given
    string.

    If sharedInputs is true, the reducers must have the same number of inputs,
    and the combined reducer's will match them; if it is false, the inputs of
    the combined reducer will be those of reducer1 followed by those of
    reducer2.

    Args:
      reducer2: The second reducer.
      outputPrefix: Prefix for reducer2's output names.
      sharedInputs: Whether the reducers share inputs.


Returns a Reducer that computes the number of non-null inputs.

    Where applicable, the output name is "count".


Returns a Reducer that computes the number of distinct inputs.

    Where applicable, the output name is "count".


Returns a Reducer that computes the number of distinct inputs, ignoring nulls.

    Where applicable, the output name is "count".


Returns a Reducer that computes the number of inputs.

    Where applicable, the output name is "count".


Returns a Reducer that computes the number of runs of distinct, non-null inputs.

    Where applicable, the output name is "count".


Returns a covariance reducer.

    Creates a reducer that reduces some number of 1-D arrays of the same length
    N to a covariance matrix of shape NxN.

    This reducer uses the one-pass covariance formula from Sandia National
    Laboratories Technical Report SAND2008-6212, which can lose accuracy if the
    values span a large range.


Returns a Reducer that separates aggregate inputs.

    Separates aggregate inputs (Arrays, Lists, or Dictionaries) into individual
    items that are then each passed to the specified reducer. When used on
    dictionaries, the dictionary keys are ignored. Non-aggregated inputs (e.g.,
    numbers or strings) are passed to the underlying reducer directly.

    Args:
      axis: If specified, indicates an array axis along which to disaggregate.
        If not specified, arrays are completely disaggregated. Ignored for
        non-array types.


Returns a Reducer that returns the first of its inputs.

    Where applicable, the output name is "first".


Returns a Reducer that returns the first of its non-null inputs.

    Where applicable, the output name is "first".


Returns a fixed 2D histogram reducer.

    Creates a reducer that will compute a 2D histogram of the inputs using a
    fixed number of fixed width bins. Values outside of the [min, max) range on
    either axis are ignored. The output is a 2D array of counts, and 2 1-D
    arrays of bucket lower edges for the xAxis and the yAxis. This reducer is
    suitable for use per-pixel, however it is always unweighted. The maximum
    count for any bucket is 2^31 - 1.

    Args:
      xMin: The lower (inclusive) bound of the first bucket on the X axis.
      xMax: The upper (exclusive) bound of the last bucket on the X axis.
      xSteps: The number of buckets to use on the X axis.
      yMin: The lower (inclusive) bound of the first bucket on the Y axis.
      yMax: The upper (exclusive) bound of the last bucket on the Y axis.
      ySteps: The number of buckets to use on the Y axis.


Returns a fixed histogram reducer.

    Creates a reducer that will compute a histogram of the inputs using a fixed
    number of fixed-width bins. Values outside of the [min, max) range are
    ignored. The output is a Nx2 array of bucket lower edges and counts (or
    cumulative counts) and is suitable for use per-pixel.

    Args:
      min: The lower (inclusive) bound of the first bucket.
      max: The upper (exclusive) bound of the last bucket.
      steps: The number of buckets to use.
      cumulative: When true, generates a cumulative histogram.


Returns a reducer that runs a reducer for each output name in the list.

    Creates a Reducer by combining a copy of the given reducer for each output
    name in the given list. If the reducer has a single output, the output names
    are used as-is; otherwise they are prefixed to the original output names.

    Args:
      outputNames: Which output names to use.


Returns a reducer that runs a reducer for each band in the image.

    Creates a Reducer by combining a copy of the given reducer for each band in
    the given image, using the band names as output names.

    Args:
      image: The image to use.


Returns a reducer that runs a reducer for each element in the input.

    Separately reduces each position in array inputs of equal shape, producing
    an array output of the same shape.

    For example, with the 'sum' reducer applied to 5 arrays with shape 2x2, the
    output will be a 2x2 array, where each position is the sum of the 5 values
    at that position.


Returns a Reducer that returns a weighted frequency table of its inputs.

    Where applicable, the output name is "histogram".


Returns a reducer that computes the geometric median across the inputs.

    Args:
      numX: The number of input dimensions.
      eta: The minimum improvement in the solution used as a stopping criteria
        for the solver.
      initialStepSize: The initial step size used in the solver.


Returns a reducer groups reducer records by the value of a given input.

    Reduces each group with the given reducer.

    Args:
      groupField: The field that contains record groups.
      groupName: The dictionary key that contains the group. Defaults to
        'group'.