colour.SpectralDistribution_UPRTek#

class colour.SpectralDistribution_UPRTek(path: str | PathLike, **kwargs: Any)[source]#

Bases: SpectralDistribution_IESTM2714

Implement support to read and write IES TM-27-14 spectral data XML files from UPRTek Pseudo-XLS files.

This class extends SpectralDistribution_IESTM2714 to handle the specific Pseudo-XLS format used by UPRTek spectral measurement devices. The implementation parses metadata embedded in the file and converts it to the standard IES TM-27-14 XML format.

Parameters:
  • path (str | PathLike) – Absolute or relative path to the UPRTek Pseudo-XLS file.

  • kwargs (Any)

Attributes

Methods

Examples

>>> from os.path import dirname, join
>>> from colour import SpectralShape
>>> directory = join(dirname(__file__), "tests", "resources")
>>> sd = SpectralDistribution_UPRTek(
...     join(directory, "ESPD2021_0104_231446.xls")
... )
>>> print(sd.align(SpectralShape(380, 780, 10)))
...
UPRTek
======

Path                  : ...
Spectral Quantity     : irradiance
Reflection Geometry   : None
Transmission Geometry : None
Bandwidth (FWHM)      : None
Bandwidth Corrected   : None

Header
------

Manufacturer           : UPRTek
Catalog Number         : None
Description            : None
Document Creator       : None
Unique Identifier      : None
Measurement Equipment  : CV600
Laboratory             : None
Report Number          : None
Report Date            : 2021/01/04_23:14:46
Document Creation Date : None
Comments               : {...}

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

[[3.8000000e+02 3.0267000e-02]
 [3.9000000e+02 3.5223000e-02]
 [4.0000000e+02 1.9325000e-02]
 [4.1000000e+02 2.9426000e-02]
 [4.2000000e+02 8.7678000e-02]
 [4.3000000e+02 6.3257800e-01]
 [4.4000000e+02 3.6256590e+00]
 [4.5000000e+02 1.4206918e+01]
 [4.6000000e+02 1.7011297e+01]
 [4.7000000e+02 1.1967313e+01]
 [4.8000000e+02 8.4273620e+00]
 [4.9000000e+02 7.9772980e+00]
 [5.0000000e+02 8.7190360e+00]
 [5.1000000e+02 9.5532150e+00]
 [5.2000000e+02 9.9061050e+00]
 [5.3000000e+02 9.9139440e+00]
 [5.4000000e+02 9.7473800e+00]
 [5.5000000e+02 9.5340490e+00]
 [5.6000000e+02 9.2739220e+00]
 [5.7000000e+02 9.0232340e+00]
 [5.8000000e+02 8.9178880e+00]
 [5.9000000e+02 9.1145460e+00]
 [6.0000000e+02 9.5578710e+00]
 [6.1000000e+02 1.0060076e+01]
 [6.2000000e+02 1.0484620e+01]
 [6.3000000e+02 1.0567954e+01]
 [6.4000000e+02 1.0435987e+01]
 [6.5000000e+02 9.8212230e+00]
 [6.6000000e+02 8.7757830e+00]
 [6.7000000e+02 7.5647180e+00]
 [6.8000000e+02 6.2980860e+00]
 [6.9000000e+02 5.1562340e+00]
 [7.0000000e+02 4.0539060e+00]
 [7.1000000e+02 3.0663860e+00]
 [7.2000000e+02 2.1925000e+00]
 [7.3000000e+02 1.5392280e+00]
 [7.4000000e+02 1.1493820e+00]
 [7.5000000e+02 9.0509500e-01]
 [7.6000000e+02 6.9094700e-01]
 [7.7000000e+02 5.0842600e-01]
 [7.8000000e+02 4.1176600e-01]]
>>> sd.header.comments
'{"Model Name": "CV600", "Serial Number": "19J00789", "Time": "2021/01/04_23:14:46", "Memo": [], "LUX": 695.154907, "fc": 64.605476, "CCT": 5198.0, "Duv": -0.00062, "I-Time": 12000.0, "X": 682.470886, "Y": 695.154907, "Z": 631.635071, "x": 0.339663, "y": 0.345975, "u\'": 0.209915, "v\'": 0.481087, "LambdaP": 456.0, "LambdaPValue": 18.404581, "CRI": 92.956993, "R1": 91.651062, "R2": 93.014732, "R3": 97.032013, "R4": 93.513229, "R5": 92.48259, "R6": 91.48687, "R7": 93.016129, "R8": 91.459312, "R9": 77.613075, "R10": 86.981613, "R11": 94.841324, "R12": 74.139542, "R13": 91.073837, "R14": 97.064323, "R15": 88.615669, "TLCI": 97.495056, "TLMF-A": 1.270032, "SSI-A": 44.881924, "Rf": 87.234917, "Rg": 98.510712, "IRR": 2.607891}'
>>> sd.metadata.keys()
dict_keys(['Model Name', 'Serial Number', 'Time', 'Memo', 'LUX', 'fc', 'CCT', 'Duv', 'I-Time', 'X', 'Y', 'Z', 'x', 'y', "u'", "v'", 'LambdaP', 'LambdaPValue', 'CRI', 'R1', 'R2', 'R3', 'R4', 'R5', 'R6', 'R7', 'R8', 'R9', 'R10', 'R11', 'R12', 'R13', 'R14', 'R15', 'TLCI', 'TLMF-A', 'SSI-A', 'Rf', 'Rg', 'IRR'])
>>> sd.write(join(directory, "ESPD2021_0104_231446.spdx"))
...
__init__(path: str | PathLike, **kwargs: Any) None[source]#
Parameters:
Return type:

None

property metadata: dict#

Getter for the dataset metadata.

Returns:

Dataset metadata containing information about the data source, structure, and properties.

Return type:

dict

__str__() str[source]#

Return a formatted string representation of the UPRTek spectral distribution.

Returns:

Formatted string representation.

Return type:

str

Examples

>>> from os.path import dirname, join
>>> from colour import SpectralShape
>>> directory = join(dirname(__file__), "tests", "resources")
>>> sd = SpectralDistribution_UPRTek(
...     join(directory, "ESPD2021_0104_231446.xls")
... )
>>> print(sd.read().align(SpectralShape(380, 780, 10)))
...
UPRTek
======

Path                  : ...
Spectral Quantity     : irradiance
Reflection Geometry   : None
Transmission Geometry : None
Bandwidth (FWHM)      : None
Bandwidth Corrected   : None

Header
------

Manufacturer           : UPRTek
Catalog Number         : None
Description            : None
Document Creator       : None
Unique Identifier      : None
Measurement Equipment  : CV600
Laboratory             : None
Report Number          : None
Report Date            : 2021/01/04_23:14:46
Document Creation Date : None
Comments               : {...}

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

[[3.8000000e+02 3.0267000e-02]
 [3.9000000e+02 3.5223000e-02]
 [4.0000000e+02 1.9325000e-02]
 [4.1000000e+02 2.9426000e-02]
 [4.2000000e+02 8.7678000e-02]
 [4.3000000e+02 6.3257800e-01]
 [4.4000000e+02 3.6256590e+00]
 [4.5000000e+02 1.4206918e+01]
 [4.6000000e+02 1.7011297e+01]
 [4.7000000e+02 1.1967313e+01]
 [4.8000000e+02 8.4273620e+00]
 [4.9000000e+02 7.9772980e+00]
 [5.0000000e+02 8.7190360e+00]
 [5.1000000e+02 9.5532150e+00]
 [5.2000000e+02 9.9061050e+00]
 [5.3000000e+02 9.9139440e+00]
 [5.4000000e+02 9.7473800e+00]
 [5.5000000e+02 9.5340490e+00]
 [5.6000000e+02 9.2739220e+00]
 [5.7000000e+02 9.0232340e+00]
 [5.8000000e+02 8.9178880e+00]
 [5.9000000e+02 9.1145460e+00]
 [6.0000000e+02 9.5578710e+00]
 [6.1000000e+02 1.0060076e+01]
 [6.2000000e+02 1.0484620e+01]
 [6.3000000e+02 1.0567954e+01]
 [6.4000000e+02 1.0435987e+01]
 [6.5000000e+02 9.8212230e+00]
 [6.6000000e+02 8.7757830e+00]
 [6.7000000e+02 7.5647180e+00]
 [6.8000000e+02 6.2980860e+00]
 [6.9000000e+02 5.1562340e+00]
 [7.0000000e+02 4.0539060e+00]
 [7.1000000e+02 3.0663860e+00]
 [7.2000000e+02 2.1925000e+00]
 [7.3000000e+02 1.5392280e+00]
 [7.4000000e+02 1.1493820e+00]
 [7.5000000e+02 9.0509500e-01]
 [7.6000000e+02 6.9094700e-01]
 [7.7000000e+02 5.0842600e-01]
 [7.8000000e+02 4.1176600e-01]]
read() SpectralDistribution_UPRTek[source]#

Read and parse the spectral data from the specified UPRTek CSV file.

Returns:

UPRTek spectral distribution.

Return type:

colour.SpectralDistribution_UPRTek

Raises:

IOError – If the file cannot be read.

Examples

>>> from os.path import dirname, join
>>> from colour import SpectralShape
>>> directory = join(dirname(__file__), "tests", "resources")
>>> sd = SpectralDistribution_UPRTek(
...     join(directory, "ESPD2021_0104_231446.xls")
... )
>>> print(sd.read().align(SpectralShape(380, 780, 10)))
...
UPRTek
======

Path                  : ...
Spectral Quantity     : irradiance
Reflection Geometry   : None
Transmission Geometry : None
Bandwidth (FWHM)      : None
Bandwidth Corrected   : None

Header
------

Manufacturer           : UPRTek
Catalog Number         : None
Description            : None
Document Creator       : None
Unique Identifier      : None
Measurement Equipment  : CV600
Laboratory             : None
Report Number          : None
Report Date            : 2021/01/04_23:14:46
Document Creation Date : None
Comments               : {...}

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

[[3.8000000e+02 3.0267000e-02]
 [3.9000000e+02 3.5223000e-02]
 [4.0000000e+02 1.9325000e-02]
 [4.1000000e+02 2.9426000e-02]
 [4.2000000e+02 8.7678000e-02]
 [4.3000000e+02 6.3257800e-01]
 [4.4000000e+02 3.6256590e+00]
 [4.5000000e+02 1.4206918e+01]
 [4.6000000e+02 1.7011297e+01]
 [4.7000000e+02 1.1967313e+01]
 [4.8000000e+02 8.4273620e+00]
 [4.9000000e+02 7.9772980e+00]
 [5.0000000e+02 8.7190360e+00]
 [5.1000000e+02 9.5532150e+00]
 [5.2000000e+02 9.9061050e+00]
 [5.3000000e+02 9.9139440e+00]
 [5.4000000e+02 9.7473800e+00]
 [5.5000000e+02 9.5340490e+00]
 [5.6000000e+02 9.2739220e+00]
 [5.7000000e+02 9.0232340e+00]
 [5.8000000e+02 8.9178880e+00]
 [5.9000000e+02 9.1145460e+00]
 [6.0000000e+02 9.5578710e+00]
 [6.1000000e+02 1.0060076e+01]
 [6.2000000e+02 1.0484620e+01]
 [6.3000000e+02 1.0567954e+01]
 [6.4000000e+02 1.0435987e+01]
 [6.5000000e+02 9.8212230e+00]
 [6.6000000e+02 8.7757830e+00]
 [6.7000000e+02 7.5647180e+00]
 [6.8000000e+02 6.2980860e+00]
 [6.9000000e+02 5.1562340e+00]
 [7.0000000e+02 4.0539060e+00]
 [7.1000000e+02 3.0663860e+00]
 [7.2000000e+02 2.1925000e+00]
 [7.3000000e+02 1.5392280e+00]
 [7.4000000e+02 1.1493820e+00]
 [7.5000000e+02 9.0509500e-01]
 [7.6000000e+02 6.9094700e-01]
 [7.7000000e+02 5.0842600e-01]
 [7.8000000e+02 4.1176600e-01]]