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)[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 (IES_TM2714_Header, 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.

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.

mapping
path
header
spectral_quantity
reflection_geometry
transmission_geometry
bandwidth_FWHM
bandwidth_corrected
read()[source]
write()[source]

References

[IESCCommitteeTM2714WGroup14]

Examples

>>> from os.path import dirname, join
>>> directory = join(dirname(__file__), 'tests', 'resources')
>>> sd = SpectralDistribution_IESTM2714(
...     join(directory, 'Fluorescent.spdx')).read()
>>> sd.header.manufacturer
'Unknown'
>>> # Doctests ellipsis for Python 2.x compatibility.
>>> sd[501.7]  
0.0950000...
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.

Parameters

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

Returns

Whether bandwidth correction has been applied to the measured data.

Return type

bool

property header

Getter and setter property for the header.

Parameters

value (IES_TM2714_Header) – Value to set the header with.

Returns

Header.

Return type

IES_TM2714_Header

property mapping

Getter and setter property for the mapping structure.

Parameters

value (Structure) – Value to set the mapping structure with.

Returns

Mapping structure.

Return type

Structure

property path

Getter and setter property for the path.

Parameters

value (unicode) – Value to set the path with.

Returns

Path.

Return type

unicode

read()[source]

Reads and parses the spectral data XML file path.

Returns

Definition success.

Return type

bool

Examples

>>> from os.path import dirname, join
>>> directory = join(dirname(__file__), 'tests', 'resources')
>>> sd = SpectralDistribution_IESTM2714(
...     join(directory, 'Fluorescent.spdx')).read()
>>> sd.header.description
'Rare earth fluorescent lamp'
>>> # Doctests ellipsis for Python 2.x compatibility.
>>> sd[400]  
0.0339999...
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 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 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

write()[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)