| 1 | |
|---|
| 2 | |
|---|
| 3 | pro baseline_diff |
|---|
| 4 | restore, 'meta.sav' |
|---|
| 5 | meta = s |
|---|
| 6 | restore, 'station_data.sav' |
|---|
| 7 | data = s |
|---|
| 8 | base = fltarr( n_elements(data)) - 999.9 |
|---|
| 9 | diff = base |
|---|
| 10 | for i=0,n_elements(data)-1 do begin |
|---|
| 11 | gd0 = where( data[i].years ge 1951 and $ |
|---|
| 12 | data[i].years le 1981 and $ |
|---|
| 13 | data[i].years ne 0 and $ |
|---|
| 14 | data[i].annual ne 999.9, n0 ) |
|---|
| 15 | gd1 = where( data[i].years ge 2000 and $ |
|---|
| 16 | data[i].years ne 0 and $ |
|---|
| 17 | data[i].annual ne 999.9, n1 ) |
|---|
| 18 | if n0 le 10 then continue |
|---|
| 19 | if n1 lt 4 then continue |
|---|
| 20 | base[i] = mean( data[i].annual[gd0] );/ float(n0) ) |
|---|
| 21 | diff[i] = mean( data[i].annual[gd1] );/ float(n1) ) |
|---|
| 22 | endfor |
|---|
| 23 | stop |
|---|
| 24 | end |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | pro find_temp_change_magnitude |
|---|
| 28 | restore,'data_struct.sav' |
|---|
| 29 | trend = fltarr(n_elements(s)) |
|---|
| 30 | line = indgen(n_elements(s[0].year)) |
|---|
| 31 | ; for i=0,n_elements(s)-1 do begin |
|---|
| 32 | for i=0,10 do begin |
|---|
| 33 | gd = where( s[i].ann ne 999.90 AND s[i].year NE 0, cnt ) |
|---|
| 34 | if cnt eq 0 then continue |
|---|
| 35 | fit = poly_fit( line[gd], s[i].ann[gd], 1 ) |
|---|
| 36 | ; n_years = max(s[i].year[gd]) - min(s[i].year[gd]) |
|---|
| 37 | ; change_per_decade = (fit[1]/n_years) * 10 |
|---|
| 38 | change_per_decade = fit[1]*10 |
|---|
| 39 | trend[i] = change_per_decade |
|---|
| 40 | endfor |
|---|
| 41 | stop |
|---|
| 42 | end |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | pro bar |
|---|
| 46 | ; get the min/max of all the temperatures, so we can pre-set the Y range |
|---|
| 47 | |
|---|
| 48 | t_all = [[s[idx].jja,s[idx].djf,s[idx].ann]] |
|---|
| 49 | gd = where( t_all ne 999.90 AND t_all NE 0, cnt ) |
|---|
| 50 | ;if cnt eq 0 then continue |
|---|
| 51 | trange = minmax(t_all[gd]) |
|---|
| 52 | |
|---|
| 53 | plotg, s[idx].year[gd], s[idx].ann[gd], $ |
|---|
| 54 | /yno, yrange=trange, $ |
|---|
| 55 | xrange=[1880,2010], /xst,psym=2, xminor=2, $ |
|---|
| 56 | xtitle='Time (Years)', ytitle='Temperature (Degrees C)', $ |
|---|
| 57 | chars=1.2, charth=3, title=name[i] |
|---|
| 58 | |
|---|
| 59 | ; 1st order fit to ANN |
|---|
| 60 | gd = where( s[idx].ann ne 999.90 AND s[idx].year NE 0 ) |
|---|
| 61 | line = indgen(n_elements(s[idx].year)) |
|---|
| 62 | r1 = poly_fit( line[gd], s[idx].ann[gd], 1 ) |
|---|
| 63 | fit1 = r1[0] + r1[1]*line |
|---|
| 64 | oplot, s[idx].year[gd], fit1[gd], color=0 |
|---|
| 65 | |
|---|
| 66 | ; if non-tropical, then 1st order fit to JJA and DJF |
|---|
| 67 | if abs( lat[i] ) GE 23.26 then begin |
|---|
| 68 | ; 1st order fit to JJA |
|---|
| 69 | gd = where( s[idx].JJA ne 999.90 AND s[idx].year NE 0, count ) |
|---|
| 70 | if count ne 0 then begin |
|---|
| 71 | r1 = poly_fit( line[gd], s[idx].jja[gd], 1 ) |
|---|
| 72 | fit1 = r1[0] + r1[1]*line |
|---|
| 73 | color=(lat[i] ge 0)? cred: cblue |
|---|
| 74 | oplot, s[idx].year[gd], s[idx].JJA[gd], color=color, psym=2, th=2 |
|---|
| 75 | oplot, s[idx].year[gd], fit1[gd], color=color, thick=2 |
|---|
| 76 | endif |
|---|
| 77 | ; 1st order fit to DJF |
|---|
| 78 | gd = where( s[idx].DJF ne 999.90 AND s[idx].year NE 0, count ) |
|---|
| 79 | if count ne 0 then begin |
|---|
| 80 | r1 = poly_fit( line[gd], s[idx].djf[gd], 1 ) |
|---|
| 81 | fit1 = r1[0] + r1[1]*line |
|---|
| 82 | color=(lat[i] lt 0)? cred: cblue |
|---|
| 83 | oplot, s[idx].year[gd], s[idx].DJF[gd], color=color, psym=2, th=2 |
|---|
| 84 | oplot, s[idx].year[gd], fit1[gd], color=color, thick=2 |
|---|
| 85 | endif |
|---|
| 86 | endif |
|---|
| 87 | ; r2 = poly_fit( line[gd], ann[gd], 2 ) |
|---|
| 88 | ; fit2 = r2[0]+r2[1]*line+r2[2]*line^2 |
|---|
| 89 | ; oplot, year, fit2, color=254 |
|---|
| 90 | end |
|---|
| 91 | |
|---|