Ignore:
Timestamp:
04/06/07 10:35:17 (17 years ago)
Author:
pinsard
Message:

improvements/corrections of some *.pro headers + replace some message by some report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/STATISTICS/a_timecorrelate.pro

    r232 r242  
    22; 
    33; @file_comments 
    4 ;  
    54; 
    65; @categories 
     
    87; 
    98; @param X {in}{required}{type=array} 
    10 ; An Array which last dimension is the time dimension so 
     9; An array which last dimension is the time dimension so 
    1110; size n. 
    1211; 
    1312; @param M 
    1413; 
    15 ; 
    1614; @param NT 
    1715; 
    18 ; 
    1916; @keyword ZERO2NAN 
    20 ; 
    2117; 
    2218; @keyword DOUBLE 
     
    2622; @examples 
    2723; 
    28 ; 
    2924; @history 
    30 ; 
    3125; 
    3226; @version 
     
    3529;- 
    3630FUNCTION timeauto_cov, X, M, nT, Double = Double, zero2nan = zero2nan 
    37 ;Sample autocovariance function 
    3831; 
    3932  compile_opt idl2, strictarrsubs 
    4033; 
     34;Sample autocovariance function 
    4135   TimeDim = size(X, /n_dimensions) 
    4236   Xmean = TOTAL(X, TimeDim, Double = Double) / nT 
     
    6660END 
    6761;+ 
     62; 
    6863; @file_comments 
    6964; Same function as A_CORRELATE but accept array (until 4 
     
    7974; 
    8075; @param X {in}{required}{type=array} 
    81 ; An Array which last dimension is the time dimension so 
     76; An array which last dimension is the time dimension so 
    8277; size n. 
    8378; 
    8479; @param LAG {in}{required}{type=scalar or vector} 
    85 ; A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
    86 ; of type integer that specifies the absolute distance(s) between  
     80; A scalar or n-elements vector, in the interval [-(n-2),(n-2)], 
     81; of type integer that specifies the absolute distance(s) between 
    8782; indexed elements of X. 
    8883; 
     
    9691; 
    9792; @examples 
    98 ;       Define an n-element sample population. 
    99 ;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
     93; Define an n-elements sample population. 
     94; IDL> x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
    10095; 
    101 ;       Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8 
    102 ;         lag = [-3, 0, 1, 3, 4, 8] 
    103 ;         result = a_correlate(x, lag) 
     96; Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8 
     97; IDL> lag = [-3, 0, 1, 3, 4, 8] 
     98; IDL> result = a_correlate(x, lag) 
    10499; 
    105 ;       The result should be: 
    106 ;         [0.0146185, 1.00000, 0.810879, 0.0146185, -0.325279, -0.151684] 
     100; The result should be: 
     101; [0.0146185, 1.00000, 0.810879, 0.0146185, -0.325279, -0.151684] 
    107102; 
    108103; @history 
     
    118113; 
    119114;- 
    120  
     115; 
    121116FUNCTION a_timecorrelate, X, Lag, COVARIANCE = Covariance, DOUBLE = Double 
    122117; 
     
    134129                                ;Check length. 
    135130   if nT lt 2 then $ 
    136     MESSAGE, "Time axis of X array must contain 2 or more elements." 
    137     
     131    ras= report("Time axis of X array must contain 2 or more elements.") 
     132 
    138133;If the DOUBLE keyword is not set then the internal precision and 
    139134;result are identical to the type of input. 
     
    141136    Double = (SIZE(X, /type) eq 5) 
    142137 
    143     
     138 
    144139   if n_elements(lag) EQ 0 then lag = 0 
    145140   nLag = N_ELEMENTS(Lag) 
     
    169164      endcase 
    170165   endif else begin             ;Compute Autocovariance. 
    171       for k = 0, nLag-1 do $  
     166      for k = 0, nLag-1 do $ 
    172167       case XNDim of 
    173168         1:Auto[k] = TimeAuto_Cov(X, ABS(Lag[k]), nT, Double = Double) / nT 
Note: See TracChangeset for help on using the changeset viewer.