Changeset 35


Ignore:
Timestamp:
01/16/08 01:30:08 (16 years ago)
Author:
ericg
Message:

Bug correction in c_correlate of fld and fld_prev if different sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/procs/trends.pro

    r21 r35  
    88; type = 't', 'xt', 'yt', 'zt' or 'xyt' 
    99 
    10    print, 'ENTER trends...' 
     10   print, '    Enter trends.pro' 
    1111 
    1212   trend_type = strtrim(string(trend_int), 2) 
     
    162162; compute time lag correlation 
    163163            IF ioverchk EQ 2 AND c_correl EQ 1 THEN BEGIN 
    164                lag_array = findgen(2*lag_correl+1)-lag_correl 
    165                lag_correlation = C_CORRELATE(fld, fld_prev_t, lag_array) 
    166                print, '     1D time series lag correlation = ', lag_correlation 
    167                indx = where (lag_correlation EQ max(lag_correlation)) 
    168                IF indx[0] NE -1 THEN BEGIN  
    169                   print, '        Lag of max correlation =', lag_array(indx),lag_correlation(indx)  
    170                   print, '        Lag correlation limit [-N,N] =', lag_correl  
     164               IF (size(fld))(1) EQ (size(fld_prev_t))(1) THEN BEGIN  
     165                  lag_array = findgen(2*lag_correl+1)-lag_correl 
     166                  lag_correlation = C_CORRELATE(fld, fld_prev_t, lag_array) 
     167                  print, '     1D time series lag correlation = ', lag_correlation 
     168                  indx = where (lag_correlation EQ max(lag_correlation)) 
     169                  IF indx[0] NE -1 THEN BEGIN  
     170                     print, '        Lag of max correlation =', lag_array(indx),lag_correlation(indx)  
     171                     print, '        Lag correlation limit [-N,N] =', lag_correl  
     172                  ENDIF  
    171173               ENDIF  
    172174            ENDIF  
     
    374376   ENDIF  
    375377 
    376    IF debug_w THEN print, 'EXIT trends...' 
    377  
    378378   return, fld 
     379    
     380   IF debug_w THEN print, '   Vargrid : ',  vargrid 
     381   IF debug_w THEN print, '   Leaving trends.pro' 
    379382 
    380383END   
Note: See TracChangeset for help on using the changeset viewer.