colour.io.ies_tm2714 Module¶
IES TM-27-14 Data Input / Output¶
Defines the IES_TM2714_Spd
class handling IES TM-27-14 spectral data
XML files.
References
[1] | IES Computer Committee, & TM-27-14 Working Group. (2014). IES Standard Format for the Electronic Transfer of Spectral Data Electronic Transfer of Spectral Data (pp. 1–16). ISBN:978-0879952952 |
-
class
colour.io.ies_tm2714.
IES_TM2714_ElementSpecification
[source]¶ Bases:
colour.io.ies_tm2714.IES_TM2714_ElementSpecification
IES TM-27-14 spectral data XML file element specification.
Parameters: - attribute (object) – Associated attribute name.
- element (unicode) – Element name.
- type (unicode) – Element type.
- attribute – Element type.
- required (bool) – Is element required.
- read_conversion (object) – Method to convert from XML to type on reading.
- write_conversion (object) – Method to convert from type to XML on writing.
-
class
colour.io.ies_tm2714.
IES_TM2714_Header
(manufacturer=None, catalog_number=None, description=None, document_creator=None, unique_identifier=None, measurement_equipment=None, laboratory=None, report_number=None, report_date=None, document_creation_date=None, comments=None)[source]¶ Bases:
object
Defines the header object for a IES TM-27-14 spectral power distribution.
Parameters: - manufacturer (unicode, optional) – Manufacturer of the device under test.
- catalog_number (unicode, optional) – Manufacturer’s product catalog number.
- description (unicode, optional) – Description of the spectral data in the spectral data XML file.
- document_creator (unicode, optional) – Creator of the spectral data XML file, which may be a test lab, a research group, a standard body, a company or an individual.
- unique_identifier (unicode, optional) – Description of the equipment used to measure the spectral data.
- measurement_equipment (unicode, optional) – Description of the equipment used to measure the spectral data.
- laboratory (unicode, optional) – Testing laboratory name that performed the spectral data measurements.
- report_number (unicode, optional) – Testing laboratory report number.
- report_date (unicode, optional) – Testing laboratory report date using the XML DateTime Data Type, YYYY-MM-DDThh:mm:ss.
- document_creation_date (unicode, optional) – Spectral data XML file creation date using the XML DateTime Data Type, YYYY-MM-DDThh:mm:ss.
- comments (unicode, optional) – Additional information relating to the tested and reported data.
-
mapping
¶
-
manufacturer
¶
-
catalog_number
¶
-
description
¶
-
document_creator
¶
-
unique_identifier
¶
-
measurement_equipment
¶
-
laboratory
¶
-
report_number
¶
-
report_date
¶
-
document_creation_date
¶
-
comments
¶
Examples
>>> IES_TM2714_Header('colour-science') <...IES_TM2714_Header object at 0x...> >>> IES_TM2714_Header('colour-science').manufacturer 'colour-science'
-
catalog_number
Property for self._catalog_number private attribute.
Returns: self._catalog_number. Return type: unicode
-
comments
Property for self._comments private attribute.
Returns: self._comments. Return type: unicode
-
description
Property for self._description private attribute.
Returns: self._description. Return type: unicode
-
document_creation_date
Property for self._document_creation_date private attribute.
Returns: self._document_creation_date. Return type: unicode
-
document_creator
Property for self._document_creator private attribute.
Returns: self._document_creator. Return type: unicode
-
laboratory
Property for self._laboratory private attribute.
Returns: self._laboratory. Return type: unicode
-
manufacturer
Property for self._manufacturer private attribute.
Returns: self._manufacturer. Return type: unicode
-
mapping
Property for self.mapping attribute.
Returns: Return type: Structure Warning
IES_TM2714_Header.mapping
is read only.
-
measurement_equipment
Property for self._measurement_equipment private attribute.
Returns: self._measurement_equipment. Return type: unicode
-
report_date
Property for self._report_date private attribute.
Returns: self._report_date. Return type: unicode
-
report_number
Property for self._report_number private attribute.
Returns: self._report_number. Return type: unicode
-
unique_identifier
Property for self._unique_identifier private attribute.
Returns: self._unique_identifier. Return type: unicode
-
class
colour.io.ies_tm2714.
IES_TM2714_Spd
(path=None, header=None, spectral_quantity=None, reflection_geometry=None, transmission_geometry=None, bandwidth_FWHM=None, bandwidth_corrected=None)[source]¶ Bases:
colour.colorimetry.spectrum.SpectralPowerDistribution
Defines a IES TM-27-14 spectral power 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 power 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
¶
Examples
>>> from os.path import dirname, join >>> directory = join(dirname(__file__), 'tests', 'resources') >>> spd = IES_TM2714_Spd(join(directory, 'Fluorescent.spdx')) >>> spd.read() True >>> spd.header.manufacturer 'Unknown' >>> # Doctests ellipsis for Python 2.x compatibility. >>> spd[501.7] array(0.095...)
-
bandwidth_FWHM
Property for self._bandwidth_FWHM private attribute.
Returns: self._bandwidth_FWHM. Return type: numeric
-
bandwidth_corrected
Property for self._bandwidth_corrected private attribute.
Returns: self._bandwidth_corrected. Return type: bool
-
header
Property for self._header private attribute.
Returns: self._header. Return type: IES_TM2714_Header
-
mapping
Property for self.mapping attribute.
Returns: Return type: Structure Warning
IES_TM2714_Spd.mapping
is read only.
-
path
Property for self._path private attribute.
Returns: self._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') >>> spd = IES_TM2714_Spd(join(directory, 'Fluorescent.spdx')) >>> spd.read() True >>> spd.header.description 'Rare earth fluorescent lamp' >>> # Doctests ellipsis for Python 2.x compatibility. >>> spd[400] array(0.034...)
-
reflection_geometry
Property for self._reflection_geometry private attribute.
Returns: self._reflection_geometry. Return type: unicode
-
spectral_quantity
Property for self._spectral_quantity private attribute.
Returns: self._spectral_quantity. Return type: unicode
-
transmission_geometry
Property for self._transmission_geometry private attribute.
Returns: self._transmission_geometry. Return type: unicode
-
write
()[source] Write the spd 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') >>> spd = IES_TM2714_Spd(join(directory, 'Fluorescent.spdx')) >>> spd.read() True >>> temporary_directory = mkdtemp() >>> spd.path = join(temporary_directory, 'Fluorescent.spdx') >>> spd.write() True >>> rmtree(temporary_directory)