Changeset 242 for trunk/SRC/ToBeReviewed


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

Location:
trunk/SRC/ToBeReviewed
Files:
8 edited

Legend:

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

    r163 r242  
    2828; 
    2929;- 
    30  
    31 FUNCTION auto_cov2d, X, Lag, Double = Double, zero2nan = zero2nan 
     30; 
     31FUNCTION auto_cov2d, X, Lag, DOUBLE = Double, ZERO2NAN = zero2nan 
    3232; 
    3333  compile_opt idl2, strictarrsubs 
     
    9595   ny = XDim[1] 
    9696   if XNDim NE 2 then $ 
    97     MESSAGE, "X array must contain 2 dimensions." 
     97    ras = report("X array must contain 2 dimensions.") 
    9898;Check length. 
    9999   if nx lt 2 then $ 
    100     MESSAGE, "first dimension of X array must contain 2 or more elements." 
     100    ras = report("first dimension of X array must contain 2 or more elements.") 
    101101   if ny lt 2 then $ 
    102     MESSAGE, "second dimension of X array must contain 2 or more elements." 
     102    ras = report("second dimension of X array must contain 2 or more elements.") 
    103103   if n_elements(Lag) NE 2 THEN $ 
    104     MESSAGE, "Lag array must contain 2 elements." 
     104    ras = report("Lag array must contain 2 elements.") 
    105105    
    106106;If the DOUBLE keyword is not set then the internal precision and 
  • 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 
  • 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  
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro

    r231 r242  
    2626; 
    2727PRO cw_bgroup_setv, id, value 
     28; 
    2829  compile_opt hidden, idl2, strictarrsubs 
    29  
     30; 
    3031  ON_ERROR, 2                       ;return to caller 
    3132 
     
    350351 
    351352 
    352   IF (N_PARAMS() ne 2) THEN MESSAGE, 'Incorrect number of arguments' 
     353  IF (N_PARAMS() ne 2) THEN ras = report('Incorrect number of arguments') 
    353354 
    354355  ON_ERROR, 2                       ;return to caller 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro

    r232 r242  
    1 ; testwid, value=strtrim(indgen(10),2) 
    2 ; PRO testwid_event, event 
    3 ; ;   help, event, /STRUCT 
    4 ;    ComboboxId = widget_info(event.top,find_by_uname = 'c''est lui') 
    5 ;    widget_control, event.id, get_uvalue=uval 
    6 ;    if n_elements(uval) EQ 0 then return 
    7 ;    case uval of 
    8 ;       'done':widget_control, event.top, /destroy 
    9 ;       'dynamic_resize':BEGIN 
    10 ;          widget_control, event.id, get_value = value 
    11 ;          widget_control, ComboboxId, set_value = {dynamic_resize:value} 
    12 ;       END 
    13 ;       'combobox_select':BEGIN 
    14 ;          widget_control, event.id, get_value = value 
    15 ;          widget_control, ComboboxId, set_value = {combobox_select:value} 
    16 ;       END 
    17 ;       'value':BEGIN 
    18 ;          widget_control, event.id, get_value = value 
    19 ;          widget_control, ComboboxId, set_value = value 
    20 ;       END 
    21 ;       'get':BEGIN 
    22 ;          widget_control, ComboboxId, get_value = value 
    23 ;          help,  value, /struct 
    24 ;       END 
    25 ;       ELSE: 
    26 ;    endcase 
    27 ;    return 
    28 ; end 
    29 ; PRO testwid, _extra = ex 
    30 ;    base=widget_base(/COLUMN) 
    31 ; print, 'base=', base 
    32 ;    nothing = widget_label(base, value = 'beginning of the test') 
    33 ; ; 
    34 ;    nothing = cw_combobox_pm(base, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui') 
    35 ; print, 'cw_combobox_pm ID =', nothing 
    36 ; ; 
    37 ;    nothing = widget_label(base, value = 'end of the test') 
    38 ;    nothing = widget_text(base, value = '0', uvalue = 'dynamic_resize', /editable) 
    39 ;    nothing = widget_text(base, value = '10', uvalue = 'combobox_select', /editable) 
    40 ;    nothing = widget_text(base, value = '5', uvalue = 'value', /editable) 
    41 ;    nothing = widget_button(base, value = 'get', uvalue = 'get') 
    42 ;    nothing = widget_button(base, value = 'done', uvalue = 'done') 
    43 ;    widget_control, base, /REALIZE 
    44 ;    xmanager,'testwid', base 
    45 ;    return 
    46 ; end 
    47 ;+ 
    48 ; 
    49 ; @file_comments 
    50 ; 
     1;+ 
     2; 
     3; @file_comments 
    514; 
    525; @categories 
     
    300253; 
    301254 
    302    IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 
     255   IF (N_PARAMS() NE 1) THEN ras = report('Incorrect number of arguments') 
    303256   ON_ERROR, 2                  ;return to caller 
    304257; checking for row and column keywords 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro

    r232 r242  
    1 ; PRO testwid_event, event 
    2 ; ;   help, event, /STRUCT 
    3 ;    DroplistId = widget_info(event.top,find_by_uname = 'c''est lui') 
    4 ;    widget_control, event.id, get_uvalue=uval 
    5 ;    if n_elements(uval) EQ 0 then return 
    6 ;    case uval of 
    7 ;       'done':widget_control, event.top, /destroy 
    8 ;       'dynamic_resize':BEGIN 
    9 ;          widget_control, event.id, get_value = value 
    10 ;          widget_control, DroplistId, set_value = {dynamic_resize:value} 
    11 ;       END 
    12 ;       'droplist_select':BEGIN 
    13 ;          widget_control, event.id, get_value = value 
    14 ;          widget_control, DroplistId, set_value = {droplist_select:value} 
    15 ;       END 
    16 ;       'value':BEGIN 
    17 ;          widget_control, event.id, get_value = value 
    18 ;          widget_control, DroplistId, set_value = value 
    19 ;       END 
    20 ;       'get':BEGIN 
    21 ;          widget_control, DroplistId, get_value = value 
    22 ;          help,  value, /struct 
    23 ;       END 
    24 ;       ELSE: 
    25 ;    endcase 
    26 ;    return 
    27 ; end 
    28 ; PRO testwid, _extra = ex 
    29 ;    base=widget_base(/COLUMN) 
    30 ; print, 'base=', base 
    31 ;    nothing = widget_label(base, value = 'beginning of the test') 
    32 ; ; 
    33 ;    nothing = cw_droplist_pm(base, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui') 
    34 ; print, 'cw_droplist_pm ID =', nothing 
    35 ; ; 
    36 ;    nothing = widget_label(base, value = 'end of the test') 
    37 ;    nothing = widget_text(base, value = '0', uvalue = 'dynamic_resize', /editable) 
    38 ;    nothing = widget_text(base, value = '10', uvalue = 'droplist_select', /editable) 
    39 ;    nothing = widget_text(base, value = '5', uvalue = 'value', /editable) 
    40 ;    nothing = widget_button(base, value = 'get', uvalue = 'get') 
    41 ;    nothing = widget_button(base, value = 'done', uvalue = 'done') 
    42 ;    widget_control, base, /REALIZE 
    43 ;    xmanager,'testwid', base 
    44 ;    return 
    45 ; end 
    46 ; 
    471;+ 
    482; 
     
    286240; 
    287241 
    288    IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 
     242   IF (N_PARAMS() NE 1) THEN ras = report('Incorrect number of arguments') 
    289243   ON_ERROR, 2                  ;return to caller 
    290244; checking for row and column keywords 
  • trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro

    r232 r242  
    1 ; PRO testwid_event, event 
    2 ; ;   help, event, /STRUCT 
    3 ;    SliderBarId = widget_info(event.top,find_by_uname = 'c''est lui') 
    4 ;    widget_control, event.id, get_uvalue=uval 
    5 ;    if n_elements(uval) EQ 0 then return 
    6 ;    case uval of 
    7 ;       'done':widget_control, event.top, /destroy 
    8 ;       'slider_min':BEGIN 
    9 ;          widget_control, event.id, get_value = value 
    10 ;          widget_control, SliderBarId, set_value = {slider_min:value} 
    11 ;       END 
    12 ;       'slider_max':BEGIN 
    13 ;          widget_control, event.id, get_value = value 
    14 ;          widget_control, SliderBarId, set_value = {slider_max:value} 
    15 ;       END 
    16 ;       'slider_value':BEGIN 
    17 ;          widget_control, event.id, get_value = value 
    18 ;          widget_control, SliderBarId, set_value = value 
    19 ;       END 
    20 ;       'get':BEGIN 
    21 ;          widget_control, SliderBarId, get_value = value 
    22 ;          help,  value, /struct 
    23 ;          print, value.slider_min_max 
    24 ;       END 
    25 ;       ELSE: 
    26 ;    endcase 
    27 ;    return 
    28 ; end 
    29 ; PRO testwid, _extra = ex 
    30 ;    base=widget_base(/COLUMN) 
    31 ; print, 'base=', base 
    32 ;    nothing = widget_label(base, value = 'beginning of the test') 
    33 ; ; 
    34 ;    nothing = cw_slider_pm(base, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui') 
    35 ; print, 'cw_slider_pm ID =', nothing 
    36 ; ; 
    37 ;    nothing = widget_label(base, value = 'end of the test') 
    38 ;    nothing = widget_text(base, value = '0', uvalue = 'slider_min', /editable) 
    39 ;    nothing = widget_text(base, value = '10', uvalue = 'slider_max', /editable) 
    40 ;    nothing = widget_text(base, value = '5', uvalue = 'slider_value', /editable) 
    41 ;    nothing = widget_button(base, value = 'get', uvalue = 'get') 
    42 ;    nothing = widget_button(base, value = 'done', uvalue = 'done') 
    43 ;    widget_control, base, /REALIZE 
    44 ;    xmanager,'testwid', base 
    45 ;    return 
    46 ; end 
    471;+ 
    482; 
     
    389343; 
    390344 
    391   IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 
     345  IF (N_PARAMS() NE 1) THEN ras = report('Incorrect number of arguments') 
    392346  ON_ERROR, 2                   ;return to caller 
    393347; 
  • trunk/SRC/ToBeReviewed/WIDGET/xquestion.pro

    r232 r242  
    4040; @file_comments 
    4141; A small widget who ask a question and give an answer. 
    42 ;   WARNING: For a binary question with yes/no answer use 
    43 ;   DIALOG_MESSAGE. 
     42;   WARNING: For a binary question with yes/no, answer use 
     43;   <proidl>DIALOG_MESSAGE</proidl>. 
    4444; 
    4545; @categories 
    4646; Widget 
    4747; 
    48 ; @param QUESTION 
    49 ; A scalar string or a array of string. If this 
    50 ; argument is set to : 
    51 ;      + an array of strings: each array element is 
     48; @param QUESTION {type=A scalar string or a array of string} 
     49; If this argument is set to : 
     50;      - an array of strings: each array element is 
    5251;        displayed as a separate line of text. 
    53 ;      + a scalar string: we are looking for the "separate line 
     52;      - a scalar string: we are looking for the "separate line 
    5453;        character" '!C' 
    5554; 
    5655; @param PROPOSEDANSWER {type=string} 
    57 ; A string proposing a answer 
     56; proposing a answer 
    5857; 
    5958; @keyword CHKWIDGET 
    60 ; Active this keyword if you want that xquestion 
    61 ; check if managed widget are present. If not, xquestion do not 
     59; Active this keyword if you want that <pro>xquestion</pro> 
     60; check if managed widget are present. If not, <pro>xquestion</pro> do not 
    6261; open a widget but print the question in the IDL window. 
    6362; 
Note: See TracChangeset for help on using the changeset viewer.