colour.SpectralDistribution_IESTM2714#

class colour.SpectralDistribution_IESTM2714(path: str | Path | 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)[source]#

Bases: 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 (str | Path | None) – Spectral data XML file path.

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

  • 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.

  • 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.

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]  
0.0950000...
__init__(path: str | Path | 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) None[source]#
Parameters:
  • path (str | Path | 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)

Return type:

None

property mapping: Structure#

Getter property for the mapping structure.

Returns:

Mapping structure.

Return type:

colour.utilities.Structure

property path: str | None#

Getter and setter property for the path.

Parameters:

value – Value to set the path with.

Returns:

Path.

Return type:

None or str

property header: 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: Literal['absorptance', 'exitance', 'flux', 'intensity', 'irradiance', 'radiance', 'reflectance', 'relative', 'transmittance', 'R-Factor', 'T-Factor', 'other'] | None#

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

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: float | None#

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 float

property bandwidth_corrected: bool | None#

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

__str__() str[source]#

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

Returns:

Formatted string representation.

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.00000000e+02   3.40000000e-02]
 [  4.03100000e+02   3.70000000e-02]
 [  4.05500000e+02   6.90000000e-02]
 [  4.07500000e+02   3.70000000e-02]
 [  4.20600000e+02   4.20000000e-02]
 [  4.31000000e+02   4.90000000e-02]
 [  4.33700000e+02   6.00000000e-02]
 [  4.37000000e+02   3.57000000e-01]
 [  4.38900000e+02   6.00000000e-02]
 [  4.60000000e+02   6.80000000e-02]
 [  4.77000000e+02   7.50000000e-02]
 [  4.81000000e+02   8.50000000e-02]
 [  4.88200000e+02   2.04000000e-01]
 [  4.92600000e+02   1.66000000e-01]
 [  5.01700000e+02   9.50000000e-02]
 [  5.07600000e+02   7.80000000e-02]
 [  5.17600000e+02   7.10000000e-02]
 [  5.29900000e+02   7.60000000e-02]
 [  5.35400000e+02   9.90000000e-02]
 [  5.39900000e+02   4.23000000e-01]
 [  5.43200000e+02   8.02000000e-01]
 [  5.44400000e+02   7.13000000e-01]
 [  5.47200000e+02   9.99000000e-01]
 [  5.48700000e+02   5.73000000e-01]
 [  5.50200000e+02   3.40000000e-01]
 [  5.53800000e+02   2.08000000e-01]
 [  5.57300000e+02   1.39000000e-01]
 [  5.63700000e+02   1.29000000e-01]
 [  5.74800000e+02   1.31000000e-01]
 [  5.78000000e+02   1.98000000e-01]
 [  5.79200000e+02   1.90000000e-01]
 [  5.80400000e+02   2.05000000e-01]
 [  5.84800000e+02   2.44000000e-01]
 [  5.85900000e+02   2.36000000e-01]
 [  5.87500000e+02   2.56000000e-01]
 [  5.90300000e+02   1.80000000e-01]
 [  5.93500000e+02   2.18000000e-01]
 [  5.95500000e+02   1.59000000e-01]
 [  5.97000000e+02   1.47000000e-01]
 [  5.99400000e+02   1.70000000e-01]
 [  6.02200000e+02   1.34000000e-01]
 [  6.04600000e+02   1.21000000e-01]
 [  6.07400000e+02   1.40000000e-01]
 [  6.09400000e+02   2.29000000e-01]
 [  6.10200000e+02   4.65000000e-01]
 [  6.12000000e+02   9.52000000e-01]
 [  6.14600000e+02   4.77000000e-01]
 [  6.16900000e+02   2.08000000e-01]
 [  6.18500000e+02   1.35000000e-01]
 [  6.22100000e+02   1.50000000e-01]
 [  6.25600000e+02   1.55000000e-01]
 [  6.28400000e+02   1.34000000e-01]
 [  6.31200000e+02   1.68000000e-01]
 [  6.33200000e+02   8.70000000e-02]
 [  6.35600000e+02   6.80000000e-02]
 [  6.42700000e+02   5.80000000e-02]
 [  6.48700000e+02   5.80000000e-02]
 [  6.50700000e+02   7.40000000e-02]
 [  6.52600000e+02   6.30000000e-02]
 [  6.56200000e+02   5.30000000e-02]
 [  6.57000000e+02   5.60000000e-02]
 [  6.60600000e+02   4.90000000e-02]
 [  6.62600000e+02   5.90000000e-02]
 [  6.64200000e+02   4.80000000e-02]
 [  6.86000000e+02   4.10000000e-02]
 [  6.87600000e+02   4.80000000e-02]
 [  6.89200000e+02   3.90000000e-02]
 [  6.92400000e+02   3.80000000e-02]
 [  6.93500000e+02   4.40000000e-02]
 [  6.95500000e+02   3.40000000e-02]
 [  7.02300000e+02   3.60000000e-02]
 [  7.06700000e+02   4.20000000e-02]
 [  7.07100000e+02   6.10000000e-02]
 [  7.10200000e+02   6.10000000e-02]
 [  7.11000000e+02   4.10000000e-02]
 [  7.12200000e+02   5.20000000e-02]
 [  7.14200000e+02   3.30000000e-02]
 [  7.48400000e+02   3.40000000e-02]
 [  7.57900000e+02   3.10000000e-02]
 [  7.60700000e+02   3.90000000e-02]
 [  7.63900000e+02   2.90000000e-02]
 [  8.08800000e+02   2.90000000e-02]
 [  8.10700000e+02   3.90000000e-02]
 [  8.12700000e+02   3.00000000e-02]
 [  8.50100000e+02   3.00000000e-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('...',
                               Header_IESTM2714('Unknown',
                                                'N/A',
                                                'Rare earth ...',
                                                'byHeart Consultants',
                                                'C3567553-C75B-...',
                                                None,
                                                'N/A',
                                                'N/A',
                                                'N/A',
                                                '2014-06-23',
                                                'Ambient ...'),
                               'relative',
                               'other',
                               'other',
                               2.0,
                               True,
                               [[  4.00000000e+02,   3.40000000e-02],
                                [  4.03100000e+02,   3.70000000e-02],
                                [  4.05500000e+02,   6.90000000e-02],
                                [  4.07500000e+02,   3.70000000e-02],
                                [  4.20600000e+02,   4.20000000e-02],
                                [  4.31000000e+02,   4.90000000e-02],
                                [  4.33700000e+02,   6.00000000e-02],
                                [  4.37000000e+02,   3.57000000e-01],
                                [  4.38900000e+02,   6.00000000e-02],
                                [  4.60000000e+02,   6.80000000e-02],
                                [  4.77000000e+02,   7.50000000e-02],
                                [  4.81000000e+02,   8.50000000e-02],
                                [  4.88200000e+02,   2.04000000e-01],
                                [  4.92600000e+02,   1.66000000e-01],
                                [  5.01700000e+02,   9.50000000e-02],
                                [  5.07600000e+02,   7.80000000e-02],
                                [  5.17600000e+02,   7.10000000e-02],
                                [  5.29900000e+02,   7.60000000e-02],
                                [  5.35400000e+02,   9.90000000e-02],
                                [  5.39900000e+02,   4.23000000e-01],
                                [  5.43200000e+02,   8.02000000e-01],
                                [  5.44400000e+02,   7.13000000e-01],
                                [  5.47200000e+02,   9.99000000e-01],
                                [  5.48700000e+02,   5.73000000e-01],
                                [  5.50200000e+02,   3.40000000e-01],
                                [  5.53800000e+02,   2.08000000e-01],
                                [  5.57300000e+02,   1.39000000e-01],
                                [  5.63700000e+02,   1.29000000e-01],
                                [  5.74800000e+02,   1.31000000e-01],
                                [  5.78000000e+02,   1.98000000e-01],
                                [  5.79200000e+02,   1.90000000e-01],
                                [  5.80400000e+02,   2.05000000e-01],
                                [  5.84800000e+02,   2.44000000e-01],
                                [  5.85900000e+02,   2.36000000e-01],
                                [  5.87500000e+02,   2.56000000e-01],
                                [  5.90300000e+02,   1.80000000e-01],
                                [  5.93500000e+02,   2.18000000e-01],
                                [  5.95500000e+02,   1.59000000e-01],
                                [  5.97000000e+02,   1.47000000e-01],
                                [  5.99400000e+02,   1.70000000e-01],
                                [  6.02200000e+02,   1.34000000e-01],
                                [  6.04600000e+02,   1.21000000e-01],
                                [  6.07400000e+02,   1.40000000e-01],
                                [  6.09400000e+02,   2.29000000e-01],
                                [  6.10200000e+02,   4.65000000e-01],
                                [  6.12000000e+02,   9.52000000e-01],
                                [  6.14600000e+02,   4.77000000e-01],
                                [  6.16900000e+02,   2.08000000e-01],
                                [  6.18500000e+02,   1.35000000e-01],
                                [  6.22100000e+02,   1.50000000e-01],
                                [  6.25600000e+02,   1.55000000e-01],
                                [  6.28400000e+02,   1.34000000e-01],
                                [  6.31200000e+02,   1.68000000e-01],
                                [  6.33200000e+02,   8.70000000e-02],
                                [  6.35600000e+02,   6.80000000e-02],
                                [  6.42700000e+02,   5.80000000e-02],
                                [  6.48700000e+02,   5.80000000e-02],
                                [  6.50700000e+02,   7.40000000e-02],
                                [  6.52600000e+02,   6.30000000e-02],
                                [  6.56200000e+02,   5.30000000e-02],
                                [  6.57000000e+02,   5.60000000e-02],
                                [  6.60600000e+02,   4.90000000e-02],
                                [  6.62600000e+02,   5.90000000e-02],
                                [  6.64200000e+02,   4.80000000e-02],
                                [  6.86000000e+02,   4.10000000e-02],
                                [  6.87600000e+02,   4.80000000e-02],
                                [  6.89200000e+02,   3.90000000e-02],
                                [  6.92400000e+02,   3.80000000e-02],
                                [  6.93500000e+02,   4.40000000e-02],
                                [  6.95500000e+02,   3.40000000e-02],
                                [  7.02300000e+02,   3.60000000e-02],
                                [  7.06700000e+02,   4.20000000e-02],
                                [  7.07100000e+02,   6.10000000e-02],
                                [  7.10200000e+02,   6.10000000e-02],
                                [  7.11000000e+02,   4.10000000e-02],
                                [  7.12200000e+02,   5.20000000e-02],
                                [  7.14200000e+02,   3.30000000e-02],
                                [  7.48400000e+02,   3.40000000e-02],
                                [  7.57900000e+02,   3.10000000e-02],
                                [  7.60700000e+02,   3.90000000e-02],
                                [  7.63900000e+02,   2.90000000e-02],
                                [  8.08800000e+02,   2.90000000e-02],
                                [  8.10700000e+02,   3.90000000e-02],
                                [  8.12700000e+02,   3.00000000e-02],
                                [  8.50100000e+02,   3.00000000e-02]],
                               CubicSplineInterpolator,
                               {},
                               Extrapolator,
                               {...})
read() 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"))
>>> 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"))
>>> temporary_directory = mkdtemp()
>>> sd.path = join(temporary_directory, "Fluorescent.spdx")
>>> sd.write()
True
>>> rmtree(temporary_directory)