    Lightcurve following the Sapir & Waxman (and Rabinak & Waxman) model

    :param time: time in observer frame in days
    :param redshift: redshift
    :param v_shock: shock speed in km/s
    :param m_env: envelope mass in solar masses
    :param f_rho_m: f_rho * M (with M in solar masses). f_rho is typically, of order unity
    :param radius: star/envelope radius in units of 10^13 cm
    :param kappa: opacity in cm^2/g
    :param kwargs: Additional parameters required by model
    :param time_temp: Optional argument to set your desired time array (in source frame days) to evaluate the model on.
    :param n: index of progenitor density profile, 1.5 (default) or 3.0
    :param RW: If True, use the simplified Rabinak & Waxman formulation (off by default)
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    Dense CSM shock breakout and cooling model From Margalit 2022

    :param time: time in days
    :param csm_mass: mass of CSM shell in g
    :param v_min: minimum velocity in km/s
    :param beta: velocity ratio in c (beta < 1)
    :param kappa: opacity in cm^2/g
    :param shell_radius: radius of shell in 10^14 cm
    :param shell_width_ratio: shell width ratio (deltaR/R0)
    :return: namedtuple with lbol, r_photosphere, and temperature


    Dense CSM shock breakout and cooling model From Margalit 2022

    :param time: time in days in source frame
    :param csm_mass: mass of CSM shell in solar masses
    :param v_min: minimum velocity in km/s
    :param beta: velocity ratio in c (beta < 1)
    :param kappa: opacity in cm^2/g
    :param shell_radius: radius of shell in 10^14 cm
    :param shell_width_ratio: shell width ratio (deltaR/R0)
    :param kwargs: Additional parameters required by model
    :return: bolometric luminosity


    Dense CSM shock breakout and cooling model From Margalit 2022

    :param time: time in days in observer frame
    :param redshift: redshift
    :param csm_mass: mass of CSM shell in solar masses
    :param v_min: minimum velocity in km/s
    :param beta: velocity ratio in c (beta < 1)
    :param kappa: opacity in cm^2/g
    :param shell_radius: radius of shell in 10^14 cm
    :param shell_width_ratio: shell width ratio (deltaR/R0)
    :param kwargs: Additional parameters required by model
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    :param time: time in source frame in seconds
    :param mass: mass of extended material in solar masses
    :param radius: radius of extended material in cm
    :param energy: energy of extended material in ergs
    :param kwargs: extra parameters to change physics
    :param nn: density power law slope
    :param delta: inner density power law slope
    :return: namedtuple with lbol, r_photosphere, and temperature


    Shocked cocoon model from Nicholl et al. 2021

    :param time: time in source frame in days
    :param kappa: opacity
    :param mejecta: ejecta in solar masses
    :param vejecta: ejecta velocity in units of c (speed of light)
    :param cos_theta_cocoon: cosine of the cocoon opening angle
    :param shocked_fraction: fraction of the ejecta that is shocked
    :param nn: ejecta power law density profile
    :param tshock: time of shock in source frame in seconds
    :return: luminosity


    :param time: time in source frame in seconds
    :param log10_mass: log10 mass of extended material in solar masses
    :param log10_radius: log10 radius of extended material in cm
    :param log10_energy: log10 energy of extended material in ergs
    :param kwargs: extra parameters to change physics
    :param nn: density power law slope
    :param delta: inner density power law slope
    :return: bolometric_luminosity


    :param time: time in observer frame in days
    :param redshift: redshift
    :param log10_mass: log10 mass of extended material in solar masses
    :param log10_radius: log10 radius of extended material in cm
    :param log10_energy: log10 energy of extended material in ergs
    :param kwargs: extra parameters to change physics and other settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param nn: density power law slope
    :param delta: inner density power law slope
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    :param p: electron power law slope
    :return: prefactor for emissivity


    :param p: electron power law slope
    :return: prefactor for absorption coefficient


    :param theta: dimensionless electron temperature
    :param p: electron power law slope
    :return: correction term for power law electron distribution


    :param x: dimensionless frequency
    :param theta: dimensionless electron temperature
    :param p: electron power law slope
    :return: low-frequency correction to power-law emissivity


    :param x: dimensionless frequency
    :param theta: dimensionless electron temperature
    :param p: electron power law slope
    :return: low-frequency correction to power-law absorption coefficient


    :param x: dimensionless frequency
    :param nism: electron number density in emitting region (cm^-3)
    :param bfield: magnetic field strength in Gauss
    :param theta: dimensionless electron temperature
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param z_cool: normalised cooling lorentz factor
    :return: synchrotron emissivity of power-law electrons


    :param x: dimensionless frequency
    :param nism: electron number density in emitting region (cm^-3)
    :param bfield: magnetic field strength in Gauss
    :param theta: dimensionless electron temperature
    :param z_cool: normalised cooling lorentz factor
    :return: synchrotron emissivity of thermal electrons


    :param x: dimensionless frequency
    :param nism: electron number density in emitting region (cm^-3)
    :param bfield: magnetic field strength in Gauss
    :param theta: dimensionless electron temperature
    :param z_cool: normalised cooling lorentz factor
    :return: Synchrotron absorption coeff of thermal electrons


    :param x: dimensionless frequency
    :param nism: electron number density in emitting region (cm^-3)
    :param bfield: magnetic field strength in Gauss
    :param theta: dimensionless electron temperature
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param z_cool: normalised cooling lorentz factor
    :return: Synchrotron absorption coeff of power-law electrons


    :param x: dimensionless frequency
    :param nism: electron number density in emitting region (cm^-3)
    :param radius: characteristic size of the emitting region (in cm)
    :param bfield: magnetic field strength in Gauss
    :param theta: dimensionless electron temperature
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param z_cool: normalised cooling lorentz factor
    :return: Total (thermal+non-thermal) synchrotron optical depth


    :param time: source frame time in days
    :param mej: ejecta mass in solar masses
    :param vej: ejecta velocity in c
    :param eta: slope for ejecta density profile
    :param tshock: shock time in seconds
    :param shocked_fraction: fraction of ejecta mass shocked
    :param cos_theta_cocoon: cocoon opening angle
    :param kappa: opacity
    :return: namedtuple with lbol, r_photosphere, and temperature


    :param time: source frame time in days
    :param mej: ejecta mass in solar masses
    :param vej: ejecta mass in km/s
    :param eta: slope for ejecta density profile
    :param tshock: shock time in seconds
    :param shocked_fraction: fraction of ejecta mass shocked
    :param cos_theta_cocoon: cocoon opening angle
    :param kappa: opacity
    :param kwargs: None
    :return: bolometric_luminosity


    :param time: observer frame time in days
    :param redshift: redshift
    :param mej: ejecta mass in solar masses
    :param vej: ejecta velocity in c
    :param eta: slope for ejecta density profile
    :param tshock: shock time in seconds
    :param shocked_fraction: fraction of ejecta mass shocked
    :param cos_theta_cocoon: cocoon opening angle
    :param kappa: opacity
    :param kwargs: Extra parameters used by function
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    Multi-zone version of Margalit 2022 model for CSM shock breakout and cooling one zone model is implemented as
    csm_shock_breakout

    :return:


    Calculate flux for multiple sets of parameters using the Bazin function,
    where parameters are indexed by the provided labels.

    :param time: time array in arbitrary units
    :param t0: start time
    :param tau_rise: exponential rise time
    :param tau_fall: exponential fall time
    :param labels: list of strings to generate parameter names
    :param kwargs: keyword arguments for parameters in the form a_{label}, b_{label}, etc.
    :return: dictionary with labels as keys and flux arrays as values


    :param frequency: frequency to calculate
    :param Y_fe: free electron fraction
    :param Zbar: average proton number
    :param mej: ejecta mass in solar units
    :param radius_2darray: radius of the ejecta at each time
    :param F_nu_2darray: unabsorbed flux density
    :return: absorbed flux density


    :param frequency: frequency to calculate
    :param Y_e: electron fraction
    :param mej: ejecta mass in solar units
    :param radius_2darray: radius of the ejecta at each time
    :param F_nu_2darray: unabsorbed flux density
    :return: absorbed flux density


    :param frequency: frequency to calculate
    :param Zbar: average proton number
    :param mej: ejecta mass in solar units
    :param radius_2darray: radius of the ejecta at each time
    :param F_nu_2darray: unabsorbed flux density
    :return: absorbed flux density


    :param frequency: frequency to calculate
    :param kappa: thermalization opacity
    :param mej: ejecta mass in solar units
    :param radius_2darray: radius of the ejecta at each time
    :param F_nu_2darray: unabsorbed flux density
    :return: absorbed flux density


    :param time: time in observer frame in days
    :param redshift: redshift
    :param mej: ejecta mass in solar units
    :param l0: initial magnetar spin-down luminosity (in erg/s)
    :param tau_sd: magnetar spin down damping timescale (in seconds)
    :param nn: braking index
    :param eps_b: magnetization of the PWN
    :param gamma_b: Lorentz factor of electrons at synchrotron break
    :param kwargs: Additional parameters -
    :param E_k: initial ejecta kinetic energy
    :param kappa: opacity (used only in dynamics and optical absorption)
    :param kappa_gamma: gamma-ray opacity used to calculate magnetar thermalisation efficiency (used only in dynamics)
    :param q1: low energy spectral index (must be < 2)
    :param q2: high energy spectral index (must be > 2)
    :param Zbar: average proton number (used for free-free and photoelectric absorption)
    :param Y_e: electron fraction (used for Compton scattering)
    :param Y_fe: free electron fraction (used for free-free absorption)
    :param pair_cascade_switch: whether to account for pair cascade losses, default is False
    :param ejecta albedo: ejecta albedo; default is 0.5
    :param pair_cascade_fraction: fraction of magnetar luminosity lost to pair cascades; default is 0.05
    :param use_r_process: determine whether the ejecta is composed of r-process material; default is no
    :param frequency: (frequency to calculate - Must be same length as time array or a single number)
    :param f_nickel: Ni^56 mass as a fraction of ejecta mass
    :return: flux density or AB magnitude or dynamics output


    Calculate the afterglow emission from a kilonova remnant, following the model of Sarin et al. 2022.
    This model was modified by Nikhil Sarin following code provided by Ben Margalit.

    :param time: time in observer frame (days) in observer frame
    :param redshift: source redshift
    :param loge0: log10 of the initial kinetic energy of the ejecta (erg)
    :param mej: ejecta mass (solar masses)
    :param logn0: log10 of the circumburst density (cm^-3)
    :param logepse: log10 of the fraction of shock energy given to electrons
    :param logepsb: log10 of the fraction of shock energy given to magnetic field
    :param p: power-law index of the electron energy distribution
    :param kwargs: Additional keyword arguments
    :param zeta_e: fraction of electrons participating in diffusive shock acceleration. Default is 1.
    :param output_format: Whether to output flux density or AB mag
    :param frequency: frequency in Hz for the flux density calculation
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density or AB mag. Note this is going to give the monochromatic magnitude at the effective frequency for the band.
        For a proper calculation of the magntitude use the sed variant models.


    A kilonova afterglow model based on Nakar & Piran 2011

    :param time: time in days in the observer frame
    :param redshift: source redshift
    :param loge0: initial kinetic energy in erg of ejecta
    :param mej: mass of ejecta in solar masses
    :param logn0: log10 of the number density of the circumburst medium in cm^-3
    :param logepse: log10 of the fraction of energy given to electrons
    :param logepsb: log10 of the fraction of energy given to the magnetic field
    :param p: electron power law index
    :param kwargs: Additional keyword arguments
    :param output_format: Whether to output flux density or AB mag
    :param frequency: frequency in Hz for the flux density calculation
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density or AB mag. Note this is going to give the monochromatic magnitude at the effective frequency for the band.
        For a proper calculation of the magntitude use the sed variant models.
    :return:


    :param time: time in source frame in seconds
    :param logn0: log10 initial ambient ism density
    :param v0: initial velocity in c
    :param logr0: log10 initial radius
    :param eta: deceleration slope (r = r0 * (time/t0)**eta; v = v0*(time/t0)**(eta-1))
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param wind_slope: slope for ism density scaling (nism = n0 * (r/r0)**(-wind_slope)). Default is 2
    :param mu: mean molecular weight, default is 0.62
    :param mu_e: mean molecular weight per electron, default is 1.18
    :return: lnu


    :param time: time in observer frame in days
    :param redshift: redshift
    :param logn0: log10 initial ambient ism density
    :param v0: initial velocity in c
    :param logr0: log10 initial radius
    :param eta: deceleration slope (r = r0 * (time/t0)**eta; v = v0*(time/t0)**(eta-1))
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param wind_slope: slope for ism density scaling (nism = n0 * (r/r0)**(-wind_slope)). Default is 2
    :param mu: mean molecular weight, default is 0.62
    :param mu_e: mean molecular weight per electron, default is 1.18
    :param kwargs: extra parameters to change physics and other settings
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density in mJy


    :param time: time in observer frame in days
    :param redshift: redshift
    :param Mej: mass of the emitting region (solar masses)
    :param vej: initial velocity of the outflow (km/s)
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param geometry: geometry of the outflow.  Either "sphere" or "cone" is supported.
    :param output_format: Whether to output light curves or physical parameters.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density


    :param time: time in observer frame in days
    :param redshift: redshift
    :param v_s: velocity of the shock (km/s)
    :param log Mdot_vwind: log10 of the mass loss rate over wind velocity ((solar mass / year)/(km / s))
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density


    :param time: time in observer frame in days
    :param redshift: redshift
    :param v_s: velocity of the shock (km/s)
    :param logn0: log10 of the circumburst density (cm^-3)
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density


    :param time: time in observer frame in days
    :param redshift: redshift
    :param v_s: velocity of the shock (km/s)
    :param logA: log10 of the circumstellar material density at R=1e15 cm (cm^-3)
    :param s: power law index of the circumstellar material density profile
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density


    :param time: time in source frame in days
    :param bG_sh: Proper-velocity of the shock (bG_sh = Gamma_sh*beta_sh)
    :param log Mdot_vwind: log10 of the mass loss rate over wind velocity ((solar mass / year)/(km / s))
    :param n_ism: the circumburst density of the ISM (cm^-3)
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param mu: mean molecular weight, default is 0.62
    :param mu_e: mean molecular weight per electron, default is 1.18
    :param ell_dec: Deceleration parameter defined in eq. (1) of MQ24, default is 1.0
    :param f: Volume-filling factor defined in eq. (3) of MQ24, default is 3.0/16.0
    :return: lnu


    :param time: time in source frame in days
    :param redshift: redshift
    :param bG_sh: Proper-velocity of the shock (bG_sh = Gamma_sh*beta_sh)
    :param log Mdot_vwind: log10 of the mass loss rate over wind velocity ((solar mass / year)/(km / s))
    :param n_ism: the circumburst density of the ISM (cm^-3)
    :param logepse: log10 epsilon_e; electron thermalisation efficiency
    :param logepsb: log10 epsilon_b; magnetic field amplification efficiency
    :param xi: fraction of energy carried by power law electrons
    :param p: electron power law slope
    :param kwargs: extra parameters to change physics/settings
    :param frequency: frequency to calculate model on - Must be same length as time array or a single number)
    :param mu: mean molecular weight, default is 0.62
    :param mu_e: mean molecular weight per electron, default is 1.18
    :param ell_dec: Deceleration parameter defined in eq. (1) of MQ24, default is 1.0
    :param f: Volume-filling factor defined in eq. (3) of MQ24, default is 3.0/16.0
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: flux density in mJy


    Compute a smooth light-curve model (in magnitudes) with an exponential rise
    transitioning into a power-law decline, with a smooth (blended) peak.
    In all filters the shape is determined by the same t0, tau_rise, alpha, and t_peak;
    only m_peak differs from filter to filter.

    For t < t0, the function returns np.nan.
    For t >= t0, the model is constructed as a blend of:

      Rising phase:
          m_rise(t)  = m_peak + 1.086 * ((t_peak - t) / tau_rise)
      Declining phase:
          m_decline(t) = m_peak + 2.5 * alpha * log10((t - t0)/(t_peak - t0))

    A smooth transition is achieved by the switching (weight) function:

          weight(t) = 0.5 * [1 + tanh((t - t_peak)/delta)]

    so that the final magnitude is:

          m(t) = (1 - weight(t)) * m_rise(t) + weight(t) * m_decline(t)

    At t = t_peak, weight = 0.5 and both m_rise and m_decline equal m_peak,
    ensuring a smooth peak.

    Parameters
    ----------
    t : array_like
        1D array of times (e.g., in modified Julian days) at which to evaluate the model.
    t0 : float
        Start time of the transient event (e.g., explosion), in MJD.
    m_peak : float or array_like
        Peak magnitude(s) at t = t_peak. If an array is provided, each element is taken
        to correspond to a different filter.
    tau_rise : float
        Characteristic timescale (in days) for the exponential rise.
    alpha : float
        Power-law decay index governing the decline.
    t_peak : float
        Time (in MJD) at peak brightness (must satisfy t_peak > t0).
    delta : float, optional
        Smoothing parameter (in days) controlling the width of the transition around t_peak.
        If not provided, defaults to 50% of (t_peak - t0).

    Returns
    -------
    m_model : ndarray
        If m_peak is an array (multiple filters), returns a 2D array of shape (n_times, n_filters);
        if m_peak is a scalar, returns a 1D array (with NaN for t < t0).

    Examples
    --------
    Single filter:

    >>> t = np.linspace(58990, 59050, 300)
    >>> model1 = exp_rise_powerlaw_decline(t, t0=59000, m_peak=17.0, tau_rise=3.0,
    ...                                     alpha=1.5, t_peak=59010)

    Multiple filters (e.g., g, r, i bands):

    >>> t = np.linspace(58990, 59050, 300)
    >>> m_peaks = np.array([17.0, 17.5, 18.0])
    >>> model_multi = exp_rise_powerlaw_decline(t, t0=59000, m_peak=m_peaks, tau_rise=3.0,
    ...                                          alpha=1.5, t_peak=59010)
    >>> print(model_multi.shape)  # Expected shape: (300, 3)


    Bazin function for CCSN light curves with vectorized inputs.

    :param time: time array in arbitrary units
    :param aa: array (or float) of normalisations, if array this is unique to each 'band'
    :param bb: array (or float) of additive constants, if array this is unique to each 'band'
    :param t0: start time
    :param tau_rise: exponential rise time
    :param tau_fall: exponential fall time
    :return: matrix of flux values in units set by AA


    Villar function for SN light curves

    :param time: time array in arbitrary units
    :param aa: normalisation on the Villar function, amplotude
    :param cc: additive constant, baseline flux
    :param t0: "start" time
    :param tau_rise: exponential rise time
    :param tau_fall: exponential fall time
    :param gamma: plateau duration
    :param nu: related to beta and between 0 an 1; nu = -beta/gamma / A
    :param kwargs:
    :return: flux in units set by AA


    Calculate evolving temperature and radius with piecewise power-law evolution

    :param time: time array in days
    :param temperature_0: initial temperature at t=1 day
    :param radius_0: initial radius at t=1 day
    :param temp_rise_index: temperature rise index
    :param temp_decline_index: temperature decline index
    :param temp_peak_time: time when temperature peaks
    :param radius_rise_index: radius rise index
    :param radius_decline_index: radius decline index
    :param radius_peak_time: time when radius peaks
    :return: temperature and radius values (scalars if time is scalar)


    :param time: time in seconds
    :param logl1: luminosity scale in log 10 ergs
    :param tr: transition time for flat luminosity to power-law decay
    :return: lbol


    A gaussian to add or subtract from a continuum spectrum to mimic absorption or emission lines

    :param wavelength: wavelength array in whatever units
    :param line_amp: line amplitude scale
    :param cont_amp: Continuum amplitude scale
    :param x0: Position of emission line
    :return: spectrum in whatever units set by line_amp


    A Gaussian line profile with velocity dispersion

    :param angstroms: wavelength array in angstroms or arbitrary units
    :param wavelength_center: center of the line in angstroms
    :param line_strength: line amplitude scale
    :param velocity_dispersion: velocity in m/s
    :return: spectrum in whatever units set by line_strength


    :param time: time array in whatver time units
    :param a_1: gaussian rise amplitude scale
    :param peak_time: peak time in whatever units
    :param sigma_t: the sharpness of the Gaussian
    :return: In whatever units set by a_1


    :param time: time array in seconds
    :param a_1: exponential amplitude scale
    :param alpha_1: first exponent
    :param alpha_2: second exponent
    :param tpeak: peak time in seconds
    :param kwargs:
    :return: In whatever units set by a_1


    Two component powerlaw model

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of first power law
    :param alpha_2: power law decay exponent for the second power law
    :return: In whatever units set by a_1


    Three component powerlaw model

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of first power law
    :param alpha_2: power law decay exponent for the second power law
    :param delta_time_two: time between first and second power laws
    :param alpha_3: power law decay exponent for third power law
    :return: In whatever units set by a_1


    Four component powerlaw model

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of first power law
    :param alpha_2: power law decay exponent for the second power law
    :param delta_time_two: time between first and second power laws
    :param alpha_3: power law decay exponent for third power law
    :param delta_time_three: time between second and third power laws
    :param alpha_4: power law decay exponent for fourth power law
    :return: In whatever units set by a_1


    Five component powerlaw model

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of first power law
    :param alpha_2: power law decay exponent for the second power law
    :param delta_time_two: time between first and second power laws
    :param alpha_3: power law decay exponent for third power law
    :param delta_time_three: time between second and third power laws
    :param alpha_4: power law decay exponent for fourth power law
    :param delta_time_four: time between third and fourth power laws
    :param alpha_5: power law decay exponent for fifth power law
    :return: In whatever units set by a_1


    six component powerlaw model

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of first power law
    :param alpha_2: power law decay exponent for the second power law
    :param delta_time_two: time between first and second power laws
    :param alpha_3: power law decay exponent for third power law
    :param delta_time_three: time between second and third power laws
    :param alpha_4: power law decay exponent for fourth power law
    :param delta_time_four: time between third and fourth power laws
    :param alpha_5: power law decay exponent for fifth power law
    :param delta_time_five: time between fourth and fifth power laws
    :param alpha_6: power law decay exponent for sixth power law
    :return: In whatever units set by a_1


    Millisecond magnetar model with evolution of inclination angle

    :param time: time in seconds
    :param mu0: Initial magnetic moment [10^33 G cm^3]
    :param muinf: Magnetic moment when field relaxes [10^33 G cm^3]
    :param p0: initial spin period
    :param sinalpha0: initial sin(alpha0) where alpha is the angle between B and P axes.
    :param tm: magnetic field decay timescale in days
    :param II: Moment of inertia in cgs
    :param kwargs: key word argument for handling plotting
    :return: luminosity (depending on scaling) as a function of time.


    Millisecond magnetar model with evolution of inclination angle

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param mu0: Initial magnetic moment [10^33 G cm^3]
    :param muinf: Magnetic moment when field relaxes [10^33 G cm^3]
    :param p0: initial spin period
    :param sinalpha0: initial sin(alpha0) where alpha is the angle between B and P axes.
    :param tm: magnetic field decay timescale in days
    :param II: Moment of inertia in cgs
    :param kwargs: key word argument for handling plotting
    :return: luminosity (depending on scaling) as a function of time.


    :param time: time in seconds
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity or flux (depending on scaling of l0) as a function of time.


    Generalised millisecond magnetar with curvature effect power law

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity or flux (depending on scaling of l0) as a function of time.


    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param fgw0: initial gravitational-wave frequency
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param log_ii: log10 moment of inertia
    :param eta: fixed to 0.1, its a fudge factor for the efficiency
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    :param time: time in seconds in source frame
    :param p0: initial spin period in milliseconds
    :param bp: polar magnetic field strength in 10^14 Gauss
    :param mass_ns: mass of neutron star in solar masses
    :param theta_pb: angle between spin and magnetic field axes in radians
    :param kwargs: None
    :return: luminosity


    Assumes a combination of GW and EM spin down with a constant spin-magnetic field inclination angle.
    Only EM contributes to observed emission.

    :param time: time in source frame in seconds (must be a large array as this function is semianalytic)
    :param bint: internal magnetic field in G
    :param bext: external magnetic field in G
    :param p0: spin period in s
    :param chi0: initial inclination angle
    :param radius: radius of NS in cm
    :param moi: moment of inertia of NS
    :param kwargs: None
    :return: luminosity


    Assumes a combination of GW and EM spin down with a constant spin-magnetic field inclination angle.
    Only EM contributes to observed emission.

    :param time: time in source frame in seconds
    :param logbint: log10 internal magnetic field in G
    :param logbext: log10 external magnetic field in G
    :param p0: spin period in s
    :param chi0: initial inclination angle
    :param radius: radius of NS in KM
    :param logmoi: log10 moment of inertia of NS
    :param kwargs: None
    :return: luminosity


    Generalised millisecond magnetar with curvature effect power law and a collapse time

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param tcol: collapse time in seconds
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity or flux (depending on scaling of l0) as a function of time.


    Reparameterized millisecond magnetar model (piecewise)

    :param time: time array for power law
    :param a_1: power law decay amplitude
    :param alpha_1: power law decay exponent
    :param delta_time_one: time between start and end of prompt emission
    :param alpha_2: Reparameterized braking index n
    :param delta_time_two: time between end of prompt emission and end of magnetar model plateau phase, (tau)
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity or flux (depending on scaling of l0) as a function of time.


    General integral for radiative losses model

    :param time: time in seconds
    :param t0: time for radiative losses to start in seconds
    :param kappa: radiative efficiency
    :param tau: spin down damping timescale in seconds
    :param nn: braking index
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    General integral for radiative losses model

    :param time: time in seconds
    :param t0: time for radiative losses to start in seconds
    :param kappa: radiative efficiency
    :param tau: spin down damping timescale in seconds
    :param nn: braking index
    :param tcol: collapse time in seconds
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    Get integral terms for radiative losses model

    :param time: time in seconds
    :param t0: time for radiative losses to start in seconds
    :param kappa: radiative efficiency
    :param tau: spin down damping timescale in seconds
    :param nn: braking index
    :return: first and second terms


    Calculate integral for vacuum dipole radiation

    :param time: time in seconds
    :param t0: time for radiative losses to start in seconds
    :param kappa: radiative efficiency
    :param a: 1/tau (spin down damping timescale)
    :return: integral


    Assumes smoothness and continuity between the prompt and magnetar term by fixing e0 variable

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    radiative losses model with a step function, indicating the magnetar term turns on at T0

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param log_e0: log10 E0 to connect curvature effect energy with transition point energy, captures flares
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    radiative losses model only

    :param time: time in seconds
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param log_e0: log10 E0 to connect curvature effect energy smoothly with transition point energy
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity

    :return:


    radiative losses model with a step function, indicating the magnetar term turns on at T0

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param log_e0: log10 E0 to connect curvature effect energy smoothly with transition point energy
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    radiative losses model for vacuum dipole radiation

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param log_e0: log10 E0 to connect curvature effect energy smoothly with transition point energy
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    radiative losses model with collapse time

    :param time: time in seconds
    :param A_1: amplitude of curvature effect power law
    :param alpha_1: index of curvature effect power law
    :param l0: initial luminosity parameter
    :param tau: spin-down damping timescale
    :param nn: braking index
    :param tcol: collapse time in seconds
    :param kappa: radiative efficiency
    :param t0_s: time for radiative losses to start in seconds
    :param log_e0: log10 E0 to connect curvature effect energy smoothly with transition point energy
    :param kwargs: key word arguments for handling plotting/other functionality
    :return: luminosity


    Luminosity models that you want to fit to flux data by placing a prior on the redshift.

    :param time: time in observers frame
    :param photon_index: photon index
    :param kwargs: all parameters for the model of choice.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: luminosity/1e50 erg


    :param angstrom: wavelength array in angstroms
    :param temperature: temperature in Kelvin
    :param r_photosphere: photosphere radius in cm
    :param distance: distance in cm
    :return: flux in ergs/s/cm^2/angstrom


    :param angstrom: wavelength array in angstroms
    :param alpha: power law index
    :param aa: normalization
    :return: flux in ergs/s/cm^2/angstrom


    A power law spectrum with one absorption line and one emission line.
    One can add more lines if needed. Or turn the line strength to zero to remove the line.

    :param angstroms: wavelength array in angstroms
    :param alpha: power law index
    :param aa: normalization
    :param lc1: center of emission line
    :param ls1: strength of emission line
    :param v1: velocity of emission line
    :param lc2: center of absorption line
    :param ls2: strength of absorption line
    :param v2: velocity of absorption line
    :return: flux in ergs/s/cm^2/angstrom


    A blackbody spectrum with one absorption line and one emission line.
    One can add more lines if needed. Or turn the line strength to zero to remove the line.

    :param angstroms: wavelength array in angstroms
    :param redshift: redshift
    :param rph: photosphere radius in cm
    :param temp: photosphere temperature in Kelvin
    :param lc1: center of emission line
    :param ls1: strength of emission line
    :param v1: velocity of emission line
    :param lc2: center of absorption line
    :param ls2: strength of absorption line
    :param v2: velocity of absorption line
    :return: flux in ergs/s/cm^2/angstrom


    A blackbody spectrum at a given redshift, properly accounting for redshift effects.

    :param angstroms: wavelength array in angstroms in obs frame
    :param redshift: redshift
    :param rph: photosphere radius in cm (rest frame)
    :param temp: photosphere temperature in Kelvin (rest frame)
    :return: flux in ergs/s/cm^2/angstrom in obs frame


    :param time: time in days
    :param l0: bolometric luminosity at 1 second in cgs
    :param t_0: turn on time in days (after this time lbol decays as 5/3 powerlaw)
    :return: bolometric luminosity


    :param mbh_6: mass of supermassive black hole in units of 10^6 solar mass
    :param stellar_mass: stellar mass in units of solar masses
    :param eta: SMBH feedback efficiency (typical range: etamin - 0.1)
    :param alpha: disk viscosity
    :param beta: TDE penetration factor (typical range: 1 - beta_max)
    :param kwargs:
    :return: named tuple with bolometric luminosity, photosphere radius, temperature, and other parameters


    This model is only valid for time after circulation. Use the gaussianrise_metzgertde model for the full lightcurve

    :param time: time in observer frame in days
    :param redshift: redshift
    :param mbh_6: mass of supermassive black hole in units of 10^6 solar mass
    :param stellar_mass: stellar mass in units of solar masses
    :param eta: SMBH feedback efficiency (typical range: etamin - 0.1)
    :param alpha: disk viscosity
    :param beta: TDE penetration factor (typical range: 1 - beta_max)
    :param kwargs: Additional parameters
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    Full lightcurve, with gaussian rise till fallback time and then the metzger tde model,
    bolometric version for fitting the bolometric lightcurve

    :param time: time in source frame in days
    :param peak_time: peak time in days
    :param sigma_t: the sharpness of the Gaussian in days
    :param mbh_6: mass of supermassive black hole in units of 10^6 solar mass
    :param stellar_mass: stellar mass in units of solar masses
    :param eta: SMBH feedback efficiency (typical range: etamin - 0.1)
    :param alpha: disk viscosity
    :param beta: TDE penetration factor (typical range: 1 - beta_max)
    :param kwargs: Additional parameters
    :return luminosity in ergs/s


    Full lightcurve, with gaussian rise till fallback time and then the metzger tde model,
    photometric version where each band is fit/joint separately

    :param time: time in observer frame in days
    :param redshift: redshift
    :param peak_time: peak time in days
    :param sigma_t: the sharpness of the Gaussian in days
    :param mbh_6: mass of supermassive black hole in units of 10^6 solar mass
    :param stellar_mass: stellar mass in units of solar masses
    :param eta: SMBH feedback efficiency (typical range: etamin - 0.1)
    :param alpha: disk viscosity
    :param beta: TDE penetration factor (typical range: 1 - beta_max)
    :param kwargs: Additional parameters
    :param xi: Optional argument (default set to one) to change the point where lightcurve switches from Gaussian rise to cooling envelope.
        stitching_point = xi * tfb (where tfb is fallback time). So a xi=1 means the stitching point is at fallback time.
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'flux'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'flux'


    Full lightcurve, with gaussian rise till fallback time and then the metzger tde model,
    photometric version where each band is fit/joint separately

    :param time: time in observer frame in days
    :param redshift: redshift
    :param peak_time: peak time in days
    :param alpha_1: power law index for first power law
    :param alpha_2: power law index for second power law (should be positive)
    :param mbh_6: mass of supermassive black hole in units of 10^6 solar mass
    :param stellar_mass: stellar mass in units of solar masses
    :param eta: SMBH feedback efficiency (typical range: etamin - 0.1)
    :param alpha: disk viscosity
    :param beta: TDE penetration factor (typical range: 1 - beta_max)
    :param kwargs: Additional parameters
    :param xi: Optional argument (default set to one) to change the point where lightcurve switches from Gaussian rise to cooling envelope.
        stitching_point = xi * tfb (where tfb is fallback time). So a xi=1 means the stitching point is at fallback time.
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'flux'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'flux'


    :param time: rest frame time in days
    :param l0: bolometric luminosity at 1 second in cgs
    :param t_0_turn: turn on time in days (after this time lbol decays as 5/3 powerlaw)
    :param interaction_process: Default is Diffusion.
            Can also be None in which case the output is just the raw engine luminosity
    :param kwargs: Must be all the kwargs required by the specific interaction_process
                e.g., for Diffusion: kappa, kappa_gamma, mej (solar masses), vej (km/s), temperature_floor
    :return: bolometric_luminosity


    :param time: observer frame time in days
    :param l0: bolometric luminosity at 1 second in cgs
    :param t_0_turn: turn on time in days (after this time lbol decays as 5/3 powerlaw)
    :param kwargs: Must be all the kwargs required by the specific interaction_process
     e.g., for Diffusion TemperatureFloor: kappa, kappa_gamma, vej (km/s), temperature_floor
    :param interaction_process: Default is Diffusion.
            Can also be None in which case the output is just the raw engine luminosity
    :param photosphere: TemperatureFloor
    :param sed: CutoffBlackbody must have cutoff_wavelength in kwargs or it will default to 3000 Angstrom
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    Initializtion function to load/process data.

    Loads and interpolates tde simulation data. Simulation data is
    from Guillochon 2013 and can be found on astrocrash.net.

    :return: Named tuple with several outputs


    Produces the processed outputs from simulation data for the TDE model.

    :param times: A dense array of times in rest frame in days
    :param mbh6: black hole mass in units of 10^6 solar masses
    :param mstar: star mass in units of solar masses
    :param b: Relates to beta and gamma values for the star that's disrupted
    :param efficiency: efficiency of the BH
    :param leddlimit: eddington limit for the BH
    :param kwargs: Additional keyword arguments
    :return: Named tuple with several outputs


    Identical to the Mosfit model following Guillochon+ 2013 apart from doing the fallback rate fudge in mosfit.

    :param time: A dense array of times in rest frame in days
    :param mbh6: black hole mass in units of 10^6 solar masses
    :param mstar: star mass in units of solar masses
    :param tvisc: viscous timescale in days
    :param bb: Relates to beta and gamma values for the star that's disrupted
    :param eta: efficiency of the BH
    :param leddlimit: eddington limit for the BH
    :param kwargs: Additional keyword arguments
    :return: bolometric luminosity


    Identical to the Mosfit model following Guillochon+ 2013 apart from doing the fallback rate fudge in mosfit.

    :param time: Times in observer frame in days
    :param redshift: redshift of the transient
    :param mbh6: black hole mass in units of 10^6 solar masses
    :param mstar: star mass in units of solar masses
    :param tvisc: viscous timescale in days
    :param bb: Relates to beta and gamma values for the star that's disrupted
    :param eta: efficiency of the BH
    :param leddlimit: eddington limit for the BH
    :param rph0: initial photosphere radius
    :param lphoto: photosphere luminosity
    :param kwargs: Additional keyword arguments
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    An import of FitTeD to model the plateau phase

    :param time: observer frame time in days
    :param redshift: redshift
    :param log_mh: log of the black hole mass (solar masses)
    :param a_bh: black hole spin parameter (dimensionless)
    :param m_disc: initial mass of disc ring (solar masses)
    :param r0: initial radius of disc ring (gravitational radii)
    :param tvi: viscous timescale of disc evolution (days)
    :param t_form: time of ring formation prior to t = 0 (days)
    :param incl: disc-observer inclination angle (radians)
    :param kwargs: Must be all the kwargs required by the specific output_format
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    An import of FitTeD to model the plateau phase, with a gaussian rise and power-law decay

    :param time: observer frame time in days
    :param redshift: redshift
    :param log_mh: log of the black hole mass (solar masses)
    :param a_bh: black hole spin parameter (dimensionless)
    :param m_disc: initial mass of disc ring (solar masses)
    :param r0: initial radius of disc ring (gravitational radii)
    :param tvi: viscous timescale of disc evolution (days)
    :param t_form: time of ring formation prior to t = 0 (days)
    :param incl: disc-observer inclination angle (radians)
    :param log_L: single temperature blackbody amplitude for decay model (log_10 erg/s)
    :param t_decay: fallback timescale (days)
    :param p: power-law decay index
    :param log_T: single temperature blackbody temperature for decay model (log_10 Kelvin)
    :param sigma_t: gaussian rise timescale (days)
    :param t_peak: time of light curve peak (days)
    :param kwargs: Must be all the kwargs required by the specific output_format
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    An import of FitTeD to model the plateau phase, with a gaussian rise and exponential decay

    :param time: observer frame time in days
    :param redshift: redshift
    :param log_mh: log of the black hole mass (solar masses)
    :param a_bh: black hole spin parameter (dimensionless)
    :param m_disc: initial mass of disc ring (solar masses)
    :param r0: initial radius of disc ring (gravitational radii)
    :param tvi: viscous timescale of disc evolution (days)
    :param t_form: time of ring formation prior to t = 0 (days)
    :param incl: disc-observer inclination angle (radians)
    :param log_L: single temperature blackbody amplitude for decay model (log_10 erg/s)
    :param t_decay: fallback timescale (days)
    :param log_T: single temperature blackbody temperature for decay model (log_10 Kelvin)
    :param sigma_t: gaussian rise timescale (days)
    :param t_peak: time of light curve peak (days)
    :param kwargs: Must be all the kwargs required by the specific output_format
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'


    A TDE model based on stream-stream collisions.  Used as input for the bolometric and broadband versions.

    :param mbh_6: black hole mass (10^6 solar masses)
    :param mstar: mass of the disrupted star (solar masses)
    :param c1: characteristic distance scale of the emission region in units of the apocenter distance of the most tightly bound debris
    :param f: fraction of the bound mass within the semimajor axis of the most tightly bound debris at peak mass return time
    :param h_r: aspect ratio used to calculate t_cool. This is only used when include_tcool_tdyn_ratio = 1
    :param inc_tcool: if include_tcool_tdyn_ratio = 1, the luminosity is limited by the Eddington luminosity if t_cool / t_dyn < 1.0
    :param del_omega: solid angle (in units of pi) of radiation from the emission region
    :return: physical outputs


    A bolometric TDE model based on stream-stream collisions.  The early emission follows a gaussian rise.

    :param time: observer frame time in days
    :param mbh_6: black hole mass (10^6 solar masses)
    :param mstar: mass of the disrupted star (solar masses)
    :param c1: characteristic distance scale of the emission region in units of the apocenter distance of the most tightly bound debris
    :param f: fraction of the bound mass within the semimajor axis of the most tightly bound debris at peak mass return time
    :param h_r: aspect ratio used to calculate t_cool. This is only used when include_tcool_tdyn_ratio = 1
    :param inc_tcool: if include_tcool_tdyn_ratio = 1, the luminosity is limited by the Eddington luminosity if t_cool / t_dyn < 1.0
    :param del_omega: solid angle (in units of pi) of radiation from the emission region
    :param peak_time: peak time in days
    :param sigma_t: the sharpness of the Gaussian in days
    :return: bolometric luminosity


    A TDE model based on stream-stream collisions.  The early emission follows a constant temperature gaussian rise.

    :param time: observer frame time in days
    :param redshift: redshift
    :param mbh_6: black hole mass (10^6 solar masses)
    :param mstar: mass of the disrupted star (solar masses)
    :param c1: characteristic distance scale of the emission region in units of the apocenter distance of the most tightly bound debris
    :param f: fraction of the bound mass within the semimajor axis of the most tightly bound debris at peak mass return time
    :param h_r: aspect ratio used to calculate t_cool. This is only used when include_tcool_tdyn_ratio = 1
    :param inc_tcool: if include_tcool_tdyn_ratio = 1, the luminosity is limited by the Eddington luminosity if t_cool / t_dyn < 1.0
    :param del_omega: solid angle (in units of pi) of radiation from the emission region
    :param peak_time: peak time in days
    :param sigma_t: the sharpness of the Gaussian in days
    :param kwargs: Must be all the kwargs required by the specific output_format
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density' or 'magnitude'


    Parameters:
    :param time: time in source frame in seconds
    :param M_star: Mass of the Wolf-Rayet star in solar masses
    :param M_bh: Mass of the black hole in solar masses
    :param M_fast: Mass of the fast component in solar masses
    :param M_pre: Mass of the pre-merger CSM in solar masses
    :param v_fast: Velocity of the fast component in units of c
    :param v_slow: Velocity of the slow component in km/s
    :param alpha: Viscosity parameter
    :param eta: Efficiency of conversion of accretion energy to radiation
    :param theta: Disk aspect ratio
    :param phi_0: Solid angle of the slow component
    :param kappa_s: Opacity of the slow component
    :param kappa_f: Opacity of the fast component
    :param kappa_x: Opacity of the x-ray component
    :param N: Number of pre-merger orbits
    :param kwargs: Additional parameters


    Parameters:
    :param time: time in source frame in days
    :param M_star: Mass of the Wolf-Rayet star in solar masses
    :param M_bh: Mass of the black hole in solar masses
    :param M_fast: Mass of the fast component in solar masses
    :param M_pre: Mass of the pre-merger CSM in solar masses
    :param v_fast: Velocity of the fast component in units of c
    :param v_slow: Velocity of the slow component in km/s
    :param alpha: Viscosity parameter
    :param eta: Efficiency of conversion of accretion energy to radiation
    :param kwargs: Additional parameters
    :param output_format: whether to output dynamics or bolometric luminosity
    :param theta: Disk aspect ratio
    :param phi_0: Solid angle of the slow component
    :param kappa_s: Opacity of the slow component
    :param kappa_f: Opacity of the fast component
    :param kappa_x: Opacity of the x-ray component
    :param N: Number of pre-merger orbits
    :return: bolometric luminosity or dynamics output


    Parameters:
    :param time: time in source frame in days
    :param redshift: redshift
    :param M_star: Mass of the Wolf-Rayet star in solar masses
    :param M_bh: Mass of the black hole in solar masses
    :param M_fast: Mass of the fast component in solar masses
    :param M_pre: Mass of the pre-merger CSM in solar masses
    :param v_fast: Velocity of the fast component in units of c
    :param v_slow: Velocity of the slow component in km/s
    :param alpha: Viscosity parameter
    :param eta: Efficiency of conversion of accretion energy to radiation
    :param kwargs: Additional parameters - Must be all the kwargs required by the specific photosphere, sed methods used
             e.g., for TemperatureFloor: vej (km/s) and temperature_floor
    :param theta: Disk aspect ratio
    :param phi_0: Solid angle of the slow component
    :param kappa_s: Opacity of the slow component
    :param kappa_f: Opacity of the fast component
    :param kappa_x: Opacity of the x-ray component
    :param N: Number of pre-merger orbits
    :param photosphere: Default is TemperatureFloor.
            kwargs must have vej or relevant parameters if using different photosphere model
    :param frequency: Required if output_format is 'flux_density'.
        frequency to calculate - Must be same length as time array or a single number).
    :param bands: Required if output_format is 'magnitude' or 'flux'.
    :param output_format: 'flux_density', 'magnitude', 'spectra', 'flux', 'sncosmo_source'
    :param lambda_array: Optional argument to set your desired wavelength array (in Angstroms) to evaluate the SED on.
    :param cosmology: Cosmology to use for luminosity distance calculation. Defaults to Planck18. Must be a astropy.cosmology object.
    :return: set by output format - 'flux_density', 'magnitude', 'dynamics_output', 'spectra', 'flux', 'sncosmo_source'


    Gets the correct function to use for the base model specified

    :param base_model: string or a function
    :param model_type: type of model, could be None if using a function as input
    :return: function; function to evaluate


    Apply host galaxy and/or Milky Way extinction to flux density

    :param flux_density: flux density in mJy outputted by the model
    :param angstroms: wavelength in angstroms (observer frame)
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param rv_host: extinction parameter for host galaxy (default 3.1)
    :param av_mw: V-band extinction from Milky Way in magnitudes
    :param rv_mw: extinction parameter for Milky Way (default 3.1)
    :param redshift: source redshift (needed for host extinction)
    :param host_law: extinction law for host galaxy
                     ('fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89')
    :param mw_law: extinction law for Milky Way
                   ('fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89')
    :param kwargs: additional parameters for specific extinction laws
    :return: flux density with extinction applied


    Generalised evaluate extinction function with host and MW extinction

    :param time: time in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param av_mw: V-band extinction from Milky Way in magnitudes
    :param model_type: None, or one of the types implemented
    :param kwargs: Must include all parameters for base_model plus:
        - redshift: source redshift (required for host extinction)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
    :return: flux/magnitude with extinction applied


    Extinction model when using your own specified function

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in supernova_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in kilonova_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in tde_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in shock_powered_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in magnetar_driven_ejecta_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in stellar_interaction_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in general_synchrotron_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    Extinction with models implemented in afterglow_models

    :param time: time in observer frame in days
    :param av_host: V-band extinction from host galaxy in magnitudes
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied
        Note that only sed variant models can take magnitude as an output


    Extinction with afterglow models using galactic dust-to-gas ratio

    :param time: time in observer frame in days
    :param lognh: log10 hydrogen column density
    :param factor: factor to convert nh to av i.e., av = nh/factor (default 2.21)
    :param kwargs: Must be all the parameters required by the base_model specified using kwargs['base_model'] plus:
        - redshift: source redshift (required)
        - av_mw: MW V-band extinction in magnitudes (default 0.0)
        - rv_host: host R_V parameter (default 3.1)
        - rv_mw: MW R_V parameter (default 3.1)
        - host_law: host extinction law (default 'fitzpatrick99')
        - mw_law: MW extinction law (default 'fitzpatrick99')
        Available extinction laws: 'fitzpatrick99', 'fm07', 'calzetti00', 'odonnell94', 'ccm89'
    :return: set by kwargs['output_format'] - 'flux_density', 'magnitude', 'flux', 'spectra' with extinction applied


    :param time: time in some unit.
    :param lognh: host galaxy column density
    :param factor: extinction factor
    :param kwargs: all params
    :return: set by output format kwarg - 'flux_density', 'magnitude', 'flux' with extinction applied


    Convert ztf difference magnitudes. This code is modified from https://lasair-ztf.lsst.ac.uk/lasair/static/mag.py

    :param filter: filters name
    :param diff_mag: difference magnitude
    :param diff_mag_err: difference magnitude error
    :param status: "t" or "f" depending on whether difference is positive or negative
    :param ref_mag: reference image magnitude
    :param ref_mag_err: reference image magnitude error
    :return: apparent magnitude, apparent magnitude error


        :return: The lasair raw data url.
        :rtype: str


Downloads the data from Lasair website and saves it into the raw file path.


Converts the raw data into processed data and saves it into the processed file path.
        The data columns are in `OpenDataGetter.PROCESSED_FILE_COLUMNS`.

        :return: The processed data.
        :rtype: pandas.DataFrame


Provides directory structure for any spectrum data.

    :param transient: Name of the GRB, e.g. GRB123456.
    :type transient: str

    :return: The directory structure, with 'directory_path', 'raw_file_path', and 'processed_file_path'
    :rtype: namedtuple


Provides directory structure for Swift afterglow data.

    :param grb: Name of the GRB, e.g. GRB123456.
    :type grb: str
    :param data_mode: Data mode.
    :type data_mode: str
    :param instrument: Must be in ['BAT+XRT', 'XRT'], default is 'BAT+XRT' (Default value = 'BAT+XRT')
    :type instrument: str, optional

    :return: The directory structure, with 'directory_path', 'raw_file_path', and 'processed_file_path'
    :rtype: namedtuple


Provides directory structure for Swift prompt data.

    :param grb: Name of the GRB, e.g. GRB123456.
    :type grb: str
    :param bin_size: Bin size to use. Must be in `SWIFT_PROMPT_BIN_SIZES`. (Default value = '2ms')
    :type bin_size: str

    :return: The directory structure, with 'directory_path', 'raw_file_path', and 'processed_file_path'
    :rtype: namedtuple


Provides directory structure for BATSE prompt data.

    :param grb: Name of the GRB, e.g. GRB123456.
    :type grb: str
    :param trigger: The BATSE trigger number. Will be inferred from the GRB if not given. (Default value = None)
    :type trigger: str, optional
    :param kwargs: Add callable `get_batse_trigger_from_grb` for testing
    :type kwargs: None

    :return: The directory structure, with 'directory_path', 'raw_file_path', and 'processed_file_path'
    :rtype: namedtuple


Provides a general directory structure.

    :param transient: Name of the transient.
    :type transient: str
    :param transient_type: Type of the transient.
    :type transient_type: str

    :return: The directory structure, with 'directory_path', 'raw_file_path', and 'processed_file_path'
    :rtype: namedtuple


        :return: The fink raw data url.
        :rtype: str


        :return: The object ID i.e., the transient name
        :rtype: str


Downloads the data from astrocats and saves it into the raw file path.


Ensures the data mode to be from `SwiftDataGetter.VALID_DATA_MODES`.

        :return: The data mode
        :rtype: str


        :param data_mode: The data mode.
        :type data_mode: str


        Ensures the data mode to be from `SwiftDataGetter.VALID_INSTRUMENTS`.

        :return: The instrument
        :rtype: str


        :param instrument: The instrument
        :type: str


Gets the trigger number based on the GRB name.

        :return: The trigger number.
        :rtype: str


        :return: The GRB website depending on the data mode and instrument.
        :rtype: str


        :return: A namedtuple with the directory path, raw file path, and processed file path.
        :rtype: redback.get_data.directory.DirectoyStructure


Downloads the data from the Swift website and saves it into the raw file path.


Downloads flux density data from the Swift website.
        Uses the PhantomJS headless browser to click through the website.
        Properly quits the driver.


Downloads integrated flux density data from the Swift website.
        Uses the PhantomJS headless browser to click through the website.
        Properly quits the driver.


Downloads prompt or XRT data directly without using PhantomJS if possible.


Converts the raw data into processed data and saves it into the processed file path.

        :return: The processed data
        :rtype: pandas.DataFrame


Converts the raw XRT data into processed data and saves it into the processed file path.
        The column names are in `SwiftDataGetter.XRT_DATA_KEYS`

        :return: The processed data.
        :rtype: pandas.DataFrame


Converts the raw afterglow data into processed data and saves it into the processed file path.

        :return: The processed data.
        :rtype: pandas.DataFrame


Converts the raw prompt data into processed data and saves it into the processed file path.
        The column names are in `SwiftDataGetter.PROMPT_DATA_KEYS`

        :return: The processed data.
        :rtype: pandas.DataFrame


Converts the flux data into processed data and saves it into the processed file path.
        The column names are in `SwiftDataGetter.INTEGRATED_FLUX_KEYS`

        :return: The processed data.
        :rtype: pandas.DataFrame


Converts the flux data into processed data and saves it into the processed file path.
        The column names are in `SwiftDataGetter.FLUX_DENSITY_KEYS`

        :return: The processed data.
        :rtype: pandas.DataFrame


        :return: The astrocats raw data url.
        :rtype: str


        :return: The astrocats metadata url.
        :rtype: str


        :return: The path to the metadata file.
        :rtype: str


Converts the raw data into processed data and saves it into the processed file path.
        The column names are in `BATSEDataGetter.PROCESSED_FILE_COLUMNS`.

        :return: The processed data frame.
        :rtype: pd.DataFrame


        :param fits_data: The fits formatted data to which extract the columns from.
        :type fits_data: astropy.io.fits.hdu.PrimaryHDU

        :return: The columns.
        :rtype: numpy.ndarray


Checks if the transient type is valid when setting.

        :return: The transient type.
        :rtype: str


        :param transient_type: The transient type.
        :type transient_type: str


        :return: The GRB number with prepended 'GRB'.
        :rtype: str


        :param grb: The GRB name with or without the prepended 'GRB'
        :type grb: str


        :return: The GRB number without prepended 'GRB'.
        :rtype: str


Constructor that loads batse data given a trigger number.

        :param name: Name of the transient.
        :type name: str
        :param trigger_number: BATSE trigger number.
        :type trigger_number: str
        :param channels: Array of channels to use. Use all channels if 'all' is given.
        :type channels: Union[np.ndarray, float]

        :return: An instance of `PromptTimeSeries`.
        :rtype: PromptTimeSeries


Load batse data given a transient name.

        :type name: str
        :param name: Name of the GRB, e.g. GRB123456.
        :param channels: Array of channels to use. Use all channels if 'all' is given.
        :type channels: Union[np.ndarray, float]

        :return: Time, time step size, and counts in the format (time, dt, counts)
        :rtype tuple:


Strips 'GRB' from the transient name.

        :return: The stripped transient name.
        :rtype: str


Trigger number getter.

        :return: The trigger number.
        :rtype: str


Trigger number setter. If no trigger number is given, get trigger number from GRB using the conversion table.

        :param trigger_number: The trigger number.
        :type trigger_number: str


Simple plot of the data.

        :param kwargs: Placeholder.
        :type kwargs: None


        :param model: The model we are using
        :type model: callable
        :param axes: Axes to plot into. Currently a placeholder.
        :type axes: matplotlib.axes.Axes, optional
        :param save: Whether to save the plot. Default is `True`. Currently, a placeholder.
        :type save: bool, option
        :param show: Whether to show the plot. Default is `True`. Currently, a placeholder.
        :type show: bool, optional
        :param random_models: Number of random posterior samples to use for plots. Default is 1000.
        :type random_models: int, optional
        :param posterior: Posterior from which to draw samples from.
        :type posterior: pd.DataFrame, optional
        :param outdir: Out directory to save the plot in. Currently, a placeholder.
        :type outdir: str
        :param kwargs: All other plotting kwargs. Currently, a placeholder.
        :type kwargs: None


Gets the event table using a relative path.

        :return: The event table.
        :rtype: str


Sets the data from the event table.


        :return: The t90 data.
        :rtype: float


        :return: The t90 error value.
        :rtype: float


        :return: The t90 start value.
        :rtype: float


        :return: The t90 end value.
        :rtype: float


        :param name: Telephone number of SGRB, e.g., 'GRB140903A' or '140903A' are valid inputs
        :type name: str
        :param data_mode: Data mode. Must be one from `Afterglow.DATA_MODES`. (Default value = 'flux')
        :type data_mode: str, optional
        :param truncate: Whether to truncate the data. (Default value = True)
        :type truncate: bool
        :param truncate_method: Must be from `Truncator.TRUNCATE_METHODS`. (Default value = 'prompt_time_error')
        :type truncate_method: str
        :param kwargs: Additional keywords to pass into Afterglow.__init__
        :type kwargs: dict

        :return: The Afterglow object.
        :rtype: Afterglow


        :return: The currently active data mode (one in `Transient.DATA_MODES`)
        :rtype: str


        :return: One of the data modes in `Transient.DATA_MODES`.
        :rtype: str


Read data of SGRB from given path and GRB telephone number.
        Truncate the data to get rid of all but the last prompt emission point
        make a cut based on the size of the temporal error; ie if t_error < 1s, the data point is
        part of the prompt emission

        :param truncate: Whether to truncate the data.
        :type truncate: bool
        :param truncate_method: Must be from `Truncator.TRUNCATE_METHODS`. (Default value = 'prompt_time_error')
        :type truncate_method: str
        :param data_mode: Data mode. Must be one from `Afterglow.DATA_MODES`. (Default value = 'flux')
        :type data_mode: str, optional


Loads and returns data from a csv file

        :param name: Telephone number of SGRB, e.g., 'GRB140903A' or '140903A' are valid inputs
        :type name: str
        :param data_mode: Data mode. Must be one from `Afterglow.DATA_MODES`. (Default value = None)
        :type data_mode: str, optional

        :return: A tuple with x, x_err, y, y_err data
        :rtype: tuple


Truncate the data using the specified method. See `redback.transient.afterglow.Truncator` for
        documentation of the truncation methods.

        :param truncate_method: Must be from `Truncator.TRUNCATE_METHODS`. (Default value = 'prompt_time_error')
        :type truncate_method: str


        :return: Relative path to the event table.
        :rtype: str


Saves luminosity data to a csv file.


Loads data from the meta data table and sets it to the respective attribute.


Set the photon index attribute from the metadata table.


Set redshift from metadata table. Some GRBs do not have measurements.


Gets redshift or defaults to 0.75.

        :return: The redshift value.
        :rtype: Union[float, None]


Sets t90 value from meta data table.


Removes superfluous characters from a string. Relevant for redshift, photon index, and t90 values.

        :param string: String to be cleaned.
        :type string: str
        :return: The cleaned string converted into a float.
        :rtype: float


Converts flux to luminosity using the numerical method.

        :param counts_to_flux_absorbed: Absorbed counts to flux ratio - a conversion of the count rate to flux.
        :type counts_to_flux_absorbed: float
        :param counts_to_flux_unabsorbed: Unabsorbed counts to flux ratio - a conversion of the count rate to flux.
        :type counts_to_flux_unabsorbed: float:


Converts flux to luminosity data. Redshift needs to be set. Changes data mode to luminosity and
        saves luminosity data.

        :param conversion_method: Either 'analytical' or 'numerical' with the standard `FluxToLuminosityConverter`.
        :type conversion_method: str, optional
        :param counts_to_flux_absorbed: Absorbed counts to flux ratio - a conversion of the count rate to flux.
                                        (Default value = 1.)
        :type counts_to_flux_absorbed: float
        :param counts_to_flux_unabsorbed: Unabsorbed counts to flux ratio - a conversion of the count rate to flux.
                                          (Default value = 1.)
        :type counts_to_flux_unabsorbed: float


Executes the truncation and returns data as a tuple.

        :return: The truncated data (x, x_err, y, y_err)
        :rtype: tuple


Truncate using the prompt time error method. Does not data points after 2.0 seconds.

        :return: The truncated data (x, x_err, y, y_err)
        :rtype: tuple


Truncate all data left of the maximum.

        :return: The truncated data (x, x_err, y, y_err)
        :rtype: tuple


Truncate using the default method.

        :return: The truncated data (x, x_err, y, y_err)
        :rtype: tuple


Truncate data left of a given index.

        :param index: The index at which to truncate.
        :type index: Union[int, np.ndarray]
        :return: The truncated data (x, x_err, y, y_err)
        :rtype: tuple


Fraction of `counts_to_flux_absorbed` to `counts_to_flux_unabsorbed`.

        :return: The counts to flux fraction.
        :rtype: float


Calculates k-correction and converts the flux to luminosity.

        :return: The rest frame times and luminosities in the format (x, x_err, y, y_err).
        :rtype: tuple


Carries out flux to luminosity conversion.

        :param counts_to_flux_fraction: Fraction of `counts_to_flux_absorbed` to `counts_to_flux_unabsorbed`.
        :type counts_to_flux_fraction: float
        :param isotropic_bolometric_flux: Isotropic bolometric flux.
        :type isotropic_bolometric_flux: float
        :param redshift: Redshift.
        :type redshift: float


        :return: xlabel used in plotting functions
        :rtype: str


        :return: ylabel used in plotting functions
        :rtype: str


Plots the Transient data and returns Axes.

        :param axes: Matplotlib axes to plot the lightcurve into. Useful for user specific modifications to the plot.
        :param filename: Name of the file to be plotted in.
        :param outdir: The directory in which to save the file in.
        :param save: Whether to save the plot. (Default value = True)
        :param show: Whether to show the plot. (Default value = True)
        :param color: Color of the data.
        :param kwargs: Additional keyword arguments to pass in the Plotter methods.
        Available in the online documentation under at `redback.plotting.Plotter`.
        `print(Transient.plot_data.__doc__)` to see all options!
        :return: The axes with the plot.


        :param model: The model used to plot the lightcurve.
        :param filename: The output filename. Otherwise, use default which starts with the name
                         attribute and ends with *lightcurve.png.
        :param axes: Axes to plot in if given.
        :param save:Whether to save the plot.
        :param show: Whether to show the plot.
        :param random_models: Number of random posterior samples plotted faintly. (Default value = 100)
        :param posterior: Posterior distribution to which to draw samples from. Is optional but must be given.
        :param outdir: Out directory in which to save the plot. Default is the current working directory.
        :param model_kwargs: Additional keyword arguments to be passed into the model.
        :param kwargs: Additional keyword arguments to pass in the Plotter methods.
        Available in the online documentation under at `redback.plotting.Plotter`.
        `print(Transient.plot_lightcurve.__doc__)` to see all options!
        :return: The axes.


        :param model: The model used to plot the lightcurve.
        :param filename: The output filename. Otherwise, use default which starts with the name
                         attribute and ends with *lightcurve.png.
        :param axes: Axes to plot in if given.
        :param save:Whether to save the plot.
        :param show: Whether to show the plot.
        :param posterior: Posterior distribution to which to draw samples from. Is optional but must be given.
        :param outdir: Out directory in which to save the plot. Default is the current working directory.
        :param model_kwargs: Additional keyword arguments to be passed into the model.
        :param kwargs: Additional keyword arguments to pass in the Plotter methods.
        Available in the online documentation under at `redback.plotting.Plotter`.
        `print(Transient.plot_residual.__doc__)` to see all options!
        :return: The axes.


Loads data from specified directory and file, and returns it as a tuple.

        :param processed_file_path: Path to the processed file to load
        :type processed_file_path: str
        :param data_mode: Name of the data mode.
                          Must be from ['magnitude', 'flux_density', 'all']. Default is magnitude.
        :type data_mode: str, optional

        :return: Six elements when querying magnitude or flux_density data, Eight for 'all'.
        :rtype: tuple


Constructor method to built object from LASAIR data.

        :param name: Name of the transient.
        :type name: str
        :param data_mode: Data mode used. Must be from `OpticalTransient.DATA_MODES`. Default is magnitude.
        :type data_mode: str, optional
        :param active_bands: Sets active bands based on array given.
                             If argument is 'all', all unique bands in `self.bands` will be used.
        :type active_bands: Union[np.ndarray, str]
        :param plotting_order: Order in which to plot the bands/and how unique bands are stored.
        :type plotting_order: Union[np.ndarray, str], optional
        :param use_phase_model: Whether to use a phase model.
        :type use_phase_model: bool, optional

        :return: A class instance.
        :rtype: OpticalTransient


Constructor method to built object from SimulatedOpticalTransient.

        :param name: Name of the transient.
        :type name: str
        :param data_mode: Data mode used. Must be from `OpticalTransient.DATA_MODES`. Default is magnitude.
        :type data_mode: str, optional
        :param active_bands: Sets active bands based on array given.
                             If argument is 'all', all unique bands in `self.bands` will be used.
        :type active_bands: Union[np.ndarray, str]
        :param plotting_order: Order in which to plot the bands/and how unique bands are stored.
        :type plotting_order: Union[np.ndarray, str], optional
        :param use_phase_model: Whether to use a phase model.
        :type use_phase_model: bool, optional

        :return: A class instance.
        :rtype: OpticalTransient


        :return: The time values given the active data mode.
        :rtype: np.ndarray


Sets the time values for the active data mode.
        :param x: The desired time values.
        :type x: np.ndarray


        :return: The time error values given the active data mode.
        :rtype: np.ndarray


Sets the time error values for the active data mode.
        :param x_err: The desired time error values.
        :type x_err: np.ndarray


        :return: The y values given the active data mode.
        :rtype: np.ndarray


Sets the y values for the active data mode.
        :param y: The desired y values.
        :type y: np.ndarray


        :return: The y error values given the active data mode.
        :rtype: np.ndarray


Sets the y error values for the active data mode.
        :param y_err: The desired y error values.
        :type y_err: np.ndarray


        :return: The currently active data mode (one in `Transient.DATA_MODES`).
        :rtype: str


        :param data_mode: One of the data modes in `Transient.DATA_MODES`.
        :type data_mode: str


        :return: Used band frequencies
        :rtype: np.ndarray


        :param frequency: Set band frequencies if an array is given. Otherwise, convert bands to frequencies.
        :type frequency: np.ndarray


        :return: The frequencies only associated with the active bands.
        :rtype: np.ndarray


        :return: The sncosmo bands only associated with the active bands.
        :rtype: np.ndarray


        :return: The band names only associated with the active bands.
        :rtype: np.ndarray


        :return: List of active bands used.
        :rtype list:


        :param active_bands: Sets active bands based on list given.
                             If argument is 'all', all unique bands in `self.bands` will be used.
        :type active_bands: Union[list, str]


        :return: The list indices in `bands` associated with the active bands.
        :rtype: Union[list, None]


        :return: All bands that we get from the data, eliminating all duplicates.
        :rtype: np.ndarray


        :return: All frequencies that we get from the data, eliminating all duplicates.
        :rtype: np.ndarray


        :return: Indices that map between bands in the data and the unique bands we obtain.
        :rtype: list


        :return: Default list of filters to use.
        :rtype: list