code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def test_matrix_augmented_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_augmented_Cheung2004` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
polynomials = [
np.array([0.17224810, 0.09170660, 0.06416938]),... |
Test :func:`colour.characterisation.correction.matrix_augmented_Cheung2004` definition.
| test_matrix_augmented_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_raise_exception_matrix_augmented_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_augmented_Cheung2004` definition raised exception.
"""
pytest.raises(
ValueError,
matrix_augmented_Cheung2004,
np.array([0.... |
Test :func:`colour.characterisation.correction.matrix_augmented_Cheung2004` definition raised exception.
| test_raise_exception_matrix_augmented_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_matrix_augmented_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_augmented_Cheung2004` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
m... |
Test :func:`colour.characterisation.correction.matrix_augmented_Cheung2004` definition nan support.
| test_nan_matrix_augmented_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_polynomial_expansion_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
polynomial_expansion_Finlayson2015` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
polynomials = [
[
np.array([0.172... |
Test :func:`colour.characterisation.correction.polynomial_expansion_Finlayson2015` definition.
| test_polynomial_expansion_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_raise_exception_polynomial_expansion_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
polynomial_expansion_Finlayson2015` definition raised exception.
"""
pytest.raises(
ValueError,
polynomial_expansion_Finlayson2015,
... |
Test :func:`colour.characterisation.correction.polynomial_expansion_Finlayson2015` definition raised exception.
| test_raise_exception_polynomial_expansion_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_polynomial_expansion_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
polynomial_expansion_Finlayson2015` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3... |
Test :func:`colour.characterisation.correction.polynomial_expansion_Finlayson2015` definition nan support.
| test_nan_polynomial_expansion_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_polynomial_expansion_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
polynomial_expansion_Vandermonde` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
polynomials = [
np.array([0.17224810, 0.09170660, 0.0... |
Test :func:`colour.characterisation.correction.polynomial_expansion_Vandermonde` definition.
| test_polynomial_expansion_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_polynomial_expansion_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
polynomial_expansion_Vandermonde` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))... |
Test :func:`colour.characterisation.correction.polynomial_expansion_Vandermonde` definition nan support.
| test_nan_polynomial_expansion_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_matrix_colour_correction_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Cheung2004` definition.
"""
np.testing.assert_allclose(
matrix_colour_correction_Cheung2004(MATRIX_TEST, MATRIX_REFERENCE),
n... |
Test :func:`colour.characterisation.correction.matrix_colour_correction_Cheung2004` definition.
| test_matrix_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_matrix_colour_correction_Cheung2004(self) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Cheung2004` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.system() in ("Darwi... |
Test :func:`colour.characterisation.correction. matrix_colour_correction_Cheung2004` definition nan support.
| test_nan_matrix_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_matrix_colour_correction_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Finlayson2015` definition.
"""
np.testing.assert_allclose(
matrix_colour_correction_Finlayson2015(MATRIX_TEST, MATRIX_REFERENCE),
... |
Test :func:`colour.characterisation.correction.matrix_colour_correction_Finlayson2015` definition.
| test_matrix_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_matrix_colour_correction_Finlayson2015(
self,
) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Finlayson2015` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platfor... |
Test :func:`colour.characterisation.correction. matrix_colour_correction_Finlayson2015` definition nan support.
| test_nan_matrix_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_matrix_colour_correction_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Vandermonde` definition.
"""
np.testing.assert_allclose(
matrix_colour_correction_Vandermonde(MATRIX_TEST, MATRIX_REFERENCE),
... |
Test :func:`colour.characterisation.correction.matrix_colour_correction_Vandermonde` definition.
| test_matrix_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_matrix_colour_correction_Vandermonde(
self,
) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
matrix_colour_correction_Vandermonde` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.sy... |
Test :func:`colour.characterisation.correction. matrix_colour_correction_Vandermonde` definition nan support.
| test_nan_matrix_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_apply_matrix_colour_correction_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Cheung2004` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
apply_m... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Cheung2004` definition.
| test_apply_matrix_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_apply_matrix_colour_correction_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Cheung2004` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
CCM = np.arr... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Cheung2004` definition n-dimensional support.
| test_n_dimensional_apply_matrix_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_apply_matrix_colour_correction_Cheung2004(
self,
) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Cheung2004` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Cheung2004` definition nan support.
| test_nan_apply_matrix_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_apply_matrix_colour_correction_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Finlayson2015` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
a... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Finlayson2015` definition.
| test_apply_matrix_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_apply_matrix_colour_correction_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Finlayson2015` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
CCM = ... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Finlayson2015` definition n-dimensional support.
| test_n_dimensional_apply_matrix_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_apply_matrix_colour_correction_Finlayson2015(
self,
) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.
apply_matrix_colour_correction_Finlayson2015` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".... |
Test :func:`colour.characterisation.correction.
apply_matrix_colour_correction_Finlayson2015` definition nan support.
| test_nan_apply_matrix_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_apply_matrix_colour_correction_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Vandermonde` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
apply... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Vandermonde` definition.
| test_apply_matrix_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_apply_matrix_colour_correction_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Vandermonde` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
CCM = np.a... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Vandermonde` definition n-dimensional support.
| test_n_dimensional_apply_matrix_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_apply_matrix_colour_correction_Vandermonde(
self,
) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
apply_matrix_colour_correction_Vandermonde` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platfor... |
Test :func:`colour.characterisation.correction.apply_matrix_colour_correction_Vandermonde` definition nan support.
| test_nan_apply_matrix_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_colour_correction_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Cheung2004` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
colour_correction_Cheung2004(RGB,... |
Test :func:`colour.characterisation.correction.colour_correction_Cheung2004` definition.
| test_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_colour_correction_Cheung2004(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Cheung2004` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
RGB_c = colour_correction_Cheung2004(R... |
Test :func:`colour.characterisation.correction.colour_correction_Cheung2004` definition n-dimensional support.
| test_n_dimensional_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_colour_correction_Cheung2004(self) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Cheung2004` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.system() in ("Darwin", "Linux"):
... |
Test :func:`colour.characterisation.correction.colour_correction_Cheung2004` definition nan support.
| test_nan_colour_correction_Cheung2004 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_colour_correction_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
colour_correction_Finlayson... |
Test :func:`colour.characterisation.correction.colour_correction_Finlayson2015` definition.
| test_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_colour_correction_Finlayson2015(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Finlayson2015` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
RGB_c = colour_correction_Finlay... |
Test :func:`colour.characterisation.correction.colour_correction_Finlayson2015` definition n-dimensional support.
| test_n_dimensional_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_colour_correction_Finlayson2015(self) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.
colour_correction_Finlayson2015` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.system() in ("Darwin... |
Test :func:`colour.characterisation.correction.
colour_correction_Finlayson2015` definition nan support.
| test_nan_colour_correction_Finlayson2015 | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_colour_correction_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Vandermonde` definition.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
np.testing.assert_allclose(
colour_correction_Vandermonde(R... |
Test :func:`colour.characterisation.correction.colour_correction_Vandermonde` definition.
| test_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_n_dimensional_colour_correction_Vandermonde(self) -> None:
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Vandermonde` definition n-dimensional support.
"""
RGB = np.array([0.17224810, 0.09170660, 0.06416938])
RGB_c = colour_correction_Vandermond... |
Test :func:`colour.characterisation.correction.colour_correction_Vandermonde` definition n-dimensional support.
| test_n_dimensional_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def test_nan_colour_correction_Vandermonde(self) -> None: # pragma: no cover
"""
Test :func:`colour.characterisation.correction.\
colour_correction_Vandermonde` definition nan support.
"""
# NOTE: Hangs on "macOS" and "Linux".
if platform.system() in ("Darwin", "Linux"):
... |
Test :func:`colour.characterisation.correction.colour_correction_Vandermonde` definition nan support.
| test_nan_colour_correction_Vandermonde | python | colour-science/colour | colour/characterisation/tests/test_correction.py | https://github.com/colour-science/colour/blob/master/colour/characterisation/tests/test_correction.py | BSD-3-Clause |
def rayleigh_jeans_law(wavelength: ArrayLike, temperature: ArrayLike) -> NDArrayFloat:
"""
Approximate the spectral radiance of a blackbody as a function of
wavelength at specified thermodynamic temperature :math:`T[K]` according to
*Rayleigh-Jeans* law.
Parameters
----------
wavelength
... |
Approximate the spectral radiance of a blackbody as a function of
wavelength at specified thermodynamic temperature :math:`T[K]` according to
*Rayleigh-Jeans* law.
Parameters
----------
wavelength
Wavelength in meters.
temperature
Temperature :math:`T[K]` in kelvin degrees.... | rayleigh_jeans_law | python | colour-science/colour | colour/colorimetry/blackbody.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/blackbody.py | BSD-3-Clause |
def sd_rayleigh_jeans(
temperature: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
) -> SpectralDistribution:
"""
Generate the spectral distribution of the planckian radiator for specified
temperature :math:`T[K]` with values in *watts per steradian per square
metre per nanometer* (:math:... |
Generate the spectral distribution of the planckian radiator for specified
temperature :math:`T[K]` with values in *watts per steradian per square
metre per nanometer* (:math:`W/sr/m^2/nm`) according to
*Rayleigh-Jeans* law.
Parameters
----------
temperature
Temperature :math:`T[K]... | sd_rayleigh_jeans | python | colour-science/colour | colour/colorimetry/blackbody.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/blackbody.py | BSD-3-Clause |
def bandpass_correction_Stearns1988(
sd: SpectralDistribution,
) -> SpectralDistribution:
"""
Perform spectral bandpass dependence correction on spectral distribution
using *Stearns and Stearns (1988)* method.
Parameters
----------
sd
Spectral distribution.
Returns
-------
... |
Perform spectral bandpass dependence correction on spectral distribution
using *Stearns and Stearns (1988)* method.
Parameters
----------
sd
Spectral distribution.
Returns
-------
:class:`colour.SpectralDistribution`
Spectral bandpass dependence corrected spectral dist... | bandpass_correction_Stearns1988 | python | colour-science/colour | colour/colorimetry/correction.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/correction.py | BSD-3-Clause |
def bandpass_correction(
sd: SpectralDistribution,
method: Literal["Stearns 1988"] | str = "Stearns 1988",
) -> SpectralDistribution:
"""
Perform spectral bandpass dependence correction on spectral distribution
using specified method.
Parameters
----------
sd
Spectral distributi... |
Perform spectral bandpass dependence correction on spectral distribution
using specified method.
Parameters
----------
sd
Spectral distribution.
method
Correction method.
Returns
-------
:class:`colour.SpectralDistribution`
Spectral bandpass dependence corr... | bandpass_correction | python | colour-science/colour | colour/colorimetry/correction.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/correction.py | BSD-3-Clause |
def closest_spectral_locus_wavelength(
xy: ArrayLike, xy_n: ArrayLike, xy_s: ArrayLike, inverse: bool = False
) -> Tuple[NDArrayInt, NDArrayFloat]:
"""
Compute the coordinates and closest spectral locus wavelength index to the
point where the line defined by the achromatic stimulus :math:`xy_n` to
c... |
Compute the coordinates and closest spectral locus wavelength index to the
point where the line defined by the achromatic stimulus :math:`xy_n` to
colour stimulus :math:`xy_n` *CIE xy* chromaticity coordinates intersects
the spectral locus.
Parameters
----------
xy
Colour stimulus ... | closest_spectral_locus_wavelength | python | colour-science/colour | colour/colorimetry/dominant.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/dominant.py | BSD-3-Clause |
def dominant_wavelength(
xy: ArrayLike,
xy_n: ArrayLike,
cmfs: MultiSpectralDistributions | None = None,
inverse: bool = False,
) -> Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]:
"""
Compute the *dominant wavelength* :math:`\\lambda_d` for colour stimulus
:math:`xy` and the related :math:... |
Compute the *dominant wavelength* :math:`\lambda_d` for colour stimulus
:math:`xy` and the related :math:`xy_wl` first and :math:`xy_{cw}` second
intersection coordinates with the spectral locus.
In the eventuality where the :math:`xy_wl` first intersection coordinates
are on the line of purples, ... | dominant_wavelength | python | colour-science/colour | colour/colorimetry/dominant.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/dominant.py | BSD-3-Clause |
def complementary_wavelength(
xy: ArrayLike,
xy_n: ArrayLike,
cmfs: MultiSpectralDistributions | None = None,
) -> Tuple[NDArrayFloat, NDArrayFloat, NDArrayFloat]:
"""
Compute the *complementary wavelength* :math:`\\lambda_c` for colour
stimulus :math:`xy` and the related :math:`xy_wl` first and... |
Compute the *complementary wavelength* :math:`\lambda_c` for colour
stimulus :math:`xy` and the related :math:`xy_wl` first and :math:`xy_{cw}`
second intersection coordinates with the spectral locus.
In the eventuality where the :math:`xy_wl` first intersection coordinates
are on the line of purp... | complementary_wavelength | python | colour-science/colour | colour/colorimetry/dominant.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/dominant.py | BSD-3-Clause |
def excitation_purity(
xy: ArrayLike,
xy_n: ArrayLike,
cmfs: MultiSpectralDistributions | None = None,
) -> NDArrayFloat:
"""
Compute the *excitation purity* :math:`P_e` for colour stimulus :math:`xy`.
Parameters
----------
xy
Colour stimulus *CIE xy* chromaticity coordinates.
... |
Compute the *excitation purity* :math:`P_e` for colour stimulus :math:`xy`.
Parameters
----------
xy
Colour stimulus *CIE xy* chromaticity coordinates.
xy_n
Achromatic stimulus *CIE xy* chromaticity coordinates.
cmfs
Standard observer colour matching functions, default ... | excitation_purity | python | colour-science/colour | colour/colorimetry/dominant.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/dominant.py | BSD-3-Clause |
def colorimetric_purity(
xy: ArrayLike,
xy_n: ArrayLike,
cmfs: MultiSpectralDistributions | None = None,
) -> NDArrayFloat:
"""
Compute the *colorimetric purity* :math:`P_c` for colour stimulus
:math:`xy`.
Parameters
----------
xy
Colour stimulus *CIE xy* chromaticity coordi... |
Compute the *colorimetric purity* :math:`P_c` for colour stimulus
:math:`xy`.
Parameters
----------
xy
Colour stimulus *CIE xy* chromaticity coordinates.
xy_n
Achromatic stimulus *CIE xy* chromaticity coordinates.
cmfs
Standard observer colour matching functions, de... | colorimetric_purity | python | colour-science/colour | colour/colorimetry/dominant.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/dominant.py | BSD-3-Clause |
def sd_constant(
k: float, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any
) -> SpectralDistribution:
"""
Generate a spectral distribution of specified spectral shape filled with
constant :math:`k` values.
Parameters
----------
k
Constant :math:`k` to fill the spectral ... |
Generate a spectral distribution of specified spectral shape filled with
constant :math:`k` values.
Parameters
----------
k
Constant :math:`k` to fill the spectral distribution with.
shape
Spectral shape used to create the spectral distribution.
Other Parameters
------... | sd_constant | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_zeros(
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any
) -> SpectralDistribution:
"""
Generate a spectral distribution of specified spectral shape filled with
zeros.
Parameters
----------
shape
Spectral shape used to create the spectral distribution.
Other P... |
Generate a spectral distribution of specified spectral shape filled with
zeros.
Parameters
----------
shape
Spectral shape used to create the spectral distribution.
Other Parameters
----------------
kwargs
{:func:`colour.sd_constant`},
See the documentation of ... | sd_zeros | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_ones(
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any
) -> SpectralDistribution:
"""
Generate a spectral distribution of specified spectral shape filled with
ones.
Parameters
----------
shape
Spectral shape used to create the spectral distribution.
Other Par... |
Generate a spectral distribution of specified spectral shape filled with
ones.
Parameters
----------
shape
Spectral shape used to create the spectral distribution.
Other Parameters
----------------
kwargs
{:func:`colour.sd_constant`},
See the documentation of t... | sd_ones | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def msds_constant(
k: float,
labels: Sequence,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> MultiSpectralDistributions:
"""
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with constant :math:`k` values.
Parameters
... |
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with constant :math:`k` values.
Parameters
----------
k
Constant :math:`k` to fill the multi-spectral distributions with.
labels
Names to use for the :class:`colour.SpectralDistribut... | msds_constant | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def msds_zeros(
labels: Sequence,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> MultiSpectralDistributions:
"""
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with zeros.
Parameters
----------
labels
Names... |
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with zeros.
Parameters
----------
labels
Names to use for the :class:`colour.SpectralDistribution` class
instances.
shape
Spectral shape used to create the multi-spectral dis... | msds_zeros | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def msds_ones(
labels: Sequence,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> MultiSpectralDistributions:
"""
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with ones.
Parameters
----------
labels
Names t... |
Generate multi-spectral distributions with specified labels and specified
spectral shape filled with ones.
Parameters
----------
labels
Names to use for the :class:`colour.SpectralDistribution` class
instances.
shape
Spectral shape used to create the multi-spectral dist... | msds_ones | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_gaussian_normal(
mu: float,
sigma: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> SpectralDistribution:
"""
Generate a gaussian spectral distribution of specified spectral shape at
specified mean wavelength :math:`\\mu` and standard deviation
:math:`sigm... |
Generate a gaussian spectral distribution of specified spectral shape at
specified mean wavelength :math:`\mu` and standard deviation
:math:`sigma`.
Parameters
----------
mu
Mean wavelength :math:`\mu` the gaussian spectral distribution will
peak at.
sigma
Standard ... | sd_gaussian_normal | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_gaussian_fwhm(
peak_wavelength: float,
fwhm: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> SpectralDistribution:
"""
Generate a gaussian spectral distribution of specified spectral shape at
specified peak wavelength and full width at half maximum.
Para... |
Generate a gaussian spectral distribution of specified spectral shape at
specified peak wavelength and full width at half maximum.
Parameters
----------
peak_wavelength
Wavelength the gaussian spectral distribution will peak at.
fwhm
Full width at half maximum, i.e., width of t... | sd_gaussian_fwhm | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_gaussian(
mu_peak_wavelength: float,
sigma_fwhm: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
method: Literal["Normal", "FWHM"] | str = "Normal",
**kwargs: Any,
) -> SpectralDistribution:
"""
Return a gaussian spectral distribution of specified spectral shape using
specif... |
Return a gaussian spectral distribution of specified spectral shape using
specified method.
Parameters
----------
mu_peak_wavelength
Mean wavelength :math:`\mu` the gaussian spectral distribution will
peak at.
sigma_fwhm
Standard deviation :math:`sigma` of the gaussian ... | sd_gaussian | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_single_led_Ohno2005(
peak_wavelength: float,
half_spectral_width: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> SpectralDistribution:
"""
Return a single *LED* spectral distribution of specified spectral shape at
specified peak wavelength and half spectral ... |
Return a single *LED* spectral distribution of specified spectral shape at
specified peak wavelength and half spectral width :math:`\Delta\lambda_{0.5}`
according to *Ohno (2005)* method.
Parameters
----------
peak_wavelength
Wavelength the single *LED* spectral distribution will peak ... | sd_single_led_Ohno2005 | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_single_led(
peak_wavelength: float,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
method: Literal["Ohno 2005"] | str = "Ohno 2005",
**kwargs: Any,
) -> SpectralDistribution:
"""
Return a single *LED* spectral distribution of specified spectral shape at
specified peak wavelength accor... |
Return a single *LED* spectral distribution of specified spectral shape at
specified peak wavelength according to specified method.
Parameters
----------
peak_wavelength
Wavelength the single *LED* spectral distribution will peak at.
shape
Spectral shape used to create the spec... | sd_single_led | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_multi_leds_Ohno2005(
peak_wavelengths: ArrayLike,
half_spectral_widths: ArrayLike,
peak_power_ratios: ArrayLike | None = None,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
**kwargs: Any,
) -> SpectralDistribution:
"""
Return a multi *LED* spectral distribution of specified spectral ... |
Return a multi *LED* spectral distribution of specified spectral shape at
specified peak wavelengths, half spectral widths :math:`\Delta\lambda_{0.5}`
and peak power ratios according to *Ohno (2005)* method.
The multi *LED* spectral distribution is generated using many single *LED*
spectral distri... | sd_multi_leds_Ohno2005 | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_multi_leds(
peak_wavelengths: ArrayLike,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
method: Literal["Ohno 2005"] | str = "Ohno 2005",
**kwargs: Any,
) -> SpectralDistribution:
"""
Return a multi *LED* spectral distribution of specified spectral shape at
specified peak wavelengths.... |
Return a multi *LED* spectral distribution of specified spectral shape at
specified peak wavelengths.
Parameters
----------
peak_wavelengths
Wavelengths the multi *LED* spectral distribution will peak at, i.e.,
the peaks for each generated single *LED* spectral distributions.
s... | sd_multi_leds | python | colour-science/colour | colour/colorimetry/generation.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/generation.py | BSD-3-Clause |
def sd_CIE_standard_illuminant_A(
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
) -> SpectralDistribution:
"""
*CIE Standard Illuminant A* is intended to represent typical, domestic,
tungsten-filament lighting.
Its spectral distribution is that of a Planckian radiator at a temperature
of appro... |
*CIE Standard Illuminant A* is intended to represent typical, domestic,
tungsten-filament lighting.
Its spectral distribution is that of a Planckian radiator at a temperature
of approximately 2856 K. *CIE Standard Illuminant A* should be used in all
applications of colorimetry involving the use of... | sd_CIE_standard_illuminant_A | python | colour-science/colour | colour/colorimetry/illuminants.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/illuminants.py | BSD-3-Clause |
def sd_CIE_illuminant_D_series(
xy: ArrayLike,
M1_M2_rounding: bool = True,
shape: SpectralShape | None = None,
) -> SpectralDistribution:
"""
Return the spectral distribution of specified *CIE Illuminant D Series* using
specified *CIE xy* chromaticity coordinates.
Parameters
----------... |
Return the spectral distribution of specified *CIE Illuminant D Series* using
specified *CIE xy* chromaticity coordinates.
Parameters
----------
xy
*CIE xy* chromaticity coordinates.
M1_M2_rounding
Whether to round :math:`M1` and :math:`M2` variables to 3 decimal
places... | sd_CIE_illuminant_D_series | python | colour-science/colour | colour/colorimetry/illuminants.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/illuminants.py | BSD-3-Clause |
def daylight_locus_function(x_D: ArrayLike) -> NDArrayFloat:
"""
Return the daylight locus as *CIE xy* chromaticity coordinates.
Parameters
----------
x_D
Chromaticity coordinate :math:`x_D`.
Returns
-------
:class:`numpy.ndarray`
Daylight locus as *CIE xy* chromaticity... |
Return the daylight locus as *CIE xy* chromaticity coordinates.
Parameters
----------
x_D
Chromaticity coordinate :math:`x_D`.
Returns
-------
:class:`numpy.ndarray`
Daylight locus as *CIE xy* chromaticity coordinates.
References
----------
:cite:`Wyszecki2000... | daylight_locus_function | python | colour-science/colour | colour/colorimetry/illuminants.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/illuminants.py | BSD-3-Clause |
def mesopic_weighting_function(
wavelength: ArrayLike,
L_p: float,
source: Literal["Blue Heavy", "Red Heavy"] | str = "Blue Heavy",
method: Literal["MOVE", "LRC"] | str = "MOVE",
photopic_lef: SpectralDistribution | None = None,
scotopic_lef: SpectralDistribution | None = None,
) -> NDArrayFloat... |
Calculate the mesopic weighting function factor :math:`V_m` at specified
wavelength :math:`\lambda` using the photopic luminance :math:`L_p`.
Parameters
----------
wavelength
Wavelength :math:`\lambda` to calculate the mesopic weighting function
factor.
L_p
Photopic lum... | mesopic_weighting_function | python | colour-science/colour | colour/colorimetry/lefs.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lefs.py | BSD-3-Clause |
def sd_mesopic_luminous_efficiency_function(
L_p: float,
source: Literal["Blue Heavy", "Red Heavy"] | str = "Blue Heavy",
method: Literal["MOVE", "LRC"] | str = "MOVE",
photopic_lef: SpectralDistribution | None = None,
scotopic_lef: SpectralDistribution | None = None,
) -> SpectralDistribution:
... |
Return the mesopic luminous efficiency function :math:`V_m(\lambda)` for
specified photopic luminance :math:`L_p`.
Parameters
----------
L_p
Photopic luminance :math:`L_p`.
source
Light source colour temperature.
method
Method to calculate the weighting factor.
... | sd_mesopic_luminous_efficiency_function | python | colour-science/colour | colour/colorimetry/lefs.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lefs.py | BSD-3-Clause |
def lightness_Glasser1958(Y: ArrayLike) -> NDArrayFloat:
"""
Compute the *Lightness* :math:`L` of specified *luminance* :math:`Y` using
*Glasser et al. (1958)* method.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*Lightness* ... |
Compute the *Lightness* :math:`L` of specified *luminance* :math:`Y` using
*Glasser et al. (1958)* method.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*Lightness* :math:`L`.
Notes
-----
+------------+--------------... | lightness_Glasser1958 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness_Wyszecki1963(Y: ArrayLike) -> NDArrayFloat:
"""
Compute the *Lightness* :math:`W` of specified *luminance* :math:`Y` using
*Wyszecki (1963)* method.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*Lightness* :mat... |
Compute the *Lightness* :math:`W` of specified *luminance* :math:`Y` using
*Wyszecki (1963)* method.
Parameters
----------
Y
*Luminance* :math:`Y`.
Returns
-------
:class:`numpy.ndarray`
*Lightness* :math:`W`.
Notes
-----
+------------+-------------------... | lightness_Wyszecki1963 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def intermediate_lightness_function_CIE1976(
Y: ArrayLike, Y_n: ArrayLike = 100
) -> NDArrayFloat:
"""
Compute the intermediate value :math:`f(Y/Yn)` in the *Lightness*
:math:`L^*` computation for specified *luminance* :math:`Y` using specified
reference white *luminance* :math:`Y_n` as per *CIE 197... |
Compute the intermediate value :math:`f(Y/Yn)` in the *Lightness*
:math:`L^*` computation for specified *luminance* :math:`Y` using specified
reference white *luminance* :math:`Y_n` as per *CIE 1976* recommendation.
Parameters
----------
Y
*Luminance* :math:`Y`.
Y_n
White r... | intermediate_lightness_function_CIE1976 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness_CIE1976(Y: ArrayLike, Y_n: ArrayLike = 100) -> NDArrayFloat:
"""
Compute the *Lightness* :math:`L^*` of specified *luminance* :math:`Y` using
specified reference white *luminance* :math:`Y_n` as per *CIE 1976*
recommendation.
Parameters
----------
Y
*Luminance* :math:`... |
Compute the *Lightness* :math:`L^*` of specified *luminance* :math:`Y` using
specified reference white *luminance* :math:`Y_n` as per *CIE 1976*
recommendation.
Parameters
----------
Y
*Luminance* :math:`Y`.
Y_n
White reference *luminance* :math:`Y_n`.
Returns
----... | lightness_CIE1976 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness_Fairchild2010(Y: ArrayLike, epsilon: ArrayLike = 1.836) -> NDArrayFloat:
"""
Compute *Lightness* :math:`L_{hdr}` of specified *luminance* :math:`Y` using
*Fairchild and Wyble (2010)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
Y
*Luminance* :... |
Compute *Lightness* :math:`L_{hdr}` of specified *luminance* :math:`Y` using
*Fairchild and Wyble (2010)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
Y
*Luminance* :math:`Y`.
epsilon
:math:`\epsilon` exponent.
Returns
-------
:class:`... | lightness_Fairchild2010 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness_Fairchild2011(
Y: ArrayLike,
epsilon: ArrayLike = 0.474,
method: Literal["hdr-CIELAB", "hdr-IPT"] | str = "hdr-CIELAB",
) -> NDArrayFloat:
"""
Compute *Lightness* :math:`L_{hdr}` of specified *luminance* :math:`Y` using
*Fairchild and Chen (2011)* method according to *Michaelis-Men... |
Compute *Lightness* :math:`L_{hdr}` of specified *luminance* :math:`Y` using
*Fairchild and Chen (2011)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
Y
*Luminance* :math:`Y`.
epsilon
:math:`\epsilon` exponent.
method
*Lightness* :math:`... | lightness_Fairchild2011 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness_Abebe2017(
Y: ArrayLike,
Y_n: ArrayLike = 100,
method: Literal["Michaelis-Menten", "Stevens"] | str = "Michaelis-Menten",
) -> NDArrayFloat:
"""
Compute *Lightness* :math:`L` of specified *luminance* :math:`Y` using
*Abebe, Pouli, Larabi and Reinhard (2017)* method according to
... |
Compute *Lightness* :math:`L` of specified *luminance* :math:`Y` using
*Abebe, Pouli, Larabi and Reinhard (2017)* method according to
*Michaelis-Menten* kinetics or *Stevens's Power Law*.
Parameters
----------
Y
*Luminance* :math:`Y` in :math:`cd/m^2`.
Y_n
Adapting luminanc... | lightness_Abebe2017 | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def lightness(
Y: ArrayLike,
method: (
Literal[
"Abebe 2017",
"CIE 1976",
"Glasser 1958",
"Fairchild 2010",
"Fairchild 2011",
"Wyszecki 1963",
]
| str
) = "CIE 1976",
**kwargs: Any,
) -> NDArrayFloat:
"""... |
Compute the *Lightness* :math:`L` of specified *luminance* :math:`Y` using
specified method.
Parameters
----------
Y
*Luminance* :math:`Y`.
method
Computation method.
Other Parameters
----------------
Y_n
{:func:`colour.colorimetry.lightness_Abebe2017`,
... | lightness | python | colour-science/colour | colour/colorimetry/lightness.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/lightness.py | BSD-3-Clause |
def luminance_Newhall1943(V: ArrayLike) -> NDArrayFloat:
"""
Compute the *luminance* :math:`R_Y` of specified *Munsell* value :math:`V`
using *Newhall et al. (1943)* method.
Parameters
----------
V
*Munsell* value :math:`V`.
Returns
-------
:class:`numpy.ndarray`
*L... |
Compute the *luminance* :math:`R_Y` of specified *Munsell* value :math:`V`
using *Newhall et al. (1943)* method.
Parameters
----------
V
*Munsell* value :math:`V`.
Returns
-------
:class:`numpy.ndarray`
*Luminance* :math:`R_Y`.
Notes
-----
+------------+--... | luminance_Newhall1943 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance_ASTMD1535(V: ArrayLike) -> NDArrayFloat:
"""
Compute the *luminance* :math:`Y` of specified *Munsell* value :math:`V` using
*ASTM D1535-08e1* method.
Parameters
----------
V
*Munsell* value :math:`V`.
Returns
-------
:class:`numpy.ndarray`
*Luminance* ... |
Compute the *luminance* :math:`Y` of specified *Munsell* value :math:`V` using
*ASTM D1535-08e1* method.
Parameters
----------
V
*Munsell* value :math:`V`.
Returns
-------
:class:`numpy.ndarray`
*Luminance* :math:`Y`.
Notes
-----
+------------+------------... | luminance_ASTMD1535 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def intermediate_luminance_function_CIE1976(
f_Y_Y_n: ArrayLike, Y_n: ArrayLike = 100
) -> NDArrayFloat:
"""
Compute the *luminance* :math:`Y` in the *luminance* :math:`Y`
computation for specified intermediate value :math:`f(Y/Yn)` using specified
reference white *luminance* :math:`Y_n` as per *CIE... |
Compute the *luminance* :math:`Y` in the *luminance* :math:`Y`
computation for specified intermediate value :math:`f(Y/Yn)` using specified
reference white *luminance* :math:`Y_n` as per *CIE 1976* recommendation.
Parameters
----------
f_Y_Y_n
Intermediate value :math:`f(Y/Yn)`.
Y_... | intermediate_luminance_function_CIE1976 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance_CIE1976(L_star: ArrayLike, Y_n: ArrayLike = 100) -> NDArrayFloat:
"""
Compute the *luminance* :math:`Y` of specified *Lightness* :math:`L^*` with
specified reference white *luminance* :math:`Y_n`.
Parameters
----------
L_star
*Lightness* :math:`L^*`
Y_n
White r... |
Compute the *luminance* :math:`Y` of specified *Lightness* :math:`L^*` with
specified reference white *luminance* :math:`Y_n`.
Parameters
----------
L_star
*Lightness* :math:`L^*`
Y_n
White reference *luminance* :math:`Y_n`.
Returns
-------
:class:`numpy.ndarray`
... | luminance_CIE1976 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance_Fairchild2010(
L_hdr: ArrayLike, epsilon: ArrayLike = 1.836
) -> NDArrayFloat:
"""
Compute *luminance* :math:`Y` of specified *Lightness* :math:`L_{hdr}` using
*Fairchild and Wyble (2010)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
L_hdr
... |
Compute *luminance* :math:`Y` of specified *Lightness* :math:`L_{hdr}` using
*Fairchild and Wyble (2010)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
L_hdr
*Lightness* :math:`L_{hdr}`.
epsilon
:math:`\epsilon` exponent.
Returns
-------
... | luminance_Fairchild2010 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance_Fairchild2011(
L_hdr: ArrayLike,
epsilon: ArrayLike = 0.474,
method: Literal["hdr-CIELAB", "hdr-IPT"] | str = "hdr-CIELAB",
) -> NDArrayFloat:
"""
Compute *luminance* :math:`Y` of specified *Lightness* :math:`L_{hdr}` using
*Fairchild and Chen (2011)* method according to *Michaelis... |
Compute *luminance* :math:`Y` of specified *Lightness* :math:`L_{hdr}` using
*Fairchild and Chen (2011)* method according to *Michaelis-Menten*
kinetics.
Parameters
----------
L_hdr
*Lightness* :math:`L_{hdr}`.
epsilon
:math:`\epsilon` exponent.
method
*Lightnes... | luminance_Fairchild2011 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance_Abebe2017(
L: ArrayLike,
Y_n: ArrayLike = 100,
method: Literal["Michaelis-Menten", "Stevens"] | str = "Michaelis-Menten",
) -> NDArrayFloat:
"""
Compute *luminance* :math:`Y` of *Lightness* :math:`L` using
*Abebe, Pouli, Larabi and Reinhard (2017)* method according to
*Michaeli... |
Compute *luminance* :math:`Y` of *Lightness* :math:`L` using
*Abebe, Pouli, Larabi and Reinhard (2017)* method according to
*Michaelis-Menten* kinetics or *Stevens's Power Law*.
Parameters
----------
L
*Lightness* :math:`L`.
Y_n
Adapting luminance :math:`Y_n` in :math:`cd/m... | luminance_Abebe2017 | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminance(
LV: ArrayLike,
method: (
Literal[
"Abebe 2017",
"CIE 1976",
"Glasser 1958",
"Fairchild 2010",
"Fairchild 2011",
"Wyszecki 1963",
]
| str
) = "CIE 1976",
**kwargs: Any,
) -> NDArrayFloat:
""... |
Compute the *luminance* :math:`Y` of specified *Lightness* :math:`L^*` or specified
*Munsell* value :math:`V`.
Parameters
----------
LV
*Lightness* :math:`L^*` or *Munsell* value :math:`V`.
method
Computation method.
Other Parameters
----------------
Y_n
{:... | luminance | python | colour-science/colour | colour/colorimetry/luminance.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/luminance.py | BSD-3-Clause |
def luminous_flux(
sd: SpectralDistribution,
lef: SpectralDistribution | None = None,
K_m: float = CONSTANT_K_M,
) -> float:
"""
Compute the *luminous flux* for specified spectral distribution using specified
luminous efficiency function.
Parameters
----------
sd
test spectr... |
Compute the *luminous flux* for specified spectral distribution using specified
luminous efficiency function.
Parameters
----------
sd
test spectral distribution
lef
:math:`V(\lambda)` luminous efficiency function, default to the
*CIE 1924 Photopic Standard Observer*.
... | luminous_flux | python | colour-science/colour | colour/colorimetry/photometry.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/photometry.py | BSD-3-Clause |
def luminous_efficiency(
sd: SpectralDistribution, lef: SpectralDistribution | None = None
) -> float:
"""
Compute the *luminous efficiency* of specified spectral distribution using
specified luminous efficiency function.
Parameters
----------
sd
test spectral distribution
lef
... |
Compute the *luminous efficiency* of specified spectral distribution using
specified luminous efficiency function.
Parameters
----------
sd
test spectral distribution
lef
:math:`V(\lambda)` luminous efficiency function, default to the
*CIE 1924 Photopic Standard Observe... | luminous_efficiency | python | colour-science/colour | colour/colorimetry/photometry.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/photometry.py | BSD-3-Clause |
def luminous_efficacy(
sd: SpectralDistribution, lef: SpectralDistribution | None = None
) -> float:
"""
Compute the *luminous efficacy* in :math:`lm\\cdot W^{-1}` of specified
spectral distribution using specified luminous efficiency function.
Parameters
----------
sd
test spectral... |
Compute the *luminous efficacy* in :math:`lm\cdot W^{-1}` of specified
spectral distribution using specified luminous efficiency function.
Parameters
----------
sd
test spectral distribution
lef
:math:`V(\lambda)` luminous efficiency function, default to the
*CIE 1924 P... | luminous_efficacy | python | colour-science/colour | colour/colorimetry/photometry.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/photometry.py | BSD-3-Clause |
def start(self, value: Real) -> None:
"""Setter for the **self.start** property."""
attest(
is_numeric(value),
f'"start" property: "{value}" is not a "number"!',
)
attest(
bool(value < self._end),
f'"start" attribute value must be strictl... | Setter for the **self.start** property. | start | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def end(self, value: Real) -> None:
"""Setter for the **self.end** property."""
attest(
is_numeric(value),
f'"end" property: "{value}" is not a "number"!',
)
attest(
bool(value > self._start),
f'"end" attribute value must be strictly grea... | Setter for the **self.end** property. | end | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def interval(self, value: Real) -> None:
"""Setter for the **self.interval** property."""
attest(
is_numeric(value),
f'"interval" property: "{value}" is not a "number"!',
)
self._interval = value | Setter for the **self.interval** property. | interval | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def boundaries(self, value: ArrayLike) -> None:
"""Setter for the **self.boundaries** property."""
value = np.asarray(value)
attest(
value.size == 2,
f'"boundaries" property: "{value}" must have exactly two elements!',
)
self.start, self.end = value | Setter for the **self.boundaries** property. | boundaries | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def __contains__(self, wavelength: ArrayLike) -> bool:
"""
Return if the spectral shape contains specified wavelength
:math:`\\lambda`.
Parameters
----------
wavelength
Wavelength :math:`\\lambda`.
Returns
-------
:class:`bool`
... |
Return if the spectral shape contains specified wavelength
:math:`\lambda`.
Parameters
----------
wavelength
Wavelength :math:`\lambda`.
Returns
-------
:class:`bool`
Whether wavelength :math:`\lambda` is contained in the spectra... | __contains__ | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def __eq__(self, other: object) -> bool:
"""
Return whether the spectral shape is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the spectral shape.
Returns
-------
:class:`bool`
... |
Return whether the spectral shape is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the spectral shape.
Returns
-------
:class:`bool`
Whether specified object is equal to the spectral s... | __eq__ | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def range(self, dtype: Type[DTypeFloat] | None = None) -> NDArrayFloat:
"""
Return an iterable range for the spectral shape.
Parameters
----------
dtype
Data type used to generate the range.
Returns
-------
:class:`numpy.ndarray`
... |
Return an iterable range for the spectral shape.
Parameters
----------
dtype
Data type used to generate the range.
Returns
-------
:class:`numpy.ndarray`
Iterable range for the spectral distribution shape
Examples
------... | range | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def _on_domain_changed(
sd: SpectralDistribution, name: str, value: NDArrayFloat
) -> NDArrayFloat:
"""Invalidate *sd._shape* when *sd._domain* is changed."""
if name == "_domain":
sd._shape = None # noqa: SLF001
return value | Invalidate *sd._shape* when *sd._domain* is changed. | _on_domain_changed | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def shape(self) -> SpectralShape:
"""
Getter property for the spectral distribution shape.
Returns
-------
:class:`colour.SpectralShape`
Spectral distribution shape.
Notes
-----
- A spectral distribution with a non-uniformly spaced independ... |
Getter property for the spectral distribution shape.
Returns
-------
:class:`colour.SpectralShape`
Spectral distribution shape.
Notes
-----
- A spectral distribution with a non-uniformly spaced independent
variable have multiple interv... | shape | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def interpolate(
self,
shape: SpectralShape,
interpolator: Type[ProtocolInterpolator] | None = None,
interpolator_kwargs: dict | None = None,
) -> Self:
"""
Interpolate the spectral distribution in-place according to
*CIE 167:2005* recommendation (if the inter... |
Interpolate the spectral distribution in-place according to
*CIE 167:2005* recommendation (if the interpolator has not been changed
at instantiation time) or specified interpolation arguments.
The logic for choosing the interpolator class when ``interpolator`` is
not specified ... | interpolate | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def extrapolate(
self,
shape: SpectralShape,
extrapolator: Type[ProtocolExtrapolator] | None = None,
extrapolator_kwargs: dict | None = None,
) -> Self:
"""
Extrapolate the spectral distribution in-place according to
*CIE 15:2004* and *CIE 167:2005* recommenda... |
Extrapolate the spectral distribution in-place according to
*CIE 15:2004* and *CIE 167:2005* recommendations or specified extrapolation
arguments.
Parameters
----------
shape
Spectral shape used for extrapolation.
extrapolator
Extrapolato... | extrapolate | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def align(
self,
shape: SpectralShape,
interpolator: Type[ProtocolInterpolator] | None = None,
interpolator_kwargs: dict | None = None,
extrapolator: Type[ProtocolExtrapolator] | None = None,
extrapolator_kwargs: dict | None = None,
) -> Self:
"""
Alig... |
Align the spectral distribution in-place to specified spectral shape:
Interpolates first then extrapolates to fit the specified range.
Interpolation is performed according to *CIE 167:2005* recommendation
(if the interpolator has not been changed at instantiation time) or
speci... | align | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def trim(self, shape: SpectralShape) -> Self:
"""
Trim the spectral distribution wavelengths to specified spectral shape.
Parameters
----------
shape
Spectral shape used for trimming.
Returns
-------
:class:`colour.SpectralDistribution`
... |
Trim the spectral distribution wavelengths to specified spectral shape.
Parameters
----------
shape
Spectral shape used for trimming.
Returns
-------
:class:`colour.SpectralDistribution`
Trimmed spectral distribution.
Examples
... | trim | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def normalise(self, factor: Real = 1) -> Self:
"""
Normalise the spectral distribution using specified normalization factor.
Parameters
----------
factor
Normalization factor.
Returns
-------
:class:`colour.SpectralDistribution`
N... |
Normalise the spectral distribution using specified normalization factor.
Parameters
----------
factor
Normalization factor.
Returns
-------
:class:`colour.SpectralDistribution`
Normalised spectral distribution.
Examples
... | normalise | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def interpolate(
self,
shape: SpectralShape,
interpolator: Type[ProtocolInterpolator] | None = None,
interpolator_kwargs: dict | None = None,
) -> Self:
"""
Interpolate the multi-spectral distributions in-place according to
*CIE 167:2005* recommendation (if th... |
Interpolate the multi-spectral distributions in-place according to
*CIE 167:2005* recommendation (if the interpolator has not been changed
at instantiation time) or specified interpolation arguments.
The logic for choosing the interpolator class when ``interpolator`` is
not spe... | interpolate | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def extrapolate(
self,
shape: SpectralShape,
extrapolator: Type[ProtocolExtrapolator] | None = None,
extrapolator_kwargs: dict | None = None,
) -> Self:
"""
Extrapolate the multi-spectral distributions in-place according to
*CIE 15:2004* and *CIE 167:2005* rec... |
Extrapolate the multi-spectral distributions in-place according to
*CIE 15:2004* and *CIE 167:2005* recommendations or specified extrapolation
arguments.
Parameters
----------
shape
Spectral shape used for extrapolation.
extrapolator
Extr... | extrapolate | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def align(
self,
shape: SpectralShape,
interpolator: Type[ProtocolInterpolator] | None = None,
interpolator_kwargs: dict | None = None,
extrapolator: Type[ProtocolExtrapolator] | None = None,
extrapolator_kwargs: dict | None = None,
) -> Self:
"""
Alig... |
Align the multi-spectral distributions in-place to specified spectral
shape: Interpolates first then extrapolates to fit the specified range.
Interpolation is performed according to *CIE 167:2005* recommendation
(if the interpolator has not been changed at instantiation time) or
... | align | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def trim(self, shape: SpectralShape) -> Self:
"""
Trim the multi-spectral distributions wavelengths to specified shape.
Parameters
----------
shape
Spectral shape used for trimming.
Returns
-------
:class:`colour.MultiSpectralDistributions`
... |
Trim the multi-spectral distributions wavelengths to specified shape.
Parameters
----------
shape
Spectral shape used for trimming.
Returns
-------
:class:`colour.MultiSpectralDistributions`
Trimmed multi-spectral distributions.
... | trim | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def normalise(self, factor: Real = 1) -> Self:
"""
Normalise the multi-spectral distributions with specified normalization
factor.
Parameters
----------
factor
Normalization factor.
Returns
-------
:class:`colour.MultiSpectralDistribu... |
Normalise the multi-spectral distributions with specified normalization
factor.
Parameters
----------
factor
Normalization factor.
Returns
-------
:class:`colour.MultiSpectralDistributions`
Normalised multi- spectral distribution... | normalise | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def to_sds(self) -> List[SpectralDistribution]:
"""
Convert the multi-spectral distributions to a list of spectral
distributions.
Returns
-------
:class:`list`
List of spectral distributions.
Examples
--------
>>> from colour.utilitie... |
Convert the multi-spectral distributions to a list of spectral
distributions.
Returns
-------
:class:`list`
List of spectral distributions.
Examples
--------
>>> from colour.utilities import numpy_print_options
>>> data = {
.... | to_sds | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def reshape_sd(
sd: TypeSpectralDistribution,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
method: (Literal["Align", "Extrapolate", "Interpolate", "Trim"] | str) = "Align",
copy: bool = True,
**kwargs: Any,
) -> TypeSpectralDistribution:
"""
Reshape specified spectral distribution with spe... |
Reshape specified spectral distribution with specified spectral shape.
The reshaped object is cached, thus another call to the definition with the
same arguments will yield the cached object immediately.
Parameters
----------
sd
Spectral distribution to reshape.
shape
Spec... | reshape_sd | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
def reshape_msds(
msds: TypeMultiSpectralDistributions,
shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
method: (Literal["Align", "Extrapolate", "Interpolate", "Trim"] | str) = "Align",
copy: bool = True,
**kwargs: Any,
) -> TypeMultiSpectralDistributions:
"""
Reshape specified multi-spectral... |
Reshape specified multi-spectral distributions with specified spectral shape.
The reshaped object is cached, thus another call to the definition with the
same arguments will yield the cached object immediately.
Parameters
----------
msds
Spectral distribution to reshape.
shape
... | reshape_msds | python | colour-science/colour | colour/colorimetry/spectrum.py | https://github.com/colour-science/colour/blob/master/colour/colorimetry/spectrum.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.