Changeset 149 for trunk


Ignore:
Timestamp:
07/08/09 18:20:40 (15 years ago)
Author:
ericg
Message:

Cleaned up spectra @s computation and added RMS difference between 2 overlaid spectra (using 1o)

Location:
trunk/procs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/procs/com_eg.pro

    r148 r149  
    44; attributs horizontal+vertical means 
    55; 
    6 COMMON zm_att, box_h, depth_z, zoom_z, diaznl_idx, box_plot, legbox, pres_max, pres_min, max_spec, spec_win, vert_type, vert_mean,  vert_switch, glamboundary_box, msf_mean, name_level, nino_plot 
     6COMMON zm_att, box_h, depth_z, zoom_z, diaznl_idx, box_plot, legbox, pres_max, pres_min, max_spec, spec_win, vert_type, vert_mean,  vert_switch, glamboundary_box, msf_mean, name_level, nino_plot, spec_prev 
    77; 
    88; attributs hoevmoeller 
  • trunk/procs/fld_pltext.pro

    r63 r149  
    1414; define variable plot attributes (min/max) 
    1515 
    16    fldextr = {name:'', assos:'', min: 0.0, max: 0.0, homin:0.0, homax:0.0, min1d:0.0, max1d:0.0, dmax:0.0} 
     16   fldextr = {name:'', assos:'', min: 0.0, max: 0.0, homin:0.0, homax:0.0, min1d:0.0, max1d:0.0, dmax:0.0, spec:0.0} 
    1717 
    1818; name of defaults files 
     
    3939         fldextr.dmax = max([abs(fldextr.min), abs(fldextr.max)]) 
    4040         fldextr.assos = var_name 
     41         fldextr.spec = 1.          
    4142   ENDIF ELSE BEGIN  
    4243      argvar = strsplit(line, ' ',  /EXTRACT) 
     
    5556         fldextr.max1d = !VALUES.F_NAN 
    5657         fldextr.dmax = !VALUES.F_NAN 
     58         fldextr.spec = !VALUES.F_NAN 
    5759         IF n_elements(argvar) GE 5 THEN BEGIN 
    5860            fldextr.homin = float(argvar[3]) 
     
    6365            fldextr.max1d = float(argvar[6]) 
    6466         ENDIF  
     67         IF n_elements(argvar) GE 8 THEN BEGIN  
     68            fldextr.spec = float(argvar[8]) 
     69         ENDIF  
     70          
    6571         IF free_1d_minmax EQ 'yes' THEN BEGIN 
    6672            IF hotyp EQ 't' THEN BEGIN  
  • trunk/procs/plt_map.pro

    r148 r149  
    277277; --------------------- 
    278278 
    279    fldatt = {name:'', assos:'', min: 0.0, max: 0.0, int: 0.0, mult: 0.0, add: 0.0,  unit: '', mid: 0.0, homin:0.0, homax:0.0, min1d:0.0, max1d:0.0, dmax:0.0} 
     279   fldatt = {name:'', assos:'', min: 0.0, max: 0.0, int: 0.0, mult: 0.0, add: 0.0,  unit: '', mid: 0.0, homin:0.0, homax:0.0, min1d:0.0, max1d:0.0, dmax:0.0, spec:0.0} 
    280280 
    281281; which variable to look for 
     
    302302   fldatt.max1d = fldext.max1d 
    303303   fldatt.dmax = fldext.dmax 
     304   fldatt.spec = fldext.spec 
    304305   fldatt.assos = fldext.assos  
    305306 
     
    479480         CASE plttyp OF 
    480481         'pltt': BEGIN & minc = fldatt.homin & maxc = fldatt.homax & END  
     482         'spec': BEGIN & minc = 0. & maxc = fldatt.spec & END  
    481483         'wavelet': BEGIN & minc = fldatt.homin & maxc = fldatt.homax & END  
    482484         'plt1d': BEGIN & minc = fldatt.min1d & maxc = fldatt.max1d & END 
     
    11301132                  ENDIF  
    11311133               ENDIF  
    1132             ; plot min/max 
    1133                min1 = min(fld) 
    1134                max1 = max(fld) 
    1135                min2 = 0 
    1136                max2 = max(time) 
    1137                !x.range = [min2-abs(max2-min2)/5.,max2+abs(max2-min2)/5.] 
    1138                !y.range = [min1-abs(max1-min1)/5.,max1+abs(max1-min1)/5.] 
     1134 
     1135            ; rms with previous curve 
     1136 
     1137               IF iover EQ 1 THEN BEGIN  
     1138                  spec_prev = fld 
     1139               ENDIF ELSE BEGIN  
     1140                  time_int = time-shift(time, 1) 
     1141                  time_int(0) = 0. 
     1142                  divi = total(time_int^2) 
     1143                  rms_spec = sqrt( total( ((fld-spec_prev)*time_int)^2) / (divi > 0.)) 
     1144                  print, '       RMS spectra difference with previous spectra =', rms_spec 
     1145               ENDELSE  
     1146                
    11391147                
    11401148            ; plot 
    11411149               ytitle = 'Power spectrum (window='+strtrim(string(spec_win/360), 2)+'y)' 
    1142                pltcmd = 'splot,time,fld,xstyle=1,ystyle=1,title=varunit,xtitle=xtitle,ytitle=ytitle'+overc+com_strplt 
     1150               pltcmd = 'splot,time,fld,xstyle=1,ystyle=1,title=varunit,xtitle=xtitle,ytitle=ytitle'+overc+com_strplt+',yrange=[0,'+string(fldatt.spec)+']' 
    11431151               printf, nulhis, 'boite_pltspec=',boite_pltspec  
    11441152               printf, nulhis, strcompress(pltcmd) 
Note: See TracChangeset for help on using the changeset viewer.