Changeset 133 for trunk


Ignore:
Timestamp:
07/07/06 11:57:27 (18 years ago)
Author:
navarro
Message:

english and nicer header (1)

Location:
trunk/SRC
Files:
5 added
2 deleted
9 edited
33 moved

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Calendar/caldat.pro

    r132 r133  
    1 ; $Id$ 
     1;+ 
    22; 
    3 ; Copyright (c) 1992-2003, Research Systems, Inc.  All rights reserved. 
    4 ;       Unauthorized reproduction prohibited. 
    5 ; 
    6  
    7 ;+ 
    8 ; NAME: 
    9 ;       CALDAT 
    10 ; 
    11 ; PURPOSE: 
     3; @file_comments 
    124;       Return the calendar date and time given julian date. 
    135;       This is the inverse of the function JULDAY. 
    14 ; CATEGORY: 
    15 ;       Misc. 
     6;  
     7; @categories Calendar 
    168; 
    17 ; CALLING SEQUENCE: 
    18 ;       CALDAT, Julian, Month, Day, Year, Hour, Minute, Second 
    19 ;       See also: julday, the inverse of this function. 
    209; 
    21 ; INPUTS: 
    22 ;       JULIAN contains the Julian Day Number (which begins at noon) of the 
     10; @param JULIAN {in}{required} contains the Julian Day Number (which begins at noon) of the 
    2311;       specified calendar date.  It should be a long integer. 
    24 ; OUTPUTS: 
    25 ;       (Trailing parameters may be omitted if not required.) 
    26 ;       MONTH:  Number of the desired month (1 = January, ..., 12 = December). 
    2712; 
    28 ;       DAY:    Number of day of the month. 
     13; @param MONTH {out} Number of the desired month (1 = January, ..., 12 = December). 
    2914; 
    30 ;       YEAR:   Number of the desired year. 
     15; @param DAY {out} Number of day of the month. 
    3116; 
    32 ;       HOUR:   Hour of the day 
    33 ;       Minute: Minute of the day 
    34 ;       Second: Second (and fractions) of the day. 
     17; @param YEAR {out} Number of the desired year. 
    3518; 
    36 ; KEYWORD PARAMETERS: 
     19; @param HOUR {out} Hour of the day 
    3720; 
    38 ;       NDAYSPM: for using a calendar with fixed number of days per 
    39 ;                months. defaut value of NDAYSPM=30 
     21; @param Minute {out} Minute of the day 
    4022; 
    41 ; COMMON BLOCKS: cm_4cal 
     23; @param Second {out} Second (and fractions) of the day. 
    4224; 
    43 ; SIDE EFFECTS: 
    44 ;       None. 
    4525; 
    46 ; RESTRICTIONS: 
    47 ;       Accuracy using IEEE double precision numbers is approximately 
     26; @keyword NDAYSPM {default=30} for using a calendar with fixed number of days per 
     27;                months. 
     28; 
     29; @uses cm_4cal 
     30; 
     31; 
     32; @restrictions Accuracy using IEEE double precision numbers is approximately 
    4833;       1/10000th of a second. 
    4934; 
    50 ; MODIFICATION HISTORY: 
    51 ;       Translated from "Numerical Recipies in C", by William H. Press, 
     35; @history Translated from "Numerical Recipies in C", by William H. Press, 
    5236;       Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 
    5337;       Cambridge University Press, 1988 (second printing). 
     
    6145; 
    6246;       AB, 3 January 2000, Make seconds output as DOUBLE in array output. 
     47; 
     48; @version $Id$ 
    6349;- 
    64 ; 
    6550pro CALDAT, julian, month, day, year, hour, minute, second, NDAYSPM = ndayspm 
    6651;------------------------------------------------------------ 
  • trunk/SRC/Calendar/julday.pro

    r132 r133  
    1 ; $Id$ 
    2 ; 
    3 ; Copyright (c) 1988-2003, Research Systems, Inc.  All rights reserved. 
    4 ;       Unauthorized reproduction prohibited. 
    5  
    61;+ 
    7 ; NAME: 
    8 ;       JULDAY 
    9 ; 
    10 ; PURPOSE: 
    11 ;       Calculate the Julian Day Number for a given month, day, and year. 
     2; 
     3; @file_comments 
     4;       Calculate the Julian Day Number for a given month, day, and year. 
    125;       This is the inverse of the library function CALDAT. 
    136;       See also caldat, the inverse of this function. 
    147; 
    15 ; CATEGORY: 
    16 ;       Misc. 
    17 ; 
    18 ; CALLING SEQUENCE: 
    19 ;       Result = JULDAY([[[[Month, Day, Year], Hour], Minute], Second]) 
    20 ; 
    21 ; INPUTS: 
    22 ;       MONTH:  Number of the desired month (1 = January, ..., 12 = December). 
    23 ; 
    24 ;       DAY:    Number of day of the month. 
    25 ; 
    26 ;       YEAR:   Number of the desired year.Year parameters must be valid 
     8; @categories Calendar 
     9; 
     10; @param MONTH {in}{required} Number of the desired month (1 = January, ..., 12 = December). Can be scalar or array 
     11; 
     12; @param DAY {in}{required} Number of day of the month.Can be scalar or array 
     13; 
     14; @param YEAR {in}{required} Number of the desired year.Year parameters must be valid 
    2715;               values from the civil calendar.  Years B.C.E. are represented 
    2816;               as negative integers.  Years in the common era are represented 
    2917;               as positive integers.  In particular, note that there is no 
    3018;               year 0 in the civil calendar.  1 B.C.E. (-1) is followed by 
    31 ;               1 C.E. (1). 
    32 ; 
    33 ;       HOUR:   Number of the hour of the day. 
    34 ; 
    35 ;       MINUTE: Number of the minute of the hour. 
    36 ; 
    37 ;       SECOND: Number of the second of the minute. 
    38 ; 
    39 ;   Note: Month, Day, Year, Hour, Minute, and Second can all be arrays. 
    40 ;         The Result will have the same dimensions as the smallest array, or 
     19;               1 C.E. (1). Can be scalar or array 
     20; 
     21; @param HOUR {in}{optional} Number of the hour of the day. Can be scalar or array 
     22; 
     23; @param MINUTE {in}{optional} Number of the minute of the hour. Can be scalar or array 
     24; 
     25; @param SECOND {in}{optional} Number of the second of the minute. Can be scalar or array 
     26; 
     27; @restrictions The Result will have the same dimensions as the smallest array, or 
    4128;         will be a scalar if all arguments are scalars. 
    42 ; 
    43 ; OPTIONAL INPUT PARAMETERS: 
    44 ;       Hour, Minute, Second = optional time of day. 
    45 ; 
    46 ; KEYWORD PARAMETERS: 
    47 ; 
    48 ;       NDAYSPM: for using a calendar with fixed number of days per 
    49 ;                months. defaut value of NDAYSPM=30 
    50 ; 
    51 ; OUTPUTS: 
    52 ;       JULDAY returns the Julian Day Number (which begins at noon) of the 
     29;  
     30; 
     31; @keywords NDAYSPM {default=30} for using a calendar with fixed number of days per 
     32;                months. 
     33; 
     34; @ returns JULDAY: the Julian Day Number (which begins at noon) of the 
    5335;       specified calendar date.  If Hour, Minute, and Second are not specified, 
    5436;       then the result will be a long integer, otherwise the result is a 
    5537;       double precision floating point number. 
    5638; 
    57 ; COMMON BLOCKS: cm_4cal 
    58 ; 
    59 ; SIDE EFFECTS: 
    60 ;       None. 
    61 ; 
    62 ; RESTRICTIONS: 
    63 ;       Accuracy using IEEE double precision numbers is approximately 
     39; @uses cm_4cal 
     40; 
     41; @restrictions Accuracy using IEEE double precision numbers is approximately 
    6442;   1/10000th of a second, with higher accuracy for smaller (earlier) 
    6543;   Julian dates. 
    6644; 
    67 ; MODIFICATION HISTORY: 
    68 ;       Translated from "Numerical Recipies in C", by William H. Press, 
     45; @history Translated from "Numerical Recipies in C", by William H. Press, 
    6946;       Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 
    7047;       Cambridge University Press, 1988 (second printing). 
     
    8259; 
    8360;   CT, April 2000, Now accepts vectors or scalars. 
     61; 
     62; @version $Id$ 
    8463;- 
    8564; 
  • trunk/SRC/Colors/color24.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;       COLOR24 
    42; 
    5 ; PURPOSE: 
    6 ;       The purpose of this function is to convert a RGB color triple 
    7 ;       into the equivalent 24-big long integer.  
     3; @file_comments  
     4; The purpose of this function is to convert a RGB color triple 
     5; into the equivalent 24-big long integer.  
    86; 
    9 ; CATEGORY: 
    10 ;       Graphics, Color Specification. 
     7; @categories Graphics, Color Specification. 
    118; 
    12 ; CALLING SEQUENCE: 
    13 ;       color = COLOR24(rgb_triple) 
    14 ; 
    15 ; INPUTS: 
    16 ;       RGB_TRIPLE: A three-element column or row array representing  
     9; @param RGB_TRIPLE {in}{required} A three-element column or row array representing  
    1710;       a color triple. The values of the elements must be between  
    1811;       0 and 255. 
    1912; 
    20 ; KEYWORD PARAMETERS: 
    21 ;       None.  
     13; @returns a 24-bit long integer that is equivalent the input color.  
     14; The color is 
     15; described in terms of a hexidecimal number (e.g., FF206A) 
     16; where the left two digits represent the blue color, the  
     17; middle two digits represent the green color, and the right  
     18; two digits represent the red color. 
    2219; 
    23 ; COMMON BLOCKS: 
    24 ;       None. 
    25 ; 
    26 ; SIDE EFFECTS: 
    27 ;       None. 
    28 ; 
    29 ; RESTRICTIONS: 
    30 ;       None. 
    31 ; 
    32 ; EXAMPLE: 
    33 ;       To convert the color triple for the color YELLOW,  
     20; @examples To convert the color triple for the color YELLOW,  
    3421;       (255, 255, 0), to the hexadecimal value '00FFFF'x  
    3522;       or the decimal number 65535, type: 
     
    4027;       COLORS or GETCOLOR 
    4128; 
    42 ; MODIFICATION HISTORY: 
     29; @history 
    4330;       Written by:     David Fanning, 3 February 96. 
     31; 
     32; @version $Id$ 
     33; 
    4434;- 
    45  
    46  
    4735FUNCTION COLOR24, number 
    4836; 
    4937  compile_opt idl2, strictarrsubs 
    50 ; 
    51  
    52    ; This FUNCTION accepts a [red, green, blue] triple that 
    53    ; describes a particular color and returns a 24-bit long 
    54    ; integer that is equivalent to that color. The color is 
    55    ; described in terms of a hexidecimal number (e.g., FF206A) 
    56    ; where the left two digits represent the blue color, the  
    57    ; middle two digits represent the green color, and the right  
    58    ; two digits represent the red color. 
    59    ; 
    60    ; The triple can be either a row or column vector of 3 elements. 
    61     
     38;    
    6239ON_ERROR, 1 
    6340 
  • trunk/SRC/Colors/colorbar.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;   COLORBAR 
    4 ; 
    5 ; PURPOSE: 
    6 ;       The purpose of this routine is to add a color bar to the current 
    7 ;       graphics window. 
    8 ; 
    9 ; CATEGORY: 
    10 ;       Graphics, Widgets. 
    11 ; 
    12 ; CALLING SEQUENCE: 
    13 ;       COLORBAR 
    14 ; 
    15 ; INPUTS: 
    16 ;       None. 
    17 ; 
    18 ; KEYWORD PARAMETERS: 
    19 ; 
    20 ;       BOTTOM: The lowest color index of the colors to be loaded in 
     2; 
     3; @file_comments  
     4; The purpose of this routine is to add a color bar to the current 
     5; graphics window. 
     6; 
     7; @categories Graphics, Widgets. 
     8; 
     9; @keyword BOTTOM The lowest color index of the colors to be loaded in 
    2110;                 the bar. 
    2211; 
    23 ;       CB_CHARSIZE: The character size of the color bar annotations. Default is 1.0. 
    24 ; 
    25 ;       CB_CHARTICK: The character thick of the color bar annotations. Default is 1.0. 
    26 ; 
    27 ;       CB_COLOR:    The color index of the bar outline and characters. Default 
     12; @keyword CB_CHARSIZE The character size of the color bar annotations. Default is 1.0. 
     13; 
     14; @keyword CB_CHARTICK The character thick of the color bar annotations. Default is 1.0. 
     15; 
     16; @keyword CB_COLOR The color index of the bar outline and characters. Default 
    2817;                 is ncolors - 1 + bottom. 
    2918; 
    30 ;       CB_LOG: to get logarithmic scale for the colorbar 
    31 ; 
    32 ;       CB_TITLE:    This is title for the color bar. The default is to have 
     19; @keyword CB_LOG to get logarithmic scale for the colorbar 
     20; 
     21; @keyword CB_TITLE This is title for the color bar. The default is to have 
    3322;                 no title. 
    3423; 
    35 ;       DISCRET:  Vecteur contenant les incices des couleurs a tracer en barre 
    36 ; de couleur. On obtient ainsi une barre de couleur discrete ne comportant que 
    37 ; les couleurs specifiees ds l'ordre ou elles apparaissent ds le vecteur. 
    38 ; 
    39 ;       DIVISIONS: The number of divisions to divide the bar into. There will 
     24; @keyword DISCRETE Vector which contain color's indexes to trace in a color bar. Therefore 
     25;               we obtain a discreet color bar which only contains specified colors in  
     26;               order where they appear in the vector 
     27; 
     28; @keyword DIVISIONS The number of divisions to divide the bar into. There will 
    4029;                 be (divisions + 1) annotations. The default is 2. 
    4130; 
    42 ;       FORMAT:   The format of the bar annotations. Default is '(F6.2)'. 
    43 ; 
    44 ;       CB_LABEL:    C''est un vecteur qui specifie la valeur des sticks 
    45 ;       presents dans la barre de couleur. Il permet qd on utilise 
    46 ;       DISCRET d''avoir des couleurs qui ne s''incrementent pas de 
    47 ;       facon regulieres. 
    48 ; 
    49 ;       MAX:      The maximum data value for the bar annotation. Default is 
     31; @keyword FORMAT The format of the bar annotations. Default is '(F6.2)'. 
     32; 
     33; @keyword CB_LABEL It is a vector who specifie sticks's value attend in the color bar. 
     34;                It allowes, when we use DISCREET, to have colors which don't increase  
     35;                by increments in a regular way. 
     36; 
     37; @keyword MAX The maximum data value for the bar annotation. Default is 
    5038;                 NCOLORS-1. 
    5139; 
    52 ;       MIN:      The minimum data value for the bar annotation. Default is 0. 
    53 ; 
    54 ;       NCOLORS: This is the number of colors in the color bar. 
    55 ; 
    56 ;       NOTITLE:  oblige a ne pas mettre de titre meme si cb_title est declare 
    57 ; 
    58 ;       POSITION: A four-element array of normalized coordinates in the same 
     40; @keyword MIN The minimum data value for the bar annotation. Default is 0. 
     41; 
     42; @keyword NCOLOR This is the number of colors in the color bar. 
     43; 
     44; @keyword NOTITLE Force to don't writte title even if CB_TITLE is declarerd. 
     45; 
     46; @keyword POSITION A four-element array of normalized coordinates in the same 
    5947;                 form as the POSITION keyword on a plot. Default is 
    6048;                 [0.88, 0.15, 0.95, 0.95] for a vertical bar and 
    6149;                 [0.15, 0.88, 0.95, 0.95] for a horizontal bar. 
    6250; 
    63 ;       PSCOLOR: This keyword is only applied if the output is being sent to 
     51; @keyword PSCOLOR This keyword is only applied if the output is being sent to 
    6452;                 a PostScript file. It indicates that the PostScript device 
    6553;                 is configured for color output. If this keyword is set, then 
     
    7462;                 are outputting to a color PostScript printer. 
    7563; 
    76 ;       RIGHT:    This puts the labels on the right-hand side of a vertical 
     64; @keyword RIGHT This puts the labels on the right-hand side of a vertical 
    7765;                 color bar. It applies only to vertical color bars. 
    7866; 
    79 ;       TOP:      This puts the labels on top of the bar rather than under it. 
     67; @keyword TOP This puts the labels on top of the bar rather than under it. 
    8068;                 The keyword only applies if a horizontal color bar is rendered. 
    8169; 
    82 ;       VERTICAL: Setting this keyword give a vertical color bar. The default 
     70; @keyword VERTICAL Setting this keyword give a vertical color bar. The default 
    8371;                 is a horizontal color bar. 
    8472; 
    85 ; COMMON BLOCKS: 
    86 ;       None. 
    87 ; 
    88 ; SIDE EFFECTS: 
    89 ;       Color bar is drawn in the current graphics window. 
    90 ; 
    91 ; RESTRICTIONS: 
    92 ;       The number of colors available on the display device (not the 
     73; @restrictions Color bar is drawn in the current graphics window. 
     74; 
     75; @restrictions The number of colors available on the display device (not the 
    9376;       PostScript device) is used unless the NCOLORS keyword is used. 
    9477; 
    95 ; EXAMPLE: 
    96 ;       To display a horizontal color bar above a contour plot, type: 
    97 ; 
    98 ;       LOADCT, 5, NCOLORS=100 
    99 ;       CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ 
    100 ;          C_COLORS=INDGEN(25)*4, NLEVELS=25 
    101 ;       COLORBAR, NCOLORS=100 
    102 ; 
    103 ; MODIFICATION HISTORY: 
    104 ;       Written by: David Fanning, 10 JUNE 96. 
     78; @examples To display a horizontal color bar above a contour plot, type: 
     79; 
     80;       IDL> LOADCT, 5, NCOLORS=100 
     81;       IDL> CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ 
     82;       IDL> C_COLORS=INDGEN(25)*4, NLEVELS=25 
     83;       IDL> COLORBAR, NCOLORS=100 
     84; 
     85; @history Written by: David Fanning, 10 JUNE 96. 
    10586;       10/27/96: Added the ability to send output to PostScript. DWF 
    10687;       11/4/96: Substantially rewritten to go to screen or PostScript 
     
    11394;       3/3/98:  ajout du keyword discret par 
    11495;                sebastien (smasson@lodyc.jussieu.fr) 
     96; 
     97; @version $Id$ 
     98; 
    11599;- 
    116100 
    117101PRO COLORBAR, BOTTOM=bottom, CB_CHARSIZE=cb_charsize, CB_CHARTHICK=cb_charthick $ 
    118102              , CB_COLOR=cb_color, $ 
    119               DIVISIONS=divisions, DISCRET=discret,CB_LABEL = cb_label, $ 
     103              DIVISIONS=divisions, DISCRETE=discrete,CB_LABEL = cb_label, $ 
    120104              FORMAT=format, POSITION=position, MAX=max, MIN=min, NCOLORS=ncolors, $ 
    121105              PSCOLOR=pscolor, CB_TITLE=cb_title, VERTICAL=vertical, TOP=top, RIGHT=right, CB_LOG = CB_log, _extra = ex 
     
    189173 
    190174   IF KEYWORD_SET(vertical) THEN BEGIN 
    191       IF KEYWORD_SET(discret) THEN begin 
    192          facteur=256/n_elements(discret) 
    193          discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret), /overwrite)  
    194          bar = REPLICATE(1B,10) # discret 
     175      IF KEYWORD_SET(discrete) THEN begin 
     176         facteur=256/n_elements(discrete) 
     177         discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite)  
     178         bar = REPLICATE(1B,10) # discrete 
    195179      endif else  bar = REPLICATE(1B,10) # BINDGEN(256) 
    196180      IF N_ELEMENTS(position) EQ 0 THEN position = [0.88, 0.15, 0.95, 0.95] 
    197181   ENDIF ELSE BEGIN 
    198       IF KEYWORD_SET(discret) THEN begin 
    199          facteur=256/n_elements(discret) 
    200          discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret), /overwrite)  
    201          bar =  discret # REPLICATE(1B,10) 
     182      IF KEYWORD_SET(discrete) THEN begin 
     183         facteur=256/n_elements(discrete) 
     184         discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite)  
     185         bar =  discrete # REPLICATE(1B,10) 
    202186      endif else bar = BINDGEN(256) # REPLICATE(1B, 10) 
    203187      IF N_ELEMENTS(position) EQ 0 THEN position = [0.15, 0.88, 0.95, 0.95] 
     
    205189 
    206190                                ; Scale the color bar. 
    207    IF NOT KEYWORD_SET(discret) THEN $ 
     191   IF NOT KEYWORD_SET(discrete) THEN $ 
    208192    bar = BYTSCL(bar, TOP=ncolors-1) + bottom 
    209193 
  • trunk/SRC/Colors/getcolor.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;       GETCOLOR 
    4 ; 
    5 ; PURPOSE: 
    6 ;       The original purpose of this function was to enable the 
    7 ;       user to specify one of the 16 colors supported by the 
    8 ;       McIDAS color map by name. Over time, however, the function 
    9 ;       has become a general purpose function for handling and 
    10 ;       supporting drawing colors in a device-independent way. 
    11 ;       In particular, I have been looking for ways to write color 
    12 ;       handling code that will work transparently on both 8-bit and 
    13 ;       24-bit machines. On 24-bit machines, the code should work the 
    14 ;       same where color decomposition is turned on or off. 
     2; 
     3; @file_comments  
     4; The original purpose of this function was to enable the 
     5; user to specify one of the 16 colors supported by the 
     6; McIDAS color map by name. Over time, however, the function 
     7; has become a general purpose function for handling and 
     8; supporting drawing colors in a device-independent way. 
     9; In particular, I have been looking for ways to write color 
     10; handling code that will work transparently on both 8-bit and 
     11; 24-bit machines. On 24-bit machines, the code should work the 
     12; same where color decomposition is turned on or off. 
    1513; 
    1614;       (The 16 supported colors in GETCOLOR come from the McIDAS color 
    1715;       table offered on the IDL newsgroup by Liam Gumley.) 
    1816; 
    19 ; CATEGORY: 
    20 ;       Graphics, Color Specification. 
    21 ; 
    22 ; CALLING SEQUENCE: 
    23 ;       result = GETCOLOR(color) 
    24 ; 
    25 ; OPTIONAL INPUT PARAMETERS: 
    26 ;       COLOR: A string with the "name" of the color. Valid names are: 
     17; @categories Graphics, Color Specification. 
     18; 
     19; @param thisColor {in}{optional} A string with the "name" of the color. Valid names are: 
    2720;           black 
    2821;           magenta 
     
    5346;           IDL 5.2 or higher. 
    5447; 
    55 ;       INDEX: The color table index where the specified color should be loaded. 
     48; @param index {in}{optional} The color table index where the specified color should be loaded. 
    5649;           If this parameter is passed, then the return value of the function is the 
    5750;           index number and not the color triple. (If color decomposition is turned 
     
    6962;           TVLCT, colors, 100 
    7063; 
    71 ; 
    72 ; INPUT KEYWORD PARAMETERS: 
    73 ; 
    74 ;       NAMES: If this keyword is set, the return value of the function is 
     64; @keyword NAMES If this keyword is set, the return value of the function is 
    7565;              a 16-element string array containing the names of the colors. 
    7666;              These names would be appropriate, for example, in building 
     
    8070;                 listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 
    8171; 
    82 ;       LOAD:  If this keyword is set, all 16 colors are automatically loaded 
     72; @keyword LOAD  If this keyword is set, all 16 colors are automatically loaded 
    8373;              starting at the color index specified by the START keyword. 
    8474;              Note that setting this keyword means that the return value of the 
     
    9282;              byte array or a long integer value. 
    9383; 
    94 ;       START: The starting color index number if the LOAD keyword is set. This keyword 
     84; @keyword START The starting color index number if the LOAD keyword is set. This keyword 
    9585;              value is ignored unless the LOAD keyword is also set. The keyword is also 
    9686;              ignored if the TRUE keyword is set or if color decomposition in on in 
     
    9888;              !D.TABLE_SIZE - 17. 
    9989; 
    100 ;       TRUE:  If this keyword is set, the specified color triple is returned 
     90; @keyword TRUE  If this keyword is set, the specified color triple is returned 
    10191;              as a 24-bit integer equivalent. The lowest 8 bits correspond to 
    10292;              the red value; the middle 8 bits to the green value; and the 
     
    10595;              were set. 
    10696; 
    107 ; COMMON BLOCKS: 
    108 ;       None. 
    109 ; 
    110 ; SIDE EFFECTS: 
    111 ;       None. 
    112 ; 
    113 ; RESTRICTIONS: 
    114 ;       The TRUE keyword causes the START keyword to be ignored. 
     97; @restrictions The TRUE keyword causes the START keyword to be ignored. 
    11598;       The NAMES keyword causes the COLOR, INDEX, START, and TRUE parameters to be ignored. 
    11699;       The COLOR parameter is ignored if the LOAD keyword is used. 
     
    119102;       returned if color decomposition is ON. 
    120103; 
    121 ; EXAMPLE: 
    122 ;       To load a yellow color in color index 100 and plot in yellow, type: 
    123 ; 
    124 ;          yellow = GETCOLOR('yellow', 100) 
    125 ;          PLOT, data, COLOR=yellow 
     104;  
     105; @examples To load a yellow color in color index 100 and plot in yellow, type: 
     106; 
     107;          IDL> yellow = GETCOLOR('yellow', 100) 
     108;          IDL> PLOT, data, COLOR=yellow 
    126109; 
    127110;       or, 
    128111; 
    129 ;          PLOT, data, COLOR=GETCOLOR('yellow', 100) 
     112;          IDL> PLOT, data, COLOR=GETCOLOR('yellow', 100) 
    130113; 
    131114;       To do the same thing on a 24-bit color system with decomposed color on, type: 
    132115; 
    133 ;          PLOT, data, COLOR=GETCOLOR('yellow', /TRUE) 
     116;          IDL> PLOT, data, COLOR=GETCOLOR('yellow', /TRUE) 
    134117; 
    135118;       or in IDL 5.2 and higher, 
    136119; 
    137 ;          DEVICE, Decomposed=1 
    138 ;          PLOT, data, COLOR=GETCOLOR('yellow') 
     120;          IDL> DEVICE, Decomposed=1 
     121;          IDL> PLOT, data, COLOR=GETCOLOR('yellow') 
    139122; 
    140123;       To load all 16 colors into the current color table, starting at 
    141124;       color index 200, type: 
    142125; 
    143 ;          TVLCT, GETCOLOR(), 200 
     126;          IDL> TVLCT, GETCOLOR(), 200 
    144127; 
    145128;       To add the color names to a list widget: 
    146129; 
    147 ;           listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 
     130;           IDL> listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 
    148131; 
    149132;       To load all 16 colors and have the color indices returned in a structure: 
    150133; 
    151 ;           DEVICE, Decomposed=0 
    152 ;           colors = GetColor(/Load, Start=1) 
    153 ;           HELP, colors, /Structure 
     134;           IDL> DEVICE, Decomposed=0 
     135;           IDL> colors = GetColor(/Load, Start=1) 
     136;           IDL> HELP, colors, /Structure 
    154137;           PLOT, data, COLOR=colors.yellow 
    155138; 
    156139;       To get the direct color values as 24-bit integers in color structure fields: 
    157140; 
    158 ;           DEVICE, Decomposed=1 
    159 ;           colors = GetColor(/Load) 
    160 ;           PLOT, data, COLOR=colors.yellow 
     141;           IDL> DEVICE, Decomposed=1 
     142;           IDL> colors = GetColor(/Load) 
     143;           IDL> PLOT, data, COLOR=colors.yellow 
    161144; 
    162145;       Note that the START keyword value is ignored if on a 24-bit device, 
     
    164147;       writing code like this: 
    165148; 
    166 ;           colors = GetColor(/Load) 
    167 ;           PLOT, data, Color=colors.yellow 
    168 ; 
    169 ; MODIFICATION HISTORY: 
    170 ;       Written by: David Fanning, 10 February 96. 
     149;           IDL> colors = GetColor(/Load) 
     150;           IDL> PLOT, data, Color=colors.yellow;           IDL> DEVICE, Decomposed=0 
     151;           IDL> colors = GetColor(/Load, Start=1) 
     152;           IDL> HELP, colors, /Structure 
     153;           PLOT, data, COLOR=colors.yellow 
     154; 
     155;       To get the direct color values as 24-bit integers in color structure fields: 
     156; 
     157;           IDL> DEVICE, Decomposed=1 
     158;           IDL> colors = GetColor(/Load) 
     159;           IDL> PLOT, data, COLOR=colors.yellow 
     160; 
     161;       Note that the START keyword value is ignored if on a 24-bit device, 
     162;       so it is possible to write completely device-independent code by 
     163;       writing code like this: 
     164; 
     165;           IDL> colors = GetColor(/Load) 
     166;           IDL> PLOT, data, Color=colors.yellow 
     167; 
     168; @history Written by: David Fanning, 10 February 96. 
    171169;       Fixed a bug in which N_ELEMENTS was spelled wrong. 7 Dec 96. DWF 
    172170;       Added the McIDAS colors to the program. 24 Feb 99. DWF 
     
    176174;       Added automatic recognition of DECOMPOSED=1 state. 7 June 99. DWF 
    177175;       Added LOAD AND START keywords. 7 June 99. DWF. 
     176; 
     177; @version $Id$ 
    178178;- 
    179  
    180  
    181  
    182 FUNCTION COLOR24, number 
    183 ; 
    184   compile_opt idl2, strictarrsubs 
    185 ; 
    186  
    187    ; This FUNCTION accepts a [red, green, blue] triple that 
    188    ; describes a particular color and returns a 24-bit long 
    189    ; integer that is equivalent to that color. The color is 
    190    ; described in terms of a hexidecimal number (e.g., FF206A) 
    191    ; where the left two digits represent the blue color, the 
    192    ; middle two digits represent the green color, and the right 
    193    ; two digits represent the red color. 
    194    ; 
    195    ; The triple can be either a row or column vector of 3 elements. 
    196  
    197 ON_ERROR, 1 
    198  
    199 IF N_ELEMENTS(number) NE 3 THEN $ 
    200    MESSAGE, 'Augument must be a three-element vector.' 
    201  
    202 IF MAX(number) GT 255 OR MIN(number) LT 0 THEN $ 
    203    MESSAGE, 'Argument values must be in range of 0-255' 
    204  
    205 base16 = [[1L, 16L], [256L, 4096L], [65536L, 1048576L]] 
    206  
    207 num24bit = 0L 
    208  
    209 FOR j=0,2 DO num24bit = num24bit + ((number[j] MOD 16) * base16[0,j]) + $ 
    210    (Fix(number[j]/16) * base16[1,j]) 
    211  
    212 RETURN, num24bit 
    213 END ; ************************  of COLOR24  ****************************** 
    214  
    215  
    216179 
    217180FUNCTION GETCOLOR, thisColor, index, TRUE=truecolor, $ 
  • trunk/SRC/Colors/lct.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:lct 
    65; 
    7 ; PURPOSE:plus court que de taper loadct,file='palette.tbl' 
     6; @file_comments  
     7; Fastest than type loadct,file='palette.tbl' 
    88; 
    9 ; CATEGORY:flemme 
     9; @categories graphics, color specification 
    1010; 
    11 ; CALLING SEQUENCE:lct[,numerp_couleur] 
     11; @param numpal {in}{optional} number of the color palette we want to select in the file palette.tbl 
    1212; 
    13 ; INPUTS:optionnel: numero de la couleur que l''on veut ds palette.tbl 
    14 ; 
    15 ; KEYWORD PARAMETERS: ceux de loadct 
    16 ; 
    17 ;        LIGHTNESS: a scalar used to change the Lightness of the color 
     13; @keyword LIGHTNESS a scalar used to change the Lightness of the color 
    1814;            palette to be abble to adjust according to the printer we use, 
    1915;            the media (paper or slide)...  
     
    2117;                         > 1 to get darker colors 
    2218; 
    23 ; rq: si le mot cle file n''est pas specifie, on cherche un fichier 
    24 ; contenant les palette du nom de palette.tbl. 
    25 ; Ce fichier peut etre dans n''importe quel repertoire du !path 
     19; @keyword FILE {default=palette.tbl} is not specified, we are looking  a file containing  
     20; palettes named palette.tbl. 
     21; This file can be in any directory of the !path 
    2622; 
    27 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    28 ;                       30/3/1999 ajout de _extra, de la recherche 
    29 ;                       du nom complet et pour que ca marche aussi en 
    30 ;                       mode PS et Z 
    31 ;                       6/7/1999: compatibilite mac et windows 
     23; @keyword GET_NAME Set this keyword to a named variable in which the names of the color tables 
     24;          are reurned as a string array. No changes are made to the color table. 
     25; 
     26; @keyword _EXTRA Used to pass your keywords 
     27; 
     28; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     29;          30/3/1999: add extra 
     30;          6/7/1999: mac/windows comptibility 
     31; 
     32; @version $Id$ 
     33; 
    3234;- 
    3335;------------------------------------------------------------ 
    3436;------------------------------------------------------------ 
    3537;------------------------------------------------------------ 
    36 PRO lct, numero, GET_NAME = get_name, LIGHTNESS = Lightness, _EXTRA = ex 
     38PRO lct, numpal, FILE = file, GET_NAME = get_name, LIGHTNESS = Lightness, _EXTRA = ex 
    3739; 
    3840  compile_opt idl2, strictarrsubs 
    3941; 
    4042@common 
    41 ; le mot cle file est passe par l''intermediere de EXTRA? 
    42 ; definition du mon du fichier qui contient les palettes de couleur 
    43    if n_elements(ex) NE 0 then BEGIN  
    44       if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then nompal=ex.FILE ELSE nompal='palette.tbl' 
    45    ENDIF ELSE nompal = 'palette.tbl' 
    46 ; quelle est l''adresse complete de nompal? 
     43; definition of the name of the file containing colors palettes. 
     44   if keyword_set(file) then nametbl = file ELSE nametbl = 'palette.tbl' 
     45; What is the full adress of nametbl? 
    4746   thisOS = strupcase(strmid(!version.os_family, 0, 3)) 
    4847   CASE thisOS of 
     
    5251   ENDCASE 
    5352   cd, current = current 
    54    if strpos(nompal,sep) lt 0 then BEGIN 
     53   if strpos(nametbl,sep) lt 0 then BEGIN 
    5554      if rstrpos(current,sep) NE strlen(current)-1 then current = current+sep 
    5655      multipath = str_sep(!path,pathsep) 
     
    5857       if rstrpos(multipath[i],sep) NE strlen(multipath[i])-1 then $ 
    5958       multipath[i] = multipath[i] +sep 
    60       nompal = [current, multipath]+ nompal 
     59      nametbl = [current, multipath]+ nametbl 
    6160   ENDIF 
    62 ; on test tous les noms possibles pour trouver ou est le fichier 
    63    nfile=n_elements(nompal) 
     61; we test all possible name in order to find where file is. 
     62   nfile=n_elements(nametbl) 
    6463   n = 0 
    6564   repeat begin 
    66       res = findfile(nompal[n])  
     65      res = findfile(nametbl[n])  
    6766      n = n+1 
    68    endrep until res[0] NE '' OR n EQ n_elements(nompal)  
     67   endrep until res[0] NE '' OR n EQ n_elements(nametbl)  
    6968   if res[0] NE '' then BEGIN 
    70       nompal = nompal[n-1] 
     69      nametbl = nametbl[n-1] 
    7170      if n_elements(ex) NE 0 then $  
    72        if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nompal 
    73 ; si on est en mode POSTSCRIPT, il faut repasser en mode X pour 
    74 ; changer la palette de couleur 
     71        if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nametbl 
     72; if we are in POSTSCRIPT mode, we have to pass in X mode in order to change the color palette 
    7573      oldname = !d.name 
    7674      if !d.name EQ 'PS' OR !d.name EQ 'Z' then BEGIN  
     
    8987; 
    9088      if arg_present(get_name) then begin 
    91          if n_elements(numero) EQ 0 then loadct, file=nompal, GET_NAME = get_name, _EXTRA = ex $ 
    92          ELSE loadct,numero, file=nompal, /silent, GET_NAME = get_name,_EXTRA = ex 
     89         if n_elements(numpal) EQ 0 then loadct, file=nametbl, GET_NAME = get_name, _EXTRA = ex $ 
     90         ELSE loadct,numpal, file=nametbl, /silent, GET_NAME = get_name,_EXTRA = ex 
    9391      ENDIF ELSE BEGIN  
    94          if n_elements(numero) EQ 0 then loadct, file=nompal, _EXTRA = ex $ 
    95          ELSE loadct,numero, file=nompal, /silent, _EXTRA = ex 
     92         if n_elements(numpal) EQ 0 then loadct, file=nametbl, _EXTRA = ex $ 
     93         ELSE loadct,numpal, file=nametbl, /silent, _EXTRA = ex 
    9694      ENDELSE  
    9795; 
  • trunk/SRC/Colors/newpalette.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:newpalette 
    65; 
    7 ; PURPOSE:permet de stocker la palette qui est a l''ecran dans un 
    8 ; fichier du meme type que celui fournit par defaut dans IDL: 
     6; @file_comments  
     7; Allows to stock the palette which is on the screen 
     8; in a same type file than the one gave by default in IDL 
    99; 'colors1.tbl'. 
    1010; 
    11 ; CATEGORY:pour garder ses jolies palettes perso. 
     11; @categories graphic, color specification 
    1212; 
    13 ; CALLING SEQUENCE:newpalette,nom_de_palette 
     13; @param namepal {in}{required} It is a string containing the name of the new palettte we want to write. 
    1414; 
    15 ; INPUTS:nom_de_palette: c'est un string qui contient le nom de la 
    16 ; nouvelle palette que l''on veut ecrire. 
     15; @keyword  OVER It is a whole number which designate the number of the palette 
     16;               we want to replace the palette on the screen  
    1717; 
    18 ; KEYWORD PARAMETERS:  
     18; @keyword FILE {default=palette.tbl} is not specified, we are looking  a file containing  
     19;              palettes named palette.tbl. 
     20;              This file can be in any directory of the !path 
     21;              On the other hand it must be writable 
    1922; 
    20 ; OVER: c''est un entier qui designe le numero de la palette que l''on 
    21 ; veut remplacer par la palette a l''ecran. 
    22 ;  
    23 ; + ceux de modifyct 
     23; @keyword _extra Used to pass your keywords 
    2424; 
    25 ; rq: si le mot cle file n''est pas specifie, on cherche un fichier 
    26 ; contenant les palettes du nom de palette.tbl. 
    27 ; Ce fichier peut etre dans n''importe quel repertoire du !path 
    28 ; Par contre il doit etre en droit d''ecriture 
     25; @history Guillaume Roulet (gr@lodyc.jussieu.fr) 
     26;                       30/3/1999 s.masson, add _extra, research of the full name, OVER 
     27;                       5/5/1999 s.masson 
    2928; 
    30 ; MODIFICATION HISTORY: Guillaume Roulet (gr@lodyc.jussieu.fr) 
    31 ;                       30/3/1999 s.masson, ajout de _extra, de le 
    32 ;                       recherche du nom complet, de OVER et du blabla 
    33 ;                       5/5/1999 s.masson, va copie eventuelle du 
    34 ;                       fichier contenant les palettes 
     29; @version $Id$ 
     30; 
     31; @todo seb cleaning + traduction 
    3532;- 
    3633;------------------------------------------------------------ 
    3734;------------------------------------------------------------ 
    3835;------------------------------------------------------------ 
    39 pro newpalette,nom, OVER = over, _extra = ex 
    40 ; le mot cle file est passe par l''intermediere de EXTRA? 
    41 ; definition du mon du fichier qui contient les palettes de couleur 
     36pro newpalette,namepal, FILE = file, OVER = over, _extra = ex 
    4237; 
    4338  compile_opt idl2, strictarrsubs 
    4439; 
    45    if n_elements(ex) NE 0 then BEGIN  
    46       if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then nompal=ex.FILE ELSE nompal='palette.tbl' 
    47    ENDIF ELSE nompal = 'palette.tbl' 
    48    nomcourt = nompal 
    49 ; quelle est l''adresse complete de nompal? 
    50    nompal = find(nompal) 
    51    if nompal[0] NE 'NOT FOUND' then begin 
    52       nompal = nompal[0] 
    53 ; nompal nous appartient??? 
     40; definition of the name of the file containing colors palettes. 
     41   if keyword_set(file) then nametbl = file ELSE nametbl = 'palette.tbl' 
     42   nomcourt = nametbl 
     43; What is the full adress of nametbl? 
     44   nametbl = find(nametbl) 
     45   if nametbl[0] NE 'NOT FOUND' then begin 
     46      nametbl = nametbl[0] 
     47; does nametbl is our? 
    5448      spawn, 'whoami', login 
    55       appartient = strpos(nompal, login[0]) 
     49      appartient = strpos(nametbl, login[0]) 
    5650      if appartient EQ -1 then begin 
    57          ouinon = report('Le fichier '+nompal+' ne vous appartient pas, Voulez-vous copier le fichier '+nomcourt+' dans le repertoire courant: '+current+' ?', /default_no, /question) 
     51         ouinon = report('Le fichier '+nametbl+' ne vous appartient pas, Voulez-vous copier le fichier '+nomcourt+' dans le repertoire courant: '+current+' ?', /default_no, /question) 
    5852         if ouinon then return ELSE BEGIN  
    59             spawn, 'cp '+nompal+' '+nomcourt ; on copie 
    60             nompal = nomcourt 
    61             spawn,  'chmod u+w '+nompal ; on se donne les droits d''ecriture 
     53            spawn, 'cp '+nametbl+' '+nomcourt ; copy 
     54            nametbl = nomcourt 
     55            spawn,  'chmod u+w '+nametbl ; give writing rights 
    6256         ENDELSE 
    6357      endif 
    64    ENDIF ELSE BEGIN             ; aucun fichier nompal a ete trouve 
    65       nompal = nomcourt         ; on recupe le nompal d''origine 
    66       ouinon = report('le fichier de palettes demande '+nompal+' n''existe pas ds les repertoires !path. Voulez-vous cree un fichier '+nompal+' dans le repertoire courant', /default_no, /question) 
     58   ENDIF ELSE BEGIN             ; no file nametbl found 
     59      nametbl = nomcourt         ; we reclaim the nametbl source 
     60      ouinon = report('le fichier de palettes demande '+nametbl+' n''existe pas ds les repertoires !path. Voulez-vous cree un fichier '+nametbl+' dans le repertoire courant', /default_no, /question) 
    6761      if NOT ouinon then return 
    6862      nomfichsource = filepath('colors1.tbl', subdir=['resource', 'colors'])  
    69       spawn,'cp '+nomfichsource+' '+nompal ; on copie 
    70       spawn,  'chmod u+w '+nompal ; on se donne les droits d''ecriture 
     63      spawn,'cp '+nomfichsource+' '+nametbl ; copy 
     64      spawn,  'chmod u+w '+nametbl ; give writing rights 
    7165   ENDELSE  
    7266 
    7367   if n_elements(ex) NE 0 then $  
    74     if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nompal 
     68    if (where(tag_names(ex) EQ 'FILE'))[0] NE -1 then ex.FILE = nametbl 
    7569; 
    7670   tvlct,r,g,b,/get 
     
    7973   b=congrid(b,256) 
    8074   IF n_elements(over) EQ 0 then over = 255 
    81    modifyct,over,nom,r,g,b,file=nompal, _extra = ex 
     75   modifyct,over,namepal,r,g,b,file=nametbl, _extra = ex 
    8276; 
    8377   return 
  • trunk/SRC/Colors/xlct.pro

    r132 r133  
    1 ; $Id$ 
    2 ; 
    3 ; Copyright (c) 1991-1998, Research Systems, Inc.  All rights reserved. 
    4 ;       Unauthorized reproduction prohibited. 
    51 
    62PRO XLCT_PSAVE                  ;Save/Restore our plotting state. 
     
    375371 
    376372;+ 
    377 ; NAME: 
    378 ;       XLCT 
    379 ; PURPOSE: 
    380 ;       comme xloadct mais plus cour a ecrire et appelle par defaut la 
    381 ;       palette palette.tbl qui peut etre situee dans n''importe quel 
    382 ;       repertoire de !path. 
    383 ; 
    384 ; CATEGORY: 
    385 ;       Widgets 
    386 ; CALLING SEQUENCE: 
    387 ;       XLCT 
    388 ; INPUTS: 
    389 ;       None. 
    390 ; KEYWORDS: 
    391 ;       FILE:   If this keyword is set, the file by the given name is used 
     373; @file_comments  
     374; Like xloadct but fastest to write and call by default the palette  
     375; palette.tbl which can be in any directory 
     376; 
     377; @categories Widgets 
     378; 
     379; @keyword FILE If this keyword is set, the file by the given name is used 
    392380;               instead of the file colors1.tbl in the IDL directory.  This 
    393381;               allows multiple IDL users to have their own color table file. 
    394 ;       GROUP = The widget ID of the widget that calls Xlct.  When  
     382; @keyword GROUP The widget ID of the widget that calls Xlct.  When  
    395383;               this ID is specified, a death of the caller results in a  
    396384;               death of Xlct 
    397 ;       NCOLORS = number of colors to use.  Use color indices from BOTTOM 
     385; @keyword NCOLORS = number of colors to use.  Use color indices from BOTTOM 
    398386;               to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. 
    399387;               Default = !D.TABLE_SIZE = all available colors. 
    400 ;       BOTTOM = first color index to use. Use color indices from BOTTOM to 
     388; @keyword BOTTOM = first color index to use. Use color indices from BOTTOM to 
    401389;               BOTTOM+NCOLORS-1.  Default = 0. 
    402 ;       SILENT - Normally, no informational message is printed when 
     390; @keyword SILENT - Normally, no informational message is printed when 
    403391;               a color map is loaded. If this keyword is present and 
    404392;               zero, this message is printed. 
    405 ;       USE_CURRENT: If set, use the current color tables, regardless of 
     393; @keyword USE_CURRENT: If set, use the current color tables, regardless of 
    406394;               the contents of the COMMON block COLORS. 
    407 ;       MODAL:  If set, then XLCT runs in "modal" mode, meaning that 
     395; @keyword MODAL:  If set, then XLCT runs in "modal" mode, meaning that 
    408396;               all other widgets are blocked until the user quits XLCT. 
    409397;               A group leader must be specified (via the GROUP keyword) 
    410398;               for the MODAL keyword to have any effect.   The default 
    411399;               is to not run in modal mode. 
    412 ;       BLOCK:  Set this keyword to have XMANAGER block when this 
     400; @keyword BLOCK:  Set this keyword to have XMANAGER block when this 
    413401;               application is registered.  By default the Xmanager 
    414402;               keyword NO_BLOCK is set to 1 to provide access to the 
     
    418406;               application.  For more information see the NO_BLOCK keyword 
    419407;               to XMANAGER. 
    420 ;       UPDATECALLBACK: Set this keyword to a string containing the name of 
     408; @keyword UPDATECALLBACK: Set this keyword to a string containing the name of 
    421409;               a user-supplied procedure that will be called when the color 
    422410;               table is updated by XLCT.  The procedure may optionally 
     
    424412;               set to the value specified by the optional UPDATECBDATA 
    425413;               keyword. 
    426 ;       UPDATECBDATA: Set this keyword to a value of any type. It will be 
     414; @keyword UPDATECBDATA: Set this keyword to a value of any type. It will be 
    427415;               passed via the DATA keyword to the user-supplied procedure 
    428416;               specified via the UPDATECALLBACK keyword, if any. If the 
     
    431419;               will be undefined. 
    432420; 
    433 ; OUTPUTS: 
    434 ;       None. 
    435 ; COMMON BLOCKS: 
    436 ;       None. 
    437 ; SIDE EFFECTS: 
    438 ;       One of the predefined color maps may be loaded. 
    439 ; RESTRICTIONS: 
    440 ;       This routine uses the LOADCT user library procedure to 
     421; @restrictions One of the predefined color maps may be loaded. 
     422; 
     423; @restrictions This routine uses the LOADCT user library procedure to 
    441424;       do the actual work. 
    442 ; MODIFICATION HISTORY: 
    443 ;       5/5/1999 copie de xloadct par Sebastien Masson (smlod@ipsl.jussieu.fr) 
     425; 
     426; @history 5/5/1999 copie de xloadct par Sebastien Masson (smlod@ipsl.jussieu.fr) 
     427; 
     428; @version $Id$ 
     429; 
    444430;- 
    445431 
     
    471457   IF KEYWORD_SET(SILENT_f) THEN silent = SILENT_F ELSE silent = 1 
    472458;----------------------------------------------------------------------------- 
    473 ; changements effectues par S.Masson 
     459; Changes made by S.Masson 
    474460;----------------------------------------------------------------------------- 
    475461   IF N_ELEMENTS(file) GT 0 THEN filename = file ELSE BEGIN  
  • trunk/SRC/Colors/xpal.pro

    r132 r133  
    1 ; $Id$ 
    2 ; 
    3 ; Copyright (c) 1992-1998, Research Systems, Inc.  All rights reserved. 
    4 ;       Unauthorized reproduction prohibited. 
    51;+ 
    6 ; NAME: 
    7 ;       XPAL 
    8 ; 
    9 ; PURPOSE: 
    10 ;       comme xpalette mais plus court a ecrire et possede en plus 
    11 ;       une touche save qui (grace a la routine newpalette) permet de 
    12 ;       sauver la routine que l''on vient de faire. Rq qd on appuie 
    13 ;       sur la touche predefined appelle xlct plutot que xloadct  
    14 ; 
    15 ; CATEGORY: 
    16 ;       Color tables, widgets. 
    17 ; 
    18 ; CALLING SEQUENCE: 
    19 ;       XPAL 
    20 ; 
    21 ; INPUTS: 
    22 ;       No explicit inputs.  The current color table is used as a starting 
    23 ;       point. 
    24 ; 
    25 ; KEYWORD PARAMETERS: 
    26 ;       BLOCK:  Set this keyword to have XMANAGER block when this 
     2; 
     3; @file_comments  
     4; like xpalette but shorter to write and ,moreover, 
     5; possess a hotkey save which (thanks to the newpalette routine) 
     6; allows to save the routine that we have just done. Comment: when we 
     7; press the predefined hotkey, it calls xlct instead of xloadct  
     8; No explicit inputs.  The current color table is used as a starting point. 
     9; 
     10; @categories Color tables, widgets. 
     11; 
     12; @keyword BLOCK Set this keyword to have XMANAGER block when this 
    2713;               application is registered.  By default the Xmanager 
    2814;               keyword NO_BLOCK is set to 1 to provide access to the 
     
    3218;               application.  For more information see the NO_BLOCK keyword 
    3319;               to XMANAGER. 
    34 ;       UPDATECALLBACK: Set this keyword to a string containing the name of 
     20; @keyword UPDATECALLBACK Set this keyword to a string containing the name of 
    3521;               a user-supplied procedure that will be called when the color 
    3622;               table is updated by XLOADCT.  The procedure may optionally 
     
    3824;               set to the value specified by the optional UPDATECBDATA 
    3925;               keyword. 
    40 ;       UPDATECBDATA: Set this keyword to a value of any type. It will be 
     26; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be 
    4127;               passed via the DATA keyword to the user-supplied procedure 
    4228;               specified via the UPDATECALLBACK keyword, if any. If the 
     
    4531;               will be undefined. 
    4632; 
    47 ; OUTPUTS: 
    48 ;       None. 
    49 ; 
    50 ; COMMON BLOCKS: 
    51 ;       COLORS: Contains the current RGB color tables. 
    52 ;       XP_COM: Private to this module. 
    53 ; 
    54 ; SIDE EFFECTS: 
    55 ;       XPAL uses two colors from the current color table as 
     33; @uses COLORS: Contains the current RGB color tables. 
     34; @uses XP_COM: Private to this module. 
     35; 
     36; @restrictions XPAL uses two colors from the current color table as 
    5637;       drawing foreground and background colors. These are used 
    5738;       for the RGB plots on the left, and the current index marker on 
     
    7253;       to the display. 
    7354; 
    74 ; PROCEDURE: 
    75 ;       The XPAL widget has the following controls: 
     55; @examples The XPAL widget has the following controls: 
    7656; 
    7757;       Left:   Three plots showing the current Red, Green, and Blue vectors. 
     
    9575;               pressed: 
    9676; 
    97 ;               Done:  Exits XPAL. 
    98 ; 
    99 ;         Predefined:  Starts XLOADCT to allow selection of one of the 
     77;                 Done: Exits XPAL. 
     78; 
     79;           Predefined: Starts XLOADCT to allow selection of one of the 
    10080;                       predefined color tables. 
    10181; 
    102 ;               Help:  Supplies help information similar to this header. 
     82;                 Help: Supplies help information similar to this header. 
    10383; 
    10484;               Redraw: Completely redraws the display using the current 
     
    11797;                       index and the mark index are interpolated linearly 
    11898;                       to lie between the colors of two endpoints. 
    119 ;                 save: permet de sauver la palette qui est 
    120 ;                       actuellement a l''ecran. Qd on appuie sur ce 
    121 ;                       bouton, un widget apparait qui demande: 
    122 ;                        1) le nom a donner a la palette que l''on veut sauver 
    123 ;                        2) le numero de la palette que l''on veut 
    124 ;                        eventuellement ecrase par la nouvelle 
    125 ;                        palette.Si aucun numero n''est specifie la 
    126 ;                        nouvelle palette estajoutee aux anciennes. 
    127 ;                        3) le nom du fichier qui contient les 
    128 ;                        palettes. Rq: suivre eventuellement les 
    129 ;                        indications fournis au prompteur. 
     99;                 save: Allows to save  the palette which is currently 
     100;                       on the screen. When we press this hotkey, there is a 
     101;                       widget who appear and ask: 
     102;                        1) the name of the palette we want to save. 
     103;                        2) The number of the palette we may want to erase 
     104;                        by the new palette. If there is not any number 
     105;                        specified, the new palette is add to elders. 
     106;                        3) The name of the file containing palettes. 
     107;                        Comment: May follow instructions gave by the prompter. 
    130108;                 
    131109; 
     
    147125;                          horizontally. 
    148126; 
    149 ; MODIFICATION HISTORY: 
    150 ;          addaptation de xpalette pour ajouter un bouton save par 
     127; @history addaptation de xpalette pour ajouter un bouton save par 
    151128;          Gima Nicolas (nglod@ipsl.jussieu.fr) et par Masson 
    152129;          Sebastien (smlod@ipsl.jussieu.fr) 
     130; 
     131; $Id$ 
     132; 
    153133;- 
    154  
     134; 
     135;+ 
     136; @file_comments XP_NEW_COLORS: Choose the best foreground and background colors for the current 
     137;                color maps and set !P appropriately. Returns 1 if the colors changed, 
     138;                0 otherwise. 
     139; 
     140; @returns 1 or 0 
     141;-  
    155142function XP_NEW_COLORS 
    156 ; Choose the best foreground and background colors for the current 
    157 ; color maps and set !P appropriately. Returns 1 if the colors changed, 
    158 ; 0 otherwise. 
    159143; 
    160144  compile_opt idl2, strictarrsubs 
     
    202186  endif 
    203187end 
    204  
     188;+ 
     189; @file_comments XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics 
     190;                after a change by XLOADCT. 
     191;- 
    205192pro XP_XLCTCALLBACK 
    206   ; For visuals with static colormaps, update the graphics 
    207   ; after a change by XLOADCT. 
    208193; 
    209194  compile_opt idl2, strictarrsubs 
     
    230215end 
    231216 
    232  
    233  
    234 pro XP_REPLOT, color_index, type 
    235 ; Re-draw the RGB plots. Type has the following possible values. 
    236 ;;      - 'D': Draw the data part of all three plots 
     217;+ 
     218; @file_comments XP_REPLOT: Re-draw the RGB plots. Type has the following possible values. 
     219;       - 'D': Draw the data part of all three plots 
    237220;       - 'F': draw all three plots 
    238221;       - 'R': Draw the data part of the Red plot 
    239222;       - 'G': Draw the data part of the Green plot 
    240223;       - 'B': Draw the data part of the Blue plot 
     224;-  
     225pro XP_REPLOT, color_index, type 
    241226; 
    242227  compile_opt idl2, strictarrsubs 
     
    312297 
    313298 
    314  
    315 pro XP_CHANGE_COLOR, type, value 
    316 ; Change current color. Type has the following possible values. 
     299;+ 
     300; @file_comments XP_CHANGE_COLOR:  Change current color. Type has the following possible values. 
    317301;       - 'R': Change the R part of the current color 
    318302;       - 'G': ... 
    319303;       - 'B': ... 
     304;- 
     305pro XP_CHANGE_COLOR, type, value 
    320306; 
    321307  compile_opt idl2, strictarrsubs 
     
    553539 
    554540 
    555  
     541;+ 
     542; 
     543; @keyword group  
     544; 
     545; @keyword BLOCK Set this keyword to have XMANAGER block when this 
     546;               application is registered.  By default the Xmanager 
     547;               keyword NO_BLOCK is set to 1 to provide access to the 
     548;               command line if active command  line processing is available. 
     549;               Note that setting BLOCK for this application will cause 
     550;               all widget applications to block, not only this 
     551;               application.  For more information see the NO_BLOCK keyword 
     552;               to XMANAGER. 
     553; @keyword UPDATECALLBACK Set this keyword to a string containing the name of 
     554;               a user-supplied procedure that will be called when the color 
     555;               table is updated by XLOADCT.  The procedure may optionally 
     556;               accept a keyword called DATA, which will be automatically 
     557;               set to the value specified by the optional UPDATECBDATA 
     558;               keyword. 
     559; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be 
     560;               passed via the DATA keyword to the user-supplied procedure 
     561;               specified via the UPDATECALLBACK keyword, if any. If the 
     562;               UPDATECBDATA keyword is not set the value accepted by the 
     563;               DATA keyword to the procedure specified by UPDATECALLBACK 
     564;               will be undefined. 
     565; 
     566;- 
    556567 
    557568 
     
    597608  !p.color = nc -1              ;Foreground color 
    598609  !p.font = 0                   ;Hdw font 
    599   save_win = !d.window  ;Previous window 
     610  save_win = !d.window          ;Previous window 
    600611 
    601612  IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors 
  • trunk/SRC/ForOldVersion/updatekwd.pro

    r122 r133  
    3535  old = [old, 'petitdessin']        & new = [new, 'small'] 
    3636  old = [old, 'ysurx']              & new = [new, 'yxaspect'] 
     37  old = [old, 'discret']            & new = [new, 'discrete'] 
    3738;  old = [old, ''] & new = [new, ''] 
    3839; supress the first dummy argument and make sure we use lowcase 
  • trunk/SRC/Interpolation/inrecgrid.pro

    r125 r133  
    22; 
    33; @file_comments  
    4 , given - a list of points, (x,y) position 
     4; given - a list of points, (x,y) position 
    55;       - the x and y limits of a rectangular grid 
    66; find in which cell is located each given point. 
  • trunk/SRC/Matrix/cmapply.pro

    r132 r133  
     1;; Utility function, adapted from CMPRODUCT 
    12;+ 
    2 ; NAME: 
    3 ;   CMAPPLY 
    4 ; 
    5 ; AUTHOR: 
    6 ;   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 
    7 ;   craigm@lheamail.gsfc.nasa.gov 
    8 ; 
    9 ; PURPOSE: 
    10 ;   Applies a function to specified dimensions of an array 
    11 ; 
    12 ; MAJOR TOPICS: 
    13 ;   Arrays 
    14 ; 
    15 ; CALLING SEQUENCE: 
    16 ;   XX = CMAPPLY(OP, ARRAY, DIMS, [/DOUBLE], [TYPE=TYPE]) 
    17 ; 
    18 ; DESCRIPTION: 
    19 ;   CMAPPLY will apply one of a few select functions to specified  
     3; @todo seb 
     4;- 
     5; 
     6function cmapply_product, x 
     7; 
     8  compile_opt idl2, strictarrsubs 
     9; 
     10  sz = size(x) 
     11  n = sz[1] 
     12 
     13  while n GT 1 do begin 
     14      if (n mod 2) EQ 1 then x[0,*] = x[0,*] * x[n-1,*] 
     15      n2 = floor(n/2) 
     16      x = x[0:n2-1,*] * x[n2:*,*] 
     17      n = n2 
     18  endwhile 
     19  return, reform(x[0,*], /overwrite) 
     20end 
     21 
     22;; Utility function, used to collect collaped dimensions 
     23;+ 
     24; @todo seb 
     25;- 
     26; 
     27pro cmapply_redim, newarr, dimapply, dimkeep, nkeep, totcol, totkeep 
     28; 
     29  compile_opt idl2, strictarrsubs 
     30; 
     31  sz = size(newarr) 
     32  ;; First task: rearrange dimensions so that the dimensions 
     33  ;; that are "kept" (ie, uncollapsed) are at the back 
     34  dimkeep = where(histogram(dimapply,min=1,max=sz[0]) ne 1, nkeep) 
     35  if nkeep EQ 0 then return 
     36 
     37  newarr = transpose(temporary(newarr), [dimapply-1, dimkeep]) 
     38  ;; totcol is the total number of collapsed elements 
     39  totcol = sz[dimapply[0]] 
     40  for i = 1, n_elements(dimapply)-1 do totcol = totcol * sz[dimapply[i]] 
     41  totkeep = sz[dimkeep[0]+1] 
     42  for i = 1, n_elements(dimkeep)-1 do totkeep = totkeep * sz[dimkeep[i]+1] 
     43 
     44  ;; this new array has two dimensions: 
     45  ;;   * the first, all elements that will be collapsed 
     46  ;;   * the second, all dimensions that will be preserved 
     47  ;; (the ordering is so that all elements to be collapsed are 
     48  ;;  adjacent in memory) 
     49  newarr = reform(newarr, [totcol, totkeep], /overwrite) 
     50end 
     51 
     52;; Main function 
     53;+ 
     54; 
     55; @file_comments  
     56; Applies a function to specified dimensions of an array 
     57; 
     58;   Description: 
     59; 
     60;      CMAPPLY will apply one of a few select functions to specified  
    2061;   dimensions of an array.  Unlike some IDL functions, you *do* have 
    2162;   a choice of which dimensions that are to be "collapsed" by this 
     
    59100;   elements is large. 
    60101; 
    61 ; 
    62 ; INPUTS: 
    63 ; 
    64 ;   OP - The operation to perform, as a string.  May be upper or lower 
     102; @categories Arrays 
     103; 
     104; @param OP {in}{required} The operation to perform, as a string.  May be upper or lower 
    65105;        case. 
    66106; 
     
    69109;        the user-defined function. 
    70110; 
    71 ;   ARRAY - An array of values to be operated on.  Must not be of type 
     111; @param ARRAY {in}{required} An array of values to be operated on.  Must not be of type 
    72112;           STRING (7) or STRUCTURE (8). 
    73113; 
    74 ; OPTIONAL INPUTS: 
    75 ; 
    76 ;   DIMS - An array of dimensions that are to be "collapsed", where 
     114; @param DIMS {in}{optional}{default=1 (ie, first dimension)}  
     115;          An array of dimensions that are to be "collapsed", where 
    77116;          the the first dimension starts with 1 (ie, same convention 
    78117;          as IDL function TOTAL).  Whereas TOTAL only allows one 
     
    84123;          DEFAULT: 1 (ie, first dimension) 
    85124; 
    86 ; KEYWORDS: 
    87 ; 
    88 ;   DOUBLE - Set this if you wish the internal computations to be done 
     125; @keyword DOUBLE Set this if you wish the internal computations to be done 
    89126;            in double precision if necessary.  If ARRAY is double  
    90127;            precision (real or complex) then DOUBLE=1 is implied. 
    91128;            DEFAULT: not set 
    92129; 
    93 ;   TYPE - Set this to the IDL code of the desired output type (refer 
     130; @keyword TYPE Set this to the IDL code of the desired output type (refer 
    94131;          to documentation of SIZE()).  Internal results will be 
    95132;          rounded to the nearest integer if the output type is an 
     
    97134;          DEFAULT: same is input type 
    98135; 
    99 ;   FUNCTARGS - If OP is 'USER:...', then the contents of this keyword 
     136; @keyword FUNCTARGS If OP is 'USER:...', then the contents of this keyword 
    100137;               are passed to the user function using the _EXTRA 
    101138;               mechanism.  This way you can pass additional data to 
     
    104141;               DEFAULT: undefined (i.e., no keywords passed by _EXTRA) 
    105142; 
    106 ; RETURN VALUE: 
    107 ; 
    108 ;   An array of the required TYPE, whose elements are the result of 
     143; @returns An array of the required TYPE, whose elements are the result of 
    109144;   the requested operation.  Depending on the operation and number of 
    110145;   elements in the input array, the result may be vulnerable to 
    111146;   overflow or underflow. 
    112147; 
    113 ; EXAMPLES: 
    114 ;   Shows how CMAPPLY can be used to total the second dimension of the 
     148; @examples  
     149;    
     150;   First example:  Shows how CMAPPLY can be used to total the second dimension of the 
    115151;   array called IN.  This is equivalent to OUT = TOTAL(IN, 2) 
    116152; 
     
    120156;   OUT             INT       = Array[5] 
    121157; 
    122 ;   Second example.  Input is assumed to be an 5x100 array of 1's and 
     158;   Second example:  Input is assumed to be an 5x100 array of 1's and 
    123159;   0's indicating the status of 5 detectors at 100 points in time. 
    124160;   The desired output is an array of 100 values, indicating whether 
     
    134170;   although there would have been more loop iterations). 
    135171; 
    136 ;   Third example.  Shows sum over first and third dimensions in an 
     172;   Third example:  Shows sum over first and third dimensions in an 
    137173;   array with dimensions 4x4x4: 
    138174; 
     
    142178;        408     472     536     600 
    143179; 
    144 ;   Fourth example. A user-function (MEDIAN) is used: 
     180;   Fourth example: A user-function (MEDIAN) is used: 
    145181; 
    146182;   IDL> IN = RANDOMN(SEED,10,10,5) 
     
    151187;   (OUT[i,j] is the median value of IN[i,j,*]) 
    152188; 
    153 ; MODIFICATION HISTORY: 
    154 ;   Mar 1998, Written, CM 
     189; @history Mar 1998, Written, CM 
    155190;   Changed usage message to not bomb, 24 Mar 2000, CM 
    156191;   Signficant rewrite for *, MIN and MAX (inspired by Todd Clements 
     
    163198;   Correct bug in MAX/MIN initialization of RESULT, CM, 05 Dec 2002 
    164199; 
    165 ;  $Id$ 
     200;  Author: Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 
     201;  craigm@lheamail.gsfc.nasa.gov 
     202; 
     203; @version $Id$ 
    166204; 
    167205;- 
    168 ; Copyright (C) 1998, 2000, 2002, Craig Markwardt 
    169 ; This software is provided as is without any warranty whatsoever. 
    170 ; Permission to use, copy, modify, and distribute modified or 
    171 ; unmodified copies is granted, provided this copyright and disclaimer 
    172 ; are included unchanged. 
    173 ;- 
    174  
    175 ;; Utility function, adapted from CMPRODUCT 
    176 function cmapply_product, x 
    177 ; 
    178   compile_opt idl2, strictarrsubs 
    179 ; 
    180   sz = size(x) 
    181   n = sz[1] 
    182  
    183   while n GT 1 do begin 
    184       if (n mod 2) EQ 1 then x[0,*] = x[0,*] * x[n-1,*] 
    185       n2 = floor(n/2) 
    186       x = x[0:n2-1,*] * x[n2:*,*] 
    187       n = n2 
    188   endwhile 
    189   return, reform(x[0,*], /overwrite) 
    190 end 
    191  
    192 ;; Utility function, used to collect collaped dimensions 
    193 pro cmapply_redim, newarr, dimapply, dimkeep, nkeep, totcol, totkeep 
    194 ; 
    195   compile_opt idl2, strictarrsubs 
    196 ; 
    197   sz = size(newarr) 
    198   ;; First task: rearrange dimensions so that the dimensions 
    199   ;; that are "kept" (ie, uncollapsed) are at the back 
    200   dimkeep = where(histogram(dimapply,min=1,max=sz[0]) ne 1, nkeep) 
    201   if nkeep EQ 0 then return 
    202  
    203   newarr = transpose(temporary(newarr), [dimapply-1, dimkeep]) 
    204   ;; totcol is the total number of collapsed elements 
    205   totcol = sz[dimapply[0]] 
    206   for i = 1, n_elements(dimapply)-1 do totcol = totcol * sz[dimapply[i]] 
    207   totkeep = sz[dimkeep[0]+1] 
    208   for i = 1, n_elements(dimkeep)-1 do totkeep = totkeep * sz[dimkeep[i]+1] 
    209  
    210   ;; this new array has two dimensions: 
    211   ;;   * the first, all elements that will be collapsed 
    212   ;;   * the second, all dimensions that will be preserved 
    213   ;; (the ordering is so that all elements to be collapsed are 
    214   ;;  adjacent in memory) 
    215   newarr = reform(newarr, [totcol, totkeep], /overwrite) 
    216 end 
    217  
    218 ;; Main function 
    219206function cmapply, op, array, dimapply, double=dbl, type=type, $ 
    220207                  functargs=functargs, nocatch=nocatch 
  • trunk/SRC/Matrix/cmset_op.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;   CMSET_OP 
    4 ; 
    5 ; AUTHOR: 
    6 ;   Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 
    7 ;   craigm@lheamail.gsfc.nasa.gov 
    8 ; 
    9 ; PURPOSE: 
    10 ;   Performs an AND, OR, or XOR operation between two sets 
    11 ; 
    12 ; CALLING SEQUENCE: 
    13 ;   SET      = CMSET_OP(A, OP, B) 
    14 ; 
    15 ; DESCRIPTION:  
    16 ; 
    17 ;   SET_OP performs three common operations between two sets.  The 
     2; @hidden 
     3; 
     4; @todo seb 
     5;- 
     6; 
     7;; Simplified version of CMSET_OP_UNIQ which sorts, and takes the 
     8;; "first" value, whatever that may mean. 
     9function cmset_op_uniq, a 
     10; 
     11  compile_opt idl2, strictarrsubs 
     12; 
     13  if n_elements(a) LE 1 then return, 0L 
     14 
     15  ii = sort(a) & b = a[ii] 
     16  wh = where(b NE shift(b, +1L), ct) 
     17  if ct GT 0 then return, ii[wh] 
     18 
     19  return, 0L 
     20; 
     21end 
     22;+ 
     23; 
     24; @file_comments  
     25; Performs an AND, OR, or XOR operation between two sets 
     26; 
     27;   Description: SET_OP performs three common operations between two sets.  The 
    1828;   three supported functions of OP are: 
    1929; 
     
    5565;   benefit. 
    5666; 
    57 ; INPUTS: 
    58 ; 
    59 ;   A, B - the two sets to be operated on.  A one dimensional array of 
     67; @categories array 
     68; 
     69; @param A {in}{required} The two sets to be operated on.  A one dimensional array of 
    6070;          either numeric or string type.  A and B must be of the same 
    6171;          type.  Empty sets are permitted, and are either represented 
    6272;          as an undefined variable, or by setting EMPTY1 or EMPTY2. 
    6373; 
    64 ;   OP - a string, the operation to be performed.  Must be one of 
     74; @param B {in}{required} See A 
     75; 
     76; @param OP {in}{required} a string, the operation to be performed.  Must be one of 
    6577;        'AND', 'OR' or 'XOR' (lower or mixed case is permitted). 
    6678;        Other operations will cause an error message to be produced. 
    6779; 
    68 ; KEYWORDS: 
    69 ; 
    70 ;   NOT1, NOT2 - if set and OP is 'AND', then the complement of A (for 
     80; @keyword NOT1 If set and OP is 'AND', then the complement of A (for 
    7181;                NOT1) or B (for NOT2) will be used in the operation. 
    7282;                NOT1 and NOT2 cannot be set simultaneously. 
    7383; 
    74 ;   EMPTY1, EMPTY2 - if set, then A (for EMPTY1) or B (for EMPTY2) are 
    75 ;                    assumed to be the empty set.  The actual values 
    76 ;                    passed as A or B are then ignored. 
    77 ; 
    78 ;   INDEX - if set, then return a list of indices instead of the array 
     84; @keyword NOT2 See NOT1 
     85; 
     86; @keyword EMPTY1 If set, then A (for EMPTY1) or B (for EMPTY2) are 
     87;                 assumed to be the empty set.  The actual values 
     88;                 passed as A or B are then ignored. 
     89; 
     90; @keyword EMPTY2 See EMPTY1 
     91; 
     92; @keyword INDEX if set, then return a list of indices instead of the array 
    7993;           values themselves.  The "slower" set operations are always 
    8094;           performed in this case. 
     
    8599;           from NA to NA+NB-1 refer to B[I-NA]. 
    86100; 
    87 ;   COUNT - upon return, the number of elements in the result set. 
     101; @keyword COUNT upon return, the number of elements in the result set. 
    88102;           This is only important when the result set is the empty 
    89103;           set, in which case COUNT is set to zero. 
    90104; 
    91 ; RETURNS: 
    92 ; 
    93 ;   The resulting set as a one-dimensional array.  The set may be 
     105; @returns The resulting set as a one-dimensional array.  The set may be 
    94106;   represented by either an array of data values (default), or an 
    95107;   array of indices (if INDEX is set).  Duplicate elements, if any, 
     
    104116;   SET_UTILS.PRO by RSI 
    105117; 
    106 ; MODIFICATION HISTORY: 
    107 ;   Written, CM, 23 Feb 2000 
     118; @history Written, CM, 23 Feb 2000 
    108119;   Added empty set capability, CM, 25 Feb 2000 
    109120;   Documentation clarification, CM 02 Mar 2000 
     
    133144;      range of the input variable (thanks to Will Maddox), CM, 16 Jan 2006 
    134145; 
    135 ;  $Id: cmset_op.pro,v 1.6 2006/01/16 19:45:22 craigm Exp $ 
    136 ; 
    137 ;- 
    138 ; Copyright (C) 2000, 2004, 2005, 2006, Craig Markwardt 
    139 ; This software is provided as is without any warranty whatsoever. 
    140 ; Permission to use, copy, modify, and distribute modified or 
    141 ; unmodified copies is granted, provided this copyright and disclaimer 
    142 ; are included unchanged. 
    143 ;- 
    144  
    145 ;; Utility function, similar to UNIQ, but allowing choice of taking 
    146 ;; first or last unique element, or non-unique elements. 
    147 ;; Unfortunately this doesn't work because of implementation dependent 
    148 ;; versions of the SORT() function. 
    149  
     146;   Author: Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 
     147;   craigm@lheamail.gsfc.nasa.gov 
     148; 
     149; @version $Id: cmset_op.pro,v 1.6 2006/01/16 19:45:22 craigm Exp $ 
     150; 
     151; @examples Utility function, similar to UNIQ, but allowing choice of taking 
     152; first or last unique element, or non-unique elements. 
     153; Unfortunately this doesn't work because of implementation dependent 
     154; versions of the SORT() function. 
     155; 
    150156; function cmset_op_uniq, a, first=first, non=non, count=ct, sort=sortit 
    151157;   if n_elements(a) LE 1 then return, 0L 
     
    168174; end 
    169175 
    170 ;; Simplified version of CMSET_OP_UNIQ which sorts, and takes the 
    171 ;; "first" value, whatever that may mean. 
    172 function cmset_op_uniq, a 
    173 ; 
    174   compile_opt idl2, strictarrsubs 
    175 ; 
    176   if n_elements(a) LE 1 then return, 0L 
    177  
    178   ii = sort(a) & b = a[ii] 
    179   wh = where(b NE shift(b, +1L), ct) 
    180   if ct GT 0 then return, ii[wh] 
    181  
    182   return, 0L 
    183 end 
     176; Simplified version of CMSET_OP_UNIQ which sorts, and takes the 
     177; "first" value, whatever that may mean. 
     178; 
     179;- 
     180 
    184181 
    185182function cmset_op, a, op0, b, not1=not1, not2=not2, count=count, $ 
  • trunk/SRC/Matrix/congridseb.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:CONGRIDSEB 
    6 ; 
    7 ; PURPOSE:meme chose que congrid mais qui marche ... 
    8 ;        cf par ex: 
     5; @file_comment  
     6; Like congrid but here, it works... 
     7;        example: 
    98;IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) 
    109;       1 1 1 2 2 2 3 3 3 3 4 4 
     
    2322;       5 5 5 6 6 6 7 7 7 8 8 8 
    2423; 
    25 ; CATEGORY:bidouille matrices 
     24; @categories utilities 
    2625; 
    27 ; CALLING SEQUENCE:res=congridseb(tableau,x[,y]) 
     26; @param tableau {in}{required} A table 1 ou 2d 
    2827; 
    29 ; INPUTS:tableau:un tableau 1 ou 2d 
    30 ;        x:dim en x du resultat doit etre un multiple de dim en x de tableau 
    31 ;        y:dim en y du resultat doit etre un multiple de dim en y de tableau 
     28; @param x {in}{required} dimension in x of the result which must be  
     29;                         a multiple of the dimension in x of the table. 
    3230; 
    33 ; KEYWORD PARAMETERS: 
     31; @param y {in}{required} dimension in y of the result which must be  
     32;                         a multiple of the dimension in y of the table. 
    3433; 
    35 ; OUTPUTS:res un tableau de dim x * y 
     34; @returns res a table dim x * y 
    3635; 
    37 ; COMMON BLOCKS: 
    38 ; 
    39 ; SIDE EFFECTS: 
    40 ; 
    41 ; RESTRICTIONS: 
    42 ; 
    43 ; EXAMPLE: 
    44 ; 
    45 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     36; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    4637;                      20/3/98 
    4738;                      18/6/1999 supression d''une horrible boucle 
     39; 
     40; @version $Id$ 
     41; 
    4842;- 
    4943;------------------------------------------------------------ 
  • trunk/SRC/Matrix/different.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:different 
    65; 
    7 ; PURPOSE:calcule les elements differents de 2 matrices D'ENTIERS POSITIFS 
     6; @file_comments  
     7; calculate the different elements of 2 matrix of positif whole numbers. 
    88; 
    9 ; CATEGORY:calcule sur les matrices 
     9; @categories Calculation of matrixes 
    1010; 
    11 ; CALLING SEQUENCE:res=different(a,b) 
    12 ; 
    13 ; INPUTS:a et b:arrays of positive integers, which need 
     11; @param a {in}{required} arrays of positive integers, which need 
    1412;               not be sorted. Duplicate elements are ignored, as they have no 
    1513;               effect on the result 
    1614; 
    17 ; KEYWORD PARAMETERS: 
     15; @param b {in}{required} see a 
    1816; 
    19 ; OUTPUTS:tableau 
     17; @returns tableau 
    2018; 
    21 ; COMMON BLOCKS: 
    22 ; 
    23 ; SIDE EFFECTS: 
    24 ; 
    25 ; The empty set is denoted by an array with the first element equal to 
     19; @restrictions The empty set is denoted by an array with the first element equal to 
    2620; -1. 
    2721; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; These functions will not be efficient on sparse sets with wide 
     22; @restrictions These functions will not be efficient on sparse sets with wide 
    3123; ranges, as they trade memory for efficiency. The HISTOGRAM function 
    3224; is used, which creates arrays of size equal to the range of the 
    3325; resulting set. 
    3426; 
    35 ; EXAMPLE: 
     27; @examples 
    3628; 
    3729;   a = [2,4,6,8] 
     
    3931;   different(a,b) = [ 4, 8]         ; Elements in A but not in B 
    4032; 
    41 ; MODIFICATION HISTORY:  
     33; @history http://www.dfanning.com/tips/set_operations.html 
    4234; 
    43 ; http://www.dfanning.com/tips/set_operations.html 
     35; @version $Id$ 
     36; 
    4437;- 
    4538;------------------------------------------------------------ 
  • trunk/SRC/Matrix/inter.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:inter 
    65; 
    7 ; PURPOSE:calcule l''intersection de 2 matrices D'ENTIERS POSITIFS 
     6; @file_comments  
     7; calculate the intersection between 2 matrixes of whole numbers 
    88; 
    9 ; CATEGORY:calcule sur les matrices 
     9; @categories calculation of matrixes 
    1010; 
    11 ; CALLING SEQUENCE:res=inter(a,b) 
    12 ; 
    13 ; INPUTS:a et b:arrays of positive integers, which need not to be 
     11; @param a {in}{required} arrays of positive integers, which need not to be 
    1412; sorted. Duplicate elements are ignored, as they have noeffect on the 
    1513; result 
    1614; 
    17 ; KEYWORD PARAMETERS: 
     15; @param b {in}{required} see a 
    1816; 
    19 ; OUTPUTS:tableau 
     17; @returns tableau 
    2018; 
    21 ; COMMON BLOCKS: 
    22 ; 
    23 ; SIDE EFFECTS: 
    24 ; 
    25 ; The empty set is denoted by an array with the first element equal to 
     19; @restrictions The empty set is denoted by an array with the first element equal to 
    2620; -1. 
    2721; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; These functions will not be efficient on sparse sets with wide 
     22; @restrictions These functions will not be efficient on sparse sets with wide 
    3123; ranges, as they trade memory for efficiency. The HISTOGRAM function 
    3224; is used, which creates arrays of size equal to the range of the 
    3325; resulting set. 
    3426; 
    35 ; EXAMPLE: 
     27; @examples  a = [2,4,6,8] 
     28;   b = [6,1,3,2] 
     29;   inter(a,b) = [ 2, 6]       ; Common elements  
    3630; 
    37 ;   a = [2,4,6,8] 
    38 ;   b = [6,1,3,2] 
    39 ;   inter(a,b) = [ 2, 6]       ; Common elements 
     31; @history  http://www.dfanning.com/tips/set_operations.html 
    4032; 
    41 ; MODIFICATION HISTORY:  
     33; @version $Id$ 
    4234; 
    43 ; http://www.dfanning.com/tips/set_operations.html 
    4435;- 
    4536;------------------------------------------------------------ 
  • trunk/SRC/Matrix/make_selection.pro

    r132 r133  
    1 ; $Id$ 
    2 ;------------------------------------------------------------- 
    31;+ 
    4 ; NAME: 
    5 ;        MAKE_SELECTION (function) 
    62; 
    7 ; PURPOSE: 
    8 ;        Convert an array of selected values to an index 
     3; file_comments  
     4; Convert an array of selected values to an index 
    95;        array that identifies the selected values in a list 
    106;        or data array.  
    117; 
    12 ; CATEGORY: 
    13 ;        Tools 
     8; categories tools 
     9;  
     10; @param NAMES {in}{required} A list or array of values to choose from  
    1411; 
    15 ; CALLING SEQUENCE: 
    16 ;        index = MAKE_SELECTION(NAMES,SELNAMES [,keywords]) 
     12; @param SELNAMES {in}{required} A list of selected values 
    1713; 
    18 ; INPUTS: 
    19 ;        NAMES -> A list or array of values to choose from  
    20 ; 
    21 ;        SELNAMES -> A list of selected values 
    22 ; 
    23 ; KEYWORD PARAMETERS: 
    24 ;        ONLY_VALID -> Return only indices of found values. Values not 
     14; @keyword ONLY_VALID Return only indices of found values. Values not 
    2515;            found are skipped. Default is to return 1 index value for 
    2616;            each SELNAME, which is -1 if SELNAME is not contained in  
     
    2919;            at all. 
    3020; 
    31 ;        REQUIRED -> Normally, MAKE_SELECTION will return indices for 
     21; @keyword REQUIRED Normally, MAKE_SELECTION will return indices for 
    3222;            all values that are found, simply ignoring the selected 
    3323;            values that are not in the NAMES array (although an error 
     
    3525;            -1 as soon as a selected value is not found. 
    3626; 
    37 ;        QUIET -> Suppress printing of the error message if a 
     27; @keyword QUIET Suppress printing of the error message if a 
    3828;            selected value is not found (the error condition will 
    3929;            still be set). 
    4030; 
    41 ; OUTPUTS: 
    42 ;        A (long) array with indices to reference the selected values 
     31; @returns A (long) array with indices to reference the selected values 
    4332;        in the NAMES array. 
    4433; 
    45 ; SUBROUTINES: 
    46 ; 
    47 ; REQUIREMENTS: 
    48 ; 
    49 ; NOTES: 
    50 ;        If the NAMES array contains multiple entries of the same value, 
     34; @restrictions If the NAMES array contains multiple entries of the same value, 
    5135;        only the index to the first entry will be returned. 
    5236; 
     
    5539;        (See example below) 
    5640; 
    57 ; EXAMPLE: 
    58 ;        names = [ 'Alfred','Anton','Peter','John','Mary'] 
    59 ;        index = MAKE_SELECTION(names,['Peter','Mary']) 
    60 ;        print,index 
    61 ;        ; prints  2  4 
     41; @examples names = [ 'Alfred','Anton','Peter','John','Mary'] 
     42;           index = MAKE_SELECTION(names,['Peter','Mary']) 
     43;           print,index 
     44;           ; prints  2  4 
    6245; 
    63 ;        vals = indgen(20) 
    64 ;        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9]) 
    65 ;        print,index 
    66 ;        ; prints  9  -1  8  7  7  8  9 
     46;           vals = indgen(20) 
     47;           index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9]) 
     48;           print,index 
     49;           ; prints  9  -1  8  7  7  8  9 
    6750; 
    68 ;        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID) 
    69 ;        print,index 
    70 ;        ; prints  9  8  7  7  8  9 
     51;           index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID) 
     52;           print,index 
     53;           ; prints  9  8  7  7  8  9 
    7154; 
    72 ;        index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED) 
    73 ;        print,index 
    74 ;        ; prints  -1 
     55;           index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED) 
     56;           print,index 
     57;           ; prints  -1 
    7558; 
     59; @history mgs, 28 Aug 1998: VERSION 1.00 
     60;          mgs, 29 Aug 1998: - changed behaviour and added ONLY_VALID keyword 
    7661; 
    77 ; MODIFICATION HISTORY: 
    78 ;        mgs, 28 Aug 1998: VERSION 1.00 
    79 ;        mgs, 29 Aug 1998: - changed behaviour and added ONLY_VALID keyword 
     62; @version $Id$ 
    8063; 
    8164;- 
  • trunk/SRC/Matrix/union.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:union 
    65; 
    7 ; PURPOSE:calcule l''union de 2 matrices D'ENTIERS POSITIFS 
     6; @file_comments  
     7; calculate tne union between 2 matrixes of whole numbers 
    88; 
    9 ; CATEGORY:calcule sur les matrices 
     9; @categories calculation of matrixes 
    1010; 
    11 ; CALLING SEQUENCE:res=union(a,b) 
    12 ; 
    13 ; INPUTS:a et b:arrays of positive integers, which need 
     11; @param a {in}{required} arrays of positive integers, which need 
    1412;               not be sorted. Duplicate elements are ignored, as they have no 
    1513;               effect on the result 
    1614; 
    17 ; KEYWORD PARAMETERS: 
     15; @param b {in}{required} see a 
    1816; 
    19 ; OUTPUTS:tableau 
     17; @returns tableau 
    2018; 
    21 ; COMMON BLOCKS: 
    22 ; 
    23 ; SIDE EFFECTS: 
    24 ; 
    25 ; The empty set is denoted by an array with the first element equal to 
     19; @restrictions The empty set is denoted by an array with the first element equal to 
    2620; -1. 
    2721; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; These functions will not be efficient on sparse sets with wide 
     22; @restrictions These functions will not be efficient on sparse sets with wide 
    3123; ranges, as they trade memory for efficiency. The HISTOGRAM function 
    3224; is used, which creates arrays of size equal to the range of the 
    3325; resulting set. 
    3426; 
    35 ; EXAMPLE: 
     27; @examples a = [2,4,6,8] 
     28;           b = [6,1,3,2] 
     29;           union(a,b) = [ 1, 2, 3, 4, 6, 8]  ; Elements in either set 
    3630; 
    37 ;   a = [2,4,6,8] 
    38 ;   b = [6,1,3,2] 
    39 ;   union(a,b) = [ 1, 2, 3, 4, 6, 8]  ; Elements in either set 
     31; @history  http://www.dfanning.com/tips/set_operations.html 
    4032; 
    41 ; MODIFICATION HISTORY:  
     33; @version $Id$ 
    4234; 
    43 ; http://www.dfanning.com/tips/set_operations.html 
    4435;- 
    4536;------------------------------------------------------------ 
  • trunk/SRC/Obsolete/extrait.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:extrait 
    65; 
    7 ; PURPOSE:extraction de sous domaines de matrices. Meme si le sous 
    8 ; domaine est "troue". cf. : l''exemple 
    9 ; Par defaut IDL peut faire des extractions de sous domaines: 
     6; @fie-comments  
     7; extractoin of subdomains of matrixes; Even if the subdomain is "pierced" (see the example) 
     8; By default, IDL can make extractions of subdomain: 
    109; 
    1110;      IDL> a=indgen(5,5)  
     
    2423;            15      17 
    2524;            20      22 
    26 ; mais  
     25; but 
    2726;      IDL> print, a[[0,2],[3,4]]  
    2827;            15      22 
    29 ; alors que 
     28; while 
    3029;      IDL> print, extrait(a,[0,2],[3,4])   
    3130;            15      17 
    3231;            20      22 
    3332; 
    34 ; CATEGORY:bidouille avec les matrices 
    3533; 
    36 ; CALLING SEQUENCE:res=extrait(tab,indicex[,indicey[,indicez,[indicet]]]) 
     34; you better use extrac2 
    3735; 
    38 ; INPUTS: 
    39 ;        tab: un tableau 1,2,3 ou 4 d 
     36; @obsolete 
    4037; 
    41 ;        indicex: indicex peut avoir deux formes: 
    42 ;              1)un vecteur contenant les indices des lignes a garder 
    43 ;              2)le string '*' dans ce cas touts les lignes sont 
    44 ;              gardees 
     38; @categories utilities 
    4539; 
    46 ;        indicey/z/t: la meme chose que indicex mais pour les 
    47 ;        dimensions 2,3 et 4. 
     40; @param tab {in}{required} a 1,2,3 or 4 dim table 
    4841; 
    49 ;        rq: il faut autant de vecteurs indice que tab a de dimensions 
     42; @param indicex {in}{required} can have 2 forms: 
     43;              1)a vector containing indexes of lines we want to keep 
     44;              2)the string '*' if we want to keep all lines. 
    5045; 
    51 ; KEYWORD PARAMETERS: 
     46; @param indicey {in}{required} the same thing that indicex but for dim 2. 
    5247; 
    53 ; OUTPUTS: 
    54 ;         res: une matice 1,2,3 ou 4d extraite a partir de tab 
     48; @param indicez {in}{required} the same thing that indicex but for dim 3. 
     49;  
     50; @param indicet {in}{required} the same thing that indicex but for dim 4. 
    5551; 
    56 ; COMMON BLOCKS: 
     52; @returns a matrix 1,2,3 or 4d extract from tab 
    5753; 
    58 ; SIDE EFFECTS:res=-1 en cas d''erreur 
     54; @restrictions res=-1 in case of mistake 
    5955; 
    60 ; RESTRICTIONS: 
    61 ; 
    62 ; EXAMPLE: 
    63 ; j''ai une matrice A de dim 2. je veux en extraire une petite matrice 
    64 ; 2d interscetion de la ligne 2,3 et 7 et de la colonne 0 et 1 
     56;  
     57; @examples I have a dim 2 matrix named A. I want extract a small intersection  
     58;          matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 
    6559;       
    6660;      res=extrait(A,[2,3,7],[0,1]) 
    6761; 
    68 ;autre ex: 
     62;other ex: 
    6963;      IDL> print, a  
    7064;      a b c 
     
    7569;      g i 
    7670; 
    77 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     71; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    7872;                       12/1/1999 
    79 ;                       29/4/1999: correction d''un bug et complement 
    80 ;                       de l''en-tete 
     73;                       29/4/1999: correction of a bug and complement of the heading 
     74; 
     75; @version $Id$ 
     76; 
    8177;- 
    8278;------------------------------------------------------------ 
     
    8884  compile_opt idl2, strictarrsubs 
    8985; 
    90    taille = size(tab) 
    91 ;------------------------------------------------------------ 
    92 ; test du nombre de parametres 
    93 ; et de la nature de indice (pour LE cas 'x') 
    94 ;------------------------------------------------------------ 
    95    if n_params() NE taille[0]+1 THEN $ 
    96     return, report('il faut autant d''indices que de dimension du tableau') 
    97    IF n_params() GE 5 THEN BEGIN  
    98       if size(indicet,/type) EQ 7 then indicet = lindgen(taille[4]) $ 
    99       ELSE indicet = long(indicet) 
    100       nt = n_elements(indicet)  
    101    ENDIF  
    102    IF n_params() GE 4 THEN BEGIN  
    103       if size(indicez,/type) EQ 7 then indicez = lindgen(taille[3]) $ 
    104       ELSE indicez = long(indicez) 
    105       nz = n_elements(indicez)  
    106    ENDIF  
    107    IF n_params() GE 3 THEN BEGIN  
    108       if size(indicey,/type) EQ 7 then indicey = lindgen(taille[2]) $ 
    109       ELSE indicey = long(indicey) 
    110       ny = n_elements(indicey)  
    111    ENDIF 
    112    IF n_params() GE 2 THEN BEGIN  
    113       if size(indicex,/type) EQ 7 then indicex = lindgen(taille[1]) $ 
    114       ELSE indicex = long(indicex) 
    115       nx = n_elements(indicex)  
    116    ENDIF 
    117     
    118 ;------------------------------------------------------------ 
    119 ; construction du tableau d''indice et du resultat suivant la taille 
    120 ; de tab 
    121 ;------------------------------------------------------------ 
    122   case taille[0] of 
    123       1:res = tab[indicex] 
    124       2:BEGIN 
    125          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    126          res = tab[indice] 
    127       END  
    128       3:BEGIN 
    129          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    130          indice = temporary(indice[*])#replicate(1, nz) $ 
    131           +taille[1]*taille[2]*replicate(1, nx*ny)#indicez 
    132          res = tab[reform(indice, nx, ny, nz, /over)] 
    133       END  
    134       4:BEGIN 
    135          indice = indicex#replicate(1, ny)+taille[1]*replicate(1, nx)#indicey 
    136          indice = temporary(indice[*])#replicate(1, nz) $ 
    137           +taille[1]*taille[2]*replicate(1, nx*ny)#indicez 
    138          indice = temporary(indice[*])#replicate(1, nt) $ 
    139           +taille[1]*taille[2]*taille[3]*replicate(1, nx*ny*nz)#indicet 
    140          res = tab[reform(indice, nx, ny, nz, nz, /over)] 
    141       END  
    142    endcase 
    143  
    144  
    145 ;------------------------------------------------------------ 
    146 ;------------------------------------------------------------ 
    147    return, res 
     86  case n_params() of 
     87      0:return, extrac2() 
     88      1:return, extrac2(tab) 
     89      2:return, extrac2(tab, indicex) 
     90      3:return, extrac2(tab, indicex, indicey) 
     91      4:return, extrac2(tab, indicex, indicey, indicez) 
     92      5:return, extrac2(tab, indicex, indicey, indicez, indicet) 
     93  endcase 
    14894end 
  • trunk/SRC/Obsolete/zeroun.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:zeroun 
     5; @file_comments  
     6; Send back a vector or a matrix constituate of 0 and 1 in alternation 
    67; 
    7 ; PURPOSE:renvoie un vecteur ou une matrice constitue de o et de 1 en 
    8 ; alternance 
     8; you better use zero_one 
    99; 
    10 ; CATEGORY:function, matrices 
     10; @obsolete 
    1111; 
    12 ; CALLING SEQUENCE:resultat=zeroun(n1 [,n2]) 
     12; @categories function, matrixes 
    1313; 
    14 ; INPUTS: 
    15 ;       n1=nombre d'elements dans la premiere dimension 
    16 ;       n2=nombre d'elements dans la deuxieme dimension 
     14; @param n1 {in}{required} number of elements in the first dimension 
     15; @param n2 {in}{required} numbre of elements in the second dimension 
    1716; 
    18 ; KEYWORD PARAMETERS: 
     17; @returns resultat 
     18;  
     19; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     20;                       1/12/98 
    1921; 
    20 ; OUTPUTS:resultat 
     22; @version $Id$ 
    2123; 
    22 ; COMMON BLOCKS: 
    23 ; 
    24 ; SIDE EFFECTS: 
    25 ; 
    26 ; RESTRICTIONS: 
    27 ; 
    28 ; EXAMPLE: 
    29 ; 
    30 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    31 ;                       1/12/98 
    3224;- 
    3325;------------------------------------------------------------ 
     
    3830  compile_opt idl2, strictarrsubs 
    3931; 
    40    CASE N_PARAMS() OF 
    41       1:return, findgen(n1) mod 2 
    42       2:BEGIN  
    43          if fix(n1/2) EQ n1/2. then BEGIN ;nombre pair de colonnes 
    44             res = findgen(n1+1,n2) mod 2 
    45             return, res[0:n1-1, *] 
    46          ENDIF ELSE return, findgen(n1,n2) mod 2 ;nombre impair de colonnes 
    47       END 
    48       else: return,  report('Mauvais nombre de parametre dans l''appel de ZEROUN') 
    49    endcase             
     32  case n_params() of 
     33      0:return, zero_one() 
     34      1:return, zero_one(n1) 
     35      2:return, zero_one(n1, n2) 
     36  endcase 
     37 
    5038end 
  • trunk/SRC/Picture/image_viewer.pro

    r132 r133  
    11;+ 
    2 ; NAME: 
    3 ;       IMAGE_VIEWER 
    4 ; 
    5 ; PURPOSE: 
    6 ;       The purpose of this program is to provide an interactive tool that can be used 
    7 ;       to view JPEG, BMP, GIF, PNG, and TIFF picture files.  Images are loaded into 
    8 ;       memory, so the initial file access may take a while, but once each picture has 
    9 ;       been opened they can all be viewed in a very rapid fashion. 
    10 ; 
    11 ; CATEGORY: 
    12 ;       Visualization, Widgets 
    13 ; 
    14 ; CALLING SEQUENCE: 
    15 ;       image_viewer 
    16 ; 
    17 ; INPUT PARAMETERS: 
    18 ;       None. 
    19 ; 
    20 ; KEYWORD PARAMETERS: 
    21 ;       None. 
    22 ; 
    23 ; OUTPUTS: 
    24 ;       None. 
    25 ; 
    26 ; COMMON BLOCKS: 
    27 ;       None. 
    28 ; 
    29 ; SIDE EFFECTS: 
    30 ;       While this program is running in an IDL session it will change the current 
     2; 
     3; @file_comments  
     4; The purpose of this program is to provide an interactive tool that can be used 
     5; to view JPEG, BMP, GIF, PNG, and TIFF picture files.  Images are loaded into 
     6; memory, so the initial file access may take a while, but once each picture has 
     7; been opened they can all be viewed in a very rapid fashion. 
     8; 
     9; @categories Visualization, Widgets 
     10; 
     11; @param event {in}{required} 
     12; 
     13; @restrictions While this program is running in an IDL session it will change the current 
    3114;       working directory, enables/disables color decomposition, and sets !QUIET=1, 
    3215;       !ORDER=0, & !P.BACKGROUND=0.  These settings are returned to their initial 
    3316;       settings before the program was initiated once it is terminated. 
    3417; 
    35 ; RESTRICTIONS: 
    36 ;       This program is supported in IDL version 5.5 and newer.  In order to open 
     18; @restrictions This program is supported in IDL version 5.5 and newer.  In order to open 
    3719;       GIF files or TIFF files with LZW compression the copy of IDL being used must 
    3820;       be licensed with these features.  IDL only supports BMP files in the standard 
    3921;       Windows format and does not support OS2 bitmaps. 
    4022; 
    41 ; MODIFICATION HISTORY: 
    42 ;       Written by: AEB, 1/02. 
    43 ;- 
    44  
    45  
    46 ;********************************************************************************************* 
     23; @history Written by: AEB, 1/02. 
     24; 
     25; @version $Id$ 
     26;********************************************************************************************* 
     27;_ 
     28 
    4729PRO IMAGE_VIEWER_OPEN_FILES,event 
    4830;THIS PROCEDURE IS CALLED WHEN A USER SELECTS "File > Open Picture Files" FROM THE MAIN MENU 
     
    126108 
    127109;********************************************************************************************* 
     110;+ 
     111; @param event {in}{required} 
     112;- 
    128113PRO IMAGE_VIEWER_OPEN_FOLDER,event 
    129114;THIS PROCEDURE IS CALLED WHEN A USER SELECTS "File > Open All In Folder" FROM THE MAIN MENU 
     
    208193 
    209194;********************************************************************************************* 
     195;+ 
     196; @param event {in}{required} 
     197;- 
    210198PRO IMAGE_VIEWER_CANCEL,event 
    211199;obtain state structure for top-level-base from its UVALUE: 
     
    221209 
    222210;********************************************************************************************* 
     211;+ 
     212; @param event {in}{required} 
     213;- 
    223214PRO IMAGE_VIEWER_TIMER,event 
    224215;obtain state structure for top-level-base from its UVALUE: 
     
    893884 
    894885;********************************************************************************************* 
     886;+ 
     887; @param event {in}{required} 
     888;- 
    895889PRO IMAGE_VIEWER_EXIT,event 
    896890;THIS PROCEDURE IS CALLED WHEN A USER SELECTS "File > Exit" FROM THE MAIN MENU 
     
    905899 
    906900;********************************************************************************************* 
     901;+ 
     902; @param event {in}{required} 
     903;- 
    907904PRO IMAGE_VIEWER_HELP,event 
    908905;THIS PROCEDURE IS CALLED WHEN A USER SELECTS "Help > Help on IMAGE_VIEWER" 
     
    924921 
    925922;********************************************************************************************* 
     923;+ 
     924; @param event {in}{required} 
     925;- 
    926926PRO IMAGE_VIEWER_THUMBS,event 
    927927;THIS PROCEDURE IS CALLED WHEN A USER CLICKS ON ONE OF THE THUMBNAIL PICTURES 
     
    971971 
    972972;********************************************************************************************* 
     973;+ 
     974; @param widjetID {in}{required} 
     975;- 
    973976PRO IMAGE_VIEWER_CLEANUP,widgetID 
    974977;THIS PROCEDURE IS CALLED WHEN THE PROGRAM IS TERMINATED AND XMANAGER REGISTERS A CLEANUP: 
     
    9991002 
    10001003;********************************************************************************************* 
     1004;+ 
     1005; @param event {in}{required} 
     1006;- 
    10011007PRO IMAGE_VIEWER_EVENT,event 
    10021008;THIS PROCEDURE IS CALLED WHEN A USER RESIZES THE TOP-LEVEL BASE 
  • trunk/SRC/Picture/imdisp.pro

    r132 r133  
    11;------------------------------------------------------------------------------- 
     2;+ 
     3; @hidden 
     4;- 
    25FUNCTION IMDISP_GETPOS, ASPECT, POSITION=POSITION, MARGIN=MARGIN 
    36; 
     
    4750END 
    4851;------------------------------------------------------------------------------- 
     52;+ 
     53; @hidden 
     54;- 
    4955FUNCTION IMDISP_IMSCALE, IMAGE, RANGE=RANGE, BOTTOM=BOTTOM, NCOLORS=NCOLORS, $ 
    5056  NEGATIVE=NEGATIVE 
     
    7884END 
    7985;------------------------------------------------------------------------------- 
     86;+ 
     87; @hidden 
     88;- 
    8089FUNCTION IMDISP_IMREGRID, DATA, NX, NY, INTERP=INTERP 
    8190; 
     
    119128END 
    120129;------------------------------------------------------------------------------- 
     130;+ 
     131; @hidden 
     132;- 
    121133PRO IMDISP_IMSIZE, IMAGE, X0, Y0, XSIZE, YSIZE, ASPECT=ASPECT, $ 
    122134  POSITION=POSITION, MARGIN=MARGIN 
     
    176188 
    177189END 
    178 ;------------------------------------------------------------------------------- 
    179 PRO IMDISP, IMAGE, RANGE=RANGE, BOTTOM=BOTTOM, NCOLORS=NCOLORS, $ 
    180   MARGIN=MARGIN, INTERP=INTERP, DITHER=DITHER, ASPECT=ASPECT, $ 
    181   POSITION=POSITION, OUT_POS=OUT_POS, NOSCALE=NOSCALE, NORESIZE=NORESIZE, $ 
    182   ORDER=ORDER, USEPOS=USEPOS, CHANNEL=CHANNEL, $ 
    183   BACKGROUND=BACKGROUND, ERASE=ERASE, $ 
    184   AXIS=AXIS, NEGATIVE=NEGATIVE, _EXTRA=EXTRA_KEYWORDS 
    185 ; 
    186   compile_opt idl2, strictarrsubs 
    187 ; 
    188  
     190;******************************************************************************* 
    189191;+ 
    190 ; NAME: 
    191 ;    IMDISP 
    192 ; 
    193 ; PURPOSE: 
     192; 
     193; @file_comments  
    194194;    Display an image on the current graphics device. 
    195195;    IMDISP is an advanced replacement for TV and TVSCL. 
     
    214214;    - Photographic negative images can be displayed via the NEGATIVE keyword. 
    215215; 
    216 ; CATEGORY: 
    217 ;    Image display 
    218 ; 
    219 ; CALLING SEQUENCE: 
    220 ;    IMDISP, IMAGE 
    221 ; 
    222 ; INPUTS: 
    223 ;    IMAGE       Array containing image data. 
     216; @categories Image display 
     217; 
     218; @param IMAGE {in}{required} Array containing image data. 
    224219;                Pseudo (indexed) color images must have 2 dimensions. 
    225220;                True color images must have 3 dimensions, in either 
    226221;                [3, NX, NY], [NX, 3, NY], or [NX, NY, 3] form. 
    227222; 
    228 ; OPTIONAL INPUTS: 
    229 ;    None. 
    230 ; 
    231 ; KEYWORD PARAMETERS: 
    232 ;    RANGE       For Pseudo Color images only, a vector with two elements 
     223; @keyword RANGE For Pseudo Color images only, a vector with two elements 
    233224;                specifying the minimum and maximum values of the image 
    234225;                array to be considered when the image is byte-scaled 
     
    237228;                or if the NOSCALE keyword is set. 
    238229; 
    239 ;    BOTTOM      Bottom value in the color table to be used 
     230; @keyword BOTTOM Bottom value in the color table to be used 
    240231;                for the byte-scaled image 
    241232;                (default is 0). 
    242233;                This keyword is ignored if the NOSCALE keyword is set. 
    243234; 
    244 ;    NCOLORS    Number of colors in the color table to be used 
     235; @keyword NCOLORS Number of colors in the color table to be used 
    245236;                for the byte-scaled image 
    246237;                (default is !D.TABLE_SIZE - BOTTOM). 
    247238;                This keyword is ignored if the NOSCALE keyword is set. 
    248239; 
    249 ;    MARGIN      A scalar value specifying the margin to be maintained 
     240; @keyword MARGIN A scalar value specifying the margin to be maintained 
    250241;                around the image in normal coordinates 
    251242;                (default is 0.1, or 0.025 if !P.MULTI is set to display 
    252243;                multiple images). 
    253244; 
    254 ;    INTERP      If set, the resized image will be interpolated using 
     245; @keyword INTERP If set, the resized image will be interpolated using 
    255246;                bilinear interpolation 
    256247;                (default is nearest neighbor sampling). 
    257248; 
    258 ;    DITHER      If set, true color images will be dithered when displayed 
     249; @keyword DITHER If set, true color images will be dithered when displayed 
    259250;                on an 8-bit graphics device 
    260251;                (default is no dithering). 
    261252; 
    262 ;    ASPECT      A scalar value specifying the aspect ratio (height/width) 
     253; @keyword ASPECT A scalar value specifying the aspect ratio (height/width) 
    263254;                for the displayed image 
    264255;                (default is to maintain native aspect ratio). 
    265256; 
    266 ;    POSITION    On input, a 4-element vector specifying the position 
     257; @keyword POSITION On input, a 4-element vector specifying the position 
    267258;                of the displayed image in the form [X0,Y0,X1,Y1] in 
    268259;                in normal coordinates 
     
    271262;                offset and size are known (e.g. MAP_IMAGE output). 
    272263; 
    273 ;    OUT_POS    On output, a 4-element vector specifying the position 
     264; @keyword OUT_POS On output, a 4-element vector specifying the position 
    274265;                actually used to display the image. 
    275266; 
    276 ;    NOSCALE    If set, the image will not be byte-scaled 
     267; @keyword NOSCALE If set, the image will not be byte-scaled 
    277268;                (default is to byte-scale the image). 
    278269; 
    279 ;    NORESIZE    If set, the image will not be resized. 
     270; @keyword NORESIZE If set, the image will not be resized. 
    280271;                (default is to resize the image to fit the display). 
    281272; 
    282 ;    ORDER      If set, the image is displayed from the top down 
     273; @keyword ORDER If set, the image is displayed from the top down 
    283274;                (default is to display the image from the bottom up). 
    284275;                Note that the system variable !ORDER is always ignored. 
    285276; 
    286 ;    USEPOS      If set, the image will be sized to exactly fit a supplied 
     277; @keyword USEPOS If set, the image will be sized to exactly fit a supplied 
    287278;                POSITION vector, over-riding ASPECT and MARGIN 
    288279;                (default is to honor ASPECT and MARGIN when a POSITION 
    289280;                vector is supplied). 
    290281; 
    291 ;    CHANNEL    Display channel (Red, Green, or Blue) to be written. 
     282; @keyword CHANNEL Display channel (Red, Green, or Blue) to be written. 
    292283;                0 => All channels (the default) 
    293284;                1 => Red channel 
     
    299290;                images can be displayed on any device supported by IMDISP. 
    300291; 
    301 ;    BACKGROUND If set to a positive integer, the background will be filled 
     292; @keyword BACKGROUND If set to a positive integer, the background will be filled 
    302293;                with the color defined by BACKGROUND. 
    303294; 
    304 ;    ERASE      If set, the screen contents will be erased. Note that if 
     295; @keyword ERASE If set, the screen contents will be erased. Note that if 
    305296;                !P.MULTI is set to display multiple images, the screen is 
    306297;                always erased when the first image is displayed. 
    307298; 
    308 ;    AXIS        If set, plot axes will be drawn on the image. The default 
     299; @keyword AXIS If set, plot axes will be drawn on the image. The default 
    309300;                x and y axis ranges are determined by the size of the image. 
    310301;                When the AXIS keyword is set, IMDISP accepts any keywords 
    311302;                supported by PLOT (e.g. TITLE, COLOR, CHARSIZE etc.). 
    312303; 
    313 ;    NEGATIVE    If set, a photographic negative of the image is displayed. 
     304; @keyword NEGATIVE If set, a photographic negative of the image is displayed. 
    314305;                The values of BOTTOM and NCOLORS are honored. This keyword 
    315306;                allows True color images scanned from color negatives to be 
     
    318309;                is ignored if the NOSCALE keyword is set. 
    319310; 
    320 ; OUTPUTS: 
    321 ;    None. 
    322 ; 
    323 ; OPTIONAL OUTPUTS: 
    324 ;    None 
    325 ; 
    326 ; COMMON BLOCKS: 
    327 ;    None 
    328 ; 
    329 ; SIDE EFFECTS: 
    330 ;    The image is displayed on the current graphics device. 
    331 ; 
    332 ; RESTRICTIONS: 
    333 ;    Requires IDL 5.0 or higher (square bracket array syntax). 
    334 ; 
    335 ; EXAMPLE: 
     311; @restrictions The image is displayed on the current graphics device. 
     312; 
     313; @restrictions Requires IDL 5.0 or higher (square bracket array syntax). 
     314; 
     315; @examples 
    336316; 
    337317;;- Load test data 
     
    472452;map_grid 
    473453; 
    474 ; MODIFICATION HISTORY: 
    475 ; Liam.Gumley@ssec.wisc.edu 
     454; @history Liam.Gumley@ssec.wisc.edu 
    476455; http://cimss.ssec.wisc.edu/~gumley 
    477 ; $Id: imdisp.pro,v 1.47 2002/06/05 16:31:07 gumley Exp $ 
    478456; 
    479457; Copyright (C) 1999, 2000 Liam E. Gumley 
     
    492470; along with this program; if not, write to the Free Software 
    493471; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     472; 
     473; @version $Id: imdisp.pro,v 1.47 2002/06/05 16:31:07 gumley Exp $ 
     474; 
    494475;- 
     476;------------------------------------------------------------------------------- 
     477PRO IMDISP, IMAGE, RANGE=RANGE, BOTTOM=BOTTOM, NCOLORS=NCOLORS, $ 
     478  MARGIN=MARGIN, INTERP=INTERP, DITHER=DITHER, ASPECT=ASPECT, $ 
     479  POSITION=POSITION, OUT_POS=OUT_POS, NOSCALE=NOSCALE, NORESIZE=NORESIZE, $ 
     480  ORDER=ORDER, USEPOS=USEPOS, CHANNEL=CHANNEL, $ 
     481  BACKGROUND=BACKGROUND, ERASE=ERASE, $ 
     482  AXIS=AXIS, NEGATIVE=NEGATIVE, _EXTRA=EXTRA_KEYWORDS 
     483; 
     484  compile_opt idl2, strictarrsubs 
     485; 
    495486 
    496487rcs_id = '$Id: imdisp.pro,v 1.47 2002/06/05 16:31:07 gumley Exp $' 
  • trunk/SRC/Picture/saveimage.pro

    r132 r133  
    1 PRO SAVEIMAGE, FILE, BMP=BMP, PNG=PNG, PICT=PICT, JPEG=JPEG, TIFF=TIFF, $ 
    2   QUALITY=QUALITY, DITHER=DITHER, CUBE=CUBE, QUIET=QUIET, MULTIPLE = multiple 
    3 ; 
    4   compile_opt idl2, strictarrsubs 
    5 ; 
    6  
    71;+ 
    8 ; NAME: 
    9 ;    SAVEIMAGE 
    10 ; 
    11 ; PURPOSE: 
    12 ;    Save the current graphics window to an output file (GIF by default). 
     2; 
     3; @file_comments  
     4; Save the current graphics window to an output file (GIF by default). 
    135; 
    146;    The output formats supported are: 
     
    2315;    8-bit or 24-bit output files are done automatically. 
    2416; 
    25 ; CATEGORY: 
    26 ;    Input/Output. 
    27 ; 
    28 ; CALLING SEQUENCE: 
    29 ;    SAVEIMAGE, FILE 
    30 ; 
    31 ; INPUTS: 
    32 ;    FILE     Name of the output file (GIF format by default). 
    33 ; 
    34 ; OPTIONAL INPUTS: 
    35 ;    None. 
    36 ; 
    37 ; KEYWORD PARAMETERS: 
    38 ;    BMP      Set this keyword to create BMP format (8-bit with color table). 
    39 ;    PNG      Set this keyword to create PNG format (8-bit with color table). 
    40 ;    PICT     Set this keyword to create PICT format (8-bit with color table). 
    41 ;    JPEG     Set this keyword to create JPEG format (24-bit true color). 
    42 ;    TIFF     Set this keyword to create TIFF format (24-bit true color). 
    43 ;    QUALITY  If set to a named variable, specifies the quality for 
     17; @categories Input/Output. 
     18; 
     19; @param FILE {in}{required} Name of the output file (GIF format by default). 
     20; 
     21; @keyword BMP Set this keyword to create BMP format (8-bit with color table). 
     22; 
     23; @keyword PNG Set this keyword to create PNG format (8-bit with color table). 
     24; 
     25; @keyword PICT Set this keyword to create PICT format (8-bit with color table). 
     26; 
     27; @keyword JPEG Set this keyword to create JPEG format (24-bit true color). 
     28; 
     29; @keyword TIFF Set this keyword to create TIFF format (24-bit true color). 
     30; 
     31; @keyword QUALITY  If set to a named variable, specifies the quality for 
    4432;             JPEG output (default 75). Ranges from 0 ("terrible") to 
    4533;             100 ("excellent"). Smaller quality values yield higher 
    4634;             compression ratios and smaller output files. 
    47 ;    DITHER   If set, dither the output image when creating 8-bit output 
     35; 
     36;@keyword DITHER   If set, dither the output image when creating 8-bit output 
    4837;             which is read from a 24-bit display (default is no dithering). 
    49 ;    CUBE     If set, use the color cube method to quantize colors when 
     38; 
     39; @keyword CUBE     If set, use the color cube method to quantize colors when 
    5040;             creating 8-bit output which is read from a 24-bit display 
    5141;             (default is to use the statistical method). This may improve 
    5242;             the accuracy of colors in the output image, especially white. 
    53 ;   QUIET    Set this keyword to suppress the information message 
     43; @keyword QUIET    Set this keyword to suppress the information message 
    5444;             (default is to print an information message). 
    55 ;    MULTIPLE to write multiple gif image 
    56 ; 
    57 ; OUTPUTS: 
    58 ;    None. 
    59 ; 
    60 ; OPTIONAL OUTPUTS: 
    61 ;    None 
    62 ; 
    63 ; COMMON BLOCKS: 
    64 ;    None 
    65 ; 
    66 ; SIDE EFFECTS: 
    67 ;    The output file is overwritten if it exists. 
    68 ; 
    69 ; RESTRICTIONS: 
    70 ;    Requires IDL 5.0 or higher (square bracket array syntax). 
    71 ; 
    72 ; EXAMPLE: 
     45; @keyword MULTIPLE to write multiple gif image. 
     46; 
     47; @restrictions The output file is overwritten if it exists. 
     48; 
     49;  
     50; @restrictions requires IDL 5.0 or higher (square bracket array syntax). 
     51; 
     52; @examples 
    7353; 
    7454;openr, lun, filepath('hurric.dat', subdir='examples/data'), /get_lun 
     
    8060;saveimage, 'hurric.gif' 
    8161; 
    82 ; MODIFICATION HISTORY: 
    83 ; Liam.Gumley@ssec.wisc.edu 
     62; @history Liam.Gumley@ssec.wisc.edu 
    8463; http://cimss.ssec.wisc.edu/~gumley 
    85 ; $Id$ 
    86 ; 
    87 ; Copyright (C) 1999 Liam E. Gumley 
    8864; 
    8965; This program is free software; you can redistribute it and/or 
     
    10076; along with this program; if not, write to the Free Software 
    10177; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     78; 
     79; @version $Id$ 
     80; 
    10281;- 
     82PRO SAVEIMAGE, FILE, BMP=BMP, PNG=PNG, PICT=PICT, JPEG=JPEG, TIFF=TIFF, $ 
     83  QUALITY=QUALITY, DITHER=DITHER, CUBE=CUBE, QUIET=QUIET, MULTIPLE = multiple 
     84; 
     85  compile_opt idl2, strictarrsubs 
     86; 
    10387 
    10488rcs_id = '$Id$' 
  • trunk/SRC/Picture/showimage.pro

    r132 r133  
    1 PRO SHOWIMAGE, FILE, DITHER=DITHER, CURRENT=CURRENT 
    2 ; 
    3   compile_opt idl2, strictarrsubs 
    4 ; 
    5  
    61;+ 
    7 ; NAME: 
    8 ;    SHOWIMAGE 
    9 ; 
    10 ; PURPOSE: 
    11 ;    Show the contents of a graphics file in the current window. 
     2; 
     3; @file_comments  
     4; Show the contents of a graphics file in the current window. 
    125; 
    136;    The input formats supported are: 
     
    2114;    to 8-bit or 24-bit images on-screen are done automatically. 
    2215; 
    23 ; CATEGORY: 
    24 ;    Input/Output. 
    25 ; 
    26 ; CALLING SEQUENCE: 
    27 ;    SHOWIMAGE, FILE 
    28 ; 
    29 ; INPUTS: 
    30 ;    FILE     Name of the output file (format is identified automatically). 
    31 ; 
    32 ; OPTIONAL INPUTS: 
    33 ;    None. 
    34 ; 
    35 ; KEYWORD PARAMETERS: 
    36 ;    DITHER   Set this keyword to dither the input image when displaying 
     16; @categories Input/Output. 
     17; 
     18; @param FILE {in}{required} Name of the output file (format is identified automatically). 
     19; 
     20; @keyword DITHER Set this keyword to dither the input image when displaying 
    3721;             24-bit images on an 8-bit display (default is no dithering). 
    38 ;    CURRENT Set this keyword to display the image in the current window 
     22; @keyword CURRENT Set this keyword to display the image in the current window 
    3923;             (default is to create a new window sized to fit the image). 
    4024; 
    41 ; OUTPUTS: 
    42 ;    None. 
    43 ; 
    44 ; OPTIONAL OUTPUTS: 
    45 ;    None 
    46 ; 
    47 ; COMMON BLOCKS: 
    48 ;    None 
    49 ; 
    50 ; SIDE EFFECTS: 
    51 ;    The color table is modified. 
    52 ; 
    53 ; RESTRICTIONS: 
    54 ;    Requires IDL 5.2 or higher (image QUERY functions). 
    55 ; 
    56 ; EXAMPLE: 
    57 ; 
    58 ;showimage, filepath('rose.jpg', subdir='examples/data') 
    59 ; 
    60 ; MODIFICATION HISTORY: 
    61 ; Liam.Gumley@ssec.wisc.edu 
     25; @restrictions The color table is modified. 
     26; 
     27; @restrictions Requires IDL 5.2 or higher (image QUERY functions). 
     28; 
     29; @examples showimage, filepath('rose.jpg', subdir='examples/data') 
     30; 
     31; @history Liam.Gumley@ssec.wisc.edu 
    6232; http://cimss.ssec.wisc.edu/~gumley 
    63 ; $Id$ 
    64 ; 
    65 ; Copyright (C) 1999 Liam E. Gumley 
    6633; 
    6734; This program is free software; you can redistribute it and/or 
     
    7845; along with this program; if not, write to the Free Software 
    7946; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     47; 
     48; @version $Id$  
     49; 
    8050;- 
    81  
     51PRO SHOWIMAGE, FILE, DITHER=DITHER, CURRENT=CURRENT 
     52; 
     53  compile_opt idl2, strictarrsubs 
     54; 
    8255rcs_id = '$Id$' 
    8356 
  • trunk/SRC/ToBeReviewed/CALENDRIER/def_month.pro

    r114 r133  
     1;+ 
     2; @todo seb 
     3;- 
    14FUNCTION def_month, timave, date 
    25; 
  • trunk/SRC/ToBeReviewed/COULEURS/palit.pro

    r114 r133  
    11;+ 
    2 ;  Eclaircit la palette courante en jouant sur la luminosite 
     2; @file_comments  
     3; Clarify the current palette playing with brightness 
    34; 
    4 ;          coef = regle l'attenuation des couleurs 
    5 ;          par defaut divise par 2 la luminosite 
     5; @param coef {in}{required} The rule of attenuation of colors divide by 2 the brightness by default 
    66; 
    7 ;  coef = 0.1 pour la QMS papier de l'IPSL convient tres bien 
     7; @param red  
     8; 
     9; @param green 
     10; 
     11; @param blue 
     12; 
     13; @todo Seb: compléter param red/green/blue 
    814;- 
    915PRO palit, coef, red, green, blue 
     
    1622   l = 1.-coef*(1.-l) 
    1723; 
    18 Le noir doit rester bien noir ! 
    19 toutes mes palettes commencent par du noir et finissent par du blanc 
     24Black must stay really black! 
     25Each palette starts by Black and ends by white 
    2026; 
    2127   l[0] = 0. 
  • trunk/SRC/ToBeReviewed/IMAGE/animgif.pro

    r114 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:animgif 
    65; 
    7 ; PURPOSE:construire une animation gif 
     6; @file_comments  
     7; Build a gif animation 
    88; 
    9 ; CATEGORY:pour faire des dessins animes 
     9; @categories Animated drawings. 
    1010; 
    11 ; CALLING SEQUENCE:animgif, 'toto.gif' 
     11; @param toto.gif {in}{required} It is the name of the gif file containing the animation. 
     12;                         Comment: this file is placed in the directory defined by iodir. 
    1213; 
    13 ; INPUTS:toto.gif: c''est le nom du fichier gif contenant 
    14 ; l''animation. Rq ce fichier est place dans le repertoire definit par 
    15 ; iodir. 
     14; @uses common.pro 
    1615; 
    17 ; KEYWORD PARAMETERS: 
    18 ; 
    19 ; OUTPUTS: 
    20 ; 
    21 ; COMMON BLOCKS: 
    22 ;       common.pro 
    23 ; 
    24 ; SIDE EFFECTS:on utilise le Z buffer pour aller plus vite!. 
    25 ;              donc si on plante ds animgif il faut faire: 
     16; @restrictions We use the Z buffer to go faster!. 
     17;              So, if it failed in animgif, you have to do: 
    2618;              IDL> device, /close 
    2719;              IDL> set_plot, 'x' 
    2820;              IDL> retall 
    2921; 
    30 ; RESTRICTIONS: si on veut supprimer le @common, 
    31 ;               il faut definir a la main la taille de l''image (les 
    32 ;               variables xsize et ysize) ainsi que iodir. 
     22; @restrictions If we want to delete the @common, 
     23;               we have to define manually the picture's size  
     24;               (variables xsize and ysize) just as iodir. 
    3325; 
    34 ; EXAMPLE: 
     26; @history Guillaume Roullet (grlod@ipsl.jussieu.fr) 
     27;          Sebastien Masson (smasson@lodyc.jussieu.fr) 
     28;          30/4/1999 
    3529; 
    36 ; MODIFICATION HISTORY: Guillaume Roullet (grlod@ipsl.jussieu.fr) 
    37 ;                       Sebastien Masson (smasson@lodyc.jussieu.fr) 
    38 ;                       30/4/1999 
     30; @version $Id$ 
     31; 
    3932;- 
    4033;------------------------------------------------------------ 
     
    4740@common 
    4841; 
    49 recupere la palette de couleur et la place dans rouge, vert, bleu 
     42It recuperates the color palette and put it in red, green, blue. 
    5043; 
    5144   tvlct,  rouge,vert,bleu,/get 
    5245; 
    53 complete la palette courante sur 256 couleurs 
     46It completes the current palette on 256 colors. 
    5447; 
    5548   red = [rouge, replicate(255, 256-n_elements(rouge))]  
     
    5750   blue = [bleu, replicate(255, 256-n_elements(rouge))]  
    5851; 
    59 ; bascule sur le z device, permettant de creer l''image sans 
    60 ; l''afficher 
     52; It rocks on the z device, allowing to create the picture without display it. 
    6153   thisOS = !VERSION.OS_FAMILY 
    6254   thisOS = STRMID(thisOS, 0, 3) 
    6355   thisOS = STRUPCASE(thisOS) 
    6456   set_plot, 'z' 
    65 ; taille de l''image (en nombre de pixel: 
     57; size of the picture (in pixel): 
    6658   xsize = 30*(min(page_size, max = ma)*key_portrait + ma*(1-key_portrait)) 
    6759   ysize = 30*(min(page_size, max = ma)*(1-key_portrait) + ma*key_portrait) 
    6860   device, set_resolution = [xsize, ysize] 
    6961; 
    70 ; commencement du fichier gif. ecriture d''une image vide  
     62; Beginning of the gif file. Writing of an empty picture.  
    7163; 
    7264   reinitplt 
     
    7668; 
    7769;---------------------------------------------------------------- 
    78 ; debut de la partie a changer 
     70; Beggining of the part we want to change. 
    7971;---------------------------------------------------------------- 
    8072; 
    81 ; boucle de creation de l''image 
     73; Loop of picture's creation. 
    8274; 
    8375   calen = TIMEGEN(366, START=JULDAY(1,1,2000))  
     
    10799;      plt, norme(nlec('unsurf', date, 'RE3'), nlec('vnsurf', date, 'RE3')), 0, 1.2, int = .1, /noerase 
    108100; 
    109 ;     Ecriture de l''image dans le fichier .gif 
     101;     Writing of the picture in the file .gif. 
    110102; 
    111103      write_gif,iodir+nomfic,tvrd(),red, green, blue, /multiple 
    112104   ENDFOR  
    113105;---------------------------------------------------------------- 
    114 ; fin de la partie a changer 
     106; End of the part we want to change. 
    115107;---------------------------------------------------------------- 
    116108; 
    117 ; fermeture du fichier 
     109; Closing of the file. 
    118110   write_gif,iodir+nomfic,/close  
    119 ; rebascule en mode terminal X 
    120    device, /close 
     111; Rerock on terminal X mode. 
     112;   device, /close 
    121113   CASE thisOS of 
    122114      'MAC': SET_PLOT, thisOS 
  • trunk/SRC/ToBeReviewed/MATRICE/colle.pro

    r114 r133  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; NAME:colle 
     2; @file_comments  
     3; This concatenation function exist in IDL so long  
     4;as we do not try to stick with a dimension superior or equal at 4.   
    65; 
    7 ; PURPOSE: Cette fonction de concatenation existe ds IDL (avec [] cf 
    8 ; ds le programme ds le case pour direc egale 1,2,3) tant que l''on ne 
    9 ; cherche pas a coller suivant une dimensionsuperieure ou egale a 4.   
     6; @categories utilities 
    107; 
    11 ; CATEGORY:bidouillage de matrice 
     8; @param a0 {in}{required} 
    129; 
    13 ; CALLING SEQUENCE:res=colle(bableau_de_pointeur,direc) ou bien 
    14 ;                  res=colle(tab1,tab2,tab3,tab4,.....,direc) 
     10; @param a1 {in}{required} 
    1511; 
    16 ; INPUTS: 
    17 ;          
    18 ;        CAS 1: 
    19 ;        tableau_de_pointeur:comme son nom l''indique c'est un tableau 
    20 ;        de pointeur, dont chaque elements pointe sur tableau a coller 
     12; @param a2 {in}{required} 
    2113; 
    22 ;        par ex ds un programme, on veut coller n tableaux entre eux 
     14; @param a3 {in}{required} 
     15; 
     16; @param a4 {in}{required} 
     17; 
     18; @param a5 {in}{required} 
     19; 
     20; @param a6 {in}{required} 
     21; 
     22; @param a7 {in}{required} 
     23; 
     24; @param a8 {in}{required} 
     25; 
     26; @param a9 {in}{required} 
     27; 
     28; @param a10 {in}{required} 
     29; 
     30; @param a11 {in}{required} 
     31; 
     32; @param a12 {in}{required} 
     33; 
     34; @param a13 {in}{required} 
     35; 
     36; @param a14 {in}{required} 
     37; 
     38; @param a15 {in}{required} 
     39; 
     40; @param a16 {in}{required} 
     41; 
     42; @param a17 {in}{required} 
     43; 
     44; @param a18 {in}{required} 
     45; 
     46; @param a19 {in}{required} 
     47; 
     48; @param a20 {in}{required} 
     49; 
     50; @param CAS 1 {in}{required} 
     51;        table_of_pointer: It is a table of pointers, where each  
     52;        element point on a table to stick 
     53;        
     54;        For exemple, in a program, we want to stick n table ones with others. 
    2355; 
    2456;          tab=ptrarr(n,/allocate_heap) 
     
    2860;          res=colle(tab,1) 
    2961; 
    30 ;        CAS 2: 
    31 ;        on donne directement les tableaux a coller 
    32 ;        rq: ds ce cas on peut au plus donner 20 tableaux en entree. 
     62; @param CAS 2 {in}{required} 
     63;        we directly give tables to stick 
     64;        Comment: In this case, the plus we can give is 20 tables. 
    3365; 
    34 ;        ATTENTION : sans le mot cle /SAUVE les arguments en entree 
    35 ;        sont detruits lorsque l''on construit res. ds le cas 1 on 
    36 ;        detruit le tableau de pointeurs et les variables sur 
    37 ;        lesquelles on pointe. 
     66;        BEWARE: whitout the keyword /SAUVE entry arguments are  
     67;                delete when, we build res. In the first case,we  
     68;                delete the table of pointers and variables on which we point. 
    3869; 
    39 ;        direc: la direction suivant laquelle les coller, 1,2,3...  
     70; @param direc {in}{required} The direction on which stick them, 1,2,3...  
    4071; 
    41 ; KEYWORD PARAMETERS: 
    42 ; 
    43 ;         /SAUVE: mot cle qui force a sauvegarder le tableau de 
     72; @keyword SAUVE mot cle qui force a sauvegarder le tableau de 
    4473;         pointeur et les tableaux a coller. 
    4574; 
    46 ; OUTPUTS:res=matrice resultat 
     75; @returns res=matrice resultat 
    4776; 
    48 ; RESTRICTIONS: 
    49 ; 
    50 ; EXAMPLE: 
    51 ;  
    52 ;         IDL> print, colle(replicate(1,2,2,2),indgen(2,2,2),2)    
     77; @examples IDL> print, colle(replicate(1,2,2,2),indgen(2,2,2),2)    
    5378;                1       1 
    5479;                1       1 
     
    6186;                6       7 
    6287; 
    63 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     88; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    6489;                       13/1/98 
     90; 
     91; @version $Id$ 
     92; 
    6593;- 
    66 ;------------------------------------------------------------ 
    67 ;------------------------------------------------------------ 
    68 ;------------------------------------------------------------ 
    69 ; pour suprimer une variable. 
    70 ;------------------------------------------------------------ 
    71    PRO UNDEFINE, varname   
    72 ; 
    73   compile_opt idl2, strictarrsubs 
    74 ; 
    75       tempvar = SIZE(TEMPORARY(varname)) 
    76    END 
    77 ;------------------------------------------------------------ 
    78 ;------------------------------------------------------------ 
    7994FUNCTION colle, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, SAUVE = sauve 
    8095; 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/get_extra.pro

    r114 r133  
     1;+ 
     2; @todo seb 
     3;- 
     4; 
    15; elle fait quoi ? 
    26 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/oups.pro

    r11 r133  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    5 ; NAME:oups 
    62; 
    7 ; PURPOSE: Sorte de UNDO: 
    8 ; permet de refaire toute la serie de dessin depuis 
    9 ; l''ouverture de la derniere fenetre sans reexecuter la derniere 
    10 ; commande. cf. je fais un dessin avec 10 plt dessus au 10 eme je me 
    11 ; plante, un coup de @oups et je peux refaire mon plt rate! 
     3; @file_comments  
     4;       Kind of UNDO: 
     5;         Allows to redo all the chain of drawing since the opening of the last window without  
     6;         reexecute the last order Example: I do a drawing with 10 plot over it, if I make a  
     7;         mistake, I execute this program and i can redo the only plot missed. 
    128; 
    13 ; CATEGORY: pour faciliter les dessins 
     9; @categories utilities 
    1410; 
    15 ; CALLING SEQUENCE: @oups 
     11; @restrictions compatible with @ps @vzoom text_box... 
    1612; 
    17 ; SIDE EFFECTS: compatible avec @ps @vzoom text_box... 
     13; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    1814; 
    19 ; RESTRICTIONS: 
    2015; 
    21 ; EXAMPLE: 
     16; @version $Id$ 
    2217; 
    23 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     18; @todo seb 
    2419; 
    2520;- 
    2621;------------------------------------------------------------ 
    27 ;------------------------------------------------------------ 
    28 ;------------------------------------------------------------ 
    29 ;------------------------------------------------------------ 
    30 ; il faut fermer le journal! 
     22; Close the journal! 
    3123;------------------------------------------------------------ 
    3224 journal 
    33 ; on recupere le journal sous la forme d''un vecteur de string: 
     25; we recuperate the journal as a vector of string: 
    3426   vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    35 ; on coupe la derniere ligne qui est oups 
     27; we cut the last line which is oups 
    3628   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
    3729;------------------------------------------------------------ 
    38 ; on le corrige si besoin est... 
     30; we correct it if there is the need... 
    3931;------------------------------------------------------------ 
    4032for i = 0, n_elements(vectjournal)-1 do $ 
    4133 if strpos(vectjournal[i],'text_box' ) EQ -1 then $ 
    4234 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2) 
    43 ;2 lignes sont identiques ?? 
     35;2 line are identical ?? 
    4436for i = 0, n_elements(vectjournal)-2 do $ 
    4537 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' ' 
     
    6254 
    6355; 
    64 ; on vire la derniere ligne pour tout reexecuter sauf la derniere commande 
     56; we erase the last line to reexecute all the programm but the last order. 
    6557; 
    6658 IF strpos(vectjournal[n_elements(vectjournal)-1],';,pos=[' ) NE -1 then $ 
    6759 vectjournal[n_elements(vectjournal)-2] = '' $ 
    6860 ELSE vectjournal[n_elements(vectjournal)-1] = ''  
    69 ; on reecrit idlsave.pro 
     61; we rewrite idlsave.pro 
    7062putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    71 ; on compile puis applique idlsave 
     63; we compile, then we apply idlsave 
    7264cd,  current = curdir 
    7365cd, myuniquetmpdir 
    7466@idlsave    
    7567cd, curdir 
    76 ; le journal vient d'etre reouvert, et on y met les elements de 
    77 ; vectjournal  
     68; the journal has just been reopened, and we put elements of vectjournal in it.  
    7869for i = 0, n_elements(vectjournal)-1 DO $ 
    7970journal, vectjournal[i] 
  • trunk/SRC/ToBeReviewed/UTILITAIRE/vzoom.pro

    r11 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:vraizoom 
    65; 
    7 ; PURPOSE:fait un vari zoom dans un plot, contrairement a la fonction 
    8 ; ZOOM  preecrite par IDL qui ne fait que grossir les pixels 
     6; @file_comments  
     7; Make a real zoom in a plot, contrarly at the function  
     8; ZOOM prewritten by IDL which just get pixels bigger. 
    99; 
    10 ; CATEGORY:petit outil 
     10; @categories utilities 
    1111; 
    12 ; CALLING SEQUENCE:@vzoom 
     12; @restrictions use the journal. 
     13; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     14;          29/4/1999 
    1315; 
    14 ; SIDE EFFECTS:utilise le journal.  
     16; @version $Id$  
    1517; 
    16 ; RESTRICTIONS: 
     18; @todo seb 
    1719; 
    18 ; EXAMPLE: 
    19 ; 
    20 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    21 ;                       29/4/1999 
    2220;- 
    2321;------------------------------------------------------------ 
     
    3129   y = y[sort(y)] 
    3230   domdef, [x, y, vert1, vert2] 
    33 ; il faut fermer le journal! 
     31; we must close the journal! 
    3432   journal 
    35 ; on recupere le journal sous la forme d''un vecteur de string: 
     33; we recuperate the journal as a vector of string: 
    3634   vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    37 ; on coupe la derniere ligne qui est vraizoom 
     35; we cut the last line which is vraizoom 
    3836   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
    3937;------------------------------------------------------------ 
    40 ; on le corrige si besoin est... 
     38; we correct it if there is the need to... 
    4139;------------------------------------------------------------ 
    4240for i = 0, n_elements(vectjournal)-1 do $ 
    4341 if strpos(vectjournal[i],'text_box' ) EQ -1 then $ 
    4442 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2) 
    45 ;2 lignes sont identiques ?? 
     43;2 line are identical ?? 
    4644for i = 0, n_elements(vectjournal)-2 do $ 
    4745 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' ' 
     
    6563 
    6664; 
    67 ; on reecrit idlsave.pro 
     65; we rewrite idlsave.pro 
    6866putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    69 ; applique idlsave 
     67; apply idlsave 
    7068   cd,  current = curdir 
    7169   cd, myuniquetmpdir 
    7270@idlsave    
    7371   cd, curdir 
    74 ; le journal vient d'etre reouvert, et on y met les elements de 
    75 ; vectjournal  
     72; the journal has just been reopened, and we put in elements of vectjournal.  
    7673for i = 0, n_elements(vectjournal)-1 DO $ 
    7774journal, vectjournal[i] 
  • trunk/SRC/Utilities/fitintobox.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:fitintobox 
    6 ; 
    7 ; PURPOSE: check that the input array has size and dimensions 
     5; 
     6; @file_comments  
     7; Check that the input array has size and dimensions 
    88; compatible with the domain that was defined with the previous call 
    99; of domdef. 
    1010; 
    11 ; CATEGORY: domain compatibility 
    12 ; 
    13 ; CALLING SEQUENCE:  
    14 ;     res = fitintobox(field[, nx, ny, nz, firstx, firsty, firstz  
    15 ;                                        ,  lastx,  lasty,  lastz]) 
    16 ;  
    17 ; INPUTS: 
    18 ;     field: an array or a structure that can be read by the function 
    19 ;     litchamp.pro 
    20 ;  
    21 ;     nx, ny, nz, firstx, firsty, firstz,  lastx,  lasty,  lastz: 
    22 ;     optional parameters. If not given they will be define with a 
    23 ;     call to the procedure grille.pro 
    24 ;      
    25 ; KEYWORD PARAMETERS: none 
    26 ; 
    27 ; OUTPUTS: an array with dimensions matching the domain 
    28 ;          or -1 if there is an error... 
    29 ; 
    30 ; COMMON BLOCKS: cm_4mesh and cm_4cal 
    31 ; 
    32 ; SIDE EFFECTS: 
    33 ; 
    34 ; RESTRICTIONS: 
    35 ; 
    36 ; EXAMPLE: 
    37 ; 
    38 ;   IDL> help, fitintobox(findgen(jpi,jpj)) 
    39 ;   <Expression>    FLOAT     = Array[41, 3] 
    40 ;   IDL> help, fitintobox(findgen(jpi,jpj,78)) 
    41 ;   Error:  
    42 ;   the array dimensions [180,148,78] are incompatible 
    43 ;   with the the domain dimensions  
    44 ;   [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/41, 148/3, 31/31, 1] 
    45 ;   <Expression>    INT       =       -1 
    46 ; 
    47 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    48 ;                     10 juin 2000. 
    49 ; June 2005: S. Masson rewrite all. 
     11; @categories domain compatibility 
     12;  
     13; @param sz {in}{required}  
     14;  
     15; @param nx {in}{required} 
     16; 
     17; @param ny {in}{required} 
     18; 
     19; @param nz {in}{required} 
     20; 
     21; @param jpi {in}{required} 
     22; 
     23; @param jpj {in}{required} 
     24; 
     25; @param jpk {in}{required} 
     26;  
     27; @param jpt {in}{required} 
     28; 
     29; @returns -1 
     30; 
     31; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     32;          10 juin 2000. 
     33;          June 2005: S. Masson rewrite all. 
     34; 
     35; @version $Id$ 
     36; 
     37; @hidden 
     38; 
    5039;- 
    5140;------------------------------------------------------------ 
     
    6756  RETURN, report(['Error: ' $ 
    6857                  , 'the array dimensions ' + tostr(sz) + ' are incompatible' $ 
    69                   , 'with the the domain dimensions ' $ 
     58                  , 'with the the domain dimensions ' $                 
    7059                  , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ 
    7160                  + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ 
     
    7463                  + ', ' + strtrim(jpt, 1) + ']'], /simple) 
    7564END 
     65; 
     66;+ 
     67; 
     68; @categories domain compatibility 
     69; 
     70; @param field {in}{required} an array or a structure that can be read by the function                 
     71;     litchamp.pro 
     72;  
     73; @param nx {in}{optional}{default=define by grille.pro} 
     74; 
     75; @param ny {in}{optional}{default=define by grille.pro} 
     76; 
     77; @param nz {in}{optional}{default=define by grille.pro} 
     78; 
     79; @param firstx {in}{optional}{default=define by grille.pro} 
     80; 
     81; @param firsty {in}{optional}{default=define by grille.pro} 
     82; 
     83; @param firstz {in}{optional}{default=define by grille.pro} 
     84; 
     85; @param lastx {in}{optional}{default=define by grille.pro} 
     86; 
     87; @param lasty {in}{optional}{default=define by grille.pro} 
     88; 
     89; @param lastz {in}{optional}{default=define by grille.pro} 
     90; 
     91; @keyword WDEPTH To specify that we are at W level 
     92; 
     93; @returns an array with dimensions matching the domain 
     94;          or -1 if there is an error... 
     95; 
     96; @uses cm_4mesh 
     97; @uses cm_4cal 
     98; 
     99; @examples IDL> help, fitintobox(findgen(jpi,jpj)) 
     100;           <Expression>    FLOAT     = Array[41, 3] 
     101;           IDL> help, fitintobox(findgen(jpi,jpj,78)) 
     102;        Error:  
     103;           the array dimensions [180,148,78] are incompatible 
     104;           with the the domain dimensions  
     105;           [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/41, 148/3, 31/31, 1] 
     106;           <Expression>    INT       =       -1 
     107; 
     108; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     109;          10 juin 2000. 
     110;          June 2005: S. Masson rewrite all. 
     111; 
     112; @version $Id$ 
     113;- 
    76114;------------------------------------------------------------ 
    77115FUNCTION fitintobox, field, nx, ny, nz, firstx, firsty $ 
  • trunk/SRC/Utilities/linearequation.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: linearequation 
    65; 
    7 ; PURPOSE:calcule une equation de droite du type ax+by+c=0 a partir 
    8 ; des coordonnees de 2 points. Rq: on peut avoir un tableau de couple 
    9 ; de points. 
     6; @file_comments  
     7; Calculate a linear equation of the type ax+by+c=0 
     8; thanks to coordinates of 2 points. 
     9; comment: we can have a table with pairs of points. 
    1010; 
    11 ; CATEGORY:petit truc qui peut etre utile (sans boucles, ca va de soit!) 
     11; @categories utilities 
     12;  
     13; @param point1 {in}{required} This is the first point of(the) straight  
     14; line(s) whose we want to calculate equation(s) 
    1215; 
    13 ; CALLING SEQUENCE:abc=linearequation(point1, point2) 
    14 ;  
    15 ; INPUTS: point1 et point2 dont deux point de(s) la droite(s) dont on 
    16 ; veut calculer l(es) equations(s). 
    17 ; deux possibilites sont possibles: 
    18 ;      1) point est un complexe ou un tableau de complexes, ou chaque 
    19 ;      element du complexe est les coordonnees du point 
    20 ;      2) points est un tableau de reels de dimensions 2 
    21 ;      ,nbre_de_droite. ou pour chaque ligne du tableau on a les 
    22 ;      coordonnees du point. 
     16; @param point2 {in}{required} This is the second point of(the) straight  
     17; line(s) whose we want to calculate equation(s) 
    2318; 
    24 ; KEYWORD PARAMETERS: 
     19;    There is 2 possibilities: 
     20;      1) point is a complex or a table ofcomplex, where each element is the coordinates of the point. 
     21;      2) point is a table of real of dimension 2,number_of_straight_line. 
     22;         For each row of the table, we have coordinates of the point. 
    2523; 
    26 ; OUTPUTS:abc c''est un tableau de dimensions 3, nbre_de_droite, ou 
    27 ; pour chaque ligne du tableau on obtient les 3 parametres a, b, c de 
    28 ; l'equation de la droite ax+by+c=0 
     24; @returns abc is a table of dimension 3, number_of_straight_line,  
     25;          where for each lign of the table we obtain the 3 parameters 
     26;          a, b and c of the linear equation ax+by+c=0 
    2927; 
    30 ; COMMON BLOCKS: 
     28; @examples IDL> abc=linearequation(complex(1,2),[3,4]) 
     29;           IDL> print, abc[0]*1+abc[1]*2+abc[2] 
     30;           0.00000 
    3131; 
    32 ; SIDE EFFECTS: 
     32; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     33;          10 juin 2000 
    3334; 
    34 ; RESTRICTIONS: 
     35; @version $Id$ 
    3536; 
    36 ; EXAMPLE: 
    37 ;    IDL> abc=linearequation(complex(1,2),[3,4]) 
    38 ;    IDL> print, abc[0]*1+abc[1]*2+abc[2] 
    39 ;          0.00000 
    40 ; 
    41 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    42 ;                       10 juin 2000 
    4337;- 
    4438;------------------------------------------------------------ 
  • trunk/SRC/Utilities/lineintersection.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: lineintersection 
    65; 
    7 ; PURPOSE: Calcule les coordonnees de l''intersection de 2 droites ou 
    8 ; d''une serie de 2 droites 
     6; @file_comments  
     7; Calculate coordinates of the intersection between 2 straight lines  
     8; or of a succession of 2 straight lines. 
    99; 
    10 ; CATEGORY:petit truc qui peut etre utile (sans boucles, ca va de soit!) 
     10; @categories utilities 
     11;  
     12; @param abc1 {in}{required} is the first table of dimension 3, number_of_pairs_of_straight_lines,  
     13;         whose each line contain the 3 parameters a,b and c of the first linear  
     14;         equation of the type ax+by+c=0 
    1115; 
    12 ; CALLING SEQUENCE: point=lineintersection(abc1, abc2) 
    13 ;  
    14 ; INPUTS: abc est un tableau de dimensions 3, 
    15 ; nbre_de_couple_de_droites, dont chaque ligne contient les 3 
    16 ; parametres a, b, c de l''equation de droite du type ax+by+c=0 
     16; @param abc2 {in}{required} is second table of dimension 3, number_of_pairs_of_straight_lines,  
     17;         whose each line contain the 3 parameters a,b and c of the second linear  
     18;         equation of the type ax+by+c=0 
    1719; 
    18 ; KEYWORD PARAMETERS: 
    19 ;       /FLOAT: pour retourner l''output sous forme de tableau de 
    20 ;       reel plutot que de vecteur decomplexes (par defaut) 
     20; @keyword FLOAT To return the output as a table of real numbers instead of vectors of complex (by default) 
    2121; 
    22 ; OUTPUTS:2 possibilites: 
    23 ;      1) par defaut: c''est une vecteur de complexe dont chaque 
    24 ;      element est les coordonnees du point d''intersection d''un 
    25 ;      couple de droites. 
    26 ;      2) si /FLOAT est active, c'est un tableau de reels de 
    27 ;      dimensiones 2, nbre_de_couple_de_droites dont chaque 
    28 ;      ligne est les coordonnees du point d''intersection d''un 
    29 ;      couple de droites 
     22; @returns 2 possibilities: 
     23;      1) by default: it is a vector of complex whose each element is the coordinates  
     24;                     of the intersection point of a pair of straight lines. 
     25;      2) if FLOAT is activated, it is a table of reals of dimension 2,  
     26;         number_of_pairs_of_straight_lines whose each row is the coordinates  
     27;         of the intersection point of a pair of straight line. 
    3028; 
    31 ; COMMON BLOCKS: 
     29; @restrictions If the 2 straight line are parallel, we return coordinates (!values.f_nan,!values.f_nan) 
    3230; 
    33 ; SIDE EFFECTS:si les deux droites dont paralleles, on retourne les 
    34 ; coordonnes (!values.f_nan,!values.f_nan) 
     31; @restrictions Beware of the precision of the machine which make  
     32;               that calculated coordinates may not exactly verify  
     33;               equations of the pair of straight lines. 
    3534; 
    36 ; RESTRICTIONS:attention a la precision de la machine qui fait que 
    37 ; les coordonnees calcules de verifient peut-etre pas exactement les 
    38 ; equations du couple de droites. 
     35; @examples IDL> abc1=linearequation(complex(1,2),[3,4]) 
     36;           IDL> abc2=linearequation(complex(1,2),[8,15]) 
     37;           IDL> print, lineintersection(abc1, abc2) 
     38;           (      1.00000,      2.00000) 
     39;           IDL> print, lineintersection(abc1, abc2,/float) 
     40;                 1.00000      2.00000 
    3941; 
    40 ; EXAMPLE: 
    41 ;     IDL> abc1=linearequation(complex(1,2),[3,4]) 
    42 ;     IDL> abc2=linearequation(complex(1,2),[8,15]) 
    43 ;     IDL> print, lineintersection(abc1, abc2) 
    44 ;     (      1.00000,      2.00000) 
    45 ;     IDL> print, lineintersection(abc1, abc2,/float) 
    46 ;           1.00000      2.00000 
     42; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
     43;          10 juin 2000 
    4744; 
    48 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    49 ;                      10 juin 2000 
     45; @version $Id$ 
     46; 
    5047;- 
    5148;------------------------------------------------------------ 
  • trunk/SRC/Utilities/pwd.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:pwd 
    65; 
    7 ; PURPOSE:print the current directory 
     6; @file_comments  
     7; print the current directory 
    88; 
    9 ; CATEGORY:like unix function 
     9; @categories like unix function 
     10;  
     11; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    1012; 
    11 ; CALLING SEQUENCE:pwd 
    12 ;  
    13 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     13; @version $Id$ 
    1414; 
    1515;- 
  • trunk/SRC/Utilities/report.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:report 
    65; 
    7 ; PURPOSE: comme dialog_message.pro si il y a deja des widgets actives 
    8 ; ou comme message.pro si il n''y a pas de widgets actives. pour poser 
    9 ; des question dont la reponse n''est pas oui/non utiliser xquestion 
     6; @file_comments  
     7; Like dialog_message.pro if there is already some widget  
     8; active or like message.pro if there is not any widget active.  
     9; To ask a question whose answer is not yes/no,use xquestion. 
    1010; 
    11 ; CATEGORY: 
    12 ; 
    13 ; CALLING SEQUENCE:res = report(text) 
    14 ;  
    15 ; INPUTS: text: un string on un vecteur de string. Si le string ne 
     11; @param text {in}{required} un string on un vecteur de string. Si le string ne 
    1612; comporte qu''un element, on cherche les eventuels characteres de 
    1713; retour a la ligne: '!C'. If text is set to an array of strings, each 
    1814; array element is displayed as a separate line of text. 
    1915; 
    20 ; KEYWORD PARAMETERS:  
    21 ;         SIMPLE: activate to print only the message without the name 
     16; @keyword SIMPLE activate to print only the message without the name 
    2217;             and the line of the routine (defined by calling routine_name) 
    2318; 
    24 ; ceux dialog_message.pro et message.pro avec en + 
    25 ; PARENT qui fait la meme chose que DIALOG_PARENT de dialog_message.pro 
     19; @keyword _extra used to pass keywords from dialog_message.pro and message.pro 
    2620; 
    27 ; OUTPUTS: -1 si le mot cle QUESTION n''est pas activer 
    28 ;          si le mot cle est active la fonction retourne 1 pour yes et 
    29 ;          0 pour no. 
     21; @keyword PARENT same as DIALOG_PARENT de dialog_message.pro 
    3022; 
    31 ; COMMON BLOCKS: 
     23; @keyword QUESTION Set this keyword to create a "Question" dialog. 
     24;                   The default dialog type is "Warning" 
    3225; 
    33 ; SIDE EFFECTS: 
     26; @keyword DEFAULT_NO Set this keyword to make the "No" button the default  
     27;                     selection for "Question" dialog. Normally, the default is yes. 
    3428; 
    35 ; RESTRICTIONS: 
     29; @keyword SIMPLE Activate to print the error message without printing  
     30;                 the routine name with its full path. 
    3631; 
    37 ; EXAMPLE: 
     32; @returns -1 if the keyword QUESTION is not activated 
     33;          If the keyword is activated, return 1 for yes and 0 for no. 
    3834;  
    39 ; si aucun widget n''est active: 
     35; @example If there is not any widget activated: 
    4036; 
    4137;     IDL> help, report('toto tata') 
    4238;     % $MAIN$: toto tata 
    4339;     <Expression>    INT       =       -1 
    44 ;     IDL> help, report('ca marche ?',/question) 
    45 ;     ca marche ? y/n (default answer is y) 
     40;     IDL> help, report('does it works ?',/question) 
     41;     does it works ? y/n (default answer is y) 
    4642;     <Expression>    BYTE      =    1 
    47 ;     IDL> help, report('question1: !C ca marche ?',/question) 
     43;     IDL> help, report('question1: !C does it works ?',/question) 
    4844;     question1: 
    49 ;     ca marche ? y/n (default answer is y) 
     45;     does it works ? y/n (default answer is y) 
    5046;     <Expression>    BYTE      =    1 
    5147; 
    52 ; si des widgets sont deja actives, c''est la meme chose mais avec des 
    53 ; widgets! 
     48; If widgets are already activated, it is the same thing but with widgets! 
    5449; 
    55 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     50; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    5651;                      21/10/1999 
     52; 
     53; @version $ID$ 
     54; 
    5755;- 
    5856;------------------------------------------------------------ 
     
    6361  compile_opt idl2, strictarrsubs 
    6462; 
    65    res = -1                     ; 
    66 ; on separe le texte en differentes lignes (separees par !C) si ce 
    67 ; n''est pas deja fait... 
     63  res = -1                      ; 
     64; we separate the text in different lines (separated by !C) if it is not already done... 
    6865   if n_elements(text) EQ 1 then text = str_sep(text, '!C', /trim) 
    69 ; il y a des widgets actifs, c''est facile on appelle dialog_massage 
     66; there is some widgets activated, it is easy, we call dialog_massage 
    7067   if (widget_info(/managed))[0] NE 0 then BEGIN 
    7168      res = dialog_message(text, dialog_parent = parent, QUESTION = question $ 
     
    7370      if keyword_set(question) THEN res = res EQ 'Yes' ELSE res = -1 
    7471   ENDIF ELSE BEGIN 
    75 ; aucun widget n''est actif 
    76 ; on pose une question ? 
     72; there is not any widget activated 
     73; do we ask a question ? 
    7774      if keyword_set(question) then BEGIN 
    78 ; quelle est la reponse par defaut ? 
     75; what i sthe answer by default ? 
    7976         if keyword_set(default_no) then answer = 'n' ELSE answer = 'y' 
    8077         default_answer = answer 
     
    8380         read, text[n_elements(text)-1]+' y/n (default answer is '+default_answer+')' , answer 
    8481         answer = strlowcase(answer) ; 
    85 ; si la reponse ne convient pas 
     82; if the answer is not appropriated 
    8683         while answer NE '' and answer NE 'y' and answer NE 'n' do begin 
    8784            read, text[n_elements(text)-1]+' y/n (default answer is '+default_answer+')' , answer 
    8885            answer = strlowcase(answer) 
    8986         ENDWHILE               ; 
    90 ; on ajuste res en fonction de la reponse 
     87; we adjust res in function of th answer 
    9188         case answer of 
    9289            '':res = default_answer EQ 'y' 
     
    9592         endcase 
    9693      endif ELSE BEGIN 
    97 ; si on ne pose pas de question on fait juste un print 
     94; If we do not ask any question, we just make a print 
    9895        IF keyword_set(simple) THEN prefix = '' ELSE prefix = '% '+routine_name(1)+': ' 
    9996         if n_elements(text) GT 1 THEN $ 
  • trunk/SRC/Utilities/routine_name.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:routine_name,remonte 
    65; 
    7 ; PURPOSE:retourne le nom de la routine (procedure ou function) ds 
    8 ; lequel on se trouve 
     6; @file_comments  
     7; Give us the name of the routine (procedure or function) where we are. 
    98; 
    10 ; CATEGORY:utilitaire 
     9; @categories utilities 
     10;  
     11; @param pilingnum {in}{optional} A whole number which give us how many level we have to reascend  
     12;                in the piling up of routines and subroutines to find the looked for routine. 
    1113; 
    12 ; CALLING SEQUENCE:res=routine_name([remonte]) 
    13 ;  
    14 ; INPUTS: remonte: un entier qui donne de combien de niveau on doit 
    15 ; remonter ds l''empillement des routines ewt sous-routines pour 
    16 ; retrouver le nom de la routine cherchee 
    1714; 
    18 ; KEYWORD PARAMETERS: 
     15; @returns a string giving either the full name of the routine (with the path) or '$MAIN$' 
    1916; 
    20 ; OUTPUTS:un string donnant soit le nom de la routine en entier (avec 
    21 ; le path) soit '$MAIN$' 
     17; @restriction This function use the keyword OUTPUT in help.pro and it is specified  
     18;              in the online help that the return syntax of this word can change in  
     19;              function of the version of the code. This version works with IDL 5.2. 
    2220; 
    23 ; COMMON BLOCKS: 
    24 ; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ; RESTRICTIONS: 
    28 ;   cette fonction utilise le mot cle OUTPUT ds help.pro et il est 
    29 ;   specifie ds l''aide en ligne que la syntaxe du retour de ce mot cle 
    30 ;   peut changer suivant la version du code. Cette version marche avec 
    31 ;   IDL 5.2 
    32 ; 
    33 ; EXAMPLE: 
    34 ; 
    35 ;  IDL> print, routine_name() 
     21; @example IDL> print, routine_name() 
    3622;  /usr1/com/smasson/IDL_RD/UTILITAIRE/report.pro 
    3723;  IDL> print, routine_name(1) 
     
    4430;  $MAIN$ 
    4531; 
    46 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     32; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    4733;                      21/10/1999 
     34; 
     35; @version $Id$ 
     36; 
    4837;- 
    4938;------------------------------------------------------------ 
    5039;------------------------------------------------------------ 
    5140;------------------------------------------------------------ 
    52 FUNCTION routine_name,  remonte 
     41FUNCTION routine_name,  pilingnum 
    5342; 
    5443; 
     
    5645; 
    5746  help,  /traceback, output = name 
    58   name = strtrim(name, 1)     ; on enleve les blancs en debut de ligne 
    59 ; on va mettre les elements du vecteur bout a bout pour former un 
    60 ; unique sring 
     47  name = strtrim(name, 1)       ; we remove blanks at the beginning of lines and  
     48;                               we put elements of the vector stuck ones with  
     49;                               each others to make an unique string. 
    6150  allnames = '' 
    6251  for i = 0, n_elements(name)-1 do allnames = allnames+name[i] 
    6352; 
    64   name = str_sep(allnames, '%') ; on le redecoupe  
    65   name = strtrim(name, 2)     ; on eleve les blancs devant et derriere 
    66   name = strcompress(name)      ; on compresse les blancs 
    67 ; on ne retient pas les 2 premiers elements qui sont 1  un vide et la 
    68 ; ligne concernant routine_name  
     53  name = str_sep(allnames, '%') ; we cut it out again.  
     54  name = strtrim(name, 2)     ; we remouve blanks in front of and behind 
     55  name = strcompress(name)      ; we compress blanks 
     56; we do not hold back the two first elements who are a blanck  and the line concerning  
     57; routine_name.  
    6958  name = name[2: n_elements(name)-1] 
    70 ; on choisit la ligne qui nous concerne 
    71   if NOT keyword_set(remonte) then remonte = 0 
    72   if remonte GE n_elements(name) then return,  '$MAIN$' 
    73   name = name[remonte] 
     59; we choose the line which concern us. 
     60  if NOT keyword_set(pilingnum) then pilingnum = 0 
     61  if pilingnum GE n_elements(name) then return,  '$MAIN$' 
     62  name = name[pilingnum] 
    7463  if strpos(name, '$MAIN$') NE -1 then return,  '$MAIN$' 
    7564  name = str_sep(name, ' ') 
  • trunk/SRC/Utilities/testvar.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:testvar 
    65; 
    7 ; PURPOSE:une sorte de keyword_set mais qd la valeur existe renvoie 
    8 ; celle-ci 
     6; @file_comments  
     7; A  kind of keyword_set but when the value exist, it send it back 
    98; 
    10 ; CATEGORY:comme keyword_set 
     9; @categories utlities 
    1110; 
    12 ; CALLING SEQUENCE:res=testvar(var=variable) 
    13 ;  
    14 ; INPUTS:rien 
     11; @keyword var any kind of 
    1512; 
    16 ; KEYWORD PARAMETERS:var : n''importe quoi 
     13; @returns 0 if the variable does not exist  
    1714; 
    18 ; OUTPUTS:0 si la variable n''existe pas  
    19 ; 
    20 ; COMMON BLOCKS: 
    21 ; 
    22 ; SIDE EFFECTS: 
    23 ; 
    24 ; RESTRICTIONS: 
    25 ; 
    26 ; EXAMPLE: 
    27 ; 
    28 ;    IDL> print, testvar(var=toto) 
     15; @examples IDL> print, testvar(var=toto) 
    2916;           0 
    3017;    IDL> print, testvar(var='toto') 
    3118;    toto 
    3219; 
    33 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     20; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3421;                      14/12/1999 
     22; 
     23; @version $Id$ 
     24; 
    3525;- 
    3626;------------------------------------------------------------ 
  • trunk/SRC/Utilities/text_box.pro

    r132 r133  
    11;+ 
    2 ; Name        : text_box 
    32; 
    4 ; Purpose     : Writes a text message within a box in a graphics window. 
     3; @file_comments  
     4; This procedure writes a short text message within a box-shaped 
     5; area in a graphics window.  The message may be split at word 
     6; boundaries into several lines, and the character size and 
     7 ;orientation may be adjusted for the text to fit within the box. 
     8;    
     9; @param TEXT {in}{required} ASCII text string containing the message. 
    510; 
    6 ; Description:  This procedure writes a short text message within a box-shaped 
    7 ;               area in a graphics window.  The message may be split at word 
    8 ;               boundaries into several lines, and the character size and 
    9 ;               orientation may be adjusted for the text to fit within the box. 
    10 ; 
    11 ; Useage:       text_box,text,pos=pos,color=color,$ 
    12 ;                    justify=justify,vert_space=vert_space 
    13 ; 
    14 ; Inputs       
    15 ; TEXT          ASCII text string containing the message. 
    16 ; 
    17 ; keywords 
    18 ;  pos          4 element vector specifying the box position and size 
     11; @keyword pos  4 element vector specifying the box position and size 
    1912;               pos[0],pos[1] specify the lower left corner coordinate 
    2013;               pos[2],pos[3] specify the upper right corner coordinate 
    2114;               data window normalized coordinates are use 
    2215; 
    23 ;   fg_color    color of box and legend titles (default=0) 
     16; @keyword fg_color color of box and legend titles (default=0) 
    2417; 
    25 ;   bg_color    background color. Setting BG_COLOR erases the area  
     18; @keyword bg_color background color. Setting BG_COLOR erases the area  
    2619;               covered by the text box (filling it with color BG_COLOR) 
    2720;               prior to writing the text.  If both BG_COLOR and !p.color 
     
    2922;               gaurantee a readability. 
    3023;                
    31 ;  right        if set, right justify text 
    32 ;  center       if set, center the text 
     24; @keyword right if set, right justify text 
    3325; 
    34 ;  vert_space   vertical spacing of lines in units of character height  
    35 ;               (default = 1.5) 
     26; @keyword center if set, center the text 
    3627; 
     28; @keyword vert_space {default=1.5}vertical spacing of lines in units of character height 
    3729; 
    38 ;  author:  Paul Ricchiazzi                            7Jul93 
     30; @keyword _EXTRA used to pass your keyword 
     31; 
     32; @keyword box activate to show the box on graphics window. 
     33; 
     34; @history  Paul Ricchiazzi                            7Jul93 
    3935;           Institute for Computational Earth System Science 
    4036;           University of California, Santa Barbara 
     37; 
     38; @version $Id$ 
     39; 
    4140;- 
    4241PRO text_box,text,pos=pos,fg_color=fg_color,bg_color=bg_color,$ 
  • trunk/SRC/Utilities/undefine.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: undefine 
    65; 
    7 ; PURPOSE: effacer une variable 
    8 ;           meme chose que delvar mais utiulisable ds un programme et 
    9 ;           utilisable que pour une variable a la fois 
     6; @file_comments  
     7; erase a variable 
     8; same thing that delvar but usable in a program and usable  
     9; for one variable simultaneously 
    1010; 
    11 ; CATEGORY:  
     11; @categories utilities   
     12;  
     13; @param varname {in}{required} The name of the variable we want erase 
    1214; 
    13 ; CALLING SEQUENCE: UNDEFINE, varname   
    14 ;  
    15 ; INPUTS: varname: la variable a detruire 
     15; @example IDL> a=1 
     16;          IDL> undefine,a 
     17;          % Compiled module: UNDEFINE. 
     18;          IDL> help, a 
     19;          A               UNDEFINED = <Undefined> 
    1620; 
    17 ; EXAMPLE: 
    18 ; 
    19 ;    IDL> a=1 
    20 ;    IDL> undefine,a 
    21 ;    % Compiled module: UNDEFINE. 
    22 ;    IDL> help, a 
    23 ;    A               UNDEFINED = <Undefined> 
    24 ; 
    25 ; MODIFICATION HISTORY: trouve sur la page web de D.Fanning  
     21; @history trouve sur la page web de D.Fanning  
    2622; http://www.dfanning.com : 
    2723;QUESTION: How do I make an IDL variable have a type "undefined"?  
  • trunk/SRC/Utilities/xfile.pro

    r132 r133  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: xfile 
    65; 
    7 ; PURPOSE: affiche ds un widget un fichier ASCII. 
    8 ;          c''est la meme chose que xdisplaydife mais ici on l''utilise pour 
    9 ;          visualiser le contenu d''une procedure ou d''une fonction 
    10 ;          meme si elle n''est pas ds le repertoire courant (grace a !path) 
     6; @file_comments  
     7; display in a widget an ASCII file. 
     8; It is the same thing that xdisplaydife but here, we use it  
     9; to display the content of a procedure or of a function,  
     10; even if it is not in the current directory (thanks to the path). 
    1111; 
    12 ; CATEGORY: help 
     12; @categories utilities 
    1313; 
    14 ; CALLING SEQUENCE: xfile,'nom_fichier' 
     14; @param filename {in}{required} It is the name of the procedure or of the function  
     15;                    we want to display (with or without .pro at the end). 
    1516; 
    16 ; INPUTS: 
    17 ;        nom_fichier:le nom d''une procedure ou d''une fonction a 
    18 ;        visualiser avec ou sans le .pro a la fin 
     17; @keyword _extra used to pass your keywords 
    1918; 
    20 ; KEYWORD PARAMETERS:ceux de xdisplayfile 
     19; @examples xfile,'plt' 
    2120; 
    22 ; EXAMPLE:xfile,'plt' 
    23 ; 
    24 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     21; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 
    2522;                       7/1/99 
    2623;                       6/7/1999: compatibilite mac et windows 
     24; 
     25; @version $Id$ 
     26; 
    2727;- 
    2828;------------------------------------------------------------ 
     
    3535pfile = strlowcase(filename) 
    3636; 
    37 ; il faut trouver le nom complet  
     37; we have to find the full name.  
    3838; 
    3939   if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro"  
     
    5757   endrep until res[0] NE '' OR i EQ n_elements(pfile)  
    5858   if res[0] NE  '' then BEGIN 
    59 ; on ouvre le fichier ds un widget 
     59; we open the file in a widget 
    6060   xdisplayfile, pfile[i-1], _extra = ex 
    6161   ENDIF ELSE ras = report('le fichier demande n''existe pas...') 
  • trunk/SRC/Utilities/xhelp.pro

    r132 r133  
    11;+ 
    2 ; NAME:  
    3 ;       xhelp 
    42; 
    5 ; PURPOSE: 
    6 ;       Display an IDL procedure header using widgets and the widget manager. 
     3; @file_comments  
     4; Display an IDL procedure header using widgets and the widget manager. 
    75; 
    8 ; CATEGORY: 
    9 ;       Widgets. 
     6; @categories Widgets. 
    107; 
    11 ; CALLING SEQUENCE: 
    12 ;       xhelp, Filename,_extra=ex 
    13 ; 
    14 ; INPUTS: 
    15 ;     Filename: A scalar string that contains the filename of the file 
     8; @param Filename {in}{required} A scalar string that contains the filename of the file 
    169;               to display.  If FILENAME does not include a complete path 
    1710;               specification, xhelp will search for the file in 
     
    2013;               ".pro" file suffix will be appended if it is not supplied. 
    2114; 
    22 ; KEYWORD PARAMETERS: 
    23 ;       Ceux de xdisplayfile 
     15; @keyword _extra used to pass your keywords 
    2416; 
    25 ; OUTPUTS: 
    26 ;       No explicit outputs.  A file viewing widget is created. 
     17; @restrictions Triggers the XMANAGER if it is not already in use. 
    2718; 
    28 ; SIDE EFFECTS: 
    29 ;       Triggers the XMANAGER if it is not already in use. 
     19; @examples Open a file and create a widget to display its contents. 
    3020; 
    31 ; RESTRICTIONS: 
    32 ;       None. 
    33 ; 
    34 ; PROCEDURE: 
    35 ;       Open a file and create a widget to display its contents. 
    36 ; 
    37 ; MODIFICATION HISTORY: 
    38 ;       Written By Steve Richards, December 1990 
     21; @history Written By Steve Richards, December 1990 
    3922;       Graceful error recovery, DMS, Feb, 1992. 
    4023;       Modified to extract .pro documentation headers, PJR/ESRG mar94 
    41 ; 
    42 ;  author:  Paul Ricchiazzi                            jun93 
    43 ;           Institute for Computational Earth System Science 
    44 ;           University of California, Santa Barbara 
    45 ; 
     24;       Paul Ricchiazzi                            jun93 
     25;       Institute for Computational Earth System Science 
     26;       University of California, Santa Barbara 
    4627;  7/1/99 : legeres mofification par Sebastien Masson : utilisation de 
    4728;  xdisplayfile, de findfile et de _extra. 
    4829;  6/7/1999: compatibilite mac et windows 
     30; 
     31; @version $Id$ 
     32; 
    4933;- 
    5034PRO xhelp, filename, _extra=ex 
     
    5337; 
    5438 
    55 ; filename est bien un string? 
     39; Are we sure filename is a string? 
    5640   cquoidonc = size(filename, /type) 
    5741   if cquoidonc NE 7 then begin 
     
    5943      return 
    6044   endif 
    61 ; il faut trouver le nom complet  
     45; We have to find the full name  
    6246   pfile=FILENAME 
    6347   if strpos(pfile,".pro") lt 0 then pfile=pfile+".pro"  
     
    7559      pfile = [current, multipath]+ pfile 
    7660   ENDIF 
    77 ; on test tous les noms possibles pour trouver ou est le fichier 
     61; We test each possile name to find where the file is. 
    7862   nfile=n_elements(pfile) 
    7963   n = 0 
     
    8367   endrep until res[0] NE '' OR n EQ n_elements(pfile)  
    8468   if res[0] NE '' then BEGIN 
    85       openr, unit,pfile[n-1], /get_lun ; ouverture du fichier 
    86 ; on selectionne le morceaux en-tete      
     69      openr, unit,pfile[n-1], /get_lun ; opening of the file 
     70; we select the heading piece      
    8771      a = strarr(1000)          ;Maximum # of lines 
    8872      xsize=0 
     
    10488         ras = report('le programme a etait mal ecrit, il n''y a pas d''en-tete... utiliser xfile.pro.') ELSE BEGIN  
    10589         a = a[0:i-1] 
    106 ; on ecrit le contenu de a ds un widget 
     90; we wrote the a's content in a widget 
    10791         xdisplayfile,'toto',text = a,title=pfile[n-1], _extra = ex 
    10892      ENDELSE  
Note: See TracChangeset for help on using the changeset viewer.