IDL5 - ; ;(a) Plot out the Planck function for...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
; ;(a) Plot out the Planck function for temperatures of 100, 300, 500, 6000 K in both ; frequency and wavelength ;(b) Overplot the limiting cases ;(c) Calculate the maximum value of the Planck function using Wien's displacement law to ; find the wavelength of the max, and compare it to the maximum in the plot. ; ;F(lambda) = 2*pi*hc^2/(lambda^5) x [exp(-hc/(lambda k T))-1] ;F(freq) = 2*pi*h*f^3/c^2 x [exp(-hf/kT) - 1] ; h = 6.625e-34 ; J s c = 3.0e8 ; m s-1 k = 1.38e-23 ;J K-1 k T = [100.,300.,500.,6000.] ;temperature array (floating point) T ;Define the temperature labels for the plot strtemp=long(t) ;change T to integer (long) and convert this to string strtemp=strcompress(strtemp,/remove_all)+' K' ;remove all spaces and add K label. s nT=n_elements(T) ;# elements in temperature array maxf=fltarr(nt) ;This will hold the maximum of the Planck irradiance at each temperature, ; which will be used for part (c) of the problem ; =================================================================================== ============= ; WAVELENGTH PLOTS FIRST ; ;Define a wavelength array that will be appropriate for a log plot. ; This is somewhat arbitrary and defined by trial and error. ; It is defined with exponentials since a linear array either gives two ; few values at low wavelengths, or is far too big to be convenient. exponent=-1.0*10^(findgen(100)/100.) lambda=10^exponent l loadct,39 ;loads a rainbow color table l ;Define the color array that will assign one color to each temperature curve col=intarr(nt) ;we'll need nt colors, one for each temperature c ;IDL has a total of 256 possible colors (indices 0 to 255). Color table 39 defines ; color 255 as white, and color 0 as black, with colors 1-254 ranging from deep ; purple to blue to green. red. So the following lines simply define the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/19/2011 for the course ATOC 5235 taught by Professor Randell during the Fall '10 term at Colorado.

Page1 / 4

IDL5 - ; ;(a) Plot out the Planck function for...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online