synthpop.modules.extinction._extinction ======================================= .. py:module:: synthpop.modules.extinction._extinction .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: synthpop.modules.extinction._extinction.EXTINCTION_DIR Classes ------- .. autoapisummary:: synthpop.modules.extinction._extinction.ExtinctionLaw synthpop.modules.extinction._extinction.ExtinctionMap Functions --------- .. autoapisummary:: synthpop.modules.extinction._extinction.CombineExtinction Module Contents --------------- .. py:data:: EXTINCTION_DIR :value: "b'.'/data/extinction" .. py:class:: ExtinctionLaw(logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` Parent 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_wavelength : float reference wavelength for the extinction map in microns for an A_lambda map, lambda for an E(lambda1-lambda2) map, lambda1 ref_wavelength2 : float 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_type : str 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) .. py:attribute:: logger :value: None .. py:attribute:: extinction_law_name :value: 'NONE' .. py:attribute:: law_ref_wavelength :value: None .. py:attribute:: min_wavelength :value: None .. py:attribute:: max_wavelength :value: None .. py:attribute:: map_name :value: 'NONE' .. py:attribute:: ref_wavelength :value: None .. py:attribute:: A_or_E_type :value: None .. py:attribute:: ref_wavelength2 :value: None .. py:method:: Alambda_Aref(eff_wavelength: float) -> float :abstractmethod: estimate A_lambda / A_ref, Parameters ---------- eff_wavelength : float Effective Wavelength of the filter for which the extinction should be determined. in micrometer .. py:method:: Alambda_Amap(eff_wavelength: float) -> float Calculate the extinction relative to the specified filter for a given effective wavelength. Arguments --------- eff_wavelength : float Effective Wavelength of the filter for which the extinction should be determined. in micrometer .. py:method:: 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_E : float, numpy array total extinction or color excess provided by the Extinction Map the type is stored as A_or_E_type .. py:method:: set_map_properties(map_name, ref_wavelength, A_or_E_type) .. py:class:: ExtinctionMap(logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` Parent class to represent an Extinction Map: Attributes ---------- extinction_map_name : str name of the Extinction Map l_deg : float galactic longitude in degree set by "update_line_of_sight" b_deg : float galactic latitude in degree set by "update_line_of_sight" ref_wavelength : float reference wavelength for the extinction for an A_lambda map, lambda for an E(lambda1-lambda2) map, lambda1 ref_wavelength2 : float secondary reference wavelength for the extinction for an A_lambda map, none for an E(lambda1-lambda2) map, lambda2 A_or_E : float or function total extinction or color excess, from the extinction map. if it is a function it will be called A_or_E_type : str 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 .. py:attribute:: logger :value: None .. py:attribute:: extinction_map_name :value: 'NONE' .. py:attribute:: ref_wavelength :value: None .. py:attribute:: ref_wavelength2 :value: None .. py:attribute:: A_or_E_type :value: 'for example A_V or E(B-V)' .. py:method:: extinction_in_map(radius: float) :abstractmethod: Estimates the extinction for the current sight-line and radial distance store the result into self.extinction_in_map. Parameters ---------- radius: float [kpc] radial distance of the current slice .. py:method:: get_map_properties() -> Tuple[str, float, str] return the extinction map properties, used to communicate between extinction map, and extinction law in case of multiple extinction laws. .. py:function:: CombineExtinction(ext_map=ExtinctionMap, ext_law=ExtinctionLaw) -> CombineExtinction.Extinction This function combines an Extinction Map and an ExtinctionLaw to a combined Class Parameters ---------- ext_map : ExtinctionMap_class Class for the Extinction map. Must not be initialized ext_law : ExtinctionLaw_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