colour.SpectralDistribution_IESTM2714

class colour.SpectralDistribution_IESTM2714(path: Optional[str] = None, header: Optional[Header_IESTM2714] = None, spectral_quantity: Optional[Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other']] = None, reflection_geometry: Optional[Literal['di:8', 'de:8', '8:di', '8:de', 'd:d', 'd:0', '45a:0', '45c:0', '0:45a', '45x:0', '0:45x', 'other']] = None, transmission_geometry: Optional[Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other']] = None, bandwidth_FWHM: Optional[Floating] = None, bandwidth_corrected: Optional[Boolean] = None, **kwargs)[source]

Bases: colour.colorimetry.spectrum.SpectralDistribution

Define a IES TM-27-14 spectral distribution.

This class can read and write IES TM-27-14 spectral data XML files.

Parameters
  • path (Optional[str]) – Spectral data XML file path.

  • header (Optional[Header_IESTM2714]) – IES TM-27-14 spectral distribution header.

  • spectral_quantity (Optional[Literal[('absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other')]]) – Quantity of measurement for each element of the spectral data.

  • reflection_geometry (Optional[Literal[('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 (Optional[Literal[('0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other')]]) – Spectral transmittance factors geometric conditions.

  • bandwidth_FWHM (Optional[Floating]) – Spectroradiometer full-width half-maximum bandwidth in nanometers.

  • bandwidth_corrected (Optional[Boolean]) – Specifies if bandwidth correction has been applied to the measured data.

  • data – Data to be stored in the spectral distribution.

  • domain – Values to initialise the colour.SpectralDistribution.wavelength property with. If both data and domain arguments are defined, the latter will be used to initialise the colour.SpectralDistribution.wavelength property.

  • extrapolator – Extrapolator class type to use as extrapolating function.

  • extrapolator_kwargs – Arguments to use when instantiating the extrapolating function.

  • interpolator – Interpolator class type to use as interpolating function.

  • interpolator_kwargs – Arguments to use when instantiating the interpolating function.

  • name – Spectral distribution name.

  • strict_name – Spectral distribution name for figures, default to colour.SpectralDistribution.name property 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

[IESCCommitteeTM2714WGroup14]

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.'
>>> sd[501.7]  
0.0950000...
__init__(path: Optional[str] = None, header: Optional[Header_IESTM2714] = None, spectral_quantity: Optional[Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other']] = None, reflection_geometry: Optional[Literal['di:8', 'de:8', '8:di', '8:de', 'd:d', 'd:0', '45a:0', '45c:0', '0:45a', '45x:0', '0:45x', 'other']] = None, transmission_geometry: Optional[Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other']] = None, bandwidth_FWHM: Optional[Floating] = None, bandwidth_corrected: Optional[Boolean] = None, **kwargs)[source]
Parameters
  • path (Optional[str]) –

  • header (Optional[Header_IESTM2714]) –

  • spectral_quantity (Optional[Literal[('absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other')]]) –

  • reflection_geometry (Optional[Literal[('di:8', 'de:8', '8:di', '8:de', 'd:d', 'd:0', '45a:0', '45c:0', '0:45a', '45x:0', '0:45x', 'other')]]) –

  • transmission_geometry (Optional[Literal[('0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other')]]) –

  • bandwidth_FWHM (Optional[Floating]) –

  • bandwidth_corrected (Optional[Boolean]) –

property mapping: colour.utilities.data_structures.Structure

Getter property for the mapping structure.

Returns

Mapping structure.

Return type

colour.utilities.Structure

property path: Optional[str]

Getter and setter property for the path.

Parameters

value – Value to set the path with.

Returns

Path.

Return type

None or str

property header: colour.io.tm2714.Header_IESTM2714

Getter and setter property for the header.

Parameters

value – Value to set the header with.

Returns

Header.

Return type

colour.io.tm2714.Header_IESTM2714

property spectral_quantity: Optional[Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other']]

Getter and setter property for the spectral quantity.

Parameters

value – Value to set the spectral quantity with.

Returns

Spectral quantity.

Return type

None or str

property reflection_geometry: Optional[Literal['di:8', 'de:8', '8:di', '8:de', 'd:d', 'd:0', '45a:0', '45c:0', '0:45a', '45x:0', '0:45x', 'other']]

Getter and setter property for the reflection geometry.

Parameters

value – Value to set the reflection geometry with.

Returns

Reflection geometry.

Return type

None or str

property transmission_geometry: Optional[Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other']]

Getter and setter property for the transmission geometry.

Parameters

value – Value to set the transmission geometry with.

Returns

Transmission geometry.

Return type

None or str

property bandwidth_FWHM: Optional[Floating]

Getter and setter property for the full-width half-maximum bandwidth.

Parameters

value – Value to set the full-width half-maximum bandwidth with.

Returns

Full-width half-maximum bandwidth.

Return type

None or numpy.floating

property bandwidth_corrected: Optional[Boolean]

Getter and setter property for whether bandwidth correction has been applied to the measured data.

Parameters

value – Whether bandwidth correction has been applied to the measured data.

Returns

Whether bandwidth correction has been applied to the measured data.

Return type

None or bool

read() colour.io.tm2714.SpectralDistribution_IESTM2714[source]

Read and parses the spectral data XML file path.

Returns

IES TM-27-14 spectral distribution.

Return type

colour.SpectralDistribution_IESTM2714

Raises

ValueError – If the IES TM-27-14 spectral distribution path is undefined.

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.'
>>> sd[400]  
0.0340000...
write() bool[source]

Write the spectral distribution spectral data to XML file path.

Returns

Definition success.

Return type

bool

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)