Ignore:
Timestamp:
07/10/06 17:20:19 (18 years ago)
Author:
pinsard
Message:

some improvements and corrections in some .pro file according to
aspell and idldoc log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Matrix/cmapply.pro

    r134 r136  
    1 ;; Utility function, adapted from CMPRODUCT 
    21;+ 
     2; @file_comments 
     3; Utility function, adapted from CMPRODUCT 
     4; 
     5; @version $Id$ 
     6; 
    37; @todo seb 
    48;- 
     
    2024end 
    2125 
    22 ;; Utility function, used to collect collaped dimensions 
    2326;+ 
     27; @file_comments 
     28; cmapply_redim : Utility function, used to collect collaped dimensions 
     29; 
    2430; @todo seb 
    2531;- 
     
    5359;+ 
    5460; 
    55 ; @file_comments  
     61; @file_comments 
    5662; Applies a function to specified dimensions of an array 
    5763; 
    58 ;   Description: 
    59 ; 
    60 ;      CMAPPLY will apply one of a few select functions to specified  
    61 ;   dimensions of an array.  Unlike some IDL functions, you *do* have 
    62 ;   a choice of which dimensions that are to be "collapsed" by this 
    63 ;   function.  Iterative loops are avoided where possible, for  
    64 ;   performance reasons. 
     64; Description: 
     65; 
     66; CMAPPLY will apply one of a few select functions to specified 
     67; dimensions of an array.  Unlike some IDL functions, you *do* have 
     68; a choice of which dimensions that are to be "collapsed" by this 
     69; function.  Iterative loops are avoided where possible, for 
     70; performance reasons. 
    6571; 
    6672;   The possible functions are:             (and number of loop iterations:) 
     
    102108; @categories Arrays 
    103109; 
    104 ; @param OP {in}{required} The operation to perform, as a string.  May be upper or lower 
    105 ;        case. 
    106 ; 
    107 ;        If a user-defined operation is to be passed, then OP is of 
    108 ;        the form, 'USER:FUNCTNAME', where FUNCTNAME is the name of 
    109 ;        the user-defined function. 
    110 ; 
    111 ; @param ARRAY {in}{required} An array of values to be operated on.  Must not be of type 
    112 ;           STRING (7) or STRUCTURE (8). 
    113 ; 
    114 ; @param DIMS {in}{optional}{default=1 (ie, first dimension)}  
    115 ;          An array of dimensions that are to be "collapsed", where 
    116 ;          the the first dimension starts with 1 (ie, same convention 
    117 ;          as IDL function TOTAL).  Whereas TOTAL only allows one 
    118 ;          dimension to be added, you can specify multiple dimensions 
    119 ;          to CMAPPLY.  Order does not matter, since all operations 
    120 ;          are associative and transitive.  NOTE: the dimensions refer 
    121 ;          to the *input* array, not the output array.  IDL allows a  
    122 ;          maximum of 8 dimensions. 
    123 ;          DEFAULT: 1 (ie, first dimension) 
    124 ; 
    125 ; @keyword DOUBLE Set this if you wish the internal computations to be done 
    126 ;            in double precision if necessary.  If ARRAY is double  
    127 ;            precision (real or complex) then DOUBLE=1 is implied. 
    128 ;            DEFAULT: not set 
    129 ; 
    130 ; @keyword TYPE Set this to the IDL code of the desired output type (refer 
    131 ;          to documentation of SIZE()).  Internal results will be 
    132 ;          rounded to the nearest integer if the output type is an 
    133 ;          integer type. 
    134 ;          DEFAULT: same is input type 
    135 ; 
    136 ; @keyword FUNCTARGS If OP is 'USER:...', then the contents of this keyword 
    137 ;               are passed to the user function using the _EXTRA 
    138 ;               mechanism.  This way you can pass additional data to 
    139 ;               your user-supplied function, via keywords, without 
    140 ;               using common blocks. 
    141 ;               DEFAULT: undefined (i.e., no keywords passed by _EXTRA) 
    142 ; 
    143 ; @returns An array of the required TYPE, whose elements are the result of 
    144 ;   the requested operation.  Depending on the operation and number of 
    145 ;   elements in the input array, the result may be vulnerable to 
    146 ;   overflow or underflow. 
    147 ; 
    148 ; @examples  
    149 ;    
     110; @param OP {in}{required} 
     111; The operation to perform, as a string.  May be upper or lower case. 
     112; 
     113; If a user-defined operation is to be passed, then OP is of 
     114; the form, 'USER:FUNCTNAME', where FUNCTNAME is the name of 
     115; the user-defined function. 
     116; 
     117; @param ARRAY {in}{required} 
     118; An array of values to be operated on. 
     119; Must not be of type STRING (7) or STRUCTURE (8). 
     120; 
     121; @param dimapply {in}{optional}{default=1 (ie, first dimension)} 
     122; An array of dimensions that are to be "collapsed", where 
     123; the the first dimension starts with 1 (ie, same convention 
     124; as IDL function TOTAL).  Whereas TOTAL only allows one 
     125; dimension to be added, you can specify multiple dimensions 
     126; to CMAPPLY.  Order does not matter, since all operations 
     127; are associative and transitive.  NOTE: the dimensions refer 
     128; to the *input* array, not the output array.  IDL allows a 
     129; maximum of 8 dimensions. 
     130; 
     131; @keyword DOUBLE {default=not set} 
     132; Set this if you wish the internal computations to be done 
     133; in double precision if necessary.  If ARRAY is double 
     134; precision (real or complex) then DOUBLE=1 is implied. 
     135; 
     136; @keyword TYPE 
     137; Set this to the IDL code of the desired output type (refer 
     138; to documentation of SIZE()).  Internal results will be 
     139; rounded to the nearest integer if the output type is an 
     140; integer type. 
     141; DEFAULT: same is input type 
     142; 
     143; @keyword FUNCTARGS 
     144; If OP is 'USER:...', then the contents of this keyword 
     145; are passed to the user function using the _EXTRA 
     146; mechanism.  This way you can pass additional data to 
     147; your user-supplied function, via keywords, without 
     148; using common blocks. 
     149; DEFAULT: undefined (i.e., no keywords passed by _EXTRA) 
     150; 
     151; @returns 
     152; An array of the required TYPE, whose elements are the result of 
     153; the requested operation.  Depending on the operation and number of 
     154; elements in the input array, the result may be vulnerable to 
     155; overflow or underflow. 
     156; 
     157; @examples 
     158; 
    150159;   First example:  Shows how CMAPPLY can be used to total the second dimension of the 
    151160;   array called IN.  This is equivalent to OUT = TOTAL(IN, 2) 
     
    190199;   Changed usage message to not bomb, 24 Mar 2000, CM 
    191200;   Signficant rewrite for *, MIN and MAX (inspired by Todd Clements 
    192 ;     <Todd_Clements@alumni.hmc.edu>); FOR loop indices are now type 
     201;     <Todd_Clements\@alumni.hmc.edu>); FOR loop indices are now type 
    193202;     LONG; copying terms are liberalized, CM, 22, Aug 2000 
    194203;   More efficient MAX/MIN (inspired by Alex Schuster), CM, 25 Jan 
     
    199208; 
    200209;  Author: Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 
    201 ;  craigm@lheamail.gsfc.nasa.gov 
     210;  craigm\@lheamail.gsfc.nasa.gov 
    202211; 
    203212; @version $Id$ 
     
    293302              if newop EQ 'MIN' then return, min(newarr) 
    294303          endif 
    295            
     304 
    296305          ;; Next task: create result array 
    297306          result = make_array(totkeep, type=type) 
    298            
     307 
    299308          ;; Now either iterate over the number of output elements, or 
    300309          ;; the number of collapsed elements, whichever is smaller. 
     
    302311              ;; Iterate over the number of collapsed elements 
    303312              result[0] = reform(newarr[0,*],totkeep,/overwrite) 
    304               case newop of  
     313              case newop of 
    305314                  'MAX': for i = 1L, totcol-1 do $ 
    306315                    result[0] = result > newarr[i,*] 
     
    310319          endif else begin 
    311320              ;; Iterate over the number of output elements 
    312               case newop of  
     321              case newop of 
    313322                  'MAX': for i = 0L, totkeep-1 do result[i] = max(newarr[*,i]) 
    314323                  'MIN': for i = 0L, totkeep-1 do result[i] = min(newarr[*,i]) 
     
    332341              return, call_function(functname, newarr) 
    333342          endif 
    334            
     343 
    335344          ;; Next task: create result array 
    336345          result = make_array(totkeep, type=type) 
    337            
     346 
    338347          ;; Iterate over the number of output elements 
    339348          if n_elements(functargs) GT 0 then begin 
     
    349358      end 
    350359 
    351                
     360 
    352361  endcase 
    353362 
     
    363372    return, call_function(castfns[type], newarr) 
    364373end 
    365    
Note: See TracChangeset for help on using the changeset viewer.