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/c_timecorrelate.pro

    r232 r242  
    88; @param XD 
    99; 
    10 ; 
    1110; @param YD 
    1211; 
    13 ; 
    1412; @param M 
    1513; 
    16 ; 
    1714; @param NT 
    1815; 
    19 ; 
    2016; @param NDIM 
    2117; 
    22 ; 
    2318; @keyword ZERO2NAN 
    24 ; 
    2519; 
    2620; @keyword DOUBLE 
     
    3024; @examples 
    3125; 
    32 ; 
    3326; @history 
    34 ; 
    3527; 
    3628; @version 
     
    3830; 
    3931;- 
     32; 
    4033FUNCTION timecross_cov, Xd, Yd, M, nT, Ndim, Double = Double, ZERO2NAN = zero2nan 
    41   ;Sample cross covariance function. 
    42  
     34; 
    4335  compile_opt hidden 
    4436; 
     37;Sample cross covariance function. 
    4538   case Ndim OF 
    4639      1:res = TOTAL(Xd[0:nT - M - 1L] * Yd[M:nT - 1L] $ 
     
    6154 
    6255END 
     56; 
    6357;+ 
     58; 
    6459; @file_comments 
    6560; This function computes the "time cross correlation" Pxy(L) or 
     
    7166; Statistics 
    7267; 
    73 ; @param X {in}{required}{type=array} 
    74 ; An Array which last dimension is the time dimension of 
     68; @param X {in}{required} {type=array} 
     69; An array which last dimension is the time dimension of 
    7570; size n, float or double. 
    7671; 
    77 ; @param Y {in}{required}{type=array} 
    78 ; An Array which last dimension is the time dimension of 
     72; @param Y {in}{required} {type=array} 
     73; An array which last dimension is the time dimension of 
    7974; size n, float or double. 
    8075; 
    8176; @param LAG {in}{required}{type=scalar or vector} 
    82 ; A scalar or n-element vector, in the interval [-(n-2), (n-2)], 
     77; A scalar or n-elements vector, in the interval [-(n-2),(n-2)], 
    8378; of type integer that specifies the absolute distance(s) between 
    8479; indexed elements of X. 
     
    9489; @examples 
    9590; 
    96 ;       Define two n-element sample populations. 
    97 ;         x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
    98 ;         y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] 
    99 ; 
    100 ;       Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 
    101 ;         lag = [-5, 0, 1, 5, 6, 7] 
    102 ;         result = c_timecorrelate(x, y, lag) 
    103 ; 
    104 ;       The result should be: 
    105 ;         [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] 
     91; Define two n-elements sample populations. 
     92; IDL> x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] 
     93; IDL> y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] 
     94; 
     95; Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 
     96; IDL> lag = [-5, 0, 1, 5, 6, 7] 
     97; IDL> result = c_timecorrelate(x, y, lag) 
     98; 
     99; The result should be: 
     100; [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] 
    106101; 
    107102; @history 
     
    120115; 
    121116;- 
     117; 
    122118FUNCTION c_timecorrelate, X, Y, Lag, Covariance = Covariance, Double = Double 
     119; 
    123120 
    124121;Compute the sample cross correlation or cross covariance of 
     
    133130 
    134131   if total(xsize[0:xsize[0]] NE ysize[0:ysize[0]]) NE 0 then $ 
    135     MESSAGE, "X and Y arrays must have the same size and the same dimensions" 
     132    ras = report("X and Y arrays must have the same size and the same dimensions") 
    136133 
    137134;Check length. 
    138135   if nt lt 2 then $ 
    139     MESSAGE, "Time dimension of X and Y arrays must contain 2 or more elements." 
     136    ras = report("Time dimension of X and Y arrays must contain 2 or more elements.") 
    140137 
    141138;If the DOUBLE keyword is not set then the internal precision and 
     
    210207 
    211208END 
    212  
Note: See TracChangeset for help on using the changeset viewer.