colour.SpectralDistribution_IESTM2714¶
- class colour.SpectralDistribution_IESTM2714(path=None, header=None, spectral_quantity=None, reflection_geometry=None, transmission_geometry=None, bandwidth_FWHM=None, bandwidth_corrected=None, **kwargs)[source]¶
Bases:
colour.colorimetry.spectrum.SpectralDistribution
Defines a IES TM-27-14 spectral distribution.
This class can read and write IES TM-27-14 spectral data XML files.
- Parameters
path (unicode, optional) – Spectral data XML file path.
header (Header_IESTM2714, optional) – IES TM-27-14 spectral distribution header.
spectral_quantity (unicode, optional) – {‘flux’, ‘absorptance’, ‘transmittance’, ‘reflectance’, ‘intensity’, ‘irradiance’, ‘radiance’, ‘exitance’, ‘R-Factor’, ‘T-Factor’, ‘relative’, ‘other’}, Quantity of measurement for each element of the spectral data.
reflection_geometry (unicode, optional) – {‘di:8’, ‘de:8’, ‘8:di’, ‘8:de’, ‘d:d’, ‘d:0’, ‘45a:0’, ‘45c:0’, ‘0:45a’, ‘45x:0’, ‘0:45x’, ‘other’}, Spectral reflectance factors geometric conditions.
transmission_geometry (unicode, optional) – {‘0:0’, ‘di:0’, ‘de:0’, ‘0:di’, ‘0:de’, ‘d:d’, ‘other’}, Spectral transmittance factors geometric conditions.
bandwidth_FWHM (numeric, optional) – Spectroradiometer full-width half-maximum bandwidth in nanometers.
bandwidth_corrected (bool, optional) – Specifies if bandwidth correction has been applied to the measured data.
data (Series or Signal, SpectralDistribution or array_like or dict_like, optional) – Data to be stored in the spectral distribution.
domain (array_like, optional) – Values to initialise the
colour.SpectralDistribution.wavelength
attribute with. If bothdata
anddomain
arguments are defined, the latter will be used to initialise thecolour.SpectralDistribution.wavelength
attribute.name (unicode, optional) – Spectral distribution name.
interpolator (object, optional) – Interpolator class type to use as interpolating function.
interpolator_kwargs (dict_like, optional) – Arguments to use when instantiating the interpolating function.
extrapolator (object, optional) – Extrapolator class type to use as extrapolating function.
extrapolator_kwargs (dict_like, optional) – Arguments to use when instantiating the extrapolating function.
strict_name (unicode, optional) – Spectral distribution name for figures, default to
colour.SpectralDistribution.name
attribute value.
Notes
Reflection Geometry
di:8: Diffuse / eight-degree, specular component included.
de:8: Diffuse / eight-degree, specular component excluded.
8:di: Eight-degree / diffuse, specular component included.
8:de: Eight-degree / diffuse, specular component excluded.
d:d: Diffuse / diffuse.
d:0: Alternative diffuse.
45a:0: Forty-five degree annular / normal.
45c:0: Forty-five degree circumferential / normal.
0:45a: Normal / forty-five degree annular.
45x:0: Forty-five degree directional / normal.
0:45x: Normal / forty-five degree directional.
other: User-specified in comments.
Transmission Geometry
0:0: Normal / normal.
di:0: Diffuse / normal, regular component included.
de:0: Diffuse / normal, regular component excluded.
0:di: Normal / diffuse, regular component included.
0:de: Normal / diffuse, regular component excluded.
d:d: Diffuse / diffuse.
other: User-specified in comments.
Attributes
Methods
References
[]
Examples
>>> from os.path import dirname, join >>> directory = join(dirname(__file__), 'tests', 'resources') >>> sd = SpectralDistribution_IESTM2714( ... join(directory, 'Fluorescent.spdx')).read() >>> sd.name 'Unknown - N/A - Rare earth fluorescent lamp' >>> sd.header.comments 'Ambient temperature 25 degrees C.' >>> # Doctests ellipsis for Python 2.x compatibility. >>> sd[501.7] 0.0950000...
- __init__(path=None, header=None, spectral_quantity=None, reflection_geometry=None, transmission_geometry=None, bandwidth_FWHM=None, bandwidth_corrected=None, **kwargs)[source]¶
- property mapping¶
Getter property for the mapping structure.
- Returns
Mapping structure.
- Return type
- property path¶
Getter and setter property for the path.
- Parameters
value (unicode) – Value to set the path with.
- Returns
Path.
- Return type
unicode
- property header¶
Getter and setter property for the header.
- Parameters
value (Header_IESTM2714) – Value to set the header with.
- Returns
Header.
- Return type
Header_IESTM2714
- property spectral_quantity¶
Getter and setter property for the spectral quantity.
- Parameters
value (unicode) – Value to set the spectral quantity with.
- Returns
Spectral quantity.
- Return type
unicode
- property reflection_geometry¶
Getter and setter property for the reflection geometry.
- Parameters
value (unicode) – Value to set the reflection geometry with.
- Returns
Reflection geometry.
- Return type
unicode
- property transmission_geometry¶
Getter and setter property for the transmission geometry.
- Parameters
value (unicode) – Value to set the transmission geometry with.
- Returns
Transmission geometry.
- Return type
unicode
- property bandwidth_FWHM¶
Getter and setter property for the full-width half-maximum bandwidth.
- Parameters
value (numeric) – Value to set the full-width half-maximum bandwidth with.
- Returns
Full-width half-maximum bandwidth.
- Return type
numeric
- property bandwidth_corrected¶
Getter and setter property for whether bandwidth correction has been applied to the measured data.
- read()[source]¶
Reads and parses the spectral data XML file path.
- Returns
Definition success.
- Return type
Examples
>>> from os.path import dirname, join >>> directory = join(dirname(__file__), 'tests', 'resources') >>> sd = SpectralDistribution_IESTM2714( ... join(directory, 'Fluorescent.spdx')).read() >>> sd.name 'Unknown - N/A - Rare earth fluorescent lamp' >>> sd.header.comments 'Ambient temperature 25 degrees C.' >>> # Doctests ellipsis for Python 2.x compatibility. >>> sd[400] 0.0339999...
- write()[source]¶
Write the spectral distribution spectral data to XML file path.
- Returns
Definition success.
- Return type
Examples
>>> from os.path import dirname, join >>> from shutil import rmtree >>> from tempfile import mkdtemp >>> directory = join(dirname(__file__), 'tests', 'resources') >>> sd = SpectralDistribution_IESTM2714( ... join(directory, 'Fluorescent.spdx')).read() >>> temporary_directory = mkdtemp() >>> sd.path = join(temporary_directory, 'Fluorescent.spdx') >>> sd.write() True >>> rmtree(temporary_directory)