synthpop.modules.extinction._extinction
This module provides the parent classes for the Extinction: An Extinction Class is a child of an ExtinctionMap and one or more ExtinctionLaws. Those will be combined with the CombineExtinction factory functions.
ExtinctionLaw: Parent class for extinction laws ExtinctionMap: Parent class for extinction maps
- CombineExtinction: Factory that combines an ExtinctionLaw subclass
and an ExtinctionMap subclass into one Extinction Class
Attributes
Classes
Parent class for an extinction law. |
|
Parent class to represent an Extinction Map: |
Functions
|
This function combines an Extinction Map and an ExtinctionLaw to a combined Class |
Module Contents
- synthpop.modules.extinction._extinction.EXTINCTION_DIR = "b'.'/data/extinction"
- class synthpop.modules.extinction._extinction.ExtinctionLaw(logger: types.ModuleType = None, **kwargs)
Bases:
abc.ABCParent class for an extinction law. It is enough to provide only a function for Alambda_Aref within the Subclasses. However, only extinction_at_lambda will be called by SynthPop. So a complete different handling of the extinction can be implemented
Attributes
- extinction_law_name: str
name of extinction law
- law_ref_wavelength: float
reference wavelength for the extinction law in microns lambda where Alambda_Aref = 1
- min_wavelength: float
lower limit of valid wavelengths for the law given in microns
- max_wavelength: float
upper limit of valid wavelengths for the law given in microns
- map_name: str
name of the extinction map, when combined into an Extinction Object. will be set by the set_map_properties function
- ref_wavelengthfloat
reference wavelength for the extinction map in microns for an A_lambda map, lambda for an E(lambda1-lambda2) map, lambda1
- ref_wavelength2float
secondary reference wavelength for the extinction map in microns for an A_lambda map, none for an E(lambda1-lambda2) map, lambda2
- A_or_E_typestr
specify if an extinction Alambda_ref, or a color excess is given by A_or_E if it starts with “A”: A_or_E is a total extinction if it starts with “E”: A_or_E is a color excess will be set by the set_map_properties function
Methods
- Alambda_Aref(eff_wavelength)
returns the absorption coefficient for a given effective wavelength, relative to the reference extinction.
- Alambda_Amap(eff_wavelength)
wrapper such that the returned absorption is relative to the reference wavelength of the Extinction map
- extinction_at_lambda(eff_wavelength, A_or_E)
estimates the total extinction at a given effective wavelength, and a given total extinction or color excess from the extinction map
- set_map_properties():
method to set the important properties from the extinction map. This is the reference Wavelength, and the Extinction type (color excess or total extinction)
- logger = None
- extinction_law_name = 'NONE'
- law_ref_wavelength = None
- min_wavelength = None
- max_wavelength = None
- map_name = 'NONE'
- ref_wavelength = None
- A_or_E_type = None
- ref_wavelength2 = None
- abstract Alambda_Aref(eff_wavelength: float) float
estimate A_lambda / A_ref,
Parameters
- eff_wavelengthfloat
Effective Wavelength of the filter for which the extinction should be determined. in micrometer
- Alambda_Amap(eff_wavelength: float) float
Calculate the extinction relative to the specified filter for a given effective wavelength.
Arguments
- eff_wavelengthfloat
Effective Wavelength of the filter for which the extinction should be determined. in micrometer
- extinction_at_lambda(eff_wavelength: float, A_or_E: float or np.ndarray) float or np.ndarray
Returns the extinction at a given effective wavelength Arguments ——— eff_wavelength : float
Effective Wavelength of the filter for which the extinction should be determined. in micrometer
- A_or_Efloat, numpy array
total extinction or color excess provided by the Extinction Map the type is stored as A_or_E_type
- set_map_properties(map_name, ref_wavelength, A_or_E_type)
- class synthpop.modules.extinction._extinction.ExtinctionMap(logger: types.ModuleType = None, **kwargs)
Bases:
abc.ABCParent class to represent an Extinction Map:
Attributes
- extinction_map_namestr
name of the Extinction Map
- l_degfloat
galactic longitude in degree set by “update_line_of_sight”
- b_degfloat
galactic latitude in degree set by “update_line_of_sight”
- ref_wavelengthfloat
reference wavelength for the extinction for an A_lambda map, lambda for an E(lambda1-lambda2) map, lambda1
- ref_wavelength2float
secondary reference wavelength for the extinction for an A_lambda map, none for an E(lambda1-lambda2) map, lambda2
- A_or_Efloat or function
total extinction or color excess, from the extinction map. if it is a function it will be called
- A_or_E_typestr
Output type from the extinction map. If it starts with “A”, A_or_E is handled as a total extinction. If it starts with “E”: A_or_E is handled as a color excess.
Methods
- update_line_of_sight(l_deg, b_deg) :
specified the new galactic coordinates
- update_extinction():
placeholder for function that updates the total extinction or color excess in self.extinction_map_name
- get_map_properties():
returns the basic parameters of the extinction map used for Communication between ExtinctionLaw and ExtinctionMap
- logger = None
- extinction_map_name = 'NONE'
- ref_wavelength = None
- ref_wavelength2 = None
- A_or_E_type = 'for example A_V or E(B-V)'
- synthpop.modules.extinction._extinction.CombineExtinction(ext_map=ExtinctionMap, ext_law=ExtinctionLaw) CombineExtinction.Extinction
This function combines an Extinction Map and an ExtinctionLaw to a combined Class
Parameters
- ext_mapExtinctionMap_class
Class for the Extinction map. Must not be initialized
- ext_lawExtinctionLaw_class or List[ExtinctionMap_class]
Class or list of classes for the Extinction Law If it is a list, it uses multiple extinction laws Use the which_extinction_law to specify which Extinction Law should be adopted