Mars Data Analysis Using IDL GG7101 Lecture 12 - PowerPoint PPT Presentation

1 / 45
About This Presentation
Title:

Mars Data Analysis Using IDL GG7101 Lecture 12

Description:

Useful math functions in IDL. Curve Fitting. Polynomial least square fits ... FFT uses tricks to solve for even fewer combinations. 30. Fourier Transform ... – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 46
Provided by: fscotta
Category:

less

Transcript and Presenter's Notes

Title: Mars Data Analysis Using IDL GG7101 Lecture 12


1
Mars Data Analysis Using IDLGG710-1Lecture 12
  • F. Scott Anderson
  • Office POST 526B
  • Phone 956-6887
  • Email anderson_at_higp.hawaii.edu

2
Review of 11/10/04
  • Finish Graphics
  • Shaded surface plots, large images
  • Copying a screen image
  • Reading and writing graphics files
  • Other devices postscript and z-buffer
  • Maps
  • Useful math functions in IDL
  • Curve Fitting
  • Polynomial least square fits
  • Minimum absolute deviation fits

3
Today
  • Homework graded
  • Questions from last time
  • Quiz 10
  • Useful math functions in IDL
  • FFT's
  • Review of today's class

4
Questions from 11/8/04
  • Squeaky wheels, Troublemakers, Forever Hold your
    piece?

5
Quiz 9/10 Scores
6
Quiz 10
7
Quiz Answers
8
Quiz Answers
9
SPD-TEST Homework
  • pro spd
  • nn100 res1fltarr(nn) res2fltarr(nn)
    res3fltarr(nn)
  • for ctr0, (nn-1) do res1ctrspd1()
  • for ctr0, (nn-1) do res2ctrspd2()
  • for ctr0, (nn-1) do res3ctrspd3()
  • plot, res1, yrange0.04, 3, /xstyle,
    /ystyle, /ylog,
  • ytitle'Time (s)', xtitle'Test',
    title'Efficiency test'
  • oplot, res2, psym-2 oplot, res3, line3
  • oplot, 5, 15, 0.8, 0.8
  • oplot, 5, 15, 0.7, 0.7, psym-2
  • oplot, 5, 15, 0.61, 0.61, line3
  • xyouts, 20, 0.8, string('Avg. Time ',
    strtrim(mean(res1), 2))
  • xyouts, 20, 0.7, string('Avg. Time ',
    strtrim(mean(res2), 2))
  • xyouts, 20, 0.61, string('Avg. Time ',
    strtrim(mean(res3), 2))
  • end

10
TES Answer
  • Use SIS to determine units of radiance in data
    file W cm-2 st-1 wvn-1 W/cm
  • Plug in MKS values into three equations provided
    and determine which has the same units as
    radiance above
  • Wavenumber Eqn 4.3
  • Could use other equation, but must convert answer
    to wavenumber units before finishing
  • Rewrite equation for T Tf(LB, n)
  • Read file, get n and L

11
TES Answer
  • Calculate T for each L as f(n) 143 values
  • Use Method.txt to derive surface T
  • First calculate T as f(e)
  • TB (Assumed e 1.0)
  • TB' (Assumed e-0.97)
  • Tf(LB, n) Eqn 4.3 rewritten
  • From notes, e LBL
  • Thus, LBL/ e
  • Thus, Tf(L/ e, n)
  • Find max from 300-500 800-1350
  • Note that max(TB)gt225 gt Tsurfacemax(TB)

12
TES Answer
  • Now that we have one final "real" temperature
  • Calculate emissivity
  • Calculate predicted radiance (planck) curve for
    Tsurface
  • Divide observed radiance by predicted radiance
  • Plot wave vs T
  • Exclude left axis
  • Add axis for e
  • Plot wave vs e

13
TES Homework
6
Temperature
Emissivity
14
TES Homework
15
Hematite!
16
Code
  • function planck_wvn_t2r, t, wvn
  • t1double(t) wvn1double(wvn)
  • h6.625D-34 Js
  • k1.381D-23 J/k
  • c2.998D8 m/s
  • L1 2Dhc2wvn13
  • L2 exp(hcwvn1/(kt1))-1
  • L L1/L2
  • return, reform(L)
  • end

17
Code
  • function planck_wvn_r2t, r, wvn
  • r1double(r) wvn1double(wvn)
  • h6.625D-34 Js
  • k1.381D-23 J/k
  • c2.998D8 m/s
  • L1 hcwvn1/k
  • L2 alog(2Dhwvn13c2/r11)
  • T L1/L2
  • return, reform(T)
  • end

18
Code
  • function calc_surf_t, brt1, brt2, wvn
  • T1 215 T2 225 s1(((wvn ge 300) and
    (wvn le 500))
  • s2((wvn ge 800) and (wvn le 1350))
  • subs1 where(s1 or s2)
  • mbt1 max(smooth(brt1subs1,7,/edge_truncate
    )) TB
  • mbt2 max(smooth(brt2subs1,7,/edge_truncate
    )) TB'
  • if (mbt1 ge T2) then Tsurface mbt1
  • else if (mbt2 le T1) then Tsurface mbt2
  • else begin
  • wgt1 1 - ( (T2 - mbt1) /
    (T2-T1) )
  • if (wgt1 lt 0.0) then wgt1 0.0
  • wgt2 1 - ( (mbt2 - T1) /
    (T2-T1) )
  • if (wgt2 lt 0.0) then wgt2 0.0
  • Tsurface ( (mbt1wgt1)
    (mbt2wgt2)) / (wgt1wgt2)
  • endelse
  • return, Tsurface
  • end

19
Code
  • pro tes
  • aread_ascii('TES_data.txt', data_start5)
  • wvna.field10, Wvn in 1/cm
  • rada.field11, Rad in W cm-2 sr-1
    wvn-1
  • W
    cm-2 sr-1 cm
  • W
    1/cm sr-1
  • Variables for graph range
  • min_wvn200.0 max_wvn1301.0
  • wvn1wvn1e2 Convert wvn to 1/m
  • rad1rad1e2 Convert rad to 1/m
  • wvl1e4/wvn Wavenumber in um

20
Code
  • Calculate brightness temperature from
    radiance for e1.0 and e0.97
  • brt1 planck_wvn_r2t(rad1, wvn1)
  • brt2 planck_wvn_r2t(rad1/0.97, wvn1)
  • Calculate the surface temperature
  • Tsurface calc_surf_T(brt1, brt2, wvn)
  • Calculate the final planck curve using the
    surface temperature
  • all calculations in 1/m (mks) so must
    convert to 1/cm
  • rad1 planck_wvn_t2r(Tsurface, wvn1)/1e2

21
Code
  • Plot the graph
  • plot, wvn, brt1, xrangemax_wvn, min_wvn,
    yrange255,280,
  • charsize2, xtitle'Wavenumber
    (cm!U-1!N)',
  • ytitle'Temperature (K)',
    ymargin3.5,3, xstyle9,
  • ystyle9, xmargin7,7
  • Add an emissivity y axis
  • axis, yaxis1, yrange0.76, 1, /ystyle,
    ytitle'Emissivity',
  • charsize2,/save
  • Plot the emissivity for this spectrum
  • oplot, wvn, rad/rad1
  • end

22
Mini-Homework
  • My Favorite Projection

23
Mini-Homework Answer
  • pro map_mars
  • read_jpeg,'mgstopo3.jpg',a
  • map_set, -5, 120, /satellite,
    sat_p1.1,0,0,/iso, /noborder
  • rmap_image(reform(a0,,), x0, y0, xs, ys,
    compress1)
  • gmap_image(reform(a1,,), x0, y0, xs, ys,
    compress1)
  • bmap_image(reform(a2,,), x0, y0, xs, ys,
    compress1)
  • imgfltarr(3,xs,ys)
  • img0,,r img1,,g img2,,b
  • tvscl, img, /true
  • end

24
Fourier Transform
  • Concept Any data can be approximated by the
    summation of some number of sine and cosine waves

25
Fourier Transform
  • A FT identifies what l's are in dataset
  • Transforms from space or time to l
  • Every possible l of sine or cosine will have
  • Amplitude
  • Non-zero values indicate the l exists in data
  • Phase shift

26
Basics l, n
n 1 / l
27
Wave Basics
  • These waves have amplitude of 1
  • Cosine and Sine are the same shape shifted by 90
  • Thus, 2nd wave is same as first with 90 shift

28
Fourier Convolution
  • A FT takes multiple steps
  • First it loops over every possible l
  • For each l it loops over every possible phase
  • The FT takes each possible combination of l
    phase, and multiplies it against the observed
    data
  • The amplitude of the correlation is the amplitude
    of the result

29
Discrete Waves Nyquist n
  • Because waves in IDL are made of discrete points,
    there are a limited number of l phase possible
  • Largest wave that can be uniquely distinguished
    over N points is just the length of the data
  • Smallest wave is N / (2 len)
  • Thus, N/2 cosines, N/2 sines total of N
    possible waves
  • Similarly, there are N possible phases
  • N2 possible combinations
  • FFT uses tricks to solve for even fewer
    combinations

30
Fourier Transform
  • A FT of a vector will result a vector of the same
    length in which
  • The values are the amplitude phase for each
    wave (a set complex numbers)
  • The position of each value indicates it's l
  • Are we getting back more numbers than we gave
    FFT?
  • FFT(Vector with n values) gt
  • Complex vector of n x 2 Values!
  • But 1/2 of the returned values are redundant

31
Fourier Transform
  • If you have a vector of amplitudes in positions
    corresponding to l can invert back to original
    data using inverse fourier transform (IFT)
  • FFT(spatial/temporal data) gt l
  • IFT(l) gt Spatial/Temporal Data

32
Fourier Transform
  • Who cares? Why identify l's in a dataset?
  • Filtering
  • Not unusual to have noise at some l but not
    others
  • Low pass (screens out high frequency noise -
    static)
  • High pass (screens out low frequency noise - slow
    drift)
  • Data manipulation
  • Physics of wave damping (seismic, gravity) e-kz
  • Relationship for specific l TlClgl
  • Power spectra
  • Sometimes want to know what l dominates data

33
IDL's FFT
  • Form FFT
  • ResultFFT(Array)
  • Form IFT
  • ResultFFT(Array, /inverse)
  • Frequency of each value in the result array is
  • Odd pts
  • Even

34
Simpler n Order
  • Odd pts
  • Even
  • Easier to remember
  • Follow mathematical definition

35
FFT Steps
  • Obtain data (need to know length amplitude)
  • Calculate shifted frequency of each position in
    result array
  • Calculate shifted FFT
  • Plot!

36
Calculating n , FFT
  • To calculate shifted frequency
  • f(findgen(nn)-(round(nn/2.)-1))/len
  • To calculate FFT
  • vshift(fft(y), round(nn/2.)-1)
  • To calculate phase must convert to degrees
  • faatan(v,/phase)/!DTOR

37
Results Cosine Amplitude
38
Results Cosine Phase
39
Results Sine Amplitude
40
Results Sine Phase
41
Results 2 Cosines
42
Results Cosines Sine
43
Power Spectrum
  • A power spectrum is defined as
  • The positive side of the frequencies
  • P 2ABS(Complex Amplitude)2

44
Today
  • Quiz 8 returned/Quiz 9 given
  • Homework Review
  • Mini-Homework Review
  • FFT's
  • Power Spectra

45
Next Time
  • GUI's
  • Event Loop Concept
  • Widgets
  • Compound Widgets
  • Widget ID's
  • Event Structures
  • Checking Events in the Event Loop
Write a Comment
User Comments (0)
About PowerShow.com