コード例 #1
0
ファイル: jakob2019.py プロジェクト: colour-science/colour
def sd_Jakob2019(
    coefficients: ArrayLike, shape: SpectralShape = SPECTRAL_SHAPE_JAKOB2019
) -> SpectralDistribution:
    """
    Return a spectral distribution following the spectral model given by
    *Jakob and Hanika (2019)*.

    Parameters
    ----------
    coefficients
        Dimensionless coefficients for *Jakob and Hanika (2019)* reflectance
        spectral model.
    shape
        Shape used by the spectral distribution.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        *Jakob and Hanika (2019)* spectral distribution.

    References
    ----------
    :cite:`Jakob2019`

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_Jakob2019([-9e-05, 8.5e-02, -20], SpectralShape(400, 700, 20))
    ...     # doctest: +ELLIPSIS
    SpectralDistribution([[ 400.        ,    0.3143046...],
                          [ 420.        ,    0.4133320...],
                          [ 440.        ,    0.4880034...],
                          [ 460.        ,    0.5279562...],
                          [ 480.        ,    0.5319346...],
                          [ 500.        ,    0.5      ...],
                          [ 520.        ,    0.4326202...],
                          [ 540.        ,    0.3373544...],
                          [ 560.        ,    0.2353056...],
                          [ 580.        ,    0.1507665...],
                          [ 600.        ,    0.0931332...],
                          [ 620.        ,    0.0577434...],
                          [ 640.        ,    0.0367011...],
                          [ 660.        ,    0.0240879...],
                          [ 680.        ,    0.0163316...],
                          [ 700.        ,    0.0114118...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    c_0, c_1, c_2 = as_float_array(coefficients)
    wl = shape.range()
    U = c_0 * wl**2 + c_1 * wl + c_2
    R = 1 / 2 + U / (2 * np.sqrt(1 + U**2))

    name = f"{coefficients!r} (COEFF) - Jakob (2019)"

    return SpectralDistribution(R, wl, name=name)
コード例 #2
0
def msds_constant(
    k: Floating,
    labels: Sequence,
    shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
    **kwargs: Any,
) -> MultiSpectralDistributions:
    """
    Return the multi-spectral distributions with given labels and given
    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.SpectralDistribution` class
        instances.
    shape
        Spectral shape used to create the multi-spectral distributions.

    Other Parameters
    ----------------
    kwargs
        {:class:`colour.MultiSpectralDistributions`},
        See the documentation of the previously listed class.

    Returns
    -------
    :class:`colour.MultiSpectralDistributions`
        Constant :math:`k` filled multi-spectral distributions.

    Notes
    -----
    -   By default, the multi-spectral distributions will use the shape given
        by :attr:`colour.SPECTRAL_SHAPE_DEFAULT` attribute.

    Examples
    --------
    >>> msds = msds_constant(100, labels=['a', 'b', 'c'])
    >>> msds.shape
    SpectralShape(360.0, 780.0, 1.0)
    >>> msds[400]
    array([ 100.,  100.,  100.])
    >>> msds.labels  # doctest: +SKIP
    ['a', 'b', 'c']
    """

    settings = {"name": f"{k} Constant"}
    settings.update(kwargs)

    wavelengths = shape.range()
    values = full((len(wavelengths), len(labels)), k)

    return MultiSpectralDistributions(values,
                                      wavelengths,
                                      labels=labels,
                                      **settings)
コード例 #3
0
ファイル: lefs.py プロジェクト: crowsonkb/colour
def mesopic_luminous_efficiency_function(
        Lp,
        source='Blue Heavy',
        method='MOVE',
        photopic_lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
        scotopic_lef=SCOTOPIC_LEFS['CIE 1951 Scotopic Standard Observer']):
    """
    Returns the mesopic luminous efficiency function :math:`V_m(\lambda)` for
    given photopic luminance :math:`L_p`.

    Parameters
    ----------
    Lp : numeric
        Photopic luminance :math:`L_p`.
    source : unicode, optional
        **{'Blue Heavy', 'Red Heavy'}**,
        Light source colour temperature.
    method : unicode, optional
        **{'MOVE', 'LRC'}**,
        Method to calculate the weighting factor.
    photopic_lef : SpectralPowerDistribution, optional
        :math:`V(\lambda)` photopic luminous efficiency function.
    scotopic_lef : SpectralPowerDistribution, optional
        :math:`V^\prime(\lambda)` scotopic luminous efficiency function.

    Returns
    -------
    SpectralPowerDistribution
        Mesopic luminous efficiency function :math:`V_m(\lambda)`.

    Examples
    --------
    >>> print(mesopic_luminous_efficiency_function(0.2))
    SpectralPowerDistribution(\
'0.2 Lp Mesopic Luminous Efficiency Function', (380.0, 780.0, 1.0))
    """

    photopic_lef_shape = photopic_lef.shape
    scotopic_lef_shape = scotopic_lef.shape
    shape = SpectralShape(
        max(photopic_lef_shape.start, scotopic_lef_shape.start),
        min(photopic_lef_shape.end, scotopic_lef_shape.end),
        max(photopic_lef_shape.interval, scotopic_lef_shape.interval))

    wavelengths = shape.range()

    spd_data = dict(
        zip(
            wavelengths,
            mesopic_weighting_function(wavelengths, Lp, source, method,
                                       photopic_lef, scotopic_lef)))

    spd = SpectralPowerDistribution(
        '{0} Lp Mesopic Luminous Efficiency Function'.format(Lp), spd_data)

    return spd.normalise()
コード例 #4
0
def sd_gaussian_fwhm(
    peak_wavelength: Floating,
    fwhm: Floating,
    shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
    **kwargs: Any,
) -> SpectralDistribution:
    """
    Return a gaussian spectral distribution of given spectral shape at given
    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 the gaussian spectral
        distribution measured between those points on the *y* axis which are
        half the maximum amplitude.
    shape
        Spectral shape used to create the spectral distribution.

    Other Parameters
    ----------------
    kwargs
        {:class:`colour.SpectralDistribution`},
        See the documentation of the previously listed class.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        Gaussian spectral distribution.

    Notes
    -----
    -   By default, the spectral distribution will use the shape given by
        :attr:`colour.SPECTRAL_SHAPE_DEFAULT` attribute.

    Examples
    --------
    >>> sd = sd_gaussian_fwhm(555, 25)
    >>> sd.shape
    SpectralShape(360.0, 780.0, 1.0)
    >>> sd[555]
    1.0
    >>> sd[530]  # doctest: +ELLIPSIS
    0.3678794...
    """

    settings = {"name": f"{peak_wavelength}nm - {fwhm} FWHM - Gaussian"}
    settings.update(kwargs)

    wavelengths = shape.range()

    values = np.exp(-(((wavelengths - peak_wavelength) / fwhm)**2))

    return SpectralDistribution(values, wavelengths, **settings)
コード例 #5
0
def sd_gaussian_normal(
    mu: Floating,
    sigma: Floating,
    shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
    **kwargs: Any,
) -> SpectralDistribution:
    """
    Return a gaussian spectral distribution of given spectral shape at
    given mean wavelength :math:`\\mu` and standard deviation :math:`sigma`.

    Parameters
    ----------
    mu
        Mean wavelength :math:`\\mu` the gaussian spectral distribution will
        peak at.
    sigma
        Standard deviation :math:`sigma` of the gaussian spectral distribution.
    shape
        Spectral shape used to create the spectral distribution.

    Other Parameters
    ----------------
    kwargs
        {:class:`colour.SpectralDistribution`},
        See the documentation of the previously listed class.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        Gaussian spectral distribution.

    Notes
    -----
    -   By default, the spectral distribution will use the shape given by
        :attr:`colour.SPECTRAL_SHAPE_DEFAULT` attribute.

    Examples
    --------
    >>> sd = sd_gaussian_normal(555, 25)
    >>> sd.shape
    SpectralShape(360.0, 780.0, 1.0)
    >>> sd[555]  # doctest: +ELLIPSIS
    1.0000000...
    >>> sd[530]  # doctest: +ELLIPSIS
    0.6065306...
    """

    settings = {"name": f"{mu}nm - {sigma} Sigma - Gaussian"}
    settings.update(kwargs)

    wavelengths = shape.range()

    values = np.exp(-((wavelengths - mu)**2) / (2 * sigma**2))

    return SpectralDistribution(values, wavelengths, **settings)
コード例 #6
0
ファイル: lefs.py プロジェクト: gitter-badger/colour
def mesopic_luminous_efficiency_function(
    Lp,
    source="Blue Heavy",
    method="MOVE",
    photopic_lef=PHOTOPIC_LEFS.get("CIE 1924 Photopic Standard Observer"),
    scotopic_lef=SCOTOPIC_LEFS.get("CIE 1951 Scotopic Standard Observer"),
):
    """
    Returns the mesopic luminous efficiency function :math:`V_m(\lambda)` for
    given photopic luminance :math:`L_p`.

    Parameters
    ----------
    Lp : numeric
        Photopic luminance :math:`L_p`.
    source : unicode, optional
        **{'Blue Heavy', 'Red Heavy'}**,
        Light source colour temperature.
    method : unicode, optional
        **{'MOVE', 'LRC'}**,
        Method to calculate the weighting factor.
    photopic_lef : SpectralPowerDistribution, optional
        :math:`V(\lambda)` photopic luminous efficiency function.
    scotopic_lef : SpectralPowerDistribution, optional
        :math:`V^\prime(\lambda)` scotopic luminous efficiency function.

    Returns
    -------
    SpectralPowerDistribution
        Mesopic luminous efficiency function :math:`V_m(\lambda)`.

    Examples
    --------
    >>> mesopic_luminous_efficiency_function(0.2)  # doctest: +ELLIPSIS
    <colour.colorimetry.spectrum.SpectralPowerDistribution object at 0x...>
    """

    photopic_lef_shape = photopic_lef.shape
    scotopic_lef_shape = scotopic_lef.shape
    shape = SpectralShape(
        max(photopic_lef_shape.start, scotopic_lef_shape.start),
        min(photopic_lef_shape.end, scotopic_lef_shape.end),
        max(photopic_lef_shape.steps, scotopic_lef_shape.steps),
    )

    wavelengths = shape.range()

    spd_data = dict(
        zip(wavelengths, mesopic_weighting_function(wavelengths, Lp, source, method, photopic_lef, scotopic_lef))
    )

    spd = SpectralPowerDistribution("{0} Lp Mesopic Luminous Efficiency Function".format(Lp), spd_data)

    return spd.normalise()
コード例 #7
0
def sd_constant(k: Floating,
                shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
                **kwargs: Any) -> SpectralDistribution:
    """
    Return a spectral distribution of given 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
    ----------------
    kwargs
        {:class:`colour.SpectralDistribution`},
        See the documentation of the previously listed class.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        Constant :math:`k` filled spectral distribution.

    Notes
    -----
    -   By default, the spectral distribution will use the shape given by
        :attr:`colour.SPECTRAL_SHAPE_DEFAULT` attribute.

    Examples
    --------
    >>> sd = sd_constant(100)
    >>> sd.shape
    SpectralShape(360.0, 780.0, 1.0)
    >>> sd[400]
    100.0
    """

    settings = {"name": f"{k} Constant"}
    settings.update(kwargs)

    wavelengths = shape.range()
    values = full(len(wavelengths), k)

    return SpectralDistribution(values, wavelengths, **settings)
コード例 #8
0
ファイル: lefs.py プロジェクト: wenh06/colour
def sd_mesopic_luminous_efficiency_function(
        Lp,
        source='Blue Heavy',
        method='MOVE',
        photopic_lef=SDS_LEFS_PHOTOPIC['CIE 1924 Photopic Standard Observer'],
        scotopic_lef=SDS_LEFS_SCOTOPIC['CIE 1951 Scotopic Standard Observer']):
    """
    Returns the mesopic luminous efficiency function :math:`V_m(\\lambda)` for
    given photopic luminance :math:`L_p`.

    Parameters
    ----------
    Lp : numeric
        Photopic luminance :math:`L_p`.
    source : unicode, optional
        **{'Blue Heavy', 'Red Heavy'}**,
        Light source colour temperature.
    method : unicode, optional
        **{'MOVE', 'LRC'}**,
        Method to calculate the weighting factor.
    photopic_lef : SpectralDistribution, optional
        :math:`V(\\lambda)` photopic luminous efficiency function.
    scotopic_lef : SpectralDistribution, optional
        :math:`V^\\prime(\\lambda)` scotopic luminous efficiency function.

    Returns
    -------
    SpectralDistribution
        Mesopic luminous efficiency function :math:`V_m(\\lambda)`.

    References
    ----------
    :cite:`Wikipedia2005d`

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_mesopic_luminous_efficiency_function(0.2)  # doctest: +ELLIPSIS
    SpectralDistribution([[ 380.        ,    0.000424 ...],
                          [ 381.        ,    0.0004781...],
                          [ 382.        ,    0.0005399...],
                          [ 383.        ,    0.0006122...],
                          [ 384.        ,    0.0006961...],
                          [ 385.        ,    0.0007929...],
                          [ 386.        ,    0.000907 ...],
                          [ 387.        ,    0.0010389...],
                          [ 388.        ,    0.0011923...],
                          [ 389.        ,    0.0013703...],
                          [ 390.        ,    0.0015771...],
                          [ 391.        ,    0.0018167...],
                          [ 392.        ,    0.0020942...],
                          [ 393.        ,    0.0024160...],
                          [ 394.        ,    0.0027888...],
                          [ 395.        ,    0.0032196...],
                          [ 396.        ,    0.0037222...],
                          [ 397.        ,    0.0042957...],
                          [ 398.        ,    0.0049531...],
                          [ 399.        ,    0.0057143...],
                          [ 400.        ,    0.0065784...],
                          [ 401.        ,    0.0075658...],
                          [ 402.        ,    0.0086912...],
                          [ 403.        ,    0.0099638...],
                          [ 404.        ,    0.0114058...],
                          [ 405.        ,    0.0130401...],
                          [ 406.        ,    0.0148750...],
                          [ 407.        ,    0.0169310...],
                          [ 408.        ,    0.0192211...],
                          [ 409.        ,    0.0217511...],
                          [ 410.        ,    0.0245342...],
                          [ 411.        ,    0.0275773...],
                          [ 412.        ,    0.0309172...],
                          [ 413.        ,    0.0345149...],
                          [ 414.        ,    0.0383998...],
                          [ 415.        ,    0.0425744...],
                          [ 416.        ,    0.0471074...],
                          [ 417.        ,    0.0519322...],
                          [ 418.        ,    0.0570541...],
                          [ 419.        ,    0.0625466...],
                          [ 420.        ,    0.0683463...],
                          [ 421.        ,    0.0745255...],
                          [ 422.        ,    0.0809440...],
                          [ 423.        ,    0.0877344...],
                          [ 424.        ,    0.0948915...],
                          [ 425.        ,    0.1022731...],
                          [ 426.        ,    0.109877 ...],
                          [ 427.        ,    0.1178421...],
                          [ 428.        ,    0.1260316...],
                          [ 429.        ,    0.1343772...],
                          [ 430.        ,    0.143017 ...],
                          [ 431.        ,    0.1518128...],
                          [ 432.        ,    0.1608328...],
                          [ 433.        ,    0.1700088...],
                          [ 434.        ,    0.1792726...],
                          [ 435.        ,    0.1886934...],
                          [ 436.        ,    0.1982041...],
                          [ 437.        ,    0.2078032...],
                          [ 438.        ,    0.2174184...],
                          [ 439.        ,    0.2271147...],
                          [ 440.        ,    0.2368196...],
                          [ 441.        ,    0.2464623...],
                          [ 442.        ,    0.2561153...],
                          [ 443.        ,    0.2657160...],
                          [ 444.        ,    0.2753387...],
                          [ 445.        ,    0.2848520...],
                          [ 446.        ,    0.2944648...],
                          [ 447.        ,    0.3034902...],
                          [ 448.        ,    0.3132347...],
                          [ 449.        ,    0.3223257...],
                          [ 450.        ,    0.3314513...],
                          [ 451.        ,    0.3406129...],
                          [ 452.        ,    0.3498117...],
                          [ 453.        ,    0.3583617...],
                          [ 454.        ,    0.3676377...],
                          [ 455.        ,    0.3762670...],
                          [ 456.        ,    0.3849392...],
                          [ 457.        ,    0.3936540...],
                          [ 458.        ,    0.4024077...],
                          [ 459.        ,    0.4111965...],
                          [ 460.        ,    0.4193298...],
                          [ 461.        ,    0.4281803...],
                          [ 462.        ,    0.4363804...],
                          [ 463.        ,    0.4453117...],
                          [ 464.        ,    0.4542949...],
                          [ 465.        ,    0.4626509...],
                          [ 466.        ,    0.4717570...],
                          [ 467.        ,    0.4809300...],
                          [ 468.        ,    0.4901776...],
                          [ 469.        ,    0.4995075...],
                          [ 470.        ,    0.5096145...],
                          [ 471.        ,    0.5191293...],
                          [ 472.        ,    0.5294259...],
                          [ 473.        ,    0.5391316...],
                          [ 474.        ,    0.5496217...],
                          [ 475.        ,    0.5602103...],
                          [ 476.        ,    0.5702197...],
                          [ 477.        ,    0.5810207...],
                          [ 478.        ,    0.5919093...],
                          [ 479.        ,    0.6028683...],
                          [ 480.        ,    0.6138806...],
                          [ 481.        ,    0.6249373...],
                          [ 482.        ,    0.6360619...],
                          [ 483.        ,    0.6465989...],
                          [ 484.        ,    0.6579538...],
                          [ 485.        ,    0.6687841...],
                          [ 486.        ,    0.6797939...],
                          [ 487.        ,    0.6909887...],
                          [ 488.        ,    0.7023827...],
                          [ 489.        ,    0.7133032...],
                          [ 490.        ,    0.7244513...],
                          [ 491.        ,    0.7358470...],
                          [ 492.        ,    0.7468118...],
                          [ 493.        ,    0.7580294...],
                          [ 494.        ,    0.7694964...],
                          [ 495.        ,    0.7805225...],
                          [ 496.        ,    0.7917805...],
                          [ 497.        ,    0.8026123...],
                          [ 498.        ,    0.8130793...],
                          [ 499.        ,    0.8239297...],
                          [ 500.        ,    0.8352251...],
                          [ 501.        ,    0.8456342...],
                          [ 502.        ,    0.8564818...],
                          [ 503.        ,    0.8676921...],
                          [ 504.        ,    0.8785021...],
                          [ 505.        ,    0.8881489...],
                          [ 506.        ,    0.8986405...],
                          [ 507.        ,    0.9079322...],
                          [ 508.        ,    0.9174255...],
                          [ 509.        ,    0.9257739...],
                          [ 510.        ,    0.9350656...],
                          [ 511.        ,    0.9432365...],
                          [ 512.        ,    0.9509063...],
                          [ 513.        ,    0.9586931...],
                          [ 514.        ,    0.9658413...],
                          [ 515.        ,    0.9722825...],
                          [ 516.        ,    0.9779924...],
                          [ 517.        ,    0.9836106...],
                          [ 518.        ,    0.9883465...],
                          [ 519.        ,    0.9920964...],
                          [ 520.        ,    0.9954436...],
                          [ 521.        ,    0.9976202...],
                          [ 522.        ,    0.9993457...],
                          [ 523.        ,    1.       ...],
                          [ 524.        ,    0.9996498...],
                          [ 525.        ,    0.9990487...],
                          [ 526.        ,    0.9975356...],
                          [ 527.        ,    0.9957615...],
                          [ 528.        ,    0.9930143...],
                          [ 529.        ,    0.9899559...],
                          [ 530.        ,    0.9858741...],
                          [ 531.        ,    0.9814453...],
                          [ 532.        ,    0.9766885...],
                          [ 533.        ,    0.9709363...],
                          [ 534.        ,    0.9648947...],
                          [ 535.        ,    0.9585832...],
                          [ 536.        ,    0.952012 ...],
                          [ 537.        ,    0.9444916...],
                          [ 538.        ,    0.9367089...],
                          [ 539.        ,    0.9293506...],
                          [ 540.        ,    0.9210429...],
                          [ 541.        ,    0.9124772...],
                          [ 542.        ,    0.9036604...],
                          [ 543.        ,    0.8945958...],
                          [ 544.        ,    0.8845999...],
                          [ 545.        ,    0.8750500...],
                          [ 546.        ,    0.8659457...],
                          [ 547.        ,    0.8559224...],
                          [ 548.        ,    0.8456846...],
                          [ 549.        ,    0.8352499...],
                          [ 550.        ,    0.8253229...],
                          [ 551.        ,    0.8152079...],
                          [ 552.        ,    0.8042205...],
                          [ 553.        ,    0.7944209...],
                          [ 554.        ,    0.7837466...],
                          [ 555.        ,    0.7735680...],
                          [ 556.        ,    0.7627808...],
                          [ 557.        ,    0.7522710...],
                          [ 558.        ,    0.7417549...],
                          [ 559.        ,    0.7312909...],
                          [ 560.        ,    0.7207983...],
                          [ 561.        ,    0.7101939...],
                          [ 562.        ,    0.6996362...],
                          [ 563.        ,    0.6890656...],
                          [ 564.        ,    0.6785599...],
                          [ 565.        ,    0.6680593...],
                          [ 566.        ,    0.6575697...],
                          [ 567.        ,    0.6471578...],
                          [ 568.        ,    0.6368208...],
                          [ 569.        ,    0.6264871...],
                          [ 570.        ,    0.6161541...],
                          [ 571.        ,    0.6058896...],
                          [ 572.        ,    0.5957000...],
                          [ 573.        ,    0.5855937...],
                          [ 574.        ,    0.5754412...],
                          [ 575.        ,    0.5653883...],
                          [ 576.        ,    0.5553742...],
                          [ 577.        ,    0.5454680...],
                          [ 578.        ,    0.5355972...],
                          [ 579.        ,    0.5258267...],
                          [ 580.        ,    0.5160152...],
                          [ 581.        ,    0.5062322...],
                          [ 582.        ,    0.4965595...],
                          [ 583.        ,    0.4868746...],
                          [ 584.        ,    0.4773299...],
                          [ 585.        ,    0.4678028...],
                          [ 586.        ,    0.4583704...],
                          [ 587.        ,    0.4489722...],
                          [ 588.        ,    0.4397606...],
                          [ 589.        ,    0.4306131...],
                          [ 590.        ,    0.4215446...],
                          [ 591.        ,    0.4125681...],
                          [ 592.        ,    0.4037550...],
                          [ 593.        ,    0.3950359...],
                          [ 594.        ,    0.3864104...],
                          [ 595.        ,    0.3778777...],
                          [ 596.        ,    0.3694405...],
                          [ 597.        ,    0.3611074...],
                          [ 598.        ,    0.3528596...],
                          [ 599.        ,    0.3447056...],
                          [ 600.        ,    0.3366470...],
                          [ 601.        ,    0.3286917...],
                          [ 602.        ,    0.3208410...],
                          [ 603.        ,    0.3130808...],
                          [ 604.        ,    0.3054105...],
                          [ 605.        ,    0.2978225...],
                          [ 606.        ,    0.2903027...],
                          [ 607.        ,    0.2828727...],
                          [ 608.        ,    0.2755311...],
                          [ 609.        ,    0.2682900...],
                          [ 610.        ,    0.2611478...],
                          [ 611.        ,    0.2541176...],
                          [ 612.        ,    0.2471885...],
                          [ 613.        ,    0.2403570...],
                          [ 614.        ,    0.2336057...],
                          [ 615.        ,    0.2269379...],
                          [ 616.        ,    0.2203527...],
                          [ 617.        ,    0.2138465...],
                          [ 618.        ,    0.2073946...],
                          [ 619.        ,    0.2009789...],
                          [ 620.        ,    0.1945818...],
                          [ 621.        ,    0.1881943...],
                          [ 622.        ,    0.1818226...],
                          [ 623.        ,    0.1754987...],
                          [ 624.        ,    0.1692476...],
                          [ 625.        ,    0.1630876...],
                          [ 626.        ,    0.1570257...],
                          [ 627.        ,    0.151071 ...],
                          [ 628.        ,    0.1452469...],
                          [ 629.        ,    0.1395845...],
                          [ 630.        ,    0.1341087...],
                          [ 631.        ,    0.1288408...],
                          [ 632.        ,    0.1237666...],
                          [ 633.        ,    0.1188631...],
                          [ 634.        ,    0.1141075...],
                          [ 635.        ,    0.1094766...],
                          [ 636.        ,    0.1049613...],
                          [ 637.        ,    0.1005679...],
                          [ 638.        ,    0.0962924...],
                          [ 639.        ,    0.0921296...],
                          [ 640.        ,    0.0880778...],
                          [ 641.        ,    0.0841306...],
                          [ 642.        ,    0.0802887...],
                          [ 643.        ,    0.0765559...],
                          [ 644.        ,    0.0729367...],
                          [ 645.        ,    0.0694345...],
                          [ 646.        ,    0.0660491...],
                          [ 647.        ,    0.0627792...],
                          [ 648.        ,    0.0596278...],
                          [ 649.        ,    0.0565970...],
                          [ 650.        ,    0.0536896...],
                          [ 651.        ,    0.0509068...],
                          [ 652.        ,    0.0482444...],
                          [ 653.        ,    0.0456951...],
                          [ 654.        ,    0.0432510...],
                          [ 655.        ,    0.0409052...],
                          [ 656.        ,    0.0386537...],
                          [ 657.        ,    0.0364955...],
                          [ 658.        ,    0.0344285...],
                          [ 659.        ,    0.0324501...],
                          [ 660.        ,    0.0305579...],
                          [ 661.        ,    0.0287496...],
                          [ 662.        ,    0.0270233...],
                          [ 663.        ,    0.0253776...],
                          [ 664.        ,    0.0238113...],
                          [ 665.        ,    0.0223226...],
                          [ 666.        ,    0.0209086...],
                          [ 667.        ,    0.0195688...],
                          [ 668.        ,    0.0183056...],
                          [ 669.        ,    0.0171216...],
                          [ 670.        ,    0.0160192...],
                          [ 671.        ,    0.0149986...],
                          [ 672.        ,    0.0140537...],
                          [ 673.        ,    0.0131784...],
                          [ 674.        ,    0.0123662...],
                          [ 675.        ,    0.0116107...],
                          [ 676.        ,    0.0109098...],
                          [ 677.        ,    0.0102587...],
                          [ 678.        ,    0.0096476...],
                          [ 679.        ,    0.0090665...],
                          [ 680.        ,    0.0085053...],
                          [ 681.        ,    0.0079567...],
                          [ 682.        ,    0.0074229...],
                          [ 683.        ,    0.0069094...],
                          [ 684.        ,    0.0064213...],
                          [ 685.        ,    0.0059637...],
                          [ 686.        ,    0.0055377...],
                          [ 687.        ,    0.0051402...],
                          [ 688.        ,    0.00477  ...],
                          [ 689.        ,    0.0044263...],
                          [ 690.        ,    0.0041081...],
                          [ 691.        ,    0.0038149...],
                          [ 692.        ,    0.0035456...],
                          [ 693.        ,    0.0032984...],
                          [ 694.        ,    0.0030718...],
                          [ 695.        ,    0.0028639...],
                          [ 696.        ,    0.0026738...],
                          [ 697.        ,    0.0025000...],
                          [ 698.        ,    0.0023401...],
                          [ 699.        ,    0.0021918...],
                          [ 700.        ,    0.0020526...],
                          [ 701.        ,    0.0019207...],
                          [ 702.        ,    0.001796 ...],
                          [ 703.        ,    0.0016784...],
                          [ 704.        ,    0.0015683...],
                          [ 705.        ,    0.0014657...],
                          [ 706.        ,    0.0013702...],
                          [ 707.        ,    0.001281 ...],
                          [ 708.        ,    0.0011976...],
                          [ 709.        ,    0.0011195...],
                          [ 710.        ,    0.0010464...],
                          [ 711.        ,    0.0009776...],
                          [ 712.        ,    0.0009131...],
                          [ 713.        ,    0.0008525...],
                          [ 714.        ,    0.0007958...],
                          [ 715.        ,    0.0007427...],
                          [ 716.        ,    0.0006929...],
                          [ 717.        ,    0.0006462...],
                          [ 718.        ,    0.0006026...],
                          [ 719.        ,    0.0005619...],
                          [ 720.        ,    0.0005240...],
                          [ 721.        ,    0.0004888...],
                          [ 722.        ,    0.0004561...],
                          [ 723.        ,    0.0004255...],
                          [ 724.        ,    0.0003971...],
                          [ 725.        ,    0.0003704...],
                          [ 726.        ,    0.0003455...],
                          [ 727.        ,    0.0003221...],
                          [ 728.        ,    0.0003001...],
                          [ 729.        ,    0.0002796...],
                          [ 730.        ,    0.0002604...],
                          [ 731.        ,    0.0002423...],
                          [ 732.        ,    0.0002254...],
                          [ 733.        ,    0.0002095...],
                          [ 734.        ,    0.0001947...],
                          [ 735.        ,    0.0001809...],
                          [ 736.        ,    0.0001680...],
                          [ 737.        ,    0.0001560...],
                          [ 738.        ,    0.0001449...],
                          [ 739.        ,    0.0001345...],
                          [ 740.        ,    0.0001249...],
                          [ 741.        ,    0.0001159...],
                          [ 742.        ,    0.0001076...],
                          [ 743.        ,    0.0000999...],
                          [ 744.        ,    0.0000927...],
                          [ 745.        ,    0.0000862...],
                          [ 746.        ,    0.0000801...],
                          [ 747.        ,    0.0000745...],
                          [ 748.        ,    0.0000693...],
                          [ 749.        ,    0.0000646...],
                          [ 750.        ,    0.0000602...],
                          [ 751.        ,    0.0000561...],
                          [ 752.        ,    0.0000523...],
                          [ 753.        ,    0.0000488...],
                          [ 754.        ,    0.0000456...],
                          [ 755.        ,    0.0000425...],
                          [ 756.        ,    0.0000397...],
                          [ 757.        ,    0.0000370...],
                          [ 758.        ,    0.0000346...],
                          [ 759.        ,    0.0000322...],
                          [ 760.        ,    0.0000301...],
                          [ 761.        ,    0.0000281...],
                          [ 762.        ,    0.0000262...],
                          [ 763.        ,    0.0000244...],
                          [ 764.        ,    0.0000228...],
                          [ 765.        ,    0.0000213...],
                          [ 766.        ,    0.0000198...],
                          [ 767.        ,    0.0000185...],
                          [ 768.        ,    0.0000173...],
                          [ 769.        ,    0.0000161...],
                          [ 770.        ,    0.0000150...],
                          [ 771.        ,    0.0000140...],
                          [ 772.        ,    0.0000131...],
                          [ 773.        ,    0.0000122...],
                          [ 774.        ,    0.0000114...],
                          [ 775.        ,    0.0000106...],
                          [ 776.        ,    0.0000099...],
                          [ 777.        ,    0.0000092...],
                          [ 778.        ,    0.0000086...],
                          [ 779.        ,    0.0000080...],
                          [ 780.        ,    0.0000075...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    photopic_lef_shape = photopic_lef.shape
    scotopic_lef_shape = scotopic_lef.shape
    shape = SpectralShape(
        max(photopic_lef_shape.start, scotopic_lef_shape.start),
        min(photopic_lef_shape.end, scotopic_lef_shape.end),
        max(photopic_lef_shape.interval, scotopic_lef_shape.interval))

    wavelengths = shape.range()

    sd_data = dict(
        zip(
            wavelengths,
            mesopic_weighting_function(wavelengths, Lp, source, method,
                                       photopic_lef, scotopic_lef)))

    sd = SpectralDistribution(
        sd_data, name='{0} Lp Mesopic Luminous Efficiency Function'.format(Lp))

    return sd.normalise()
コード例 #9
0
def sd_rayleigh_scattering(
    shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
    CO2_concentration: FloatingOrArrayLike = CONSTANT_STANDARD_CO2_CONCENTRATION,
    temperature: FloatingOrArrayLike = CONSTANT_STANDARD_AIR_TEMPERATURE,
    pressure: FloatingOrArrayLike = CONSTANT_AVERAGE_PRESSURE_MEAN_SEA_LEVEL,
    latitude: FloatingOrArrayLike = CONSTANT_DEFAULT_LATITUDE,
    altitude: FloatingOrArrayLike = CONSTANT_DEFAULT_ALTITUDE,
    avogadro_constant: FloatingOrArrayLike = CONSTANT_AVOGADRO,
    n_s_function: Callable = air_refraction_index_Bodhaine1999,
    F_air_function: Callable = F_air_Bodhaine1999,
) -> SpectralDistribution:
    """
    Return the *Rayleigh* spectral distribution for given spectral shape.

    Parameters
    ----------
    shape
        Spectral shape used to create the *Rayleigh* scattering spectral
        distribution.
    CO2_concentration
        :math:`CO_2` concentration in parts per million (ppm).
    temperature
        Air temperature :math:`T[K]` in kelvin degrees.
    pressure
        Surface pressure :math:`P` of the measurement site.
    latitude
        Latitude of the site in degrees.
    altitude
        Altitude of the site in meters.
    avogadro_constant
        *Avogadro*'s number (molecules :math:`mol^{-1}`).
    n_s_function
        Air refraction index :math:`n_s` computation method.
    F_air_function
        :math:`(6+3_p)/(6-7_p)`, the depolarisation term :math:`F(air)` or
        *King Factor* computation method.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        *Rayleigh* optical depth spectral distribution.

    References
    ----------
    :cite:`Bodhaine1999a`, :cite:`Wikipedia2001c`

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_rayleigh_scattering()  # doctest: +ELLIPSIS
    SpectralDistribution([[ 360.        ,    0.5991013...],
                          [ 361.        ,    0.5921706...],
                          [ 362.        ,    0.5853410...],
                          [ 363.        ,    0.5786105...],
                          [ 364.        ,    0.5719774...],
                          [ 365.        ,    0.5654401...],
                          [ 366.        ,    0.5589968...],
                          [ 367.        ,    0.5526460...],
                          [ 368.        ,    0.5463860...],
                          [ 369.        ,    0.5402153...],
                          [ 370.        ,    0.5341322...],
                          [ 371.        ,    0.5281354...],
                          [ 372.        ,    0.5222234...],
                          [ 373.        ,    0.5163946...],
                          [ 374.        ,    0.5106476...],
                          [ 375.        ,    0.5049812...],
                          [ 376.        ,    0.4993939...],
                          [ 377.        ,    0.4938844...],
                          [ 378.        ,    0.4884513...],
                          [ 379.        ,    0.4830934...],
                          [ 380.        ,    0.4778095...],
                          [ 381.        ,    0.4725983...],
                          [ 382.        ,    0.4674585...],
                          [ 383.        ,    0.4623891...],
                          [ 384.        ,    0.4573889...],
                          [ 385.        ,    0.4524566...],
                          [ 386.        ,    0.4475912...],
                          [ 387.        ,    0.4427917...],
                          [ 388.        ,    0.4380568...],
                          [ 389.        ,    0.4333856...],
                          [ 390.        ,    0.4287771...],
                          [ 391.        ,    0.4242302...],
                          [ 392.        ,    0.4197439...],
                          [ 393.        ,    0.4153172...],
                          [ 394.        ,    0.4109493...],
                          [ 395.        ,    0.4066391...],
                          [ 396.        ,    0.4023857...],
                          [ 397.        ,    0.3981882...],
                          [ 398.        ,    0.3940458...],
                          [ 399.        ,    0.3899576...],
                          [ 400.        ,    0.3859227...],
                          [ 401.        ,    0.3819402...],
                          [ 402.        ,    0.3780094...],
                          [ 403.        ,    0.3741295...],
                          [ 404.        ,    0.3702996...],
                          [ 405.        ,    0.366519 ...],
                          [ 406.        ,    0.3627868...],
                          [ 407.        ,    0.3591025...],
                          [ 408.        ,    0.3554651...],
                          [ 409.        ,    0.3518740...],
                          [ 410.        ,    0.3483286...],
                          [ 411.        ,    0.344828 ...],
                          [ 412.        ,    0.3413716...],
                          [ 413.        ,    0.3379587...],
                          [ 414.        ,    0.3345887...],
                          [ 415.        ,    0.3312609...],
                          [ 416.        ,    0.3279747...],
                          [ 417.        ,    0.3247294...],
                          [ 418.        ,    0.3215245...],
                          [ 419.        ,    0.3183593...],
                          [ 420.        ,    0.3152332...],
                          [ 421.        ,    0.3121457...],
                          [ 422.        ,    0.3090962...],
                          [ 423.        ,    0.3060841...],
                          [ 424.        ,    0.3031088...],
                          [ 425.        ,    0.3001699...],
                          [ 426.        ,    0.2972668...],
                          [ 427.        ,    0.2943989...],
                          [ 428.        ,    0.2915657...],
                          [ 429.        ,    0.2887668...],
                          [ 430.        ,    0.2860017...],
                          [ 431.        ,    0.2832697...],
                          [ 432.        ,    0.2805706...],
                          [ 433.        ,    0.2779037...],
                          [ 434.        ,    0.2752687...],
                          [ 435.        ,    0.2726650...],
                          [ 436.        ,    0.2700922...],
                          [ 437.        ,    0.2675500...],
                          [ 438.        ,    0.2650377...],
                          [ 439.        ,    0.2625551...],
                          [ 440.        ,    0.2601016...],
                          [ 441.        ,    0.2576770...],
                          [ 442.        ,    0.2552807...],
                          [ 443.        ,    0.2529124...],
                          [ 444.        ,    0.2505716...],
                          [ 445.        ,    0.2482581...],
                          [ 446.        ,    0.2459713...],
                          [ 447.        ,    0.2437110...],
                          [ 448.        ,    0.2414768...],
                          [ 449.        ,    0.2392683...],
                          [ 450.        ,    0.2370851...],
                          [ 451.        ,    0.2349269...],
                          [ 452.        ,    0.2327933...],
                          [ 453.        ,    0.2306841...],
                          [ 454.        ,    0.2285989...],
                          [ 455.        ,    0.2265373...],
                          [ 456.        ,    0.2244990...],
                          [ 457.        ,    0.2224838...],
                          [ 458.        ,    0.2204912...],
                          [ 459.        ,    0.2185211...],
                          [ 460.        ,    0.2165730...],
                          [ 461.        ,    0.2146467...],
                          [ 462.        ,    0.2127419...],
                          [ 463.        ,    0.2108583...],
                          [ 464.        ,    0.2089957...],
                          [ 465.        ,    0.2071536...],
                          [ 466.        ,    0.2053320...],
                          [ 467.        ,    0.2035304...],
                          [ 468.        ,    0.2017487...],
                          [ 469.        ,    0.1999865...],
                          [ 470.        ,    0.1982436...],
                          [ 471.        ,    0.1965198...],
                          [ 472.        ,    0.1948148...],
                          [ 473.        ,    0.1931284...],
                          [ 474.        ,    0.1914602...],
                          [ 475.        ,    0.1898101...],
                          [ 476.        ,    0.1881779...],
                          [ 477.        ,    0.1865633...],
                          [ 478.        ,    0.1849660...],
                          [ 479.        ,    0.1833859...],
                          [ 480.        ,    0.1818227...],
                          [ 481.        ,    0.1802762...],
                          [ 482.        ,    0.1787463...],
                          [ 483.        ,    0.1772326...],
                          [ 484.        ,    0.1757349...],
                          [ 485.        ,    0.1742532...],
                          [ 486.        ,    0.1727871...],
                          [ 487.        ,    0.1713365...],
                          [ 488.        ,    0.1699011...],
                          [ 489.        ,    0.1684809...],
                          [ 490.        ,    0.1670755...],
                          [ 491.        ,    0.1656848...],
                          [ 492.        ,    0.1643086...],
                          [ 493.        ,    0.1629468...],
                          [ 494.        ,    0.1615991...],
                          [ 495.        ,    0.1602654...],
                          [ 496.        ,    0.1589455...],
                          [ 497.        ,    0.1576392...],
                          [ 498.        ,    0.1563464...],
                          [ 499.        ,    0.1550668...],
                          [ 500.        ,    0.1538004...],
                          [ 501.        ,    0.1525470...],
                          [ 502.        ,    0.1513063...],
                          [ 503.        ,    0.1500783...],
                          [ 504.        ,    0.1488628...],
                          [ 505.        ,    0.1476597...],
                          [ 506.        ,    0.1464687...],
                          [ 507.        ,    0.1452898...],
                          [ 508.        ,    0.1441228...],
                          [ 509.        ,    0.1429675...],
                          [ 510.        ,    0.1418238...],
                          [ 511.        ,    0.1406916...],
                          [ 512.        ,    0.1395707...],
                          [ 513.        ,    0.1384610...],
                          [ 514.        ,    0.1373624...],
                          [ 515.        ,    0.1362747...],
                          [ 516.        ,    0.1351978...],
                          [ 517.        ,    0.1341316...],
                          [ 518.        ,    0.1330759...],
                          [ 519.        ,    0.1320306...],
                          [ 520.        ,    0.1309956...],
                          [ 521.        ,    0.1299707...],
                          [ 522.        ,    0.1289559...],
                          [ 523.        ,    0.1279511...],
                          [ 524.        ,    0.1269560...],
                          [ 525.        ,    0.1259707...],
                          [ 526.        ,    0.1249949...],
                          [ 527.        ,    0.1240286...],
                          [ 528.        ,    0.1230717...],
                          [ 529.        ,    0.1221240...],
                          [ 530.        ,    0.1211855...],
                          [ 531.        ,    0.1202560...],
                          [ 532.        ,    0.1193354...],
                          [ 533.        ,    0.1184237...],
                          [ 534.        ,    0.1175207...],
                          [ 535.        ,    0.1166263...],
                          [ 536.        ,    0.1157404...],
                          [ 537.        ,    0.1148630...],
                          [ 538.        ,    0.1139939...],
                          [ 539.        ,    0.1131331...],
                          [ 540.        ,    0.1122804...],
                          [ 541.        ,    0.1114357...],
                          [ 542.        ,    0.1105990...],
                          [ 543.        ,    0.1097702...],
                          [ 544.        ,    0.1089492...],
                          [ 545.        ,    0.1081358...],
                          [ 546.        ,    0.1073301...],
                          [ 547.        ,    0.1065319...],
                          [ 548.        ,    0.1057411...],
                          [ 549.        ,    0.1049577...],
                          [ 550.        ,    0.1041815...],
                          [ 551.        ,    0.1034125...],
                          [ 552.        ,    0.1026507...],
                          [ 553.        ,    0.1018958...],
                          [ 554.        ,    0.1011480...],
                          [ 555.        ,    0.1004070...],
                          [ 556.        ,    0.0996728...],
                          [ 557.        ,    0.0989453...],
                          [ 558.        ,    0.0982245...],
                          [ 559.        ,    0.0975102...],
                          [ 560.        ,    0.0968025...],
                          [ 561.        ,    0.0961012...],
                          [ 562.        ,    0.0954062...],
                          [ 563.        ,    0.0947176...],
                          [ 564.        ,    0.0940352...],
                          [ 565.        ,    0.0933589...],
                          [ 566.        ,    0.0926887...],
                          [ 567.        ,    0.0920246...],
                          [ 568.        ,    0.0913664...],
                          [ 569.        ,    0.0907141...],
                          [ 570.        ,    0.0900677...],
                          [ 571.        ,    0.0894270...],
                          [ 572.        ,    0.0887920...],
                          [ 573.        ,    0.0881627...],
                          [ 574.        ,    0.0875389...],
                          [ 575.        ,    0.0869207...],
                          [ 576.        ,    0.0863079...],
                          [ 577.        ,    0.0857006...],
                          [ 578.        ,    0.0850986...],
                          [ 579.        ,    0.0845019...],
                          [ 580.        ,    0.0839104...],
                          [ 581.        ,    0.0833242...],
                          [ 582.        ,    0.0827430...],
                          [ 583.        ,    0.082167 ...],
                          [ 584.        ,    0.0815959...],
                          [ 585.        ,    0.0810298...],
                          [ 586.        ,    0.0804687...],
                          [ 587.        ,    0.0799124...],
                          [ 588.        ,    0.0793609...],
                          [ 589.        ,    0.0788142...],
                          [ 590.        ,    0.0782722...],
                          [ 591.        ,    0.0777349...],
                          [ 592.        ,    0.0772022...],
                          [ 593.        ,    0.0766740...],
                          [ 594.        ,    0.0761504...],
                          [ 595.        ,    0.0756313...],
                          [ 596.        ,    0.0751166...],
                          [ 597.        ,    0.0746063...],
                          [ 598.        ,    0.0741003...],
                          [ 599.        ,    0.0735986...],
                          [ 600.        ,    0.0731012...],
                          [ 601.        ,    0.072608 ...],
                          [ 602.        ,    0.0721189...],
                          [ 603.        ,    0.0716340...],
                          [ 604.        ,    0.0711531...],
                          [ 605.        ,    0.0706763...],
                          [ 606.        ,    0.0702035...],
                          [ 607.        ,    0.0697347...],
                          [ 608.        ,    0.0692697...],
                          [ 609.        ,    0.0688087...],
                          [ 610.        ,    0.0683515...],
                          [ 611.        ,    0.0678981...],
                          [ 612.        ,    0.0674485...],
                          [ 613.        ,    0.0670026...],
                          [ 614.        ,    0.0665603...],
                          [ 615.        ,    0.0661218...],
                          [ 616.        ,    0.0656868...],
                          [ 617.        ,    0.0652555...],
                          [ 618.        ,    0.0648277...],
                          [ 619.        ,    0.0644033...],
                          [ 620.        ,    0.0639825...],
                          [ 621.        ,    0.0635651...],
                          [ 622.        ,    0.0631512...],
                          [ 623.        ,    0.0627406...],
                          [ 624.        ,    0.0623333...],
                          [ 625.        ,    0.0619293...],
                          [ 626.        ,    0.0615287...],
                          [ 627.        ,    0.0611312...],
                          [ 628.        ,    0.0607370...],
                          [ 629.        ,    0.0603460...],
                          [ 630.        ,    0.0599581...],
                          [ 631.        ,    0.0595733...],
                          [ 632.        ,    0.0591917...],
                          [ 633.        ,    0.0588131...],
                          [ 634.        ,    0.0584375...],
                          [ 635.        ,    0.0580649...],
                          [ 636.        ,    0.0576953...],
                          [ 637.        ,    0.0573286...],
                          [ 638.        ,    0.0569649...],
                          [ 639.        ,    0.0566040...],
                          [ 640.        ,    0.0562460...],
                          [ 641.        ,    0.0558909...],
                          [ 642.        ,    0.0555385...],
                          [ 643.        ,    0.0551890...],
                          [ 644.        ,    0.0548421...],
                          [ 645.        ,    0.0544981...],
                          [ 646.        ,    0.0541567...],
                          [ 647.        ,    0.053818 ...],
                          [ 648.        ,    0.0534819...],
                          [ 649.        ,    0.0531485...],
                          [ 650.        ,    0.0528176...],
                          [ 651.        ,    0.0524894...],
                          [ 652.        ,    0.0521637...],
                          [ 653.        ,    0.0518405...],
                          [ 654.        ,    0.0515198...],
                          [ 655.        ,    0.0512017...],
                          [ 656.        ,    0.0508859...],
                          [ 657.        ,    0.0505726...],
                          [ 658.        ,    0.0502618...],
                          [ 659.        ,    0.0499533...],
                          [ 660.        ,    0.0496472...],
                          [ 661.        ,    0.0493434...],
                          [ 662.        ,    0.0490420...],
                          [ 663.        ,    0.0487428...],
                          [ 664.        ,    0.0484460...],
                          [ 665.        ,    0.0481514...],
                          [ 666.        ,    0.0478591...],
                          [ 667.        ,    0.0475689...],
                          [ 668.        ,    0.0472810...],
                          [ 669.        ,    0.0469953...],
                          [ 670.        ,    0.0467117...],
                          [ 671.        ,    0.0464302...],
                          [ 672.        ,    0.0461509...],
                          [ 673.        ,    0.0458737...],
                          [ 674.        ,    0.0455986...],
                          [ 675.        ,    0.0453255...],
                          [ 676.        ,    0.0450545...],
                          [ 677.        ,    0.0447855...],
                          [ 678.        ,    0.0445185...],
                          [ 679.        ,    0.0442535...],
                          [ 680.        ,    0.0439905...],
                          [ 681.        ,    0.0437294...],
                          [ 682.        ,    0.0434703...],
                          [ 683.        ,    0.0432131...],
                          [ 684.        ,    0.0429578...],
                          [ 685.        ,    0.0427044...],
                          [ 686.        ,    0.0424529...],
                          [ 687.        ,    0.0422032...],
                          [ 688.        ,    0.0419553...],
                          [ 689.        ,    0.0417093...],
                          [ 690.        ,    0.0414651...],
                          [ 691.        ,    0.0412226...],
                          [ 692.        ,    0.0409820...],
                          [ 693.        ,    0.0407431...],
                          [ 694.        ,    0.0405059...],
                          [ 695.        ,    0.0402705...],
                          [ 696.        ,    0.0400368...],
                          [ 697.        ,    0.0398047...],
                          [ 698.        ,    0.0395744...],
                          [ 699.        ,    0.0393457...],
                          [ 700.        ,    0.0391187...],
                          [ 701.        ,    0.0388933...],
                          [ 702.        ,    0.0386696...],
                          [ 703.        ,    0.0384474...],
                          [ 704.        ,    0.0382269...],
                          [ 705.        ,    0.0380079...],
                          [ 706.        ,    0.0377905...],
                          [ 707.        ,    0.0375747...],
                          [ 708.        ,    0.0373604...],
                          [ 709.        ,    0.0371476...],
                          [ 710.        ,    0.0369364...],
                          [ 711.        ,    0.0367266...],
                          [ 712.        ,    0.0365184...],
                          [ 713.        ,    0.0363116...],
                          [ 714.        ,    0.0361063...],
                          [ 715.        ,    0.0359024...],
                          [ 716.        ,    0.0357000...],
                          [ 717.        ,    0.0354990...],
                          [ 718.        ,    0.0352994...],
                          [ 719.        ,    0.0351012...],
                          [ 720.        ,    0.0349044...],
                          [ 721.        ,    0.0347090...],
                          [ 722.        ,    0.0345150...],
                          [ 723.        ,    0.0343223...],
                          [ 724.        ,    0.0341310...],
                          [ 725.        ,    0.0339410...],
                          [ 726.        ,    0.0337523...],
                          [ 727.        ,    0.033565 ...],
                          [ 728.        ,    0.0333789...],
                          [ 729.        ,    0.0331941...],
                          [ 730.        ,    0.0330106...],
                          [ 731.        ,    0.0328284...],
                          [ 732.        ,    0.0326474...],
                          [ 733.        ,    0.0324677...],
                          [ 734.        ,    0.0322893...],
                          [ 735.        ,    0.0321120...],
                          [ 736.        ,    0.0319360...],
                          [ 737.        ,    0.0317611...],
                          [ 738.        ,    0.0315875...],
                          [ 739.        ,    0.0314151...],
                          [ 740.        ,    0.0312438...],
                          [ 741.        ,    0.0310737...],
                          [ 742.        ,    0.0309048...],
                          [ 743.        ,    0.0307370...],
                          [ 744.        ,    0.0305703...],
                          [ 745.        ,    0.0304048...],
                          [ 746.        ,    0.0302404...],
                          [ 747.        ,    0.0300771...],
                          [ 748.        ,    0.0299149...],
                          [ 749.        ,    0.0297538...],
                          [ 750.        ,    0.0295938...],
                          [ 751.        ,    0.0294349...],
                          [ 752.        ,    0.0292771...],
                          [ 753.        ,    0.0291203...],
                          [ 754.        ,    0.0289645...],
                          [ 755.        ,    0.0288098...],
                          [ 756.        ,    0.0286561...],
                          [ 757.        ,    0.0285035...],
                          [ 758.        ,    0.0283518...],
                          [ 759.        ,    0.0282012...],
                          [ 760.        ,    0.0280516...],
                          [ 761.        ,    0.0279030...],
                          [ 762.        ,    0.0277553...],
                          [ 763.        ,    0.0276086...],
                          [ 764.        ,    0.027463 ...],
                          [ 765.        ,    0.0273182...],
                          [ 766.        ,    0.0271744...],
                          [ 767.        ,    0.0270316...],
                          [ 768.        ,    0.0268897...],
                          [ 769.        ,    0.0267487...],
                          [ 770.        ,    0.0266087...],
                          [ 771.        ,    0.0264696...],
                          [ 772.        ,    0.0263314...],
                          [ 773.        ,    0.0261941...],
                          [ 774.        ,    0.0260576...],
                          [ 775.        ,    0.0259221...],
                          [ 776.        ,    0.0257875...],
                          [ 777.        ,    0.0256537...],
                          [ 778.        ,    0.0255208...],
                          [ 779.        ,    0.0253888...],
                          [ 780.        ,    0.0252576...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    wavelengths = shape.range()
    return SpectralDistribution(
        rayleigh_optical_depth(
            wavelengths * 10e-8,
            CO2_concentration,
            temperature,
            pressure,
            latitude,
            altitude,
            avogadro_constant,
            n_s_function,
            F_air_function,
        ),
        wavelengths,
        name=(
            "Rayleigh Scattering - "
            f"{CO2_concentration!r} ppm, "
            f"{temperature!r} K, "
            f"{pressure!r} Pa, "
            f"{latitude!r} Degrees, "
            f"{altitude!r} m"
        ),
    )
コード例 #10
0
ファイル: lefs.py プロジェクト: colour-science/colour
def sd_mesopic_luminous_efficiency_function(
        Lp,
        source='Blue Heavy',
        method='MOVE',
        photopic_lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
        scotopic_lef=SCOTOPIC_LEFS['CIE 1951 Scotopic Standard Observer']):
    """
    Returns the mesopic luminous efficiency function :math:`V_m(\\lambda)` for
    given photopic luminance :math:`L_p`.

    Parameters
    ----------
    Lp : numeric
        Photopic luminance :math:`L_p`.
    source : unicode, optional
        **{'Blue Heavy', 'Red Heavy'}**,
        Light source colour temperature.
    method : unicode, optional
        **{'MOVE', 'LRC'}**,
        Method to calculate the weighting factor.
    photopic_lef : SpectralDistribution, optional
        :math:`V(\\lambda)` photopic luminous efficiency function.
    scotopic_lef : SpectralDistribution, optional
        :math:`V^\\prime(\\lambda)` scotopic luminous efficiency function.

    Returns
    -------
    SpectralDistribution
        Mesopic luminous efficiency function :math:`V_m(\\lambda)`.

    References
    ----------
    :cite:`Wikipedia2005d`

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_mesopic_luminous_efficiency_function(0.2)  # doctest: +ELLIPSIS
    SpectralDistribution([[ 380.        ,    0.000424 ...],
                          [ 381.        ,    0.0004781...],
                          [ 382.        ,    0.0005399...],
                          [ 383.        ,    0.0006122...],
                          [ 384.        ,    0.0006961...],
                          [ 385.        ,    0.0007929...],
                          [ 386.        ,    0.000907 ...],
                          [ 387.        ,    0.0010389...],
                          [ 388.        ,    0.0011923...],
                          [ 389.        ,    0.0013703...],
                          [ 390.        ,    0.0015771...],
                          [ 391.        ,    0.0018167...],
                          [ 392.        ,    0.0020942...],
                          [ 393.        ,    0.0024160...],
                          [ 394.        ,    0.0027888...],
                          [ 395.        ,    0.0032196...],
                          [ 396.        ,    0.0037222...],
                          [ 397.        ,    0.0042957...],
                          [ 398.        ,    0.0049531...],
                          [ 399.        ,    0.0057143...],
                          [ 400.        ,    0.0065784...],
                          [ 401.        ,    0.0075658...],
                          [ 402.        ,    0.0086912...],
                          [ 403.        ,    0.0099638...],
                          [ 404.        ,    0.0114058...],
                          [ 405.        ,    0.0130401...],
                          [ 406.        ,    0.0148750...],
                          [ 407.        ,    0.0169310...],
                          [ 408.        ,    0.0192211...],
                          [ 409.        ,    0.0217511...],
                          [ 410.        ,    0.0245342...],
                          [ 411.        ,    0.0275773...],
                          [ 412.        ,    0.0309172...],
                          [ 413.        ,    0.0345149...],
                          [ 414.        ,    0.0383998...],
                          [ 415.        ,    0.0425744...],
                          [ 416.        ,    0.0471074...],
                          [ 417.        ,    0.0519322...],
                          [ 418.        ,    0.0570541...],
                          [ 419.        ,    0.0625466...],
                          [ 420.        ,    0.0683463...],
                          [ 421.        ,    0.0745255...],
                          [ 422.        ,    0.0809440...],
                          [ 423.        ,    0.0877344...],
                          [ 424.        ,    0.0948915...],
                          [ 425.        ,    0.1022731...],
                          [ 426.        ,    0.109877 ...],
                          [ 427.        ,    0.1178421...],
                          [ 428.        ,    0.1260316...],
                          [ 429.        ,    0.1343772...],
                          [ 430.        ,    0.143017 ...],
                          [ 431.        ,    0.1518128...],
                          [ 432.        ,    0.1608328...],
                          [ 433.        ,    0.1700088...],
                          [ 434.        ,    0.1792726...],
                          [ 435.        ,    0.1886934...],
                          [ 436.        ,    0.1982041...],
                          [ 437.        ,    0.2078032...],
                          [ 438.        ,    0.2174184...],
                          [ 439.        ,    0.2271147...],
                          [ 440.        ,    0.2368196...],
                          [ 441.        ,    0.2464623...],
                          [ 442.        ,    0.2561153...],
                          [ 443.        ,    0.2657160...],
                          [ 444.        ,    0.2753387...],
                          [ 445.        ,    0.2848520...],
                          [ 446.        ,    0.2944648...],
                          [ 447.        ,    0.3034902...],
                          [ 448.        ,    0.3132347...],
                          [ 449.        ,    0.3223257...],
                          [ 450.        ,    0.3314513...],
                          [ 451.        ,    0.3406129...],
                          [ 452.        ,    0.3498117...],
                          [ 453.        ,    0.3583617...],
                          [ 454.        ,    0.3676377...],
                          [ 455.        ,    0.3762670...],
                          [ 456.        ,    0.3849392...],
                          [ 457.        ,    0.3936540...],
                          [ 458.        ,    0.4024077...],
                          [ 459.        ,    0.4111965...],
                          [ 460.        ,    0.4193298...],
                          [ 461.        ,    0.4281803...],
                          [ 462.        ,    0.4363804...],
                          [ 463.        ,    0.4453117...],
                          [ 464.        ,    0.4542949...],
                          [ 465.        ,    0.4626509...],
                          [ 466.        ,    0.4717570...],
                          [ 467.        ,    0.4809300...],
                          [ 468.        ,    0.4901776...],
                          [ 469.        ,    0.4995075...],
                          [ 470.        ,    0.5096145...],
                          [ 471.        ,    0.5191293...],
                          [ 472.        ,    0.5294259...],
                          [ 473.        ,    0.5391316...],
                          [ 474.        ,    0.5496217...],
                          [ 475.        ,    0.5602103...],
                          [ 476.        ,    0.5702197...],
                          [ 477.        ,    0.5810207...],
                          [ 478.        ,    0.5919093...],
                          [ 479.        ,    0.6028683...],
                          [ 480.        ,    0.6138806...],
                          [ 481.        ,    0.6249373...],
                          [ 482.        ,    0.6360619...],
                          [ 483.        ,    0.6465989...],
                          [ 484.        ,    0.6579538...],
                          [ 485.        ,    0.6687841...],
                          [ 486.        ,    0.6797939...],
                          [ 487.        ,    0.6909887...],
                          [ 488.        ,    0.7023827...],
                          [ 489.        ,    0.7133032...],
                          [ 490.        ,    0.7244513...],
                          [ 491.        ,    0.7358470...],
                          [ 492.        ,    0.7468118...],
                          [ 493.        ,    0.7580294...],
                          [ 494.        ,    0.7694964...],
                          [ 495.        ,    0.7805225...],
                          [ 496.        ,    0.7917805...],
                          [ 497.        ,    0.8026123...],
                          [ 498.        ,    0.8130793...],
                          [ 499.        ,    0.8239297...],
                          [ 500.        ,    0.8352251...],
                          [ 501.        ,    0.8456342...],
                          [ 502.        ,    0.8564818...],
                          [ 503.        ,    0.8676921...],
                          [ 504.        ,    0.8785021...],
                          [ 505.        ,    0.8881489...],
                          [ 506.        ,    0.8986405...],
                          [ 507.        ,    0.9079322...],
                          [ 508.        ,    0.9174255...],
                          [ 509.        ,    0.9257739...],
                          [ 510.        ,    0.9350656...],
                          [ 511.        ,    0.9432365...],
                          [ 512.        ,    0.9509063...],
                          [ 513.        ,    0.9586931...],
                          [ 514.        ,    0.9658413...],
                          [ 515.        ,    0.9722825...],
                          [ 516.        ,    0.9779924...],
                          [ 517.        ,    0.9836106...],
                          [ 518.        ,    0.9883465...],
                          [ 519.        ,    0.9920964...],
                          [ 520.        ,    0.9954436...],
                          [ 521.        ,    0.9976202...],
                          [ 522.        ,    0.9993457...],
                          [ 523.        ,    1.       ...],
                          [ 524.        ,    0.9996498...],
                          [ 525.        ,    0.9990487...],
                          [ 526.        ,    0.9975356...],
                          [ 527.        ,    0.9957615...],
                          [ 528.        ,    0.9930143...],
                          [ 529.        ,    0.9899559...],
                          [ 530.        ,    0.9858741...],
                          [ 531.        ,    0.9814453...],
                          [ 532.        ,    0.9766885...],
                          [ 533.        ,    0.9709363...],
                          [ 534.        ,    0.9648947...],
                          [ 535.        ,    0.9585832...],
                          [ 536.        ,    0.952012 ...],
                          [ 537.        ,    0.9444916...],
                          [ 538.        ,    0.9367089...],
                          [ 539.        ,    0.9293506...],
                          [ 540.        ,    0.9210429...],
                          [ 541.        ,    0.9124772...],
                          [ 542.        ,    0.9036604...],
                          [ 543.        ,    0.8945958...],
                          [ 544.        ,    0.8845999...],
                          [ 545.        ,    0.8750500...],
                          [ 546.        ,    0.8659457...],
                          [ 547.        ,    0.8559224...],
                          [ 548.        ,    0.8456846...],
                          [ 549.        ,    0.8352499...],
                          [ 550.        ,    0.8253229...],
                          [ 551.        ,    0.8152079...],
                          [ 552.        ,    0.8042205...],
                          [ 553.        ,    0.7944209...],
                          [ 554.        ,    0.7837466...],
                          [ 555.        ,    0.7735680...],
                          [ 556.        ,    0.7627808...],
                          [ 557.        ,    0.7522710...],
                          [ 558.        ,    0.7417549...],
                          [ 559.        ,    0.7312909...],
                          [ 560.        ,    0.7207983...],
                          [ 561.        ,    0.7101939...],
                          [ 562.        ,    0.6996362...],
                          [ 563.        ,    0.6890656...],
                          [ 564.        ,    0.6785599...],
                          [ 565.        ,    0.6680593...],
                          [ 566.        ,    0.6575697...],
                          [ 567.        ,    0.6471578...],
                          [ 568.        ,    0.6368208...],
                          [ 569.        ,    0.6264871...],
                          [ 570.        ,    0.6161541...],
                          [ 571.        ,    0.6058896...],
                          [ 572.        ,    0.5957000...],
                          [ 573.        ,    0.5855937...],
                          [ 574.        ,    0.5754412...],
                          [ 575.        ,    0.5653883...],
                          [ 576.        ,    0.5553742...],
                          [ 577.        ,    0.5454680...],
                          [ 578.        ,    0.5355972...],
                          [ 579.        ,    0.5258267...],
                          [ 580.        ,    0.5160152...],
                          [ 581.        ,    0.5062322...],
                          [ 582.        ,    0.4965595...],
                          [ 583.        ,    0.4868746...],
                          [ 584.        ,    0.4773299...],
                          [ 585.        ,    0.4678028...],
                          [ 586.        ,    0.4583704...],
                          [ 587.        ,    0.4489722...],
                          [ 588.        ,    0.4397606...],
                          [ 589.        ,    0.4306131...],
                          [ 590.        ,    0.4215446...],
                          [ 591.        ,    0.4125681...],
                          [ 592.        ,    0.4037550...],
                          [ 593.        ,    0.3950359...],
                          [ 594.        ,    0.3864104...],
                          [ 595.        ,    0.3778777...],
                          [ 596.        ,    0.3694405...],
                          [ 597.        ,    0.3611074...],
                          [ 598.        ,    0.3528596...],
                          [ 599.        ,    0.3447056...],
                          [ 600.        ,    0.3366470...],
                          [ 601.        ,    0.3286917...],
                          [ 602.        ,    0.3208410...],
                          [ 603.        ,    0.3130808...],
                          [ 604.        ,    0.3054105...],
                          [ 605.        ,    0.2978225...],
                          [ 606.        ,    0.2903027...],
                          [ 607.        ,    0.2828727...],
                          [ 608.        ,    0.2755311...],
                          [ 609.        ,    0.2682900...],
                          [ 610.        ,    0.2611478...],
                          [ 611.        ,    0.2541176...],
                          [ 612.        ,    0.2471885...],
                          [ 613.        ,    0.2403570...],
                          [ 614.        ,    0.2336057...],
                          [ 615.        ,    0.2269379...],
                          [ 616.        ,    0.2203527...],
                          [ 617.        ,    0.2138465...],
                          [ 618.        ,    0.2073946...],
                          [ 619.        ,    0.2009789...],
                          [ 620.        ,    0.1945818...],
                          [ 621.        ,    0.1881943...],
                          [ 622.        ,    0.1818226...],
                          [ 623.        ,    0.1754987...],
                          [ 624.        ,    0.1692476...],
                          [ 625.        ,    0.1630876...],
                          [ 626.        ,    0.1570257...],
                          [ 627.        ,    0.151071 ...],
                          [ 628.        ,    0.1452469...],
                          [ 629.        ,    0.1395845...],
                          [ 630.        ,    0.1341087...],
                          [ 631.        ,    0.1288408...],
                          [ 632.        ,    0.1237666...],
                          [ 633.        ,    0.1188631...],
                          [ 634.        ,    0.1141075...],
                          [ 635.        ,    0.1094766...],
                          [ 636.        ,    0.1049613...],
                          [ 637.        ,    0.1005679...],
                          [ 638.        ,    0.0962924...],
                          [ 639.        ,    0.0921296...],
                          [ 640.        ,    0.0880778...],
                          [ 641.        ,    0.0841306...],
                          [ 642.        ,    0.0802887...],
                          [ 643.        ,    0.0765559...],
                          [ 644.        ,    0.0729367...],
                          [ 645.        ,    0.0694345...],
                          [ 646.        ,    0.0660491...],
                          [ 647.        ,    0.0627792...],
                          [ 648.        ,    0.0596278...],
                          [ 649.        ,    0.0565970...],
                          [ 650.        ,    0.0536896...],
                          [ 651.        ,    0.0509068...],
                          [ 652.        ,    0.0482444...],
                          [ 653.        ,    0.0456951...],
                          [ 654.        ,    0.0432510...],
                          [ 655.        ,    0.0409052...],
                          [ 656.        ,    0.0386537...],
                          [ 657.        ,    0.0364955...],
                          [ 658.        ,    0.0344285...],
                          [ 659.        ,    0.0324501...],
                          [ 660.        ,    0.0305579...],
                          [ 661.        ,    0.0287496...],
                          [ 662.        ,    0.0270233...],
                          [ 663.        ,    0.0253776...],
                          [ 664.        ,    0.0238113...],
                          [ 665.        ,    0.0223226...],
                          [ 666.        ,    0.0209086...],
                          [ 667.        ,    0.0195688...],
                          [ 668.        ,    0.0183056...],
                          [ 669.        ,    0.0171216...],
                          [ 670.        ,    0.0160192...],
                          [ 671.        ,    0.0149986...],
                          [ 672.        ,    0.0140537...],
                          [ 673.        ,    0.0131784...],
                          [ 674.        ,    0.0123662...],
                          [ 675.        ,    0.0116107...],
                          [ 676.        ,    0.0109098...],
                          [ 677.        ,    0.0102587...],
                          [ 678.        ,    0.0096476...],
                          [ 679.        ,    0.0090665...],
                          [ 680.        ,    0.0085053...],
                          [ 681.        ,    0.0079567...],
                          [ 682.        ,    0.0074229...],
                          [ 683.        ,    0.0069094...],
                          [ 684.        ,    0.0064213...],
                          [ 685.        ,    0.0059637...],
                          [ 686.        ,    0.0055377...],
                          [ 687.        ,    0.0051402...],
                          [ 688.        ,    0.00477  ...],
                          [ 689.        ,    0.0044263...],
                          [ 690.        ,    0.0041081...],
                          [ 691.        ,    0.0038149...],
                          [ 692.        ,    0.0035456...],
                          [ 693.        ,    0.0032984...],
                          [ 694.        ,    0.0030718...],
                          [ 695.        ,    0.0028639...],
                          [ 696.        ,    0.0026738...],
                          [ 697.        ,    0.0025000...],
                          [ 698.        ,    0.0023401...],
                          [ 699.        ,    0.0021918...],
                          [ 700.        ,    0.0020526...],
                          [ 701.        ,    0.0019207...],
                          [ 702.        ,    0.001796 ...],
                          [ 703.        ,    0.0016784...],
                          [ 704.        ,    0.0015683...],
                          [ 705.        ,    0.0014657...],
                          [ 706.        ,    0.0013702...],
                          [ 707.        ,    0.001281 ...],
                          [ 708.        ,    0.0011976...],
                          [ 709.        ,    0.0011195...],
                          [ 710.        ,    0.0010464...],
                          [ 711.        ,    0.0009776...],
                          [ 712.        ,    0.0009131...],
                          [ 713.        ,    0.0008525...],
                          [ 714.        ,    0.0007958...],
                          [ 715.        ,    0.0007427...],
                          [ 716.        ,    0.0006929...],
                          [ 717.        ,    0.0006462...],
                          [ 718.        ,    0.0006026...],
                          [ 719.        ,    0.0005619...],
                          [ 720.        ,    0.0005240...],
                          [ 721.        ,    0.0004888...],
                          [ 722.        ,    0.0004561...],
                          [ 723.        ,    0.0004255...],
                          [ 724.        ,    0.0003971...],
                          [ 725.        ,    0.0003704...],
                          [ 726.        ,    0.0003455...],
                          [ 727.        ,    0.0003221...],
                          [ 728.        ,    0.0003001...],
                          [ 729.        ,    0.0002796...],
                          [ 730.        ,    0.0002604...],
                          [ 731.        ,    0.0002423...],
                          [ 732.        ,    0.0002254...],
                          [ 733.        ,    0.0002095...],
                          [ 734.        ,    0.0001947...],
                          [ 735.        ,    0.0001809...],
                          [ 736.        ,    0.0001680...],
                          [ 737.        ,    0.0001560...],
                          [ 738.        ,    0.0001449...],
                          [ 739.        ,    0.0001345...],
                          [ 740.        ,    0.0001249...],
                          [ 741.        ,    0.0001159...],
                          [ 742.        ,    0.0001076...],
                          [ 743.        ,    0.0000999...],
                          [ 744.        ,    0.0000927...],
                          [ 745.        ,    0.0000862...],
                          [ 746.        ,    0.0000801...],
                          [ 747.        ,    0.0000745...],
                          [ 748.        ,    0.0000693...],
                          [ 749.        ,    0.0000646...],
                          [ 750.        ,    0.0000602...],
                          [ 751.        ,    0.0000561...],
                          [ 752.        ,    0.0000523...],
                          [ 753.        ,    0.0000488...],
                          [ 754.        ,    0.0000456...],
                          [ 755.        ,    0.0000425...],
                          [ 756.        ,    0.0000397...],
                          [ 757.        ,    0.0000370...],
                          [ 758.        ,    0.0000346...],
                          [ 759.        ,    0.0000322...],
                          [ 760.        ,    0.0000301...],
                          [ 761.        ,    0.0000281...],
                          [ 762.        ,    0.0000262...],
                          [ 763.        ,    0.0000244...],
                          [ 764.        ,    0.0000228...],
                          [ 765.        ,    0.0000213...],
                          [ 766.        ,    0.0000198...],
                          [ 767.        ,    0.0000185...],
                          [ 768.        ,    0.0000173...],
                          [ 769.        ,    0.0000161...],
                          [ 770.        ,    0.0000150...],
                          [ 771.        ,    0.0000140...],
                          [ 772.        ,    0.0000131...],
                          [ 773.        ,    0.0000122...],
                          [ 774.        ,    0.0000114...],
                          [ 775.        ,    0.0000106...],
                          [ 776.        ,    0.0000099...],
                          [ 777.        ,    0.0000092...],
                          [ 778.        ,    0.0000086...],
                          [ 779.        ,    0.0000080...],
                          [ 780.        ,    0.0000075...]],
                         interpolator=SpragueInterpolator,
                         interpolator_args={},
                         extrapolator=Extrapolator,
                         extrapolator_args={...})
    """

    photopic_lef_shape = photopic_lef.shape
    scotopic_lef_shape = scotopic_lef.shape
    shape = SpectralShape(
        max(photopic_lef_shape.start, scotopic_lef_shape.start),
        min(photopic_lef_shape.end, scotopic_lef_shape.end),
        max(photopic_lef_shape.interval, scotopic_lef_shape.interval))

    wavelengths = shape.range()

    sd_data = dict(
        zip(
            wavelengths,
            mesopic_weighting_function(wavelengths, Lp, source, method,
                                       photopic_lef, scotopic_lef)))

    sd = SpectralDistribution(
        sd_data, name='{0} Lp Mesopic Luminous Efficiency Function'.format(Lp))

    return sd.normalise()
コード例 #11
0
ファイル: illuminants.py プロジェクト: colour-science/colour
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 approximately 2856 K. *CIE Standard Illuminant A* should be used in all
    applications of colorimetry involving the use of incandescent lighting,
    unless there are specific reasons for using a different illuminant.

    Parameters
    ----------
    shape
        Spectral shape used to create the spectral distribution of the
        *CIE Standard Illuminant A*.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        *CIE Standard Illuminant A*. spectral distribution.

    References
    ----------
    :cite:`CIETC1-482004n`

    Examples
    --------
    >>> from colour import SpectralShape
    >>> sd_CIE_standard_illuminant_A(SpectralShape(400, 700, 10))
    ... # doctest: +ELLIPSIS
    SpectralDistribution([[ 400.        ,   14.7080384...],
                          [ 410.        ,   17.6752521...],
                          [ 420.        ,   20.9949572...],
                          [ 430.        ,   24.6709226...],
                          [ 440.        ,   28.7027304...],
                          [ 450.        ,   33.0858929...],
                          [ 460.        ,   37.8120566...],
                          [ 470.        ,   42.8692762...],
                          [ 480.        ,   48.2423431...],
                          [ 490.        ,   53.9131532...],
                          [ 500.        ,   59.8610989...],
                          [ 510.        ,   66.0634727...],
                          [ 520.        ,   72.4958719...],
                          [ 530.        ,   79.1325945...],
                          [ 540.        ,   85.9470183...],
                          [ 550.        ,   92.9119589...],
                          [ 560.        ,  100.       ...],
                          [ 570.        ,  107.1837952...],
                          [ 580.        ,  114.4363383...],
                          [ 590.        ,  121.7312009...],
                          [ 600.        ,  129.0427389...],
                          [ 610.        ,  136.3462674...],
                          [ 620.        ,  143.6182057...],
                          [ 630.        ,  150.8361944...],
                          [ 640.        ,  157.9791857...],
                          [ 650.        ,  165.0275098...],
                          [ 660.        ,  171.9629200...],
                          [ 670.        ,  178.7686175...],
                          [ 680.        ,  185.4292591...],
                          [ 690.        ,  191.9309499...],
                          [ 700.        ,  198.2612232...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    wavelengths = shape.range()
    values = (
        100
        * (560 / wavelengths) ** 5
        * (
            np.expm1((1.435 * 10**7) / (2848 * 560))
            / np.expm1((1.435 * 10**7) / (2848 * wavelengths))
        )
    )

    return SpectralDistribution(
        values, wavelengths, name="CIE Standard Illuminant A"
    )
コード例 #12
0
    [0.35760870152308100, 0.32914390227898000, 0.31324730130288600],
    [0.34871280010839300, 0.33080872680368200, 0.32047832512463300],
    [0.34488011934469100, 0.33148268992224300, 0.32363699470796100],
    [0.34191787732329100, 0.33198455035238900, 0.32609730884690000],
    [0.33953109298712900, 0.33234117252254500, 0.32812736934018400],
    [0.33716950377436700, 0.33291200941553900, 0.32991797595888800],
    [0.33617201852771700, 0.33291927969521400, 0.33090790121664900],
    [0.33516744343336300, 0.33302767257885600, 0.33180363309599500],
    [0.33442162530646300, 0.33317970467326000, 0.33239662725536100],
    [0.33400876037640200, 0.33324703097454900, 0.33274078072682400],
    [0.33391579279008200, 0.33325934921060100, 0.33282085708148900],
    [0.33381845494636700, 0.33327505027938300, 0.33290173128344400],
    [0.33367277492845600, 0.33329432844873200, 0.33302596748863200],
    [0.33356951340559100, 0.33330942495777500, 0.33311108308149700],
])

MSDS_BASIS_FUNCTIONS_sRGB_MALLETT2019 = MultiSpectralDistributions(
    DATA_BASIS_FUNCTIONS_sRGB_MALLETT2019,
    SPECTRAL_SHAPE_sRGB_MALLETT2019.range(),
    name='Basis Functions - sRGB - Mallett 2019',
    labels=('red', 'green', 'blue'))
"""
*Mallett and Yuksel (2019)* basis functions for the *sRGB* colourspace.

References
----------
:cite:`Mallett2019`

MSDS_BASIS_FUNCTIONS_sRGB_MALLETT2019 : MultiSpectralDistributions
"""
コード例 #13
0
ファイル: cfi2017.py プロジェクト: colour-science/colour
def sd_reference_illuminant(CCT: Floating,
                            shape: SpectralShape) -> SpectralDistribution:
    """
    Compute the reference illuminant for a given correlated colour temperature
    :math:`T_{cp}` for use in *CIE 2017 Colour Fidelity Index* (CFI)
    computation.

    Parameters
    ----------
    CCT
        Correlated colour temperature :math:`T_{cp}`.
    shape
        Desired shape of the returned spectral distribution.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        Reference illuminant for *CIE 2017 Colour Fidelity Index* (CFI)
        computation.

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_reference_illuminant(  # doctest: +ELLIPSIS
    ...         4224.469705295263300, SpectralShape(380, 780, 20))
    SpectralDistribution([[ 380.        ,    0.0034089...],
                          [ 400.        ,    0.0044208...],
                          [ 420.        ,    0.0053260...],
                          [ 440.        ,    0.0062857...],
                          [ 460.        ,    0.0072767...],
                          [ 480.        ,    0.0080207...],
                          [ 500.        ,    0.0086590...],
                          [ 520.        ,    0.0092242...],
                          [ 540.        ,    0.0097686...],
                          [ 560.        ,    0.0101444...],
                          [ 580.        ,    0.0104475...],
                          [ 600.        ,    0.0107642...],
                          [ 620.        ,    0.0110439...],
                          [ 640.        ,    0.0112535...],
                          [ 660.        ,    0.0113922...],
                          [ 680.        ,    0.0115185...],
                          [ 700.        ,    0.0113155...],
                          [ 720.        ,    0.0108192...],
                          [ 740.        ,    0.0111582...],
                          [ 760.        ,    0.0101299...],
                          [ 780.        ,    0.0105638...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    if CCT <= 5000:
        sd_planckian = sd_blackbody(CCT, shape)

    if CCT >= 4000:
        xy = CCT_to_xy_CIE_D(CCT)
        sd_daylight = sd_CIE_illuminant_D_series(xy).align(shape)

    if CCT < 4000:
        sd_reference = sd_planckian
    elif 4000 <= CCT <= 5000:
        # Planckian and daylight illuminant must be normalised so that the
        # mixture isn't biased.
        sd_planckian /= sd_to_XYZ(sd_planckian)[1]  # type: ignore[misc]
        sd_daylight /= sd_to_XYZ(sd_daylight)[1]  # type: ignore[misc]

        # Mixture: 4200K should be 80% Planckian, 20% CIE Illuminant D Series.
        m = (CCT - 4000) / 1000
        values = linstep_function(m, sd_planckian.values, sd_daylight.values)
        name = (f"{as_int_scalar(CCT)}K "
                f"Blackbody & CIE Illuminant D Series Mixture - "
                f"{as_float_scalar(100 * m):.1f}%")
        sd_reference = SpectralDistribution(values, shape.range(), name=name)
    elif CCT > 5000:
        sd_reference = sd_daylight

    return sd_reference
コード例 #14
0
ファイル: lefs.py プロジェクト: Nick-Shaw/colour
def mesopic_luminous_efficiency_function(
        Lp,
        source='Blue Heavy',
        method='MOVE',
        photopic_lef=PHOTOPIC_LEFS.get(
            'CIE 1924 Photopic Standard Observer'),
        scotopic_lef=SCOTOPIC_LEFS.get(
            'CIE 1951 Scotopic Standard Observer')):
    """
    Returns the mesopic luminous efficiency function :math:`V_m(\lambda)` for
    given photopic luminance :math:`L_p`.

    Parameters
    ----------
    Lp : numeric
        Photopic luminance :math:`L_p`.
    source : unicode, optional
        **{'Blue Heavy', 'Red Heavy'}**,
        Light source colour temperature.
    method : unicode, optional
        **{'MOVE', 'LRC'}**,
        Method to calculate the weighting factor.
    photopic_lef : SpectralPowerDistribution, optional
        :math:`V(\lambda)` photopic luminous efficiency function.
    scotopic_lef : SpectralPowerDistribution, optional
        :math:`V^\prime(\lambda)` scotopic luminous efficiency function.

    Returns
    -------
    SpectralPowerDistribution
        Mesopic luminous efficiency function :math:`V_m(\lambda)`.

    Examples
    --------
    >>> print(mesopic_luminous_efficiency_function(0.2))
    SpectralPowerDistribution(\
'0.2 Lp Mesopic Luminous Efficiency Function', (380.0, 780.0, 1.0))
    """

    photopic_lef_shape = photopic_lef.shape
    scotopic_lef_shape = scotopic_lef.shape
    shape = SpectralShape(
        max(photopic_lef_shape.start, scotopic_lef_shape.start),
        min(photopic_lef_shape.end, scotopic_lef_shape.end),
        max(photopic_lef_shape.interval, scotopic_lef_shape.interval))

    wavelengths = shape.range()

    spd_data = dict(zip(wavelengths,
                        mesopic_weighting_function(
                            wavelengths,
                            Lp,
                            source,
                            method,
                            photopic_lef,
                            scotopic_lef)))

    spd = SpectralPowerDistribution(
        '{0} Lp Mesopic Luminous Efficiency Function'.format(Lp),
        spd_data)

    return spd.normalise()
コード例 #15
0
ファイル: blackbody.py プロジェクト: colour-science/colour
def sd_blackbody(
    temperature: Floating,
    shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT,
    c1: Floating = CONSTANT_C1,
    c2: Floating = CONSTANT_C2,
    n: Floating = CONSTANT_N,
) -> SpectralDistribution:
    """
    Return the spectral distribution of the planckian radiator for given
    temperature :math:`T[K]` with values in
    *watts per steradian per square metre per nanometer* (:math:`W/sr/m^2/nm`).

    Parameters
    ----------
    temperature
        Temperature :math:`T[K]` in kelvin degrees.
    shape
        Spectral shape used to create the spectral distribution of the
        planckian radiator.
    c1
        The official value of :math:`c1` is provided by the Committee on Data
        for Science and Technology (CODATA) and is
        :math:`c1=3,741771x10.16\\ W/m_2` *(Mohr and Taylor, 2000)*.
    c2
        Since :math:`T` is measured on the International Temperature Scale,
        the value of :math:`c2` used in colorimetry should follow that adopted
        in the current International Temperature Scale (ITS-90)
        *(Preston-Thomas, 1990; Mielenz et aI., 1991)*, namely
        :math:`c2=1,4388x10.2\\ m/K`.
    n
        Medium index of refraction. For dry air at 15C and 101 325 Pa,
        containing 0,03 percent by volume of carbon dioxide, it is
        approximately 1,00028 throughout the visible region although
        *CIE 15:2004* recommends using :math:`n=1`.

    Returns
    -------
    :class:`colour.SpectralDistribution`
        Blackbody spectral distribution with values in
        *watts per steradian per square metre per nanometer*
        (:math:`W/sr/m^2/nm`).

    Examples
    --------
    >>> from colour.utilities import numpy_print_options
    >>> with numpy_print_options(suppress=True):
    ...     sd_blackbody(5000)  # doctest: +ELLIPSIS
    SpectralDistribution([[   360.        ,   6654.2782706...],
                          [   361.        ,   6709.6052792...],
                          [   362.        ,   6764.8251215...],
                          [   363.        ,   6819.9330786...],
                          [   364.        ,   6874.9244898...],
                          [   365.        ,   6929.7947526...],
                          [   366.        ,   6984.5393232...],
                          [   367.        ,   7039.1537166...],
                          [   368.        ,   7093.6335071...],
                          [   369.        ,   7147.9743284...],
                          [   370.        ,   7202.1718736...],
                          [   371.        ,   7256.2218956...],
                          [   372.        ,   7310.1202073...],
                          [   373.        ,   7363.8626816...],
                          [   374.        ,   7417.4452515...],
                          [   375.        ,   7470.8639102...],
                          [   376.        ,   7524.1147113...],
                          [   377.        ,   7577.1937686...],
                          [   378.        ,   7630.0972565...],
                          [   379.        ,   7682.8214094...],
                          [   380.        ,   7735.3625224...],
                          [   381.        ,   7787.7169506...],
                          [   382.        ,   7839.8811097...],
                          [   383.        ,   7891.8514754...],
                          [   384.        ,   7943.6245836...],
                          [   385.        ,   7995.1970300...],
                          [   386.        ,   8046.5654705...],
                          [   387.        ,   8097.7266205...],
                          [   388.        ,   8148.6772551...],
                          [   389.        ,   8199.4142089...],
                          [   390.        ,   8249.9343757...],
                          [   391.        ,   8300.2347083...],
                          [   392.        ,   8350.3122185...],
                          [   393.        ,   8400.1639766...],
                          [   394.        ,   8449.7871113...],
                          [   395.        ,   8499.1788096...],
                          [   396.        ,   8548.3363163...],
                          [   397.        ,   8597.2569337...],
                          [   398.        ,   8645.9380216...],
                          [   399.        ,   8694.3769968...],
                          [   400.        ,   8742.5713329...],
                          [   401.        ,   8790.5185599...],
                          [   402.        ,   8838.2162638...],
                          [   403.        ,   8885.6620864...],
                          [   404.        ,   8932.8537251...],
                          [   405.        ,   8979.7889322...],
                          [   406.        ,   9026.4655149...],
                          [   407.        ,   9072.8813344...],
                          [   408.        ,   9119.0343064...],
                          [   409.        ,   9164.9223997...],
                          [   410.        ,   9210.5436366...],
                          [   411.        ,   9255.8960922...],
                          [   412.        ,   9300.9778938...],
                          [   413.        ,   9345.7872209...],
                          [   414.        ,   9390.3223045...],
                          [   415.        ,   9434.5814267...],
                          [   416.        ,   9478.5629206...],
                          [   417.        ,   9522.2651692...],
                          [   418.        ,   9565.6866057...],
                          [   419.        ,   9608.8257125...],
                          [   420.        ,   9651.6810212...],
                          [   421.        ,   9694.2511118...],
                          [   422.        ,   9736.5346124...],
                          [   423.        ,   9778.5301986...],
                          [   424.        ,   9820.2365935...],
                          [   425.        ,   9861.6525666...],
                          [   426.        ,   9902.7769336...],
                          [   427.        ,   9943.6085564...],
                          [   428.        ,   9984.1463416...],
                          [   429.        ,  10024.3892411...],
                          [   430.        ,  10064.3362510...],
                          [   431.        ,  10103.9864112...],
                          [   432.        ,  10143.3388051...],
                          [   433.        ,  10182.3925589...],
                          [   434.        ,  10221.1468414...],
                          [   435.        ,  10259.6008633...],
                          [   436.        ,  10297.7538768...],
                          [   437.        ,  10335.6051749...],
                          [   438.        ,  10373.1540914...],
                          [   439.        ,  10410.3999999...],
                          [   440.        ,  10447.3423137...],
                          [   441.        ,  10483.9804852...],
                          [   442.        ,  10520.3140051...],
                          [   443.        ,  10556.3424025...],
                          [   444.        ,  10592.0652439...],
                          [   445.        ,  10627.4821331...],
                          [   446.        ,  10662.5927104...],
                          [   447.        ,  10697.3966524...],
                          [   448.        ,  10731.8936712...],
                          [   449.        ,  10766.0835144...],
                          [   450.        ,  10799.9659640...],
                          [   451.        ,  10833.5408365...],
                          [   452.        ,  10866.8079821...],
                          [   453.        ,  10899.7672843...],
                          [   454.        ,  10932.4186594...],
                          [   455.        ,  10964.7620561...],
                          [   456.        ,  10996.7974551...],
                          [   457.        ,  11028.5248683...],
                          [   458.        ,  11059.9443388...],
                          [   459.        ,  11091.0559402...],
                          [   460.        ,  11121.8597759...],
                          [   461.        ,  11152.3559791...],
                          [   462.        ,  11182.5447121...],
                          [   463.        ,  11212.4261658...],
                          [   464.        ,  11242.0005596...],
                          [   465.        ,  11271.2681403...],
                          [   466.        ,  11300.2291822...],
                          [   467.        ,  11328.8839867...],
                          [   468.        ,  11357.2328813...],
                          [   469.        ,  11385.2762197...],
                          [   470.        ,  11413.0143813...],
                          [   471.        ,  11440.4477705...],
                          [   472.        ,  11467.5768165...],
                          [   473.        ,  11494.4019726...],
                          [   474.        ,  11520.9237164...],
                          [   475.        ,  11547.1425485...],
                          [   476.        ,  11573.0589928...],
                          [   477.        ,  11598.6735959...],
                          [   478.        ,  11623.9869264...],
                          [   479.        ,  11648.9995750...],
                          [   480.        ,  11673.7121534...],
                          [   481.        ,  11698.1252948...],
                          [   482.        ,  11722.2396526...],
                          [   483.        ,  11746.0559008...],
                          [   484.        ,  11769.5747329...],
                          [   485.        ,  11792.7968621...],
                          [   486.        ,  11815.7230205...],
                          [   487.        ,  11838.3539591...],
                          [   488.        ,  11860.6904469...],
                          [   489.        ,  11882.7332712...],
                          [   490.        ,  11904.4832366...],
                          [   491.        ,  11925.9411650...],
                          [   492.        ,  11947.1078953...],
                          [   493.        ,  11967.9842826...],
                          [   494.        ,  11988.5711984...],
                          [   495.        ,  12008.8695298...],
                          [   496.        ,  12028.8801795...],
                          [   497.        ,  12048.6040651...],
                          [   498.        ,  12068.0421192...],
                          [   499.        ,  12087.1952887...],
                          [   500.        ,  12106.0645344...],
                          [   501.        ,  12124.6508312...],
                          [   502.        ,  12142.9551672...],
                          [   503.        ,  12160.9785437...],
                          [   504.        ,  12178.7219748...],
                          [   505.        ,  12196.1864870...],
                          [   506.        ,  12213.3731190...],
                          [   507.        ,  12230.2829214...],
                          [   508.        ,  12246.9169563...],
                          [   509.        ,  12263.2762971...],
                          [   510.        ,  12279.3620282...],
                          [   511.        ,  12295.1752445...],
                          [   512.        ,  12310.7170514...],
                          [   513.        ,  12325.9885643...],
                          [   514.        ,  12340.9909086...],
                          [   515.        ,  12355.7252189...],
                          [   516.        ,  12370.1926394...],
                          [   517.        ,  12384.3943230...],
                          [   518.        ,  12398.3314315...],
                          [   519.        ,  12412.0051350...],
                          [   520.        ,  12425.4166118...],
                          [   521.        ,  12438.5670483...],
                          [   522.        ,  12451.4576382...],
                          [   523.        ,  12464.0895830...],
                          [   524.        ,  12476.4640911...],
                          [   525.        ,  12488.5823780...],
                          [   526.        ,  12500.4456657...],
                          [   527.        ,  12512.0551828...],
                          [   528.        ,  12523.4121640...],
                          [   529.        ,  12534.5178499...],
                          [   530.        ,  12545.3734871...],
                          [   531.        ,  12555.9803275...],
                          [   532.        ,  12566.3396282...],
                          [   533.        ,  12576.4526517...],
                          [   534.        ,  12586.3206651...],
                          [   535.        ,  12595.9449403...],
                          [   536.        ,  12605.3267534...],
                          [   537.        ,  12614.4673849...],
                          [   538.        ,  12623.3681194...],
                          [   539.        ,  12632.0302452...],
                          [   540.        ,  12640.4550541...],
                          [   541.        ,  12648.6438417...],
                          [   542.        ,  12656.5979064...],
                          [   543.        ,  12664.3185499...],
                          [   544.        ,  12671.8070768...],
                          [   545.        ,  12679.0647943...],
                          [   546.        ,  12686.0930120...],
                          [   547.        ,  12692.8930419...],
                          [   548.        ,  12699.4661982...],
                          [   549.        ,  12705.8137971...],
                          [   550.        ,  12711.9371564...],
                          [   551.        ,  12717.8375957...],
                          [   552.        ,  12723.5164362...],
                          [   553.        ,  12728.9750001...],
                          [   554.        ,  12734.2146109...],
                          [   555.        ,  12739.2365933...],
                          [   556.        ,  12744.0422724...],
                          [   557.        ,  12748.6329745...],
                          [   558.        ,  12753.0100260...],
                          [   559.        ,  12757.1747541...],
                          [   560.        ,  12761.1284859...],
                          [   561.        ,  12764.8725489...],
                          [   562.        ,  12768.4082704...],
                          [   563.        ,  12771.7369777...],
                          [   564.        ,  12774.8599976...],
                          [   565.        ,  12777.7786567...],
                          [   566.        ,  12780.4942809...],
                          [   567.        ,  12783.0081955...],
                          [   568.        ,  12785.3217250...],
                          [   569.        ,  12787.4361930...],
                          [   570.        ,  12789.3529220...],
                          [   571.        ,  12791.0732335...],
                          [   572.        ,  12792.5984474...],
                          [   573.        ,  12793.9298826...],
                          [   574.        ,  12795.0688562...],
                          [   575.        ,  12796.0166840...],
                          [   576.        ,  12796.7746799...],
                          [   577.        ,  12797.3441559...],
                          [   578.        ,  12797.7264224...],
                          [   579.        ,  12797.9227874...],
                          [   580.        ,  12797.9345572...],
                          [   581.        ,  12797.7630356...],
                          [   582.        ,  12797.4095241...],
                          [   583.        ,  12796.8753220...],
                          [   584.        ,  12796.1617260...],
                          [   585.        ,  12795.2700302...],
                          [   586.        ,  12794.2015261...],
                          [   587.        ,  12792.9575025...],
                          [   588.        ,  12791.5392453...],
                          [   589.        ,  12789.9480374...],
                          [   590.        ,  12788.1851590...],
                          [   591.        ,  12786.2518870...],
                          [   592.        ,  12784.1494952...],
                          [   593.        ,  12781.8792543...],
                          [   594.        ,  12779.4424316...],
                          [   595.        ,  12776.8402910...],
                          [   596.        ,  12774.0740932...],
                          [   597.        ,  12771.1450952...],
                          [   598.        ,  12768.0545506...],
                          [   599.        ,  12764.8037091...],
                          [   600.        ,  12761.3938171...],
                          [   601.        ,  12757.8261171...],
                          [   602.        ,  12754.1018476...],
                          [   603.        ,  12750.2222435...],
                          [   604.        ,  12746.1885357...],
                          [   605.        ,  12742.0019511...],
                          [   606.        ,  12737.6637126...],
                          [   607.        ,  12733.1750389...],
                          [   608.        ,  12728.5371449...],
                          [   609.        ,  12723.7512409...],
                          [   610.        ,  12718.8185333...],
                          [   611.        ,  12713.7402241...],
                          [   612.        ,  12708.5175109...],
                          [   613.        ,  12703.1515870...],
                          [   614.        ,  12697.6436414...],
                          [   615.        ,  12691.9948585...],
                          [   616.        ,  12686.2064183...],
                          [   617.        ,  12680.2794963...],
                          [   618.        ,  12674.2152632...],
                          [   619.        ,  12668.0148855...],
                          [   620.        ,  12661.6795247...],
                          [   621.        ,  12655.2103378...],
                          [   622.        ,  12648.6084770...],
                          [   623.        ,  12641.8750899...],
                          [   624.        ,  12635.0113192...],
                          [   625.        ,  12628.0183029...],
                          [   626.        ,  12620.8971740...],
                          [   627.        ,  12613.6490609...],
                          [   628.        ,  12606.2750869...],
                          [   629.        ,  12598.7763704...],
                          [   630.        ,  12591.1540251...],
                          [   631.        ,  12583.4091595...],
                          [   632.        ,  12575.5428771...],
                          [   633.        ,  12567.5562766...],
                          [   634.        ,  12559.4504515...],
                          [   635.        ,  12551.2264904...],
                          [   636.        ,  12542.8854766...],
                          [   637.        ,  12534.4284886...],
                          [   638.        ,  12525.8565997...],
                          [   639.        ,  12517.1708779...],
                          [   640.        ,  12508.3723863...],
                          [   641.        ,  12499.4621828...],
                          [   642.        ,  12490.4413201...],
                          [   643.        ,  12481.3108457...],
                          [   644.        ,  12472.0718019...],
                          [   645.        ,  12462.7252260...],
                          [   646.        ,  12453.2721498...],
                          [   647.        ,  12443.7136000...],
                          [   648.        ,  12434.0505982...],
                          [   649.        ,  12424.2841606...],
                          [   650.        ,  12414.4152982...],
                          [   651.        ,  12404.4450167...],
                          [   652.        ,  12394.3743166...],
                          [   653.        ,  12384.2041931...],
                          [   654.        ,  12373.9356362...],
                          [   655.        ,  12363.5696306...],
                          [   656.        ,  12353.1071555...],
                          [   657.        ,  12342.5491851...],
                          [   658.        ,  12331.8966883...],
                          [   659.        ,  12321.1506285...],
                          [   660.        ,  12310.3119640...],
                          [   661.        ,  12299.3816476...],
                          [   662.        ,  12288.3606272...],
                          [   663.        ,  12277.2498448...],
                          [   664.        ,  12266.0502378...],
                          [   665.        ,  12254.7627377...],
                          [   666.        ,  12243.3882711...],
                          [   667.        ,  12231.9277592...],
                          [   668.        ,  12220.3821179...],
                          [   669.        ,  12208.7522577...],
                          [   670.        ,  12197.0390841...],
                          [   671.        ,  12185.2434970...],
                          [   672.        ,  12173.3663914...],
                          [   673.        ,  12161.4086567...],
                          [   674.        ,  12149.3711771...],
                          [   675.        ,  12137.2548318...],
                          [   676.        ,  12125.0604945...],
                          [   677.        ,  12112.7890338...],
                          [   678.        ,  12100.4413128...],
                          [   679.        ,  12088.0181898...],
                          [   680.        ,  12075.5205176...],
                          [   681.        ,  12062.9491438...],
                          [   682.        ,  12050.3049109...],
                          [   683.        ,  12037.5886562...],
                          [   684.        ,  12024.8012117...],
                          [   685.        ,  12011.9434044...],
                          [   686.        ,  11999.016056 ...],
                          [   687.        ,  11986.0199830...],
                          [   688.        ,  11972.9559971...],
                          [   689.        ,  11959.8249045...],
                          [   690.        ,  11946.6275064...],
                          [   691.        ,  11933.3645990...],
                          [   692.        ,  11920.0369733...],
                          [   693.        ,  11906.6454152...],
                          [   694.        ,  11893.1907055...],
                          [   695.        ,  11879.6736202...],
                          [   696.        ,  11866.0949300...],
                          [   697.        ,  11852.4554007...],
                          [   698.        ,  11838.7557929...],
                          [   699.        ,  11824.9968625...],
                          [   700.        ,  11811.1793602...],
                          [   701.        ,  11797.3040317...],
                          [   702.        ,  11783.3716180...],
                          [   703.        ,  11769.3828548...],
                          [   704.        ,  11755.3384733...],
                          [   705.        ,  11741.2391993...],
                          [   706.        ,  11727.0857541...],
                          [   707.        ,  11712.878854 ...],
                          [   708.        ,  11698.6192103...],
                          [   709.        ,  11684.3075296...],
                          [   710.        ,  11669.9445138...],
                          [   711.        ,  11655.5308596...],
                          [   712.        ,  11641.0672593...],
                          [   713.        ,  11626.5544002...],
                          [   714.        ,  11611.9929648...],
                          [   715.        ,  11597.3836310...],
                          [   716.        ,  11582.7270720...],
                          [   717.        ,  11568.0239562...],
                          [   718.        ,  11553.2749471...],
                          [   719.        ,  11538.4807040...],
                          [   720.        ,  11523.6418811...],
                          [   721.        ,  11508.7591283...],
                          [   722.        ,  11493.8330905...],
                          [   723.        ,  11478.8644085...],
                          [   724.        ,  11463.8537180...],
                          [   725.        ,  11448.8016505...],
                          [   726.        ,  11433.7088327...],
                          [   727.        ,  11418.5758871...],
                          [   728.        ,  11403.4034314...],
                          [   729.        ,  11388.1920788...],
                          [   730.        ,  11372.9424382...],
                          [   731.        ,  11357.6551141...],
                          [   732.        ,  11342.3307063...],
                          [   733.        ,  11326.9698104...],
                          [   734.        ,  11311.5730175...],
                          [   735.        ,  11296.1409144...],
                          [   736.        ,  11280.6740836...],
                          [   737.        ,  11265.1731031...],
                          [   738.        ,  11249.6385466...],
                          [   739.        ,  11234.0709837...],
                          [   740.        ,  11218.4709796...],
                          [   741.        ,  11202.8390952...],
                          [   742.        ,  11187.1758873...],
                          [   743.        ,  11171.4819083...],
                          [   744.        ,  11155.7577065...],
                          [   745.        ,  11140.0038261...],
                          [   746.        ,  11124.2208070...],
                          [   747.        ,  11108.4091852...],
                          [   748.        ,  11092.5694922...],
                          [   749.        ,  11076.7022559...],
                          [   750.        ,  11060.8079996...],
                          [   751.        ,  11044.8872430...],
                          [   752.        ,  11028.9405016...],
                          [   753.        ,  11012.9682867...],
                          [   754.        ,  10996.9711059...],
                          [   755.        ,  10980.9494627...],
                          [   756.        ,  10964.9038566...],
                          [   757.        ,  10948.8347833...],
                          [   758.        ,  10932.7427345...],
                          [   759.        ,  10916.6281979...],
                          [   760.        ,  10900.4916576...],
                          [   761.        ,  10884.3335937...],
                          [   762.        ,  10868.1544824...],
                          [   763.        ,  10851.9547962...],
                          [   764.        ,  10835.7350038...],
                          [   765.        ,  10819.4955701...],
                          [   766.        ,  10803.2369563...],
                          [   767.        ,  10786.9596199...],
                          [   768.        ,  10770.6640145...],
                          [   769.        ,  10754.3505902...],
                          [   770.        ,  10738.0197934...],
                          [   771.        ,  10721.6720668...],
                          [   772.        ,  10705.3078497...],
                          [   773.        ,  10688.9275774...],
                          [   774.        ,  10672.5316819...],
                          [   775.        ,  10656.1205916...],
                          [   776.        ,  10639.6947313...],
                          [   777.        ,  10623.2545223...],
                          [   778.        ,  10606.8003824...],
                          [   779.        ,  10590.3327259...],
                          [   780.        ,  10573.8519636...]],
                         interpolator=SpragueInterpolator,
                         interpolator_kwargs={},
                         extrapolator=Extrapolator,
                         extrapolator_kwargs={...})
    """

    wavelengths = shape.range()
    return SpectralDistribution(
        planck_law(wavelengths * 1e-9, temperature, c1, c2, n) * 1e-9,
        wavelengths,
        name=f"{temperature}K Blackbody",
    )