colour.SpectralDistribution_IESTM2714#

class colour.SpectralDistribution_IESTM2714(path: str | PathLike | None = None, header: Header_IESTM2714 | None = None, spectral_quantity: Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other'] | None = None, reflection_geometry: 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 = None, transmission_geometry: Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other'] | None = None, bandwidth_FWHM: float | None = None, bandwidth_corrected: bool | None = None, **kwargs: Any)[source]#

Bases: SpectralDistribution

Define an IES TM-27-14 spectral distribution for electronic transfer of spectral data.

This class provides functionality to read and write spectral distribution data using the IES TM-27-14 standard format. The standard defines an XML schema for exchanging spectral measurement data between systems, ensuring consistent representation of wavelength-dependent measurements across different applications and instruments.

Parameters:
  • path (str | PathLike | None) – Spectral data XML file path.

  • header (Header_IESTM2714 | None) – IES TM-27-14 spectral distribution header containing metadata.

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

  • reflection_geometry (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) – Spectral reflectance factors geometric conditions.

  • transmission_geometry (Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other'] | None) – Spectral transmittance factors geometric conditions.

  • bandwidth_FWHM (float | None) – Spectroradiometer full-width half-maximum bandwidth in nanometers.

  • bandwidth_corrected (bool | None) – 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.

  • display_name – Spectral distribution name for figures, default to colour.SpectralDistribution.name property value.

  • kwargs (Any)

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"))
>>> sd.name
'Unknown - N/A - Rare earth fluorescent lamp'
>>> sd.header.comments
'Ambient temperature 25 degrees C.'
>>> sd[501.7]
np.float64(0.09...)
__init__(path: str | PathLike | None = None, header: Header_IESTM2714 | None = None, spectral_quantity: Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other'] | None = None, reflection_geometry: 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 = None, transmission_geometry: Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other'] | None = None, bandwidth_FWHM: float | None = None, bandwidth_corrected: bool | None = None, **kwargs: Any) None[source]#
Parameters:
  • path (str | PathLike | None)

  • header (Header_IESTM2714 | None)

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

  • reflection_geometry (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 (Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other'] | None)

  • bandwidth_FWHM (float | None)

  • bandwidth_corrected (bool | None)

  • kwargs (Any)

Return type:

None

property mapping: Structure#

Getter for the structure containing file mappings.

Returns:

Mapping structure.

Return type:

colour.utilities.Structure

property path: str | None#

Getter and setter for the resource path.

Parameters:

value – Value to set the path with.

Returns:

Path to the resource.

Return type:

str or None

property header: Header_IESTM2714#

Getter and setter for the IES TM-27-14 spectral distribution header.

Parameters:

value – Value to set the header with.

Returns:

Header object containing spectral distribution metadata.

Return type:

colour.io.tm2714.Header_IESTM2714

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

Getter and setter for the spectral quantity.

Parameters:

value – Value to set the spectral quantity with.

Returns:

Spectral quantity.

Return type:

str or None

property reflection_geometry: 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#

Getter and setter for the reflection geometry.

Parameters:

value – Value to set the reflection geometry with.

Returns:

Reflection geometry.

Return type:

str or None

property transmission_geometry: Literal['0:0', 'di:0', 'de:0', '0:di', '0:de', 'd:d', 'other'] | None#

Getter and setter for the transmission geometry.

Parameters:

value – Value to set the transmission geometry with.

Returns:

Transmission geometry.

Return type:

str or None

property bandwidth_FWHM: float | None#

Getter and setter for the full-width half-maximum (FWHM) bandwidth of the spectral measurement.

Parameters:

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

Returns:

Full-width half-maximum bandwidth.

Return type:

float or None

property bandwidth_corrected: bool | None#

Getter and setter 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:

bool or None

__str__() str[source]#

Generate a formatted string representation of the IES TM-27-14 spectral distribution.

Returns:

Formatted string representation containing path, spectral metadata, header details, and spectral data values.

Return type:

str

Examples

>>> from os.path import dirname, join
>>> directory = join(dirname(__file__), "tests", "resources")
>>> print(SpectralDistribution_IESTM2714(join(directory, "Fluorescent.spdx")))
...
IES TM-27-14 Spectral Distribution
==================================

Path                  : ...
Spectral Quantity     : relative
Reflection Geometry   : other
Transmission Geometry : other
Bandwidth (FWHM)      : 2.0
Bandwidth Corrected   : True

Header
------

Manufacturer           : Unknown
Catalog Number         : N/A
Description            : Rare earth fluorescent lamp
Document Creator       : byHeart Consultants
Unique Identifier      : C3567553-C75B-4354-961E-35CEB9FEB42C
Measurement Equipment  : None
Laboratory             : N/A
Report Number          : N/A
Report Date            : N/A
Document Creation Date : 2014-06-23
Comments               : Ambient temperature 25 degrees C.

Spectral Data
-------------

[[4.000e+02 3.400e-02]
 [4.031e+02 3.700e-02]
 [4.055e+02 6.900e-02]
 [4.075e+02 3.700e-02]
 [4.206e+02 4.200e-02]
 [4.310e+02 4.900e-02]
 [4.337e+02 6.000e-02]
 [4.370e+02 3.570e-01]
 [4.389e+02 6.000e-02]
 [4.600e+02 6.800e-02]
 [4.770e+02 7.500e-02]
 [4.810e+02 8.500e-02]
 [4.882e+02 2.040e-01]
 [4.926e+02 1.660e-01]
 [5.017e+02 9.500e-02]
 [5.076e+02 7.800e-02]
 [5.176e+02 7.100e-02]
 [5.299e+02 7.600e-02]
 [5.354e+02 9.900e-02]
 [5.399e+02 4.230e-01]
 [5.432e+02 8.020e-01]
 [5.444e+02 7.130e-01]
 [5.472e+02 9.990e-01]
 [5.487e+02 5.730e-01]
 [5.502e+02 3.400e-01]
 [5.538e+02 2.080e-01]
 [5.573e+02 1.390e-01]
 [5.637e+02 1.290e-01]
 [5.748e+02 1.310e-01]
 [5.780e+02 1.980e-01]
 [5.792e+02 1.900e-01]
 [5.804e+02 2.050e-01]
 [5.848e+02 2.440e-01]
 [5.859e+02 2.360e-01]
 [5.875e+02 2.560e-01]
 [5.903e+02 1.800e-01]
 [5.935e+02 2.180e-01]
 [5.955e+02 1.590e-01]
 [5.970e+02 1.470e-01]
 [5.994e+02 1.700e-01]
 [6.022e+02 1.340e-01]
 [6.046e+02 1.210e-01]
 [6.074e+02 1.400e-01]
 [6.094e+02 2.290e-01]
 [6.102e+02 4.650e-01]
 [6.120e+02 9.520e-01]
 [6.146e+02 4.770e-01]
 [6.169e+02 2.080e-01]
 [6.185e+02 1.350e-01]
 [6.221e+02 1.500e-01]
 [6.256e+02 1.550e-01]
 [6.284e+02 1.340e-01]
 [6.312e+02 1.680e-01]
 [6.332e+02 8.700e-02]
 [6.356e+02 6.800e-02]
 [6.427e+02 5.800e-02]
 [6.487e+02 5.800e-02]
 [6.507e+02 7.400e-02]
 [6.526e+02 6.300e-02]
 [6.562e+02 5.300e-02]
 [6.570e+02 5.600e-02]
 [6.606e+02 4.900e-02]
 [6.626e+02 5.900e-02]
 [6.642e+02 4.800e-02]
 [6.860e+02 4.100e-02]
 [6.876e+02 4.800e-02]
 [6.892e+02 3.900e-02]
 [6.924e+02 3.800e-02]
 [6.935e+02 4.400e-02]
 [6.955e+02 3.400e-02]
 [7.023e+02 3.600e-02]
 [7.067e+02 4.200e-02]
 [7.071e+02 6.100e-02]
 [7.102e+02 6.100e-02]
 [7.110e+02 4.100e-02]
 [7.122e+02 5.200e-02]
 [7.142e+02 3.300e-02]
 [7.484e+02 3.400e-02]
 [7.579e+02 3.100e-02]
 [7.607e+02 3.900e-02]
 [7.639e+02 2.900e-02]
 [8.088e+02 2.900e-02]
 [8.107e+02 3.900e-02]
 [8.127e+02 3.000e-02]
 [8.501e+02 3.000e-02]]
__repr__() str[source]#

Return an evaluable string representation of the IES TM-27-14 spectral distribution.

Returns:

Evaluable string representation.

Return type:

str

Examples

>>> from os.path import dirname, join
>>> directory = join(dirname(__file__), "tests", "resources")
>>> SpectralDistribution_IESTM2714(
...     join(directory, "Fluorescent.spdx")
... )
SpectralDistribution_IESTM2714(...)
read() SpectralDistribution_IESTM2714[source]#

Read and parse the spectral data from the specified 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"))
>>> sd.name
'Unknown - N/A - Rare earth fluorescent lamp'
>>> sd.header.comments
'Ambient temperature 25 degrees C.'
>>> sd[400]
np.float64(0.03...)
write() bool[source]#

Write the spectral distribution spectral data to the specified XML file path.

Returns:

Definition success.

Return type:

bool

Raises:

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

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"))
>>> temporary_directory = mkdtemp()
>>> sd.path = join(temporary_directory, "Fluorescent.spdx")
>>> sd.write()
True
>>> rmtree(temporary_directory)