LineEmission#

class sunkit_spex.models.physical.thermal.LineEmission(
temperature=<Quantity 10. MK>,
emission_measure=<Quantity 1.e+50 1 / cm3>,
mg=8.15,
al=7.04,
si=8.1,
s=7.27,
ar=6.58,
ca=6.93,
fe=8.1,
abundance_type='sun_coronal_ext',
**kwargs,
)[source]#

Bases: FittableModel

Calculate thermal line emission from the solar corona.

Examples

import astropy.units as u
import numpy as np
import matplotlib.pyplot as plt

from astropy.visualization import quantity_support

from sunkit_spex.models.physical.thermal import LineEmission

ph_energies = np.arange(4, 100, 0.5)*u.keV
ph_energies_centers = ph_energies[:-1] + 0.5*np.diff(ph_energies)

source = LineEmission()(ph_energies)

with quantity_support():
    plt.figure()
    plt.plot(ph_energies_centers ,  source)
    plt.loglog()
    plt.legend()
    plt.show()

(Source code, png, hires.png, pdf)

../_images/sunkit_spex-models-physical-thermal-LineEmission-1.png
Parameters:
  • energy_edges (astropy.units.Quantity) – The edges of the energy bins in a 1D N+1 quantity.

  • temperature (astropy.units.Quantity) – The temperature of the plasma. Can be scalar or 1D of any length. If not scalar, the flux for each temperature will be calculated. The first dimension of the output flux will correspond to temperature.

  • emission_measure (astropy.units.Quantity) – The emission measure of the plasma at each temperature. Must be same length as temperature or scalar. This is passed in units of cm**-3, however is scaled and therefore is in units of 1e49cm**-3.

  • abundance_type –

    Abundance type to use. Options are:
    1. cosmic

    2. sun_coronal - default abundance

    3. sun_coronal_ext

    4. sun_hybrid

    5. sun_hybrid_ext

    6. sun_photospheric

    7. mewe_cosmic

    8. mewe_solar

    The values for each abundance type is stored in the global variable DEFAULT_ABUNDANCES which is generated by setup_default_abundances function. To load different default values for each abundance type, see the docstring of that function.

Returns:

flux – The photon flux as a function of temperature and energy.

Return type:

astropy.units.Quantity

Attributes Summary

al

ar

ca

emission_measure

fe

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

mg

n_inputs

n_outputs

param_names

Names of the parameters that describe models of this type.

return_units

This property is used to indicate what units or sets of units the output of evaluate should be in, and returns a dictionary mapping outputs to units (or None if any units are accepted).

s

si

temperature

Methods Summary

__call__(*inputs[, model_set_axis, ...])

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(energy_edges, temperature, ...)

Evaluate the model on some input variables.

Attributes Documentation

al = Parameter('al', value=7.04, fixed=True, bounds=(5.04, 9.04))#
ar = Parameter('ar', value=6.58, fixed=True, bounds=(4.58, 8.58))#
ca = Parameter('ca', value=6.93, fixed=True, bounds=(4.93, 8.93))#
emission_measure = Parameter('emission_measure', value=1e+50, unit=1 / cm3)#
fe = Parameter('fe', value=8.1, fixed=True, bounds=(6.1, 10.1))#
input_units#
mg = Parameter('mg', value=8.15, fixed=True, bounds=(6.15, 10.15))#
n_inputs = 1#
n_outputs = 1#
param_names = ('temperature', 'emission_measure', 'mg', 'al', 'si', 's', 'ar', 'ca', 'fe')#

Names of the parameters that describe models of this type.

The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.

When defining a custom model class the value of this attribute is automatically set by the Parameter attributes defined in the class body.

return_units#
s = Parameter('s', value=7.27, fixed=True, bounds=(5.27, 9.27))#
si = Parameter('si', value=8.1, fixed=True, bounds=(6.1, 10.1))#
temperature = Parameter('temperature', value=10.0, unit=MK, bounds=(1, 100))#

Methods Documentation

__call__(
*inputs,
model_set_axis=None,
with_bounding_box=False,
fill_value=nan,
equivalencies=None,
inputs_map=None,
**new_inputs,
)#

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(
energy_edges,
temperature,
emission_measure,
mg,
al,
si,
s,
ar,
ca,
fe,
)[source]#

Evaluate the model on some input variables.