예제 #1
0
def rayleigh_spectrum_plot(illuminant, title, filename):
    '''Plot the spectrum of Rayleigh scattering of the specified illuminant.'''
    spectrum = rayleigh_illuminated_spectrum(illuminant)
    plots.spectrum_plot(spectrum,
                        title,
                        filename,
                        xlabel='Wavelength (nm)',
                        ylabel='Intensity ($W/m^2$)')
예제 #2
0
def rayleigh_spectrum_plot (illuminant, title, filename):
    '''Plot the spectrum of Rayleigh scattering of the specified illuminant.'''
    spectrum = rayleigh_illuminated_spectrum (illuminant)
    plots.spectrum_plot (
        spectrum,
        title,
        filename,
        xlabel = 'Wavelength (nm)',
        ylabel = 'Intensity ($W/m^2$)')
예제 #3
0
def spectral_line_555nm_plot():
    '''Plot a spectrum that has mostly only a line at 555 nm.
    It is widened a bit only so the plot looks nicer, otherwise the black curve covers up the color.'''
    spectrum_list = [[360.0, 0.0], [549.0, 0.0], [552.0, 100.0],
                     [553.0, 100.0], [554.0, 100.0], [555.0, 100.0],
                     [556.0, 100.0], [557.0, 100.0], [558.0, 100.0],
                     [557.0, 0.0], [830.0, 0.0]]
    spectrum = numpy.array(spectrum_list)
    plots.spectrum_plot(spectrum, '555 nm Spectral Line', 'line555nm')
예제 #4
0
def thinfilm_spectrum_plot(n1, n2, n3, thickness_nm, illuminant, title,
                           filename):
    '''Plot the spectrum of the reflection from a thin film for the given thickness [nm].'''
    film = thin_film(n1, n2, n3, thickness_nm)
    illuminated_spectrum = film.illuminated_spectrum(illuminant)
    plots.spectrum_plot(illuminated_spectrum,
                        title,
                        filename,
                        xlabel='Wavelength (nm)',
                        ylabel='Refection Intensity')
예제 #5
0
def blackbody_spectrum_plot(T_K):
    '''Draw the spectrum of a blackbody at the given temperature.'''
    spectrum = blackbody_spectrum(T_K)
    title = 'Blackbody Spectrum - T %d K' % (int(T_K))
    filename = 'BlackbodySpectrum-%dK' % (int(T_K))
    plots.spectrum_plot(spectrum,
                        title,
                        filename,
                        xlabel='Wavelength (nm)',
                        ylabel='Specific Intensity')
예제 #6
0
def thinfilm_spectrum_plot (n1, n2, n3, thickness_nm, illuminant, title, filename):
    '''Plot the spectrum of the reflection from a thin film for the given thickness [nm].'''
    film = thin_film (n1, n2, n3, thickness_nm)
    illuminated_spectrum = film.illuminated_spectrum (illuminant)
    plots.spectrum_plot (
        illuminated_spectrum,
        title,
        filename,
        xlabel   = 'Wavelength (nm)',
        ylabel   = 'Refection Intensity')
예제 #7
0
def blackbody_spectrum_plot (T_K):
    '''Draw the spectrum of a blackbody at the given temperature.'''
    spectrum = blackbody_spectrum (T_K)
    title    = 'Blackbody Spectrum - T %d K' % (round (T_K))
    filename = 'BlackbodySpectrum-%dK' % (round (T_K))
    plots.spectrum_plot (
        spectrum,
        title,
        filename,
        xlabel = 'Wavelength (nm)',
        ylabel = 'Specific Intensity')
예제 #8
0
def spectral_line_555nm_plot ():
    '''Plot a spectrum that has mostly only a line at 555 nm.
    It is widened a bit only so the plot looks nicer, otherwise the black curve covers up the color.'''
    spectrum_list = [
        [360.0, 0.0],
        [549.0, 0.0],
        [552.0, 100.0],
        [553.0, 100.0],
        [554.0, 100.0],
        [555.0, 100.0],
        [556.0, 100.0],
        [557.0, 100.0],
        [558.0, 100.0],
        [557.0, 0.0],
        [830.0, 0.0]]
    spectrum = numpy.array (spectrum_list)
    plots.spectrum_plot (spectrum, '555 nm Spectral Line', 'line555nm')
예제 #9
0
def figures():
    """Plot spectra for several illuminants."""
    # D65
    plots.spectrum_plot(get_illuminant_D65(), "CIE Illuminant D65", "Illuminant-D65")
    # A
    plots.spectrum_plot(get_illuminant_A(), "CIE Illuminant A", "Illuminant-A")
    # Constant
    plots.spectrum_plot(get_constant_illuminant(), "Constant Illuminant", "Illuminant-Const")
    # Blackbody (5778)
    plots.spectrum_plot(get_blackbody_illuminant(5778.0), "5778 K Illuminant", "Illuminant-5778")
예제 #10
0
def figures():
    '''Plot spectra for several illuminants.'''
    # D65
    plots.spectrum_plot(get_illuminant_D65(), 'CIE Illuminant D65',
                        'Illuminant-D65')
    # A
    plots.spectrum_plot(get_illuminant_A(), 'CIE Illuminant A', 'Illuminant-A')
    # Constant
    plots.spectrum_plot(get_constant_illuminant(), 'Constant Illuminant',
                        'Illuminant-Const')
    # Blackbody (5778)
    plots.spectrum_plot(get_blackbody_illuminant(5778.0), '5778 K Illuminant',
                        'Illuminant-5778')
예제 #11
0
def figures ():
    '''Plot spectra for several illuminants.'''
    # D65
    plots.spectrum_plot (
        get_illuminant_D65(), 'CIE Illuminant D65', 'Illuminant-D65')
    # A
    plots.spectrum_plot (
        get_illuminant_A(), 'CIE Illuminant A', 'Illuminant-A')
    # Constant
    plots.spectrum_plot (
        get_constant_illuminant(), 'Constant Illuminant', 'Illuminant-Const')
    # Blackbody (5778)
    plots.spectrum_plot (
        get_blackbody_illuminant (5778.0), '5778 K Illuminant', 'Illuminant-5778')