BaseExtModel

class dust_extinction.baseclasses.BaseExtModel(*args, meta=None, name=None, **kwargs)[source]

Bases: Model

Base Extinction Model. Do not use directly.

Attributes Summary

input_units

input_units_equivalencies

n_inputs

The number of inputs.

n_outputs

The number of outputs.

return_units

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.

extinguish(x[, Av, Ebv])

Calculate the extinction as a fraction

prepare_inputs(*args, **kwargs)

This method is used in __call__ to ensure that all the inputs to the model can be broadcast into compatible shapes (if one or both of them are input as arrays), particularly if there are more than one parameter sets.

Attributes Documentation

input_units = {'x': Unit("1 / micron")}
input_units_equivalencies = {'x': [(Unit("m"), Unit("Hz"), <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("J"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("J"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("1 / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("1 / m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>)]}
n_inputs = 1

The number of inputs.

n_outputs = 1

The number of outputs.

return_units = {'y': Unit(dimensionless)}

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.

extinguish(x, Av=None, Ebv=None)[source]

Calculate the extinction as a fraction

Parameters:
x: float

expects either x in units of wavelengths or frequency or assumes wavelengths in wavenumbers [1/micron]

internally wavenumbers are used

Av: float

A(V) value of dust column Av or Ebv must be set

Ebv: float

E(B-V) value of dust column Av or Ebv must be set

Returns:
frac_ext: np array (float)

fractional extinction as a function of x

prepare_inputs(*args, **kwargs)[source]

This method is used in __call__ to ensure that all the inputs to the model can be broadcast into compatible shapes (if one or both of them are input as arrays), particularly if there are more than one parameter sets. This also makes sure that (if applicable) the units of the input will be compatible with the evaluate method.