lentil.radiometry.Blackbody

class lentil.radiometry.Blackbody(wave, temp, waveunit='nm', valueunit='photlam')[source]

Class for representing a blackbody emitter.

Parameters
  • wave (array_like) – Array of wavelengths or wavenumbers

  • temp (float) – Temperature in K

  • waveunit (str) – Wavelength units, as accepted by Unit(). Default is nm.

  • valueunit (str) – Flux units, as accepted by Unit(). Default is photlam.

Examples

Create a Blackbody object with wavelength range 400-4000 nm and a temperature of 4000K:

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> import lentil
>>> wave = np.arange(400,4000)
>>> temp = 5000
>>> src = lentil.radiometry.Blackbody(wave,temp,waveunit='nm')
>>> plt.plot(src.wave, src.value), plt.grid()
>>> plt.xlabel('Wavelength [nm]'), plt.ylabel('Flux [photons/sec/m^2/sr]')
../_images/lentil-radiometry-Blackbody-1.png

Attributes

value

valueunit

wave

waveunit

Methods

add(other[, sampling, method, fill_value])

Add Spectrum and other, element-wise

append(other[, copy])

Append Spectrum to the end of caller

asarray()

Return wave and value as an array.

bin(wave[, interp_method, ends, ...])

Compute a binned representation of the Spectrum data at a given array of central wavelengths.

copy()

crop(min_wave, max_wave)

Crop a Spectrum object.

divide(other[, sampling, method, fill_value])

Divide Spectrum and other, element-wise

ends([tol])

Locate the indices defining the continuous nonzero portion of the value

from_csv(filename, waveunit, valueunit[, ...])

Create a Spectrum from a csv file.

integrate([start, end, method])

Compute the integrated value between start and end.

multiply(other[, sampling, method, fill_value])

Multiply Spectrum and other, element-wise

pad(ends[, sampling, mode])

Pad a Spectrum

power(other[, sampling, method, fill_value])

Spectrum elements raised to powers from other, element-wise

resample(wave[, method, fill_value, waveunit])

Sample the Spectrum object at a set of desired wavelengths and overwrite the object's wave and value attributes.

sample(wave[, waveunit])

Sample the Spectrum at a set of desired wavelengths.

sample_vegamag(wave, temp, waveunit, valueunit)

subtract(other[, sampling, method, fill_value])

Subtract Spectrum and other, element-wise

to(*args)

Set new wavelength and/or value units.

trim([tol])

Trim the zero or near-zero ends off the Spectrum object.

vegamag(wave, temp, mag, band[, waveunit, ...])

Create a Blackbody with its irradiance scaled to an apparent magnitude.