- Timestamp:
- 04/30/08 23:54:33 (16 years ago)
- Location:
- trunk/procs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/procs/macros/make_stddev.pro
r86 r95 6 6 @common 7 7 @com_eg 8 9 IF debug_w THEN print, ' ENTER make_stddev... ' 8 10 ; 9 11 ; … … 11 13 ; 12 14 IF debug_w THEN print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 15 print, ' Warning: standard deviation assuming monthly time serie of base field ',macro_base_fld 13 16 14 17 mfld = nc_read(file_name, macro_base_fld, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 15 18 mfld.data = trends(mfld.data, '412', 'xyt') 16 19 17 print, ' Warning: standard deviation assuming monthly time serie of base field ',macro_base_fld 20 nxa = (size(mfld.data))[1] 21 nya = (size(mfld.data))[2] 18 22 19 ; Modif MK 23 IF debug_w THEN print, ' nxa, nya', nxa, nya 20 24 21 IF stddev_mth NE '00' THEN BEGIN 22 23 mth = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] 24 CASE STRMID(stddev_mth, 0, 2) OF 25 '01': strd = 1 26 '02': strd = 2 27 '03': strd = 3 28 '04': strd = 4 29 '05': strd = 5 30 '06': strd = 6 31 '07': strd = 7 32 '08': strd = 8 33 '09': strd = 9 34 '10': strd = 10 35 '11': strd = 11 36 '12': strd = 12 37 ENDCASE 38 39 print, ' Warning: standard deviation computed for ', mth[strd-1] 25 stdw = fltarr(nxa, nya) 26 stdw[*, *] = 0 40 27 41 28 ; Sampling of data and computation of new numbers of values 42 data = (mfld.data)[*, *, strd-1:*:12]43 nval = (size(data))[3]44 ENDIF ELSE BEGIN45 data = mfld.data46 nval = jpt47 ENDELSE48 29 49 std = a_timecorrelate(data, 0,/covariance) 50 std = sqrt( nval/(nval-1)*std ) 51 idx = WHERE (std GT 1.0e+10) 30 @mth_decode 52 31 53 IF idx(0) NE -1 THEN std(idx) = valmask 32 FOR imth = 0, nmth-1 DO BEGIN 33 34 IF debug_w THEN print, ' month idx/value: ', imth, strd(imth) 35 36 data = (mfld.data)[*, *, reform(idxm(imth,*), njpt)] 37 nval = njpt 38 ; compute std dev 39 std = a_timecorrelate(data, 0,/covariance) 40 stdw = stdw + sqrt( nval/(nval-1)*std ) 41 42 ENDFOR 43 44 idm = where(mfld.data[*, *, 0] GE valmask/10.) 45 46 stdw = stdw/float(nmth) 47 48 IF idm[0] NE -1 THEN stdw(idm) = valmask 49 50 varname = varname+' '+ntxt 54 51 55 52 IF stddev_mth NE '00' AND stddev_diff EQ 1 THEN BEGIN 56 print, ' Warning: standard deviation diff between ', mth[strd-1],' and the whole serie'53 print, ' Warning: standard deviation diff between '+ntxt+' and the whole serie' 57 54 std_tot = a_timecorrelate(mfld.data, 0,/covariance) 58 55 std_tot = sqrt( jpt/(jpt-1)*std_tot ) 59 IF id x(0) NE -1 THEN std_tot(idx) = valmask60 idx_diff = WHERE (std NE valmask)61 std (idx_diff) = std(idx_diff) - std_tot(idx_diff)56 IF idm[0] NE -1 THEN std_tot(idm) = valmask 57 idx_diff = WHERE (stdw NE valmask) 58 stdw(idx_diff) = stdw(idx_diff) - std_tot(idx_diff) 62 59 ENDIF 63 60 64 field = {name: '', data: std , legend: '', units: '', origin: '', dim: 0, direc:''}61 field = {name: '', data: stdw, legend: '', units: '', origin: '', dim: 0, direc:''} 65 62 66 63 field.origin = mfld.origin 67 64 68 65 field.dim = 2 66 67 field.legend = ' '+ntxt+' ['+cmdm.date1+'-'+cmdm.spec+']' 69 68 70 IF stddev_mth NE '00' THEN BEGIN 71 field.legend = ' for '+mth[strd-1]+' in ['+cmdm.date1+'-'+cmdm.spec+'] -' 72 IF stddev_diff EQ 1 THEN BEGIN 73 field.legend = ' diff between '+mth[strd-1]+' and total TS ['+cmdm.date1+' - '+cmdm.spec+'] -' 74 ENDIF 75 ENDIF ELSE BEGIN 76 field.legend = ' ['+cmdm.date1+'-'+cmdm.spec+']' 77 ENDELSE 78 79 ; Fin Modif MK 69 IF stddev_diff EQ 1 THEN BEGIN 70 field.legend = ' diff between '+ntxt+' and total TS ['+cmdm.date1+' - '+cmdm.spec+']' 71 ENDIF 80 72 81 73 ; data and plot are 2D -
trunk/procs/mth_decode.pro
r91 r95 34 34 IF nmth EQ 1 THEN ntxt = mth[strd-1] 35 35 36 print, ' Warning: correlation computedand average for following period: ', ntxt36 print, ' Warning: monthly computation and average for following period: ', ntxt
Note: See TracChangeset
for help on using the changeset viewer.