Changeset 136
- Timestamp:
- 07/10/06 17:20:19 (18 years ago)
- Location:
- trunk/SRC
- Files:
-
- 76 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Calendar/caldat.pro
r134 r136 2 2 ; 3 3 ; @file_comments 4 ; Return the calendar date and time given julian date.5 ; 4 ; Return the calendar date and time given Julian date. 5 ; This is the inverse of the function JULDAY. 6 6 ; 7 7 ; @categories Calendar 8 8 ; 9 ; 10 ; @param JULIAN {in}{required} contains the Julian Day Number (which begins at noon) of the 11 ; specified calendar date. It should be a long integer. 12 ; 13 ; @param MONTH {out} Number of the desired month (1 = January, ..., 12 = December). 14 ; 15 ; @param DAY {out} Number of day of the month. 16 ; 17 ; @param YEAR {out} Number of the desired year. 18 ; 19 ; @param HOUR {out} Hour of the day 20 ; 21 ; @param Minute {out} Minute of the day 22 ; 23 ; @param Second {out} Second (and fractions) of the day. 24 ; 25 ; 26 ; @keyword NDAYSPM {default=30} for using a calendar with fixed number of days per 27 ; months. 9 ; @param JULIAN {in}{required} 10 ; contains the Julian Day Number (which begins at noon) of the 11 ; specified calendar date. It should be a long integer. 12 ; 13 ; @param MONTH {out} 14 ; Number of the desired month (1 = January, ..., 12 = December). 15 ; 16 ; @param DAY {out} 17 ; Number of day of the month. 18 ; 19 ; @param YEAR {out} 20 ; Number of the desired year. 21 ; 22 ; @param HOUR {out} 23 ; Hour of the day 24 ; 25 ; @param Minute {out} 26 ; Minute of the day 27 ; 28 ; @param Second {out} 29 ; Second (and fractions) of the day. 30 ; 31 ; @keyword NDAYSPM {default=30} 32 ; for using a calendar with fixed number of days per months. 28 33 ; 29 34 ; @uses cm_4cal 30 35 ; 31 ; 32 ; @restrictions Accuracy using IEEE double precision numbers is approximately 33 ; 1/10000th of a second. 34 ; 35 ; @history Translated from "Numerical Recipies in C", by William H. Press, 36 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 37 ; Cambridge University Press, 1988 (second printing). 38 ; 39 ; DMS, July 1992. 40 ; DMS, April 1996, Added HOUR, MINUTE and SECOND keyword 41 ; AB, 7 December 1997, Generalized to handle array input. 42 ; 43 ; Eric Guilyardi, June 1999 44 ; Added key_work ndayspm for fixed number of days per months 45 ; 46 ; AB, 3 January 2000, Make seconds output as DOUBLE in array output. 36 ; @restrictions 37 ; Accuracy using IEEE double precision numbers is approximately 1/10000th of a 38 ; second. 39 ; 40 ; @history 41 ; Translated from "Numerical Recipes in C", by William H. Press, 42 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 43 ; Cambridge University Press, 1988 (second printing). 44 ; 45 ; DMS, July 1992. 46 ; DMS, April 1996, Added HOUR, MINUTE and SECOND keyword 47 ; AB, 7 December 1997, Generalized to handle array input. 48 ; 49 ; Eric Guilyardi, June 1999 50 ; Added key_work ndayspm for fixed number of days per months 51 ; 52 ; AB, 3 January 2000, Make seconds output as DOUBLE in array output. 47 53 ; 48 54 ; @version $Id$ -
trunk/SRC/Calendar/date2jul.pro
r134 r136 5 5 ; 6 6 ; @file_comments 7 ; gives julian day equivalent of a date in yyyymmdd format7 ; gives Julian day equivalent of a date in yyyymmdd format 8 8 ; 9 9 ; @categories calendar 10 10 ; 11 ; @param date {in}{required} date in yyyymmdd format 11 ; @param date {in}{required} 12 ; date in yyyymmdd format 12 13 ; 13 14 ; @keyword GRADS {in}{optional} … … 15 16 ; if 50 <= year <= 99 --> year = 1900 + year 16 17 ; 17 ; @returns date in julian day 18 ; @returns 19 ; date in Julian day 18 20 ; 19 21 ; @examples -
trunk/SRC/Calendar/date2string.pro
r134 r136 9 9 ; @categories calendar, string 10 10 ; 11 ; @param yyyymmdd {in}{required} the date in the format yyyymmdd 11 ; @param yyyymmdd {in}{required} 12 ; the date in the format yyyymmdd 12 13 ; 13 ; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used 14 ; @file_comments 15 ; keyword parameters of string function to specify the format of 16 ; the month (the C format) can be used 14 17 ; 15 ; @keyword _EXTRA used to pass your keywords to the created procedure. 18 ; @keyword _EXTRA 19 ; used to pass your keywords to the created procedure. 16 20 ; 17 ; @returns a string containing the date in a easy readable format 21 ; @returns 22 ; a string containing the date in a easy readable format 18 23 ; 19 24 ; @examples -
trunk/SRC/Calendar/daysinmonth.pro
r134 r136 15 15 ; If not provided, we take month and year from "time" common variable. 16 16 ; 17 ; @returns number of days in a month or -1 in case of error 17 ; @returns 18 ; number of days in a month or -1 in case of error 18 19 ; 19 20 ; @uses cm_4cal … … 23 24 ; 24 25 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 25 ; 26 ; 2/7/98 26 27 ; update/review/english/new commons: June 2005 Sebastien Masson. 27 28 ; -
trunk/SRC/Calendar/jul2date.pro
r134 r136 5 5 ; 6 6 ; @file_comments 7 ; gives yyyymmdd date equivalent of a julian day7 ; gives yyyymmdd date equivalent of a Julian day 8 8 ; 9 9 ; @categories calendar 10 10 ; 11 ; @param jday {in}{required} julian day 11 ; @param jday {in}{required} 12 ; Julian day 12 13 ; 13 ; @returns date in yyyymmdd format 14 ; @returns 15 ; date in yyyymmdd format 14 16 ; 15 17 ; @examples -
trunk/SRC/Calendar/julday.pro
r134 r136 2 2 ; 3 3 ; @file_comments 4 ; 5 ; 6 ; 4 ; Calculate the Julian Day Number for a given month, day, and year. 5 ; This is the inverse of the library function CALDAT. 6 ; See also caldat, the inverse of this function. 7 7 ; 8 8 ; @categories Calendar 9 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 15 ; values from the civil calendar. Years B.C.E. are represented 16 ; as negative integers. Years in the common era are represented 17 ; as positive integers. In particular, note that there is no 18 ; year 0 in the civil calendar. 1 B.C.E. (-1) is followed by 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 28 ; will be a scalar if all arguments are scalars. 10 ; @param MONTH {in}{required} 11 ; Number of the desired month (1 = January, ..., 12 = December). 12 ; Can be scalar or array 13 ; 14 ; @param DAY {in}{required} 15 ; Number of day of the month.Can be scalar or array 16 ; 17 ; @param YEARin {in}{required} 18 ; Number of the desired year. Year parameters must be valid 19 ; values from the civil calendar. Years B.C.E. are represented 20 ; as negative integers. Years in the common era are represented 21 ; as positive integers. In particular, note that there is no 22 ; year 0 in the civil calendar. 1 B.C.E. (-1) is followed by 23 ; 1 C.E. (1). Can be scalar or array 24 ; 25 ; @param HOUR {in}{optional} 26 ; Number of the hour of the day. Can be scalar or array 27 ; 28 ; @param MINUTE {in}{optional} 29 ; Number of the minute of the hour. Can be scalar or array 30 ; 31 ; @param SECOND {in}{optional} 32 ; Number of the second of the minute. Can be scalar or array 33 ; 34 ; @restrictions 35 ; The Result will have the same dimensions as the smallest array, or 36 ; will be a scalar if all arguments are scalars. 29 37 ; 30 ; 31 ; @keywords NDAYSPM {default=30} for using a calendar with fixed number of days per32 ; months.33 ; 34 ; @ returns JULDAY: the Julian Day Number (which begins at noon) of the35 ; specified calendar date. If Hour, Minute, and Second are not specified,36 ; then the result will be a long integer, otherwise the result is a37 ; double precision floating pointnumber.38 ; @keyword NDAYSPM {default=30} 39 ; for using a calendar with fixed number of days per months. 40 ; 41 ; @returns 42 ; the Julian Day Number (which begins at noon) of the specified calendar date. 43 ; If Hour, Minute, and Second are not specified, then the result will be a 44 ; long integer, otherwise the result is a double precision floating point 45 ; number. 38 46 ; 39 47 ; @uses cm_4cal 40 48 ; 41 ; @restrictions Accuracy using IEEE double precision numbers is approximately 42 ; 1/10000th of a second, with higher accuracy for smaller (earlier) 43 ; Julian dates. 44 ; 45 ; @history Translated from "Numerical Recipies in C", by William H. Press, 46 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 47 ; Cambridge University Press, 1988 (second printing). 48 ; 49 ; AB, September, 1988 50 ; DMS, April, 1995, Added time of day. 51 ; 52 ; Eric Guilyardi, June 1999 53 ; Added key_work ndayspm for fixed number of days per months 54 ; + change to accept year 0 55 ; 56 ; Sebastien Masson, Aug. 2003 57 ; fix bug for negative and large values of month values 58 ; eg. julday(349,1,1970) 59 ; 60 ; CT, April 2000, Now accepts vectors or scalars. 49 ; @restrictions 50 ; Accuracy using IEEE double precision numbers is approximately 51 ; 1/10000th of a second, with higher accuracy for smaller (earlier) 52 ; Julian dates. 53 ; 54 ; @history Translated from "Numerical Recipes in C", by William H. Press, 55 ; Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 56 ; Cambridge University Press, 1988 (second printing). 57 ; 58 ; AB, September, 1988 59 ; DMS, April, 1995, Added time of day. 60 ; 61 ; Eric Guilyardi, June 1999 62 ; Added keyword ndayspm for fixed number of days per months 63 ; + change to accept year 0 64 ; 65 ; Sebastien Masson, Aug. 2003 66 ; fix bug for negative and large values of month values 67 ; eg. julday(349,1,1970) 68 ; 69 ; CT, April 2000, Now accepts vectors or scalars. 61 70 ; 62 71 ; @version $Id$ … … 84 93 85 94 86 ; Gregorian Cal ander was adopted on Oct. 15, 158295 ; Gregorian Calender was adopted on Oct. 15, 1582 87 96 ; skipping from Oct. 4, 1582 to Oct. 15, 1582 88 97 GREG = 2299171L ; incorrect Julian day for Oct. 25, 1582 … … 151 160 ; change to accept year 0 152 161 ; if (MAX(L_YEAR eq 0) NE 0) then message, $ 153 ; 162 ; 'There is no year zero in the civil calendar.' 154 163 ; 155 164 ; by seb Aug 2003 … … 177 186 JUL = floor(365.25d * JY) + floor(30.6001d*TEMPORARY(JM)) + L_DAY + 1720995L 178 187 179 ; Test whether to change to Gregorian Cal andar.188 ; Test whether to change to Gregorian Calendar. 180 189 IF (MIN(JUL) GE GREG) THEN BEGIN ; change all dates 181 190 JA = long(0.01d * TEMPORARY(JY)) … … 197 206 eps = (MACHAR(/DOUBLE)).eps 198 207 eps = eps*ABS(jul) > eps 199 ; For Hours, divide by 24, then subtract 0.5, in case we have unsigned int s.208 ; For Hours, divide by 24, then subtract 0.5, in case we have unsigned integers. 200 209 jul = TEMPORARY(JUL) + ( (TEMPORARY(d_Hour)/24d - 0.5d) + $ 201 210 TEMPORARY(d_Minute)/1440d + TEMPORARY(d_Second)/86400d + eps ) -
trunk/SRC/Calendar/leapyr.pro
r134 r136 9 9 ; @categories calendar 10 10 ; 11 ; @param year {in}{required} year to be tested as a leap year 11 ; @param year {in}{required} 12 ; year to be tested as a leap year 12 13 ; 13 ; @returns 0 then not a leap year14 ; 14 ; @returns 15 ; 0 then not a leap year, 1 then year is a leap year 15 16 ; 16 17 ; @uses cm_4cal … … 32 33 ; This means that year 1800, 1900, 2100, 2200, 2300 and 2500 are 33 34 ; NOT leap years, while year 2000 and 2400 are leap years. 34 ; + sup ress the automatic change 89 -> 198935 ; + suppress the automatic change 89 -> 1989 35 36 ; 36 37 ; June 2005 update for new commons, Sebastien Masson. -
trunk/SRC/Calendar/monthname.pro
r134 r136 9 9 ; @categories calendar 10 10 ; 11 ; @param mm1 {in}{required} the month number (from 1 to 12) 11 ; @param mm1 {in}{required} 12 ; the month number (from 1 to 12) 12 13 ; 13 ; @keyword _EXTRA used to pass your keywords to the created procedure. 14 ; @keyword _EXTRA 15 ; used to pass your keywords to the created procedure. 14 16 ; 15 ; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used. 17 ; @file_comments 18 ; keyword parameters of string function to specify the format of the 19 ; month (the C format) can be used. 16 20 ; 17 ; @returns the month's name 21 ; @returns 22 ; the month's name 18 23 ; 19 24 ; @examples -
trunk/SRC/Colors/color24.pro
r134 r136 7 7 ; @categories Graphics, Color Specification. 8 8 ; 9 ; @param RGB_TRIPLE {in}{required} A three-element column or row array representing10 ; a color triple. The values of the elements must be between11 ; 9 ; @param rgb_triple {in}{required} 10 ; A three-element column or row array representing 11 ; a color triple. The values of the elements must be between 0 and 255. 12 12 ; 13 ; @returns a 24-bit long integer that is equivalent the input color.14 ; The color is15 ; described in terms of a hexidecimal number (e.g., FF206A)13 ; @returns 14 ; a 24-bit long integer that is equivalent the input color. 15 ; The color is described in terms of a hexadecimal number (e.g., FF206A) 16 16 ; where the left two digits represent the blue color, the 17 17 ; middle two digits represent the green color, and the right 18 18 ; two digits represent the red color. 19 19 ; 20 ; @examples To convert the color triple for the color YELLOW, 21 ; (255, 255, 0), to the hexadecimal value '00FFFF'x 22 ; or the decimal number 65535, type: 20 ; @examples 21 ; To convert the color triple for the color YELLOW, 22 ; (255, 255, 0), to the hexadecimal value '00FFFF'x 23 ; or the decimal number 65535, type: 23 24 ; 24 ; 25 ; IDL> color = COLOR24([255, 255, 0]) 25 26 ; 26 ; This routine was written to be used with routines like 27 ; COLORS or GETCOLOR 27 ; This routine was written to be used with routines like COLORS or GETCOLOR 28 28 ; 29 29 ; @history … … 33 33 ; 34 34 ;- 35 FUNCTION COLOR24, number35 FUNCTION COLOR24, rgb_triple 36 36 ; 37 37 compile_opt idl2, strictarrsubs … … 39 39 ON_ERROR, 1 40 40 41 IF N_ELEMENTS( number) NE 3 THEN $42 MESSAGE, 'A ugument must be a three-element vector.'41 IF N_ELEMENTS(rgb_triple) NE 3 THEN $ 42 MESSAGE, 'Argument must be a three-element vector.' 43 43 44 IF MAX( number) GT 255 OR MIN(number) LT 0 THEN $44 IF MAX(rgb_triple) GT 255 OR MIN(rgb_triple) LT 0 THEN $ 45 45 MESSAGE, 'Argument values must be in range of 0-255' 46 46 … … 49 49 num24bit = 0L 50 50 51 FOR j=0,2 DO num24bit = num24bit + (( number[j] MOD 16) * base16[0,j]) + $52 (Fix( number[j]/16) * base16[1,j])51 FOR j=0,2 DO num24bit = num24bit + ((rgb_triple[j] MOD 16) * base16[0,j]) + $ 52 (Fix(rgb_triple[j]/16) * base16[1,j]) 53 53 54 54 RETURN, num24bit -
trunk/SRC/Colors/colorbar.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; The purpose of this routine is to add a color bar to the current 5 5 ; graphics window. … … 7 7 ; @categories Graphics, Widgets. 8 8 ; 9 ; @keyword BOTTOM The lowest color index of the colors to be loaded in 10 ; the bar. 11 ; 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 17 ; is ncolors - 1 + bottom. 18 ; 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 22 ; no title. 23 ; 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 29 ; be (divisions + 1) annotations. The default is 2. 30 ; 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 38 ; NCOLORS-1. 39 ; 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 47 ; form as the POSITION keyword on a plot. Default is 48 ; [0.88, 0.15, 0.95, 0.95] for a vertical bar and 49 ; [0.15, 0.88, 0.95, 0.95] for a horizontal bar. 50 ; 51 ; @keyword PSCOLOR This keyword is only applied if the output is being sent to 52 ; a PostScript file. It indicates that the PostScript device 53 ; is configured for color output. If this keyword is set, then 54 ; the annotation is drawn in the color specified by the COLOR 55 ; keyword. If the keyword is not set, the annotation is drawn 56 ; in the color specified by the !P.COLOR system variable 57 ; (usually this will be the color black). In general, this 58 ; gives better looking output on non-color or gray-scale 59 ; printers. If you are not specifically setting the annotation 60 ; color (with the COLOR keyword), it will probably 61 ; be better NOT to set this keyword either, even if you 62 ; are outputting to a color PostScript printer. 63 ; 64 ; @keyword RIGHT This puts the labels on the right-hand side of a vertical 65 ; color bar. It applies only to vertical color bars. 66 ; 67 ; @keyword TOP This puts the labels on top of the bar rather than under it. 68 ; The keyword only applies if a horizontal color bar is rendered. 69 ; 70 ; @keyword VERTICAL Setting this keyword give a vertical color bar. The default 71 ; is a horizontal color bar. 72 ; 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 76 ; PostScript device) is used unless the NCOLORS keyword is used. 77 ; 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 9 ; @keyword BOTTOM 10 ; The lowest color index of the colors to be loaded in the bar. 11 ; 12 ; @keyword CB_CHARSIZE {default=1.0} 13 ; The character size of the color bar annotations. 14 ; 15 ; @keyword CB_CHARTHICK {default=1.0} 16 ; The character thick of the color bar annotations. 17 ; 18 ; @keyword CB_COLOR {default=ncolors - 1 + bottom} 19 ; The color index of the bar outline and characters. 20 ; 21 ; @keyword CB_LOG 22 ; to get logarithmic scale for the colorbar 23 ; 24 ; @keyword CB_TITLE 25 ; This is title for the color bar. The default is to have no title. 26 ; 27 ; @keyword DISCRETE 28 ; Vector which contain color's indexes to trace in a color bar. Therefore 29 ; we obtain a discreet color bar which only contains specified colors in 30 ; order where they appear in the vector 31 ; 32 ; @keyword DIVISIONS {default=2} 33 ; The number of divisions to divide the bar into. 34 ; There will be (divisions + 1) annotations. 35 ; 36 ; @keyword FORMAT {default='(F6.2)'} 37 ; The format of the bar annotations. 38 ; 39 ; @keyword CB_LABEL 40 ; It is a vector who specifies sticks's value attend in the color bar. 41 ; It allowes, when we use DISCREET, to have colors which don't increase 42 ; by increments in a regular way. 43 ; 44 ; @keyword MAX {default=NCOLORS - 1} 45 ; The maximum data value for the bar annotation. 46 ; 47 ; @keyword MIN {default=0} 48 ; The minimum data value for the bar annotation. 49 ; 50 ; @keyword NCOLORS 51 ; This is the number of colors in the color bar. 52 ; 53 ; @keyword NOTITLE 54 ; Force to don't write title even if CB_TITLE is declared. 55 ; 56 ; @keyword POSITION 57 ; A four-element array of normalized coordinates in the same 58 ; form as the POSITION keyword on a plot. Default is 59 ; [0.88, 0.15, 0.95, 0.95] for a vertical bar and 60 ; [0.15, 0.88, 0.95, 0.95] for a horizontal bar. 61 ; 62 ; @keyword PSCOLOR 63 ; This keyword is only applied if the output is being sent to 64 ; a Postscript file. It indicates that the Postscript device 65 ; is configured for color output. If this keyword is set, then 66 ; the annotation is drawn in the color specified by the COLOR 67 ; keyword. If the keyword is not set, the annotation is drawn 68 ; in the color specified by the !P.COLOR system variable 69 ; (usually this will be the color black). In general, this 70 ; gives better looking output on non-color or gray-scale 71 ; printers. If you are not specifically setting the annotation 72 ; color (with the COLOR keyword), it will probably 73 ; be better NOT to set this keyword either, even if you 74 ; are outputting to a color Postscript printer. 75 ; 76 ; @keyword RIGHT 77 ; This puts the labels on the right-hand side of a vertical 78 ; color bar. It applies only to vertical color bars. 79 ; 80 ; @keyword TOP 81 ; This puts the labels on top of the bar rather than under it. 82 ; The keyword only applies if a horizontal color bar is rendered. 83 ; 84 ; @keyword VERTICAL 85 ; Setting this keyword give a vertical color bar. 86 ; The default is a horizontal color bar. 87 ; 88 ; @restrictions 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 93 ; Postscript device) is used unless the NCOLORS keyword is used. 94 ; 95 ; @examples 96 ; To display a horizontal color bar above a contour plot, type: 97 ; 98 ; IDL> LOADCT, 5, NCOLORS=100 99 ; IDL> CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $ 100 ; IDL> C_COLORS=INDGEN(25)*4, NLEVELS=25 101 ; IDL> COLORBAR, NCOLORS=100 84 102 ; 85 103 ; @history Written by: David Fanning, 10 JUNE 96. 86 ; 10/27/96: Added the ability to send output to Post Script. DWF87 ; 11/4/96: Substantially rewritten to go to screen or Post Script88 ; file without having to know much about the Post Script device104 ; 10/27/96: Added the ability to send output to Postscript. DWF 105 ; 11/4/96: Substantially rewritten to go to screen or Postscript 106 ; file without having to know much about the Postscript device 89 107 ; or even what the current graphics device is. DWF 90 108 ; 1/27/97: Added the RIGHT and TOP keywords. Also modified the … … 93 111 ; no valid data range in them. DWF 94 112 ; 3/3/98: ajout du keyword discret par 95 ; sebastien (smasson@lodyc.jussieu.fr)113 ; sebastien (smasson\@lodyc.jussieu.fr) 96 114 ; 97 115 ; @version $Id$ 98 116 ; 99 117 ;- 100 101 PRO COLORBAR, BOTTOM=bottom, CB_CHARSIZE=cb_charsize,CB_CHARTHICK=cb_charthick $118 PRO COLORBAR, BOTTOM=bottom, CB_CHARSIZE=cb_charsize, $ 119 CB_CHARTHICK=cb_charthick $ 102 120 , CB_COLOR=cb_color, $ 103 121 DIVISIONS=divisions, DISCRETE=discrete,CB_LABEL = cb_label, $ 104 FORMAT=format, POSITION=position, MAX=max, MIN=min, NCOLORS=ncolors, $ 105 PSCOLOR=pscolor, CB_TITLE=cb_title, VERTICAL=vertical, TOP=top, RIGHT=right, CB_LOG = CB_log, _extra = ex 106 ; Is the PostScript device selected? 122 FORMAT=format, POSITION=position, MAX=max, MIN=min, $ 123 NCOLORS=ncolors, $ 124 PSCOLOR=pscolor, CB_TITLE=cb_title, NOTITLE=notitle, $ 125 VERTICAL=vertical, $ 126 TOP=top, RIGHT=right, CB_LOG = CB_log, _extra = ex 127 ; Is the Postscript device selected? 107 128 ; 108 129 compile_opt idl2, strictarrsubs … … 175 196 IF KEYWORD_SET(discrete) THEN begin 176 197 facteur=256/n_elements(discrete) 177 discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite) 198 discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite) 178 199 bar = REPLICATE(1B,10) # discrete 179 200 endif else bar = REPLICATE(1B,10) # BINDGEN(256) … … 182 203 IF KEYWORD_SET(discrete) THEN begin 183 204 facteur=256/n_elements(discrete) 184 discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite) 205 discrete=reform(replicate(1,facteur) # discrete,facteur*n_elements(discrete), /overwrite) 185 206 bar = discrete # REPLICATE(1B,10) 186 207 endif else bar = BINDGEN(256) # REPLICATE(1B, 10) -
trunk/SRC/Colors/getcolor.pro
r134 r136 12 12 ; same where color decomposition is turned on or off. 13 13 ; 14 ; 15 ; 14 ; (The 16 supported colors in GETCOLOR come from the McIDAS color 15 ; table offered on the IDL newsgroup by Liam Gumley.) 16 16 ; 17 17 ; @categories Graphics, Color Specification. 18 18 ; 19 ; @param thisColor {in}{optional} A string with the "name" of the color. Valid names are: 19 ; @param thisColor {in}{optional} 20 ; A string with the "name" of the color. Valid names are: 20 21 ; black 21 22 ; magenta … … 46 47 ; IDL 5.2 or higher. 47 48 ; 48 ; @param index {in}{optional} The color table index where the specified color should be loaded. 49 ; @param index {in}{optional} 50 ; The color table index where the specified color should be loaded. 49 51 ; If this parameter is passed, then the return value of the function is the 50 52 ; index number and not the color triple. (If color decomposition is turned … … 62 64 ; TVLCT, colors, 100 63 65 ; 64 ; @keyword NAMES If this keyword is set, the return value of the function is 65 ; a 16-element string array containing the names of the colors. 66 ; These names would be appropriate, for example, in building 67 ; a list widget with the names of the colors. If the NAMES 68 ; keyword is set, the COLOR and INDEX parameters are ignored. 69 ; 70 ; listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 71 ; 72 ; @keyword LOAD If this keyword is set, all 16 colors are automatically loaded 73 ; starting at the color index specified by the START keyword. 74 ; Note that setting this keyword means that the return value of the 75 ; function will be a structure, with each field of the structure 76 ; corresponding to a color name. The value of each field will be 77 ; an index number (set by the START keyword) corresponding to the 78 ; associated color, or a 24-bit long integer value that creates the 79 ; color on a true-color device. What you have as the field values is 80 ; determined by the TRUE keyword or whether color decomposition is on 81 ; or off in the absense of the TRUE keyword. It will either be a 1-by-3 82 ; byte array or a long integer value. 83 ; 84 ; @keyword START The starting color index number if the LOAD keyword is set. This keyword 85 ; value is ignored unless the LOAD keyword is also set. The keyword is also 86 ; ignored if the TRUE keyword is set or if color decomposition in on in 87 ; IDL 5.2 and higher. The default value for the START keyword is 88 ; !D.TABLE_SIZE - 17. 89 ; 90 ; @keyword TRUE If this keyword is set, the specified color triple is returned 91 ; as a 24-bit integer equivalent. The lowest 8 bits correspond to 92 ; the red value; the middle 8 bits to the green value; and the 93 ; highest 8 bits correspond to the blue value. In IDL 5.2 and higher, 94 ; if color decomposition is turned on, it is as though this keyword 95 ; were set. 96 ; 97 ; @restrictions The TRUE keyword causes the START keyword to be ignored. 98 ; The NAMES keyword causes the COLOR, INDEX, START, and TRUE parameters to be ignored. 99 ; The COLOR parameter is ignored if the LOAD keyword is used. 100 ; On systems where it is possible to tell the state of color decomposition 101 ; (i.e., IDL 5.2 and higher), a 24-bit value (or values) is automatically 102 ; returned if color decomposition is ON. 103 ; 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 66 ; @keyword NAMES 67 ; If this keyword is set, the return value of the function is 68 ; a 16-element string array containing the names of the colors. 69 ; These names would be appropriate, for example, in building 70 ; a list widget with the names of the colors. If the NAMES 71 ; keyword is set, the COLOR and INDEX parameters are ignored. 72 ; 73 ; listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 74 ; 75 ; @keyword LOAD 76 ; If this keyword is set, all 16 colors are automatically loaded 77 ; starting at the color index specified by the START keyword. 78 ; Note that setting this keyword means that the return value of the 79 ; function will be a structure, with each field of the structure 80 ; corresponding to a color name. The value of each field will be 81 ; an index number (set by the START keyword) corresponding to the 82 ; associated color, or a 24-bit long integer value that creates the 83 ; color on a true-color device. What you have as the field values is 84 ; determined by the TRUE keyword or whether color decomposition is on 85 ; or off in the absence of the TRUE keyword. It will either be a 1-by-3 86 ; byte array or a long integer value. 87 ; 88 ; @keyword START {default=!D.TABLE_SIZE - 17} 89 ; The starting color index number if the LOAD keyword is set. This keyword 90 ; value is ignored unless the LOAD keyword is also set. The keyword is also 91 ; ignored if the TRUE keyword is set or if color decomposition in on in 92 ; IDL 5.2 and higher. The default value for the START keyword is 93 ; 94 ; @keyword TRUE 95 ; If this keyword is set, the specified color triple is returned 96 ; as a 24-bit integer equivalent. The lowest 8 bits correspond to 97 ; the red value; the middle 8 bits to the green value; and the 98 ; highest 8 bits correspond to the blue value. In IDL 5.2 and higher, 99 ; if color decomposition is turned on, it is as though this keyword 100 ; were set. 101 ; 102 ; @restrictions 103 ; The TRUE keyword causes the START keyword to be ignored. 104 ; The NAMES keyword causes the COLOR, INDEX, START, and TRUE parameters to be 105 ; ignored. 106 ; The COLOR parameter is ignored if the LOAD keyword is used. 107 ; On systems where it is possible to tell the state of color decomposition 108 ; (i.e., IDL 5.2 and higher), a 24-bit value (or values) is automatically 109 ; returned if color decomposition is ON. 110 ; 111 ; @examples 112 ; To load a yellow color in color index 100 and plot in yellow, type: 113 ; 114 ; IDL> yellow = GETCOLOR('yellow', 100) 115 ; IDL> PLOT, data, COLOR=yellow 109 116 ; 110 117 ; or, 111 118 ; 112 ; 113 ; 114 ; 115 ; 116 ; 119 ; IDL> PLOT, data, COLOR=GETCOLOR('yellow', 100) 120 ; 121 ; To do the same thing on a 24-bit color system with decomposed color on, type: 122 ; 123 ; IDL> PLOT, data, COLOR=GETCOLOR('yellow', /TRUE) 117 124 ; 118 125 ; or in IDL 5.2 and higher, 119 126 ; 120 ; 121 ; 122 ; 123 ; 124 ; 125 ; 126 ; 127 ; 128 ; 129 ; 130 ; 131 ; 132 ; To load all 16 colors and have the color indices returned in a structure:133 ; 134 ; 135 ; 136 ; 137 ; 138 ; 139 ; 140 ; 141 ; 142 ; 143 ; 144 ; 145 ; 146 ; 147 ; 148 ; 149 ; 150 ; 151 ; 152 ; 153 ; 154 ; 155 ; 156 ; 157 ; 158 ; 159 ; 160 ; 161 ; 162 ; 163 ; 164 ; 165 ; 166 ; 127 ; IDL> DEVICE, Decomposed=1 128 ; IDL> PLOT, data, COLOR=GETCOLOR('yellow') 129 ; 130 ; To load all 16 colors into the current color table, starting at 131 ; color index 200, type: 132 ; 133 ; IDL> TVLCT, GETCOLOR(), 200 134 ; 135 ; To add the color names to a list widget: 136 ; 137 ; IDL> listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16) 138 ; 139 ; To load all 16 colors and have the color indexes returned in a structure: 140 ; 141 ; IDL> DEVICE, Decomposed=0 142 ; IDL> colors = GetColor(/Load, Start=1) 143 ; IDL> HELP, colors, /Structure 144 ; PLOT, data, COLOR=colors.yellow 145 ; 146 ; To get the direct color values as 24-bit integers in color structure fields: 147 ; 148 ; IDL> DEVICE, Decomposed=1 149 ; IDL> colors = GetColor(/Load) 150 ; IDL> PLOT, data, COLOR=colors.yellow 151 ; 152 ; Note that the START keyword value is ignored if on a 24-bit device, 153 ; so it is possible to write completely device-independent code by 154 ; writing code like this: 155 ; 156 ; IDL> colors = GetColor(/Load) 157 ; IDL> PLOT, data, Color=colors.yellow; IDL> DEVICE, Decomposed=0 158 ; IDL> colors = GetColor(/Load, Start=1) 159 ; IDL> HELP, colors, /Structure 160 ; IDL> PLOT, data, COLOR=colors.yellow 161 ; 162 ; To get the direct color values as 24-bit integers in color structure fields: 163 ; 164 ; IDL> DEVICE, Decomposed=1 165 ; IDL> colors = GetColor(/Load) 166 ; IDL> PLOT, data, COLOR=colors.yellow 167 ; 168 ; Note that the START keyword value is ignored if on a 24-bit device, 169 ; so it is possible to write completely device-independent code by 170 ; writing code like this: 171 ; 172 ; IDL> colors = GetColor(/Load) 173 ; IDL> PLOT, data, Color=colors.yellow 167 174 ; 168 175 ; @history Written by: David Fanning, 10 February 96. … … 171 178 ; Added the INDEX parameter to the program 8 Mar 99. DWF 172 179 ; Added the NAMES keyword at insistence of Martin Schultz. 10 Mar 99. DWF 173 ; Reorder d the colors so black is first and white is last. 7 June 99. DWF180 ; Reordered the colors so black is first and white is last. 7 June 99. DWF 174 181 ; Added automatic recognition of DECOMPOSED=1 state. 7 June 99. DWF 175 182 ; Added LOAD AND START keywords. 7 June 99. DWF. … … 292 299 colorIndex = WHERE(names EQ thisColor) 293 300 294 ; If you can't find it. Issue an info mational message,301 ; If you can't find it. Issue an informational message, 295 302 ; set the index to a YELLOW color, and continue. 296 303 -
trunk/SRC/Colors/lct.pro
r134 r136 12 12 ; 13 13 ; @keyword LIGHTNESS a scalar used to change the Lightness of the color 14 ; palette to be ab ble to adjust according to the printer we use,14 ; palette to be able to adjust according to the printer we use, 15 15 ; the media (paper or slide)... 16 16 ; lightness < 1 to get lighter colors … … 22 22 ; 23 23 ; @keyword GET_NAME Set this keyword to a named variable in which the names of the color tables 24 ; are re urned as a string array. No changes are made to the color table.24 ; are returned as a string array. No changes are made to the color table. 25 25 ; 26 26 ; @keyword _EXTRA Used to pass your keywords … … 28 28 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 29 29 ; 30/3/1999: add extra 30 ; 6/7/1999: mac/windows comp tibility30 ; 6/7/1999: mac/windows compatibility 31 31 ; 32 32 ; @version $Id$ … … 43 43 ; definition of the name of the file containing colors palettes. 44 44 if keyword_set(file) then nametbl = file ELSE nametbl = 'palette.tbl' 45 ; What is the full ad ress of nametbl?45 ; What is the full address of nametbl? 46 46 thisOS = strupcase(strmid(!version.os_family, 0, 3)) 47 47 CASE thisOS of -
trunk/SRC/Colors/newpalette.pro
r134 r136 11 11 ; @categories graphic, color specification 12 12 ; 13 ; @param namepal {in}{required} It is a string containing the name of the new palettte we want to write. 13 ; @param namepal {in}{required} 14 ; It is a string containing the name of the new palette we want to write. 14 15 ; 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 16 ; @keyword OVER 17 ; It is a whole number which designate the number of the palette 18 ; we want to replace the palette on the screen 17 19 ; 18 ; @keyword FILE {default=palette.tbl} is not specified, we are looking a file containing19 ; 20 ; 21 ; 20 ; @keyword FILE {default=palette.tbl} 21 ; if not specified, we are looking a file containing palettes named palette.tbl. 22 ; This file can be in any directory of the !path 23 ; On the other hand it must be writable 22 24 ; 23 ; @keyword _extra Used to pass your keywords 25 ; @keyword _extra 26 ; Used to pass your keywords 24 27 ; 25 28 ; @history Guillaume Roulet (gr@lodyc.jussieu.fr) 26 ; 29 ; 30/3/1999 s.masson, add _extra, research of the full name, OVER 27 30 ; 5/5/1999 s.masson 28 31 ; -
trunk/SRC/Colors/xlct.pro
r134 r136 383 383 ; this ID is specified, a death of the caller results in a 384 384 ; death of Xlct 385 ; @keyword NCOLORS = number of colors to use. Use color ind ices from BOTTOM385 ; @keyword NCOLORS = number of colors to use. Use color indexes from BOTTOM 386 386 ; to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. 387 387 ; Default = !D.TABLE_SIZE = all available colors. 388 ; @keyword BOTTOM = first color index to use. Use color ind ices from BOTTOM to388 ; @keyword BOTTOM = first color index to use. Use color indexes from BOTTOM to 389 389 ; BOTTOM+NCOLORS-1. Default = 0. 390 390 ; @keyword SILENT - Normally, no informational message is printed when -
trunk/SRC/Colors/xpal.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 4 ; like xpalette but shorter to write and ,moreover,3 ; @file_comments 4 ; like xpalette but shorter to write and, moreover, 5 5 ; possess a hotkey save which (thanks to the newpalette routine) 6 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 7 ; press the predefined hotkey, it calls xlct instead of xloadct 8 8 ; No explicit inputs. The current color table is used as a starting point. 9 9 ; 10 10 ; @categories Color tables, widgets. 11 11 ; 12 ; @keyword BLOCK Set this keyword to have XMANAGER block when this13 ; application is registered. By default the Xmanager14 ; keyword NO_BLOCK is set to 1 to provide access to the15 ; command line if active command line processing is available.16 ; Note that setting BLOCK for this application will cause17 ; all widget applications to block, not only this18 ; application. For more information see the NO_BLOCK keyword19 ; to XMANAGER.20 ; @keyword UPDATECALLBACK Set this keyword to a string containing the name of21 ; a user-supplied procedure that will be called when the color22 ; table is updated by XLOADCT. The procedure may optionally23 ; accept a keyword called DATA, which will be automatically24 ; set to the value specified by the optional UPDATECBDATA25 ; keyword.26 ; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be27 ; passed via the DATA keyword to the user-supplied procedure28 ; specified via the UPDATECALLBACK keyword, if any. If the29 ; UPDATECBDATA keyword is not set the value accepted by the30 ; DATA keyword to the procedure specified by UPDATECALLBACK31 ; will be undefined.32 ;33 ; @uses COLORS: Contains the current RGB color tables.34 12 ; @uses XP_COM: Private to this module. 35 13 ; 36 ; @restrictions XPAL uses two colors from the current color table as 37 ; drawing foreground and background colors. These are used 38 ; for the RGB plots on the left, and the current index marker on 39 ; the right. This means that if the user set these two colors 40 ; to the same value, the XPAL display could become unreadable 41 ; (like writing on black paper with black ink). XPAL minimizes 42 ; this possibility by noting changes to the color map and always 43 ; using the brightest available color for the foreground color 44 ; and the darkest for the background. Thus, the only way 45 ; to make XPAL's display unreadable is to set the entire color 46 ; map to a single color, which is highly unlikely. The only side 47 ; effect of this policy is that you may notice XPAL redrawing 48 ; the entire display after you've modified the current color. 49 ; This simply means that the change has made XPAL pick new 50 ; drawing colors. 51 ; 52 ; The new color tables are saved in the COLORS common and loaded 53 ; to the display. 54 ; 55 ; @examples The XPAL widget has the following controls: 14 ; @restrictions 15 ; XPAL uses two colors from the current color table as 16 ; drawing foreground and background colors. These are used 17 ; for the RGB plots on the left, and the current index marker on 18 ; the right. This means that if the user set these two colors 19 ; to the same value, the XPAL display could become unreadable 20 ; (like writing on black paper with black ink). XPAL minimizes 21 ; this possibility by noting changes to the color map and always 22 ; using the brightest available color for the foreground color 23 ; and the darkest for the background. Thus, the only way 24 ; to make XPAL's display unreadable is to set the entire color 25 ; map to a single color, which is highly unlikely. The only side 26 ; effect of this policy is that you may notice XPAL redrawing 27 ; the entire display after you've modified the current color. 28 ; This simply means that the change has made XPAL pick new 29 ; drawing colors. 30 ; 31 ; The new color tables are saved in the COLORS common and loaded 32 ; to the display. 33 ; 34 ; @examples 35 ; The XPAL widget has the following controls: 56 36 ; 57 37 ; Left: Three plots showing the current Red, Green, and Blue vectors. … … 106 86 ; 3) The name of the file containing palettes. 107 87 ; Comment: May follow instructions gave by the prompter. 108 ; 88 ; 109 89 ; 110 90 ; Three sliders (R, G, and B) that allow the user to modify the … … 125 105 ; horizontally. 126 106 ; 127 ; @history ad daptation de xpalette pour ajouter un bouton save par128 ; G ima Nicolas (nglod@ipsl.jussieu.fr) et par Masson129 ; Sebastien (smlod @ipsl.jussieu.fr)107 ; @history adaptation de xpalette pour ajouter un bouton save par 108 ; Grima Nicolas (nglod\@ipsl.jussieu.fr) et par Masson 109 ; Sebastien (smlod\@ipsl.jussieu.fr) 130 110 ; 131 111 ; $Id$ … … 134 114 ; 135 115 ;+ 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 ;- 116 ; @file_comments 117 ; XP_NEW_COLORS: Choose the best foreground and background colors for 118 ; the current color maps and set !P appropriately. 119 ; 120 ; @returns 121 ; 1 if the colors changed, 0 otherwise. 122 ;- 142 123 function XP_NEW_COLORS 143 124 ; … … 162 143 end 163 144 145 ;+ 146 ; @hidden 147 ;- 164 148 pro XP_ALERT_CALLER 165 149 ; … … 187 171 end 188 172 ;+ 189 ; @file_comments XP_XLCTCALLBACK: For visuals with static colormaps, update the graphics 190 ; after a change by XLOADCT. 173 ; @file_comments 174 ; XP_XLCTCALLBACK: For visuals with static colormaps, update the graphics 175 ; after a change by XLOADCT. 191 176 ;- 192 177 pro XP_XLCTCALLBACK … … 201 186 end 202 187 188 ;+ 189 ; @hidden 190 ;- 203 191 pro XP_REDRAW 204 192 ; … … 216 204 217 205 ;+ 218 ; @file_comments XP_REPLOT: Re-draw the RGB plots. Type has the following possible values. 206 ; @file_comments 207 ; XP_REPLOT: Re-draw the RGB plots. Type has the following possible values. 219 208 ; - 'D': Draw the data part of all three plots 220 209 ; - 'F': draw all three plots … … 222 211 ; - 'G': Draw the data part of the Green plot 223 212 ; - 'B': Draw the data part of the Blue plot 224 ;- 213 ;- 225 214 pro XP_REPLOT, color_index, type 226 215 ; … … 240 229 save_x_s = !x.s 241 230 save_y_s = !y.s 242 save_x_type = !x.type 243 save_y_type = !y.type 231 save_x_type = !x.type 232 save_y_type = !y.type 244 233 245 234 !y.margin= [2, 2] … … 435 424 436 425 7: goto, do_copy 437 8: BEGIN 426 8: BEGIN 438 427 COMMON basecommon, bas212, bas222, bas232 439 428 base = WIDGET_BASE(/COLUMN, /FRAME) … … 476 465 THEN BEGIN 477 466 CASE uval OF 478 'ok' :BEGIN 467 'ok' :BEGIN 479 468 WIDGET_CONTROL, bas212, GET_VALUE = palname 480 469 WIDGET_CONTROL, bas222, GET_VALUE = over … … 541 530 ;+ 542 531 ; 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 ;- 567 568 569 532 ; @keyword group 533 ; 534 ; @keyword BLOCK 535 ; Set this keyword to have XMANAGER block when this 536 ; application is registered. By default the Xmanager 537 ; keyword NO_BLOCK is set to 1 to provide access to the 538 ; command line if active command line processing is available. 539 ; Note that setting BLOCK for this application will cause 540 ; all widget applications to block, not only this 541 ; application. For more information see the NO_BLOCK keyword 542 ; to XMANAGER. 543 ; 544 ; @keyword UPDATECALLBACK 545 ; Set this keyword to a string containing the name of 546 ; a user-supplied procedure that will be called when the color 547 ; table is updated by XLOADCT. The procedure may optionally 548 ; accept a keyword called DATA, which will be automatically 549 ; set to the value specified by the optional UPDATECBDATA 550 ; keyword. 551 ; 552 ; @keyword UPDATECBDATA 553 ; Set this keyword to a value of any type. It will be 554 ; passed via the DATA keyword to the user-supplied procedure 555 ; specified via the UPDATECALLBACK keyword, if any. If the 556 ; UPDATECBDATA keyword is not set the value accepted by the 557 ; DATA keyword to the procedure specified by UPDATECALLBACK 558 ; will be undefined. 559 ; 560 ;- 570 561 pro XPAL, group=group, BLOCK=block, UPDATECALLBACK=updt_cb_name, $ 571 562 UPDATECBDATA=updt_cb_data … … 584 575 585 576 xpw = { xp_widgets, base:0L, $ 586 577 colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L} 587 578 588 579 state = {old_p:!p, $ ; Original value of !P 589 590 591 592 593 594 580 mark_idx:0, $ ; Current mark index 581 cur_idx:0, $ ; Current index 582 cur_color_win:0, $ ; Current Color draw window index 583 plot_win:0, $ ; RGB plot draw window index 584 updt_callback: updt_callback, $ ; user-defined callback (optional) 585 p_updt_cb_data:p_updt_cb_data} ; data for callback (optional) 595 586 596 587 if (XREGISTERED('XPAL')) then return ; Only one copy at a time … … 610 601 save_win = !d.window ;Previous window 611 602 612 IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN 613 614 615 616 617 603 IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors 604 TVLCT, r_orig, g_orig, b_orig, /GET 605 r_curr = r_orig 606 b_curr = b_orig 607 g_curr = g_orig 608 ENDIF 618 609 619 610 ; Create widgets … … 631 622 632 623 c1 = WIDGET_BASE(xpw.base, /COLUMN, space=20) 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 624 status = WIDGET_BASE(c1, /COLUMN, /FRAME) 625 ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE) 626 xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $ 627 xsize=20, /STRING) 628 xpw.mark_label = CW_FIELD(status, title='Mark Index: ', value='0', $ 629 xsize=20, /STRING) 630 c1_1 = widget_base(status, /ROW) 631 junk = WIDGET_LABEL(c1_1, value="Current Color: ") 632 cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame) 633 names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $ 634 'Switch Mark', 'Copy Current', 'Interpolate', 'save'] 635 xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME) 636 xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG) 637 638 junk = WIDGET_BASE(xpw.base) ; Responds to YOFFSET 648 639 if (version.style='Motif') then junk2=30 else junk2 = 50 649 640 xpw.colorsel = CW_COLORSEL(junk, yoffset=junk2) 650 651 641 652 642 state.cur_idx = 0 … … 658 648 659 649 WIDGET_CONTROL, ncw, $ 660 650 set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL) 661 651 WIDGET_CONTROL, get_value=tmp, cur_color 662 652 state.cur_color_win = tmp … … 672 662 673 663 XMANAGER, 'Xpal', xpw.base, event_handler='XP_EVENT', group=group, $ 674 675 end 676 664 NO_BLOCK=(NOT(FLOAT(block))) 665 end 666 -
trunk/SRC/Commons/cm_4cal.pro
r134 r136 7 7 ; 8 8 COMMON time_coord, jpt, time 9 ; key_caltype = 'greg' : gregorian calendar9 ; key_caltype = 'greg' : Gregorian calendar 10 10 ; = '360d' :360 days calendar 11 11 ; = 'noleap' : no leap year calendar (always 365 days) -
trunk/SRC/Commons/cm_4ps.pro
r134 r136 42 42 ; archive_ps = 0 -> nothing is done 43 43 ; archive_ps = 1 -> each printed ps has its name and creation date 44 ; written in the bottom-left cor ber of the page44 ; written in the bottom-left corner of the page 45 45 ; and is gzipped in the psdir directory 46 46 ; archive_ps > 1 -> question is asked to know if ps file has to be 47 ; a chived or not47 ; archived or not 48 48 ; 49 49 COMMON ps_archiving, archive_ps -
trunk/SRC/ForOldVersion/updatekwd.pro
r133 r136 37 37 old = [old, 'discret'] & new = [new, 'discrete'] 38 38 ; old = [old, ''] & new = [new, ''] 39 ; supress the first dummy argument and make sure we use low case39 ; supress the first dummy argument and make sure we use low case 40 40 old = strtrim(strlowcase(old[1:*]), 2) 41 41 new = strtrim(strlowcase(new[1:*]), 2) -
trunk/SRC/Interpolation/angle.pro
r134 r136 1 1 ;--------- 2 2 ;+ 3 ; @file_comments 3 ; @file_comments 4 4 ; north stereographic polar projection 5 5 ; … … 8 8 ; @param pphi {in}{required} 9 9 ; 10 ; @keyword DOUBLE {default=0} use double precision (default is float) 10 ; @keyword DOUBLE {default=0} 11 ; use double precision (default is float) 11 12 ; 12 13 ; @returns -
trunk/SRC/Interpolation/clickincell.pro
r134 r136 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; click on a map and find in which cell the click was 4 4 ; -
trunk/SRC/Interpolation/compute_fromirr_bilinear_weigaddr.pro
r125 r136 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; compute the weight and address needed to interpolate data from 4 4 ; an "irregular 2D grid" (defined as a grid made of quadrilateral cells) … … 7 7 ; @categories interpolation 8 8 ; 9 ; @param olonin {in}{required} longitudeof the input data 10 ; @param olat {in}{required} latitude of the input data 11 ; @param omsk {in}{required} land/se mask of the input data 12 ; @param alonin {in}{required} longitude of the output data 13 ; @param alat {in}{required} latitude of the output data 14 ; @param amsk {in}{required} land/sea mask of the output data 9 ; @param olonin {in}{required} 10 ; longitude of the input data 11 ; 12 ; @param olat {in}{required} 13 ; latitude of the input data 14 ; 15 ; @param omsk {in}{required} 16 ; land/sea mask of the input data 17 ; 18 ; @param alonin {in}{required} 19 ; longitude of the output data 20 ; 21 ; @param alat {in}{required} 22 ; latitude of the output data 23 ; 24 ; @param amsk {in}{required} 25 ; land/sea mask of the output data 15 26 ; 16 27 ; @param weig {out} -
trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro
r134 r136 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; compute the weight and address needed to interpolate data from a 4 4 ; "regular grid" to any grid using the bilinear method … … 6 6 ; @categories interpolation 7 7 ; 8 ; @param alonin {in}{required} longitudeof the input data 9 ; @param alatin {in}{required} latitude of the input data 10 ; @param olonin {in}{required} longitude of the output data 11 ; @param olat {in}{required} latitude of the output data 12 ; 13 ; @keyword NONORTHERNLINE activate if you don't want to take into 14 ; account the northen line of the input data when perfoming the 15 ; @keyword NOSOUTHERNLINE activate if you don't want to take into 16 ; account the southern line of the input data when perfoming the 17 ; interpolation. 8 ; @param alonin{in}{required} 9 ; longitude of the input data 10 ; 11 ; @param alatin {in}{required} 12 ; latitude of the input data 13 ; 14 ; @param olonin {in}{required} 15 ; longitude of the output data 16 ; 17 ; @param olat {in}{required} 18 ; latitude of the output data 19 ; 20 ; @keyword NONORTHERNLINE 21 ; activate if you don't want to take into 22 ; account the northen line of the input data when perfoming the interpolation. 23 ; 24 ; @keyword NOSOUTHERNLINE 25 ; activate if you don't want to take into 26 ; account the southern line of the input data when perfoming the interpolation. 18 27 ; 19 28 ; @param weig {out} -
trunk/SRC/Interpolation/compute_fromreg_imoms3_weigaddr.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; compute the weight and address neede to interpolate data from a 5 5 ; "regular grid" to any grid using the imoms3 method … … 7 7 ; @categories interpolation 8 8 ; 9 ; @param alonin {in}{required} longitude of the input data 10 ; @param alatin {in}{required} latitude of the input data 11 ; @param olonin {in}{required} longitude of the output data 12 ; @param olat {in}{required} latitude of the output data 9 ; @param alonin {in}{required} 10 ; longitude of the input data 11 ; 12 ; @param alatin {in}{required} 13 ; latitude of the input data 14 ; 15 ; @param olonin {in}{required} 16 ; longitude of the output data 17 ; @param olat {in}{required} 18 ; latitude of the output data 13 19 ; 14 20 ; @keyword NONORTHERNLINE -
trunk/SRC/Interpolation/cutpar.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; cut p parallelogram(s) into p*n^2 parallelograms 5 5 ; … … 14 14 ; @param x3 {in}{required} 15 15 ; @param y3 {in}{required} 16 ; 1d arrays of p elements, giving the edge positions. The 17 ; edges must be given as in plot to draw the parallelogram. (see 18 ; example). 16 ; 1d arrays of p elements, giving the edge positions. 17 ; The edges must be given as in plot to draw the parallelogram. (see example). 19 18 ; 20 ; @param n {in}{required} each parallelogram will be cutted in n^2 pieces 19 ; @param n {in}{required} 20 ; each parallelogram will be cutted in n^2 pieces 21 21 ; 22 ; @keyword ENDPOINTS see outputs 22 ; @keyword ENDPOINTS 23 ; see outputs 23 24 ; 24 ; @keyword ONSPHERE to specify that the points are located on a 25 ; sphere. In this case, x and y corresponds to longitude and 26 ; latitude in degrees. 25 ; @keyword ONSPHERE 26 ; to specify that the points are located on a 27 ; sphere. In this case, x and y corresponds to longitude and 28 ; latitude in degrees. 27 29 ; 28 30 ; @returns -
trunk/SRC/Interpolation/cutsegment.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; cut p segments into p*n equal parts 5 5 ; … … 12 12 ; 1d arrays of p elements, the coordinates of the endpoints of the p segments 13 13 ; 14 ; @param n {in}{required} the number of pieces we want to cut each segment 14 ; @param n {in}{required} 15 ; the number of pieces we want to cut each segment 15 16 ; 16 ; @keyword ENDPOINTS see ouputs 17 ; @keyword ENDPOINTS 18 ; see ouputs 17 19 ; 18 ; @keyword ONSPHERE to specify that the points are located on a19 ; sphere. In this case, x and y corresponds to longitude and20 ; 20 ; @keyword ONSPHERE 21 ; to specify that the points are located on a sphere. 22 ; In this case, x and y corresponds to longitude and latitude in degrees. 21 23 ; 22 24 ; @returns -
trunk/SRC/Interpolation/extrapolate.pro
r134 r136 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; extrapolate data (zinput) where maskinput eq 0 by filling 4 4 ; step by step the coastline points with the mean value of the 8 neighbourgs. -
trunk/SRC/Interpolation/fromirr.pro
r125 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; interpolate data from an irregular 2D grid to any 2D grid. 5 5 ; Only 1 method available = bilinear … … 7 7 ; @categories interpolation 8 8 ; 9 ; @param method {in}{required} a string defining the interpolation method. must be 'bilinear' 10 ; @param datain {in}{required} a 2D array the input data to interpolate 11 ; @param lonin {in}{optional} a 2D array defining the longitude of the input data 12 ; @param latin {in}{optional} a 2D array defining the latitude of the input data. 13 ; @param mskin {in}{optional} a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 14 ; @param lonout {in}{optional} 1D or 2D array defining the longitude of the output data. 15 ; @param latout {in}{optional} 1D or 2D array defining the latitude of the output data. 16 ; @param mskout {in}{required} a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 9 ; @param method {in}{required} 10 ; a string defining the interpolation method. must be 'bilinear' 11 ; 12 ; @param datain {in}{required} 13 ; a 2D array the input data to interpolate 14 ; 15 ; @param lonin {in}{optional} 16 ; a 2D array defining the longitude of the input data 17 ; 18 ; @param latin {in}{optional} 19 ; a 2D array defining the latitude of the input data. 20 ; 21 ; @param mskin {in}{optional} 22 ; a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 23 ; 24 ; @param lonout {in}{optional} 25 ; 1D or 2D array defining the longitude of the output data. 26 ; 27 ; @param latout {in}{optional} 28 ; 1D or 2D array defining the latitude of the output data. 29 ; 30 ; @param mskout {in}{required} 31 ; a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 17 32 ; 18 33 ; @keyword WEIG (see ADDR) 19 34 ; @keyword ADDR 2D arrays, weig and addr are the weight and addresses used to 20 ; 35 ; perform the interpolation: 21 36 ; dataout = total(weig*datain[addr], 1) 22 37 ; dataout = reform(dataout, jpio, jpjo, /over) 23 ; 24 ; 25 ; 26 ; 38 ; Those keywords can be set to named variables (that are undefined or equal to 0) into which the 39 ; values will be copied when the current routine exits. Next, they can be used to perform 40 ; the interpolation whithout computing again those 2 parameters. This greatly 41 ; speed-up the interpolation! In that case, lonin, latin, lonout and latout are not necessary. 27 42 ; 28 ; @returns 2D array the interpolated data 43 ; @returns 44 ; 2D array the interpolated data 29 45 ; 30 46 ; @restrictions -
trunk/SRC/Interpolation/fromreg.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; interpolate data from a "regular/rectangular grid" to any grid. 5 5 ; 2 methods availables: bilinear and imoms3 … … 9 9 ; @categories interpolation 10 10 ; 11 ; @param method {in}{required} a string defining the interpolation method. 12 ; must be 'bilinear' or 'imoms3' 13 ; @param datain {in}{required} a 2D array the input data to interpolate 14 ; @param lonin {in}{optional} 1D or 2D array defining the longitude of the input data 15 ; @param latin {in}{optional} 1D or 2D array defining the latitude of the input data 16 ; @param lonout {in}{optional} 1D or 2D array defining the longitude of the output data 17 ; @param latout {in}{required} 1D or 2D array defining the latitude of the output data 11 ; @param method {in}{required} 12 ; a string defining the interpolation method. 13 ; must be 'bilinear' or 'imoms3' 14 ; 15 ; @param datain {in}{required} 16 ; a 2D array the input data to interpolate 17 ; 18 ; @param lonin {in}{optional} 19 ; 1D or 2D array defining the longitude of the input data 20 ; 21 ; @param latin {in}{optional} 22 ; 1D or 2D array defining the latitude of the input data 23 ; 24 ; @param lonout {in}{optional} 25 ; 1D or 2D array defining the longitude of the output data 26 ; 27 ; @param latout {in}{required} 28 ; 1D or 2D array defining the latitude of the output data 18 29 ; 19 30 ; @keyword WEIG (see ADDR) 20 31 ; @keyword ADDR 2D arrays, weig and addr are the weight and addresses used to 21 ; 32 ; perform the interpolation: 22 33 ; dataout = total(weig*datain[addr], 1) 23 34 ; dataout = reform(dataout, jpio, jpjo, /over) 24 ; 25 ; 26 ; 27 ; 35 ; Those keywords can be set to named variables (that are undefined or equal to 0) into which the 36 ; values will be copied when the current routine exits. Next, they can be used to perform 37 ; the interpolation whithout computing again those 2 parameters. In that 38 ; case, lonin, latin, lonout and latout are not necessary. 28 39 ; 29 40 ; @keyword NONORTHERNLINE … … 32 43 ; of the input data when perfoming the interpolation. 33 44 ; 34 ; @returns 2D array the interpolated data 45 ; @returns 46 ; 2D array the interpolated data 35 47 ; 36 48 ; @restrictions -
trunk/SRC/Interpolation/get_gridparams.pro
r134 r136 2 2 ; 3 3 ; @file_comments 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 4 ; 1) extract from a NetCDF file the longitude, latidude, and their dimensions 5 ; and make sure it is 1D or 2D arrays 6 ; 7 ; or 8 ; 2) given longitude and latitude arrays get their dimensions and make 9 ; sure they are 1D or 2D arrays 10 10 ; 11 11 ; @categories interpolation … … 22 22 ; 23 23 ; 1) 24 ; @param in1 {in}{required} the name of the netcdf file 25 ; @param in2 {in}{required} the name of the variable that contains the longitude in the NetCDF file 26 ; @param in3 {in}{required} the name of the variable that contains the latitude in the NetCDF file 27 ; @param in4 {out} the number of points in the longitudinal direction 28 ; @param in5 {out} the number of points in the latitudinal direction 29 ; @param in6 {out} the variable that will contain the longitudes 30 ; @param in7 {out} the variable that will contain the latitudes 31 ; @param in8 {out} 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 24 ; @param in1 {in}{required} 25 ; the name of the netcdf file 26 ; 27 ; @param in2 {in}{required} 28 ; the name of the variable that contains the longitude in the NetCDF file 29 ; 30 ; @param in3 {in}{required} 31 ; the name of the variable that contains the latitude in the NetCDF file 32 ; 33 ; @param in4 {out} 34 ; the number of points in the longitudinal direction 35 ; 36 ; @param in5 {out} 37 ; the number of points in the latitudinal direction 38 ; 39 ; @param in6 {out} 40 ; the variable that will contain the longitudes 41 ; 42 ; @param in7 {out} 43 ; the variable that will contain the latitudes 44 ; 45 ; @param in8 {out} 46 ; 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 32 47 ; 33 48 ; or 34 49 ; 35 50 ; 2) 36 ; @param in1 {in}{required} 1d or 2D arrays defining longitudes and latitudes. 37 ; @param in2 {in}{required} 1d or 2D arrays defining longitudes and latitudes. 38 ; Note that these arrays are also outputs and can therefore be modified. 39 40 ; @param in1 {out} the variable that will contain the longitudes 41 ; @param in2 {out} the variable that will contain the latitudes 42 ; @param in3 {in} the number of points in the longitudinal direction 43 ; @param in4 {in} the number of points in the latitudinal direction 44 ; @param in5 {in} 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 45 ; arrays or 2D arrays (jpi,jpj). Note that of n_dimensions = 1, then the 46 ; grid must be regular (each longitudes must be the same for all latitudes 47 ; and each latitudes should be the sae for all longitudes). 48 ; 49 ; @keyword DOUBLE use double precision to perform the computation 51 ; @param in1 {in}{required} 52 ; 1d or 2D arrays defining longitudes and latitudes. 53 ; 54 ; @param in2 {in}{required} 55 ; 1d or 2D arrays defining longitudes and latitudes. 56 ; Note that these arrays are also outputs and can therefore be modified. 57 ; 58 ; @param in1 {out} 59 ; the variable that will contain the longitudes 60 ; 61 ; @param in2 {out} 62 ; the variable that will contain the latitudes 63 ; 64 ; @param in3 {in} 65 ; the number of points in the longitudinal direction 66 ; 67 ; @param in4 {in} 68 ; the number of points in the latitudinal direction 69 ; 70 ; @param in5 {in} 71 ; 1 or 2 to specify if lon and lat should be 1D (jpi or jpj) 72 ; arrays or 2D arrays (jpi,jpj). Note that of n_dimensions = 1, then the 73 ; grid must be regular (each longitudes must be the same for all latitudes 74 ; and each latitudes should be the sae for all longitudes). 75 ; 76 ; @keyword DOUBLE 77 ; use double precision to perform the computation 50 78 ; 51 79 ; @examples -
trunk/SRC/Interpolation/inquad.pro
r134 r136 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; to find if an (x,y) point is in a quadrilateral (x1,x2,x3,x4) 4 4 ; … … 7 7 ; @param x {in}{required} 8 8 ; @param y {in}{required} 9 ; 10 ; 9 ; the coordinates of the point we want to know where it is. 10 ; Must be a scalar if /ONSPHERE activated else can be scalar or array. 11 11 ; 12 12 ; @param x1 {in}{required} … … 18 18 ; @param x4 {in}{required} 19 19 ; @param y4 {in}{required} 20 ; the coordinates of the quadrilateral given in the CLOCKWISE order. 21 ; Scalar or array. 22 ; 23 ; @keyword DOUBLE use double precision to perform the computation 24 ; 25 ; @keyword ONSPHERE to specify that the quadilateral are on a sphere and 26 ; that teir coordinates are longitude-latitude coordinates. In this 27 ; case, est-west periodicity, poles singularity and other pbs 28 ; related to longitude-latitude coordinates are managed 29 ; automatically. 20 ; the coordinates of the quadrilateral given in the CLOCKWISE order. 21 ; Scalar or array. 22 ; 23 ; @keyword DOUBLE 24 ; use double precision to perform the computation 25 ; 26 ; @keyword ONSPHERE 27 ; to specify that the quadilateral are on a sphere and 28 ; that teir coordinates are longitude-latitude coordinates. In this 29 ; case, est-west periodicity, poles singularity and other pbs 30 ; related to longitude-latitude coordinates are managed 31 ; automatically. 30 32 ; 31 33 ; @keyword ZOOMRADIUS {default=4} 32 34 ; the zoom (circle centred on the (x,y) with a radius of 33 ; zoomradius degree where we look for the the quadrilateral which 34 ; contains the (x,y) point) used for the satellite projection 35 ; when /ONSPHERE is activated. 36 ; 4 seems to be the minimum which can be used. 37 ; Can be increase if the cell size is larger than 5 degrees. 38 ; 39 ; @keyword NOPRINT to suppress the print messages. 35 ; zoomradius degree where we look for the the quadrilateral which 36 ; contains the (x,y) point) used for the satellite projection 37 ; when /ONSPHERE is activated. 38 ; 4 seems to be the minimum which can be used. 39 ; Can be increase if the cell size is larger than 5 degrees. 40 ; 41 ; @keyword NOPRINT 42 ; to suppress the print messages. 40 43 ; 41 44 ; @keyword NEWCOORD 42 45 ; 43 46 ; @returns 44 ; 45 ; 46 ; 47 ; a n element vector. Where n is the number of elements of 48 ; x. res[i]=j means that the point number i is located in the 49 ; quadrilateral number j with (0 <= j <= n_elements(x0)-1) 47 50 ; 48 51 ; @restrictions … … 67 70 ; IDL> print, inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4) 68 71 ; 69 ; 72 ; On a sphere see clickincell.pro... 70 73 ; 71 74 ; @history … … 292 295 ; point 293 296 found = temporary(found)/ntofind 294 ; found must be sorted accordin dto forsort297 ; found must be sorted according to forsort 295 298 found = found[sort(forsort)] 296 299 ENDELSE -
trunk/SRC/Interpolation/inrecgrid.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; given - a list of points, (x,y) position 5 5 ; - the x and y limits of a rectangular grid … … 24 24 ; @keyword OUTPUT2D 25 25 ; to get the output as a 2d array (2,n_elements(x1d)), 26 ; with res[0,*] the x index accoring to the 1d array defined by 27 ; left and res[1,*] the y index accoring to the 1d array defined by 28 ; bottom. 26 ; with res[0,*] the x index according to the 1d array defined by 27 ; left and res[1,*] the y index according to the 1d array defined by bottom. 29 28 ; 30 29 ; @keyword CHECKOUT 31 30 ; = [rbgrid,ubgrid] specify the right and upper boundaries of 32 ; 31 ; the grid and check if some points are out. 33 32 ; 34 33 ; @returns 35 ; the index on the cell accor ing to the 2d array defined by left and bottom.34 ; the index on the cell according to the 2d array defined by left and bottom. 36 35 ; 37 36 ; @examples -
trunk/SRC/Interpolation/ll_narcs_distances.pro
r134 r136 8 8 ; 9 9 ; Formula from Map Projections - a working manual. USGS paper 10 ; 1395. 10 ; 1395. Equations (5-5) and (5-6). 11 11 ; 12 12 ; @categories Mapping, geography -
trunk/SRC/Interpolation/map_npoints.pro
r134 r136 1 ;+ 2 ; 3 ; @file_comments 4 ; Return the distance in meter between all np0 points P0 and all 5 ; np1 points P1 on a sphere. If keyword /TWO_BY_TWO is given then 6 ; returns the distances between number n of P0 points and number 1 ;+ 2 ; 3 ; @file_comments 4 ; Return the distance in meter between all np0 points P0 and all 5 ; np1 points P1 on a sphere. If keyword /TWO_BY_TWO is given then 6 ; returns the distances between number n of P0 points and number 7 7 ; n of P1 points (in that case, np0 and np1 must be equal). 8 8 ; Same as map_2points with the meter parameter but for n points … … 46 46 ; an np-element vector giving the distance in meter between P0[i] 47 47 ; and P1[i] (in that case, we have np0 = np1 = np) ; if /MIDDLE see this keyword. 48 ;49 48 ; @examples 50 49 ; IDL> print, $ -
trunk/SRC/Interpolation/neighbor.pro
r134 r136 7 7 ; @categories Maps 8 8 ; 9 ; @param p0lon {in}{required} scalar. longitudes of point P0. 10 ; @param p0lat {in}{required} scalar. latitudes of point P0. 9 ; @param p0lon {in}{required} 10 ; scalar. longitudes of point P0. 11 ; 12 ; @param p0lat {in}{required} 13 ; scalar. latitudes of point P0. 14 ; 11 15 ; @param neighlon {in}{optional} 16 ; 12 17 ; @param neighlat {in}{optional} 13 18 ; -
trunk/SRC/Interpolation/quadrilateral2square.pro
r134 r136 28 28 ; given in the anticlockwise order. 29 29 ; 30 ; @param xxin {in}{required} the coordinates of the point(s) for which we want to do the mapping. Can be scalar or array. 31 ; @param yyin {in}{required} the coordinates of the point(s) for which we want to do the mapping. Can be scalar or array. 30 ; @param xxin {in}{required} 31 ; the coordinates of the point(s) for which we want to do the mapping. 32 ; Can be scalar or array. 33 ; 34 ; @param yyin {in}{required} 35 ; the coordinates of the point(s) for which we want to do the mapping. 36 ; Can be scalar or array. 32 37 ; 33 38 ; @keyword PERF … … 35 40 ; @returns 36 41 ; 37 ; (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 38 ; point(s) after mapping. 39 ; If xin is a scalar, then n is equal to the number of elements of 40 ; x0. If xin is an array , then n is equal to the number of 41 ; elements of xin. 42 ; (2,n) array: the new coodinates (xout, yout) of the (xin,yin) point(s) after 43 ; mapping. 44 ; If xin is a scalar, then n is equal to the number of elements of x0. 45 ; If xin is an array , then n is equal to the number of elements of xin. 42 46 ; 43 47 ; @restrictions -
trunk/SRC/Interpolation/spl_incr.pro
r134 r136 18 18 ; @param y1 {in}{required} 19 19 ; f(x) = y. An n-element input vector that specifies the values 20 ; 21 ; 22 ; 20 ; of the tabulated function F(Xi) corresponding to Xi. As f is 21 ; supposed to be monotonically increasing, y values must be 22 ; monotonically increasing. y can have equal consecutive values. 23 23 ; 24 24 ; @param x2 {in}{required} … … 27 27 ; 28 28 ; @param der2 29 ; 29 30 ; @param x 30 31 ; … … 34 35 ; 35 36 ; @restrictions 36 ; 37 ; 37 ; It might be possible that y2[i+1]-y2[i] has very small negative 38 ; values (amplitude smaller than 1.e-6)... 38 39 ; 39 40 ; @examples -
trunk/SRC/Interpolation/spl_keep_mean.pro
r134 r136 41 41 ; 42 42 ; @returns 43 ; 44 ; y2: the meean value between two consecutive values of x2. This 45 ; array has one element less than y2. y2 has double precision. 43 ; y2: the mean value between two consecutive values of x2. This 44 ; array has one element less than y2. y2 has double precision. 46 45 ; 47 46 ; @restrictions 48 ; It might be possible that y2 has very small negative values 49 ; (amplitude smaller than 1.e-6)... 50 ; 47 ; It might be possible that y2 has very small negative values 48 ; (amplitude smaller than 1.e-6)... 51 49 ; 52 50 ; @examples -
trunk/SRC/Interpolation/square2quadrilateral.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; warm (or map) a unit square onto an arbitrary quadrilateral 5 5 ; according to the 4-point correspondences: … … 14 14 ; @categories image, grid manipulation 15 15 ; 16 ; @param x0in {in}{required} the coordinates of the quadrilateral 17 ; (see above for correspondance with the unit square). Can be 18 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 19 ; given in the anticlockwise order. 20 ; @param y0in {in}{required} the coordinates of the quadrilateral 21 ; (see above for correspondance with the unit square). Can be 22 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 23 ; given in the anticlockwise order. 24 ; @param x1in {in}{required} the coordinates of the quadrilateral 25 ; (see above for correspondance with the unit square). Can be 26 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 27 ; given in the anticlockwise order. 28 ; @param y1in {in}{required} the coordinates of the quadrilateral 29 ; (see above for correspondance with the unit square). Can be 30 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 31 ; given in the anticlockwise order. 32 ; @param x2in {in}{required} the coordinates of the quadrilateral 33 ; (see above for correspondance with the unit square). Can be 34 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 35 ; given in the anticlockwise order. 36 ; @param y2in {in}{required} the coordinates of the quadrilateral 37 ; (see above for correspondance with the unit square). Can be 38 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 39 ; given in the anticlockwise order. 40 ; @param x3in {in}{required} the coordinates of the quadrilateral 41 ; (see above for correspondance with the unit square). Can be 42 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 43 ; given in the anticlockwise order. 44 ; @param y3in {in}{required} the coordinates of the quadrilateral 45 ; (see above for correspondance with the unit square). Can be 46 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 47 ; given in the anticlockwise order. 16 ; @param x0in {in}{required} 17 ; @param y0in {in}{required} 18 ; @param x1in {in}{required} 19 ; @param y1in {in}{required} 20 ; @param x2in {in}{required} 21 ; @param y2in {in}{required} 22 ; @param x3in {in}{required} 23 ; @param y3in {in}{required} 24 ; the coordinates of the quadrilateral (see above for correspondance with the 25 ; unit square). 26 ; Can be scalar or array. 27 ; (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are given in the anticlockwise order. 48 28 ; 49 ; @param xxin {in}{optional} the coordinates of the point(s) for which we want to do the50 ; mapping. Can be scalar or array.51 ; @param yyin {in}{optional} the coordinates of the point(s) for which we want to do the52 ; mapping. Can be scalar or array.29 ; 30 ; @param xxin {in}{optional} 31 ; @param yyin {in}{optional} 32 ; the coordinates of the point(s) for which we want to do the mapping. 53 33 ; 54 34 ; @returns 35 ; (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 36 ; point(s) after mapping. 37 ; If xin is a scalar, then n is equal to the number of elements of 38 ; x0. If xin is an array , then n is equal to the number of 39 ; elements of xin. 40 ; If xin and yin are omited, square2quadrilateral returns the 41 ; matrix A which is used for the inverse transformation. 55 42 ; 56 ; (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 57 ; point(s) after mapping. 58 ; If xin is a scalar, then n is equal to the number of elements of 59 ; x0. If xin is an array , then n is equal to the number of 60 ; elements of xin. 61 ; If xin and yin are omited, square2quadrilateral returns the 62 ; matrix A which is used for the inverse transformation. 63 ; 64 ; 65 ; @restrictions I think degenerated quadrilateral (e.g. flat of 66 ; twisted) is not work. This has to be tested. 43 ; @restrictions 44 ; I think degenerated quadrilateral (e.g. flat of twisted) is not work. 45 ; This has to be tested. 67 46 ; 68 47 ; @examples -
trunk/SRC/Matrix/cmapply.pro
r134 r136 1 ;; Utility function, adapted from CMPRODUCT2 1 ;+ 2 ; @file_comments 3 ; Utility function, adapted from CMPRODUCT 4 ; 5 ; @version $Id$ 6 ; 3 7 ; @todo seb 4 8 ;- … … 20 24 end 21 25 22 ;; Utility function, used to collect collaped dimensions23 26 ;+ 27 ; @file_comments 28 ; cmapply_redim : Utility function, used to collect collaped dimensions 29 ; 24 30 ; @todo seb 25 31 ;- … … 53 59 ;+ 54 60 ; 55 ; @file_comments 61 ; @file_comments 56 62 ; Applies a function to specified dimensions of an array 57 63 ; 58 ; 59 ; 60 ; CMAPPLY will apply one of a few select functions to specified61 ; 62 ; 63 ; function. Iterative loops are avoided where possible, for64 ; 64 ; Description: 65 ; 66 ; CMAPPLY will apply one of a few select functions to specified 67 ; dimensions of an array. Unlike some IDL functions, you *do* have 68 ; a choice of which dimensions that are to be "collapsed" by this 69 ; function. Iterative loops are avoided where possible, for 70 ; performance reasons. 65 71 ; 66 72 ; The possible functions are: (and number of loop iterations:) … … 102 108 ; @categories Arrays 103 109 ; 104 ; @param OP {in}{required} The operation to perform, as a string. May be upper or lower 105 ; case. 106 ; 107 ; If a user-defined operation is to be passed, then OP is of 108 ; the form, 'USER:FUNCTNAME', where FUNCTNAME is the name of 109 ; the user-defined function. 110 ; 111 ; @param ARRAY {in}{required} An array of values to be operated on. Must not be of type 112 ; STRING (7) or STRUCTURE (8). 113 ; 114 ; @param DIMS {in}{optional}{default=1 (ie, first dimension)} 115 ; An array of dimensions that are to be "collapsed", where 116 ; the the first dimension starts with 1 (ie, same convention 117 ; as IDL function TOTAL). Whereas TOTAL only allows one 118 ; dimension to be added, you can specify multiple dimensions 119 ; to CMAPPLY. Order does not matter, since all operations 120 ; are associative and transitive. NOTE: the dimensions refer 121 ; to the *input* array, not the output array. IDL allows a 122 ; maximum of 8 dimensions. 123 ; DEFAULT: 1 (ie, first dimension) 124 ; 125 ; @keyword DOUBLE Set this if you wish the internal computations to be done 126 ; in double precision if necessary. If ARRAY is double 127 ; precision (real or complex) then DOUBLE=1 is implied. 128 ; DEFAULT: not set 129 ; 130 ; @keyword TYPE Set this to the IDL code of the desired output type (refer 131 ; to documentation of SIZE()). Internal results will be 132 ; rounded to the nearest integer if the output type is an 133 ; integer type. 134 ; DEFAULT: same is input type 135 ; 136 ; @keyword FUNCTARGS If OP is 'USER:...', then the contents of this keyword 137 ; are passed to the user function using the _EXTRA 138 ; mechanism. This way you can pass additional data to 139 ; your user-supplied function, via keywords, without 140 ; using common blocks. 141 ; DEFAULT: undefined (i.e., no keywords passed by _EXTRA) 142 ; 143 ; @returns An array of the required TYPE, whose elements are the result of 144 ; the requested operation. Depending on the operation and number of 145 ; elements in the input array, the result may be vulnerable to 146 ; overflow or underflow. 147 ; 148 ; @examples 149 ; 110 ; @param OP {in}{required} 111 ; The operation to perform, as a string. May be upper or lower case. 112 ; 113 ; If a user-defined operation is to be passed, then OP is of 114 ; the form, 'USER:FUNCTNAME', where FUNCTNAME is the name of 115 ; the user-defined function. 116 ; 117 ; @param ARRAY {in}{required} 118 ; An array of values to be operated on. 119 ; Must not be of type STRING (7) or STRUCTURE (8). 120 ; 121 ; @param dimapply {in}{optional}{default=1 (ie, first dimension)} 122 ; An array of dimensions that are to be "collapsed", where 123 ; the the first dimension starts with 1 (ie, same convention 124 ; as IDL function TOTAL). Whereas TOTAL only allows one 125 ; dimension to be added, you can specify multiple dimensions 126 ; to CMAPPLY. Order does not matter, since all operations 127 ; are associative and transitive. NOTE: the dimensions refer 128 ; to the *input* array, not the output array. IDL allows a 129 ; maximum of 8 dimensions. 130 ; 131 ; @keyword DOUBLE {default=not set} 132 ; Set this if you wish the internal computations to be done 133 ; in double precision if necessary. If ARRAY is double 134 ; precision (real or complex) then DOUBLE=1 is implied. 135 ; 136 ; @keyword TYPE 137 ; Set this to the IDL code of the desired output type (refer 138 ; to documentation of SIZE()). Internal results will be 139 ; rounded to the nearest integer if the output type is an 140 ; integer type. 141 ; DEFAULT: same is input type 142 ; 143 ; @keyword FUNCTARGS 144 ; If OP is 'USER:...', then the contents of this keyword 145 ; are passed to the user function using the _EXTRA 146 ; mechanism. This way you can pass additional data to 147 ; your user-supplied function, via keywords, without 148 ; using common blocks. 149 ; DEFAULT: undefined (i.e., no keywords passed by _EXTRA) 150 ; 151 ; @returns 152 ; An array of the required TYPE, whose elements are the result of 153 ; the requested operation. Depending on the operation and number of 154 ; elements in the input array, the result may be vulnerable to 155 ; overflow or underflow. 156 ; 157 ; @examples 158 ; 150 159 ; First example: Shows how CMAPPLY can be used to total the second dimension of the 151 160 ; array called IN. This is equivalent to OUT = TOTAL(IN, 2) … … 190 199 ; Changed usage message to not bomb, 24 Mar 2000, CM 191 200 ; Signficant rewrite for *, MIN and MAX (inspired by Todd Clements 192 ; <Todd_Clements @alumni.hmc.edu>); FOR loop indices are now type201 ; <Todd_Clements\@alumni.hmc.edu>); FOR loop indices are now type 193 202 ; LONG; copying terms are liberalized, CM, 22, Aug 2000 194 203 ; More efficient MAX/MIN (inspired by Alex Schuster), CM, 25 Jan … … 199 208 ; 200 209 ; Author: Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 201 ; craigm @lheamail.gsfc.nasa.gov210 ; craigm\@lheamail.gsfc.nasa.gov 202 211 ; 203 212 ; @version $Id$ … … 293 302 if newop EQ 'MIN' then return, min(newarr) 294 303 endif 295 304 296 305 ;; Next task: create result array 297 306 result = make_array(totkeep, type=type) 298 307 299 308 ;; Now either iterate over the number of output elements, or 300 309 ;; the number of collapsed elements, whichever is smaller. … … 302 311 ;; Iterate over the number of collapsed elements 303 312 result[0] = reform(newarr[0,*],totkeep,/overwrite) 304 case newop of 313 case newop of 305 314 'MAX': for i = 1L, totcol-1 do $ 306 315 result[0] = result > newarr[i,*] … … 310 319 endif else begin 311 320 ;; Iterate over the number of output elements 312 case newop of 321 case newop of 313 322 'MAX': for i = 0L, totkeep-1 do result[i] = max(newarr[*,i]) 314 323 'MIN': for i = 0L, totkeep-1 do result[i] = min(newarr[*,i]) … … 332 341 return, call_function(functname, newarr) 333 342 endif 334 343 335 344 ;; Next task: create result array 336 345 result = make_array(totkeep, type=type) 337 346 338 347 ;; Iterate over the number of output elements 339 348 if n_elements(functargs) GT 0 then begin … … 349 358 end 350 359 351 360 352 361 endcase 353 362 … … 363 372 return, call_function(castfns[type], newarr) 364 373 end 365 -
trunk/SRC/Matrix/cmset_op.pro
r134 r136 2 2 ; @hidden 3 3 ; 4 ; @file_comments 5 ; Simplified version of CMSET_OP_UNIQ which sorts, and takes the 6 ; "first" value, whatever that may mean. 7 ; 4 8 ; @todo seb 5 9 ;- 6 10 ; 7 ;; Simplified version of CMSET_OP_UNIQ which sorts, and takes the8 ;; "first" value, whatever that may mean.9 11 function cmset_op_uniq, a 10 12 ; … … 22 24 ;+ 23 25 ; 24 ; @file_comments 26 ; @file_comments 25 27 ; Performs an AND, OR, or XOR operation between two sets 26 28 ; 27 ; Description: SET_OP performs three common operations between two sets.The28 ; 29 ; Description: SET_OP performs three common operations between two sets. The 30 ; three supported functions of OP are: 29 31 ; 30 32 ; OP Meaning 31 33 ; 'AND' - to find the intersection of A and B; 32 34 ; 'OR' - to find the union of A and B; 33 ; 'XOR' - to find the those elements who are members of A or B 35 ; 'XOR' - to find the those elements who are members of A or B 34 36 ; but not both; 35 37 ; 36 38 ; Sets as defined here are one dimensional arrays composed of 37 ; numeric or string types. 39 ; numeric or string types. Comparisons of equality between elements 38 40 ; are done using the IDL EQ operator. 39 41 ; 40 42 ; The complements of either set can be taken as well, by using the 41 ; NOT1 and NOT2 keywords. 43 ; NOT1 and NOT2 keywords. For example, it may be desireable to find 42 44 ; the elements in A but not B, or B but not A (they are different!). 43 45 ; The following IDL expressions achieve each of those effects: … … 52 54 ; 53 55 ; NOT1 and NOT2 can only be set for the 'AND' operator, and never 54 ; simultaneously. 56 ; simultaneously. This is because the results of an operation with 55 57 ; 'OR' or 'XOR' and any combination of NOTs -- or with 'AND' and 56 58 ; both NOTs -- formally cannot produce a defined result. 57 59 ; 58 ; The implementation depends on the type of operands. 59 ; types, a fast technique using HISTOGRAM is used. 60 ; The implementation depends on the type of operands. For integer 61 ; types, a fast technique using HISTOGRAM is used. However, this 60 62 ; algorithm becomes inefficient when the dynamic range in the data 61 ; is large. 62 ; based on SORT() is used. 63 ; is large. For those cases, and for other data types, a technique 64 ; based on SORT() is used. Thus the compute time should scale 63 65 ; roughly as (A+B)*ALOG(A+B) or better, rather than (A*B) for the 64 ; brute force approach. 66 ; brute force approach. For large arrays this is a significant 65 67 ; benefit. 66 68 ; 67 69 ; @categories array 68 70 ; 69 ; @param A {in}{required} The two sets to be operated on. A one dimensional array of 70 ; either numeric or string type. A and B must be of the same 71 ; type. Empty sets are permitted, and are either represented 72 ; as an undefined variable, or by setting EMPTY1 or EMPTY2. 73 ; 74 ; @param B {in}{required} See A 75 ; 76 ; @param OP {in}{required} a string, the operation to be performed. Must be one of 77 ; 'AND', 'OR' or 'XOR' (lower or mixed case is permitted). 78 ; Other operations will cause an error message to be produced. 79 ; 80 ; @keyword NOT1 If set and OP is 'AND', then the complement of A (for 81 ; NOT1) or B (for NOT2) will be used in the operation. 82 ; NOT1 and NOT2 cannot be set simultaneously. 83 ; 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 93 ; values themselves. The "slower" set operations are always 94 ; performed in this case. 95 ; 96 ; The indices refer to the *combined* array [A,B]. To 97 ; clarify, in the following call: I = CMSET_OP(..., /INDEX); 98 ; returned values from 0 to NA-1 refer to A[I], and values 99 ; from NA to NA+NB-1 refer to B[I-NA]. 100 ; 101 ; @keyword COUNT upon return, the number of elements in the result set. 102 ; This is only important when the result set is the empty 103 ; set, in which case COUNT is set to zero. 104 ; 105 ; @returns The resulting set as a one-dimensional array. The set may be 106 ; represented by either an array of data values (default), or an 107 ; array of indices (if INDEX is set). Duplicate elements, if any, 108 ; are removed, and element order may not be preserved. 109 ; 110 ; The empty set is represented as a return value of -1L, and COUNT 111 ; is set to zero. Note that the only way to recognize the empty set 112 ; is to examine COUNT. 71 ; @param A {in}{required} 72 ; The two sets to be operated on. A one dimensional array of 73 ; either numeric or string type. A and B must be of the same 74 ; type. Empty sets are permitted, and are either represented 75 ; as an undefined variable, or by setting EMPTY1 or EMPTY2. 76 ; 77 ; @param B {in}{required} 78 ; See A 79 ; 80 ; @param OP0 {in}{required} 81 ; a string, the operation to be performed. Must be one of 82 ; 'AND', 'OR' or 'XOR' (lower or mixed case is permitted). 83 ; Other operations will cause an error message to be produced. 84 ; 85 ; @keyword NOT1 86 ; If set and OP is 'AND', then the complement of A (for 87 ; NOT1) or B (for NOT2) will be used in the operation. 88 ; NOT1 and NOT2 cannot be set simultaneously. 89 ; 90 ; @keyword NOT2 91 ; See NOT1 92 ; 93 ; @keyword EMPTY1 94 ; If set, then A (for EMPTY1) or B (for EMPTY2) are 95 ; assumed to be the empty set. The actual values 96 ; passed as A or B are then ignored. 97 ; 98 ; @keyword EMPTY2 99 ; See EMPTY1 100 ; 101 ; @keyword INDEX 102 ; if set, then return a list of indices instead of the array 103 ; values themselves. The "slower" set operations are always 104 ; performed in this case. 105 ; 106 ; The indices refer to the *combined* array [A,B]. To 107 ; clarify, in the following call: I = CMSET_OP(..., /INDEX); 108 ; returned values from 0 to NA-1 refer to A[I], and values 109 ; from NA to NA+NB-1 refer to B[I-NA]. 110 ; 111 ; @keyword COUNT 112 ; upon return, the number of elements in the result set. 113 ; This is only important when the result set is the empty 114 ; set, in which case COUNT is set to zero. 115 ; 116 ; @returns 117 ; The resulting set as a one-dimensional array. The set may be 118 ; represented by either an array of data values (default), or an 119 ; array of indices (if INDEX is set). Duplicate elements, if any, 120 ; are removed, and element order may not be preserved. 121 ; 122 ; The empty set is represented as a return value of -1L, and COUNT 123 ; is set to zero. Note that the only way to recognize the empty set 124 ; is to examine COUNT. 113 125 ; 114 126 ; SEE ALSO: 115 127 ; 116 ; 128 ; SET_UTILS.PRO by RSI 117 129 ; 118 130 ; @history Written, CM, 23 Feb 2000 … … 145 157 ; 146 158 ; 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 159 ; craigm\@lheamail.gsfc.nasa.gov 160 ; 161 ; @version $Id$ 162 ; 163 ; @examples 164 ; Utility function, similar to UNIQ, but allowing choice of taking 152 165 ; first or last unique element, or non-unique elements. 153 166 ; Unfortunately this doesn't work because of implementation dependent … … 235 248 if n2 GT 0 then b1 = cmset_op_uniq(b) 236 249 n1 = n_elements(a1) < n1 & n2 = n_elements(b1) < n2 237 case op of 250 case op of 238 251 'OR': if n1 EQ 0 then goto, RET_A1 else goto, RET_B1 239 252 'XOR': if n1 EQ 0 then goto, RET_B1 else goto, RET_A1 … … 255 268 if kind then begin 256 269 if count GT 0 then return, b1+n1 else return, -1L 257 endif 270 endif 258 271 if count GT 0 then return, b[b1] else return, -1L 259 272 endif … … 294 307 ;; String and real types, or large int arrays 295 308 SLOW_SET_OP: 296 case op of 309 case op of 297 310 'OR': begin 298 311 uu = [a,b] ;; OR is simple; just take unique values … … 394 407 395 408 ;; Compute NOT cases 396 if keyword_set(not1) then ha = 1b - ha 409 if keyword_set(not1) then ha = 1b - ha 397 410 if keyword_set(not2) then hb = 1b - hb 398 case op of 411 case op of 399 412 ;; Boolean operations 400 'AND': mask = temporary(ha) AND temporary(hb) 413 'AND': mask = temporary(ha) AND temporary(hb) 401 414 'OR': mask = temporary(ha) OR temporary(hb) 402 415 'XOR': mask = temporary(ha) XOR temporary(hb) … … 405 418 wh = where(temporary(mask), count) 406 419 if count EQ 0 then return, -1L 407 420 408 421 result = temporary(wh+minn) 409 422 if tp1 NE tp2 then return, result -
trunk/SRC/Matrix/congridseb.pro
r134 r136 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; @file_comment 5 ; @file_comments 6 6 ; Like congrid but here, it works... 7 7 ; example: 8 ; IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4)8 ; IDL> print, congrid([[1,2,3,4],[5,6,7,8]],12,4) 9 9 ; 1 1 1 2 2 2 3 3 3 3 4 4 10 10 ; 1 1 1 2 2 2 3 3 3 3 4 4 11 11 ; 5 5 5 6 6 6 7 7 7 7 8 8 12 12 ; 5 5 5 6 6 6 7 7 7 7 8 8 13 ; IDL> print, rebin([[1,2,3,4],[5,6,7,8]],12,4)13 ; IDL> print, rebin([[1,2,3,4],[5,6,7,8]],12,4) 14 14 ; 1 1 1 2 2 2 3 3 3 4 4 4 15 15 ; 3 3 3 4 4 4 5 5 5 6 6 6 16 16 ; 5 5 5 6 6 6 7 7 7 8 8 8 17 17 ; 5 5 5 6 6 6 7 7 7 8 8 8 18 ; IDL> print, congridseb([[1,2,3,4],[5,6,7,8]],12,4)18 ; IDL> print, congridseb([[1,2,3,4],[5,6,7,8]],12,4) 19 19 ; 1 1 1 2 2 2 3 3 3 4 4 4 20 20 ; 1 1 1 2 2 2 3 3 3 4 4 4 … … 24 24 ; @categories utilities 25 25 ; 26 ; @param tableau {in}{required} A table 1 ou 2d 26 ; @param tableau {in}{required} 27 ; A table 1 ou 2d 27 28 ; 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. 29 ; @param x {in}{required} 30 ; dimension in x of the result which must be 31 ; a multiple of the dimension in x of the table. 30 32 ; 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. 33 ; @param y {in}{required} 34 ; dimension in y of the result which must be 35 ; a multiple of the dimension in y of the table. 33 36 ; 34 ; @returns res a table dim x * y 37 ; @returns 38 ; a table dim x * y 35 39 ; 36 ; @history Sebastien Masson (smasson @lodyc.jussieu.fr)40 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 37 41 ; 20/3/98 38 42 ; 18/6/1999 supression d''une horrible boucle … … 64 68 end 65 69 else: return, report('Mauvais nombre de parametre dans l''appel de CONGRIDSEB') 66 endcase 70 endcase 67 71 end -
trunk/SRC/Matrix/extrac2.pro
r134 r136 4 4 ;+ 5 5 ; 6 ; @fie-comments 7 ; extractoin of subdomains of matrixes; Even if the subdomain is "pierced" (see the example) 6 ; @file_comments 7 ; extraction of subdomains of matrixes; 8 ; Even if the subdomain is "pierced" (see the example) 8 9 ; By default, IDL can make extractions of subdomain: 9 10 ; 10 ; IDL> a=indgen(5,5) 11 ; IDL> print, a 11 ; IDL> a=indgen(5,5) 12 ; IDL> print, a 12 13 ; 0 1 2 3 4 13 14 ; 5 6 7 8 9 … … 15 16 ; 15 16 17 18 19 16 17 ; 20 21 22 23 24 17 ; IDL> print, a[[0,2],3] 18 ; IDL> print, a[[0,2],3] 18 19 ; 15 17 19 ; IDL> print, a[[0,2],*] 20 ; IDL> print, a[[0,2],*] 20 21 ; 0 2 21 22 ; 5 7 … … 24 25 ; 20 22 25 26 ; but 26 ; IDL> print, a[[0,2],[3,4]] 27 ; IDL> print, a[[0,2],[3,4]] 27 28 ; 15 22 28 29 ; while 29 ; IDL> print, extrac2(a,[0,2],[3,4]) 30 ; IDL> print, extrac2(a,[0,2],[3,4]) 30 31 ; 15 17 31 32 ; 20 22 … … 33 34 ; @categories utilities 34 35 ; 35 ; @param array {in}{required} a 1,2,3 or 4 dim input array 36 ; @param array {in}{required} 37 ; a 1,2,3 or 4 dim input array 36 38 ; 37 ; @param index1 {in}{required} can have 2 forms: 38 ; 1)a vector containing indexes of lines we want to keep 39 ; 2)the string '*' if we want to keep all lines. 39 ; @param index1 {in}{required} 40 ; can have 2 forms: 41 ; 1)a vector containing indexes of lines we want to keep 42 ; 2)the string '*' if we want to keep all lines. 40 43 ; 41 ; @param index2 {in}{required} the same thing that index1 but for dim 2. 44 ; @param index2 {in}{required} 45 ; the same thing that index1 but for dim 2. 42 46 ; 43 ; @param index3 {in}{required} the same thing that index1 but for dim 3. 47 ; @param index3 {in}{required} 48 ; the same thing that index1 but for dim 3. 49 ; 50 ; @param index4 {in}{required} 51 ; the same thing that index1 but for dim 4. 52 ; 53 ; @returns 54 ; a matrix 1,2,3 or 4d extract from input array 55 ; 56 ; @restrictions 57 ; -1 in case of mistake 58 ; 59 ; @examples 60 ; I have a dim 2 matrix named A. I want extract a small intersection 61 ; matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 44 62 ; 45 ; @param index4 {in}{required} the same thing that index1 but for dim 4.63 ; IDL> res=extrac2(A,[2,3,7],[0,1]) 46 64 ; 47 ; @returns a matrix 1,2,3 or 4d extract from input array 65 ; other ex: 66 ; IDL> print, a 67 ; a b c 68 ; d e f 69 ; g h i 70 ; IDL> print, extrac2(a,[0,2],[0,2]) 71 ; a c 72 ; g i 48 73 ; 49 ; @restrictions res=-1 in case of mistake 50 ; 51 ; 52 ; @examples I have a dim 2 matrix named A. I want extract a small intersection 53 ; matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 54 ; 55 ; res=extrac2(A,[2,3,7],[0,1]) 56 ; 57 ;other ex: 58 ; IDL> print, a 59 ; a b c 60 ; d e f 61 ; g h i 62 ; IDL> print, extrac2(a,[0,2],[0,2]) 63 ; a c 64 ; g i 65 ; 66 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 74 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 67 75 ; 12/1/1999 68 76 ; 29/4/1999: correction of a bug and complement of the heading … … 86 94 if n_params() NE taille[0]+1 THEN $ 87 95 return, report('we need as many indexes as the number of dimensions of the input array') 88 IF n_params() GE 5 THEN BEGIN 96 IF n_params() GE 5 THEN BEGIN 89 97 if size(index4,/type) EQ 7 then index4 = lindgen(taille[4]) $ 90 98 ELSE index4 = long(index4) 91 nt = n_elements(index4) 92 ENDIF 93 IF n_params() GE 4 THEN BEGIN 99 nt = n_elements(index4) 100 ENDIF 101 IF n_params() GE 4 THEN BEGIN 94 102 if size(index3,/type) EQ 7 then index3 = lindgen(taille[3]) $ 95 103 ELSE index3 = long(index3) 96 nz = n_elements(index3) 97 ENDIF 98 IF n_params() GE 3 THEN BEGIN 104 nz = n_elements(index3) 105 ENDIF 106 IF n_params() GE 3 THEN BEGIN 99 107 if size(index2,/type) EQ 7 then index2 = lindgen(taille[2]) $ 100 108 ELSE index2 = long(index2) 101 ny = n_elements(index2) 109 ny = n_elements(index2) 102 110 ENDIF 103 IF n_params() GE 2 THEN BEGIN 111 IF n_params() GE 2 THEN BEGIN 104 112 if size(index1,/type) EQ 7 then index1 = lindgen(taille[1]) $ 105 113 ELSE index1 = long(index1) 106 nx = n_elements(index1) 114 nx = n_elements(index1) 107 115 ENDIF 108 116 109 117 ;------------------------------------------------------------ 110 118 ; construction of an array of indexes and of results following the size of array … … 115 123 index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 116 124 res = array[index] 117 END 125 END 118 126 3:BEGIN 119 127 index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 … … 121 129 +taille[1]*taille[2]*replicate(1, nx*ny)#index3 122 130 res = array[reform(index, nx, ny, nz, /over)] 123 END 131 END 124 132 4:BEGIN 125 133 index = index1#replicate(1, ny)+taille[1]*replicate(1, nx)#index2 … … 129 137 +taille[1]*taille[2]*taille[3]*replicate(1, nx*ny*nz)#index4 130 138 res = array[reform(index, nx, ny, nz, nz, /over)] 131 END 139 END 132 140 endcase 133 141 -
trunk/SRC/Obsolete/extrait.pro
r134 r136 4 4 ;+ 5 5 ; 6 ; @fie-comments 7 ; extractoin of subdomains of matrixes; Even if the subdomain is "pierced" (see the example) 6 ; @file_comments 7 ; extraction of subdomains of matrixes; 8 ; Even if the subdomain is "pierced" (see the example) 8 9 ; By default, IDL can make extractions of subdomain: 9 10 ; … … 38 39 ; @categories utilities 39 40 ; 40 ; @param tab {in}{required} a 1,2,3 or 4 dim table 41 ; @param tab {in}{required} 42 ; a 1,2,3 or 4 dim table 41 43 ; 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. 44 ; @param indicex {in}{required} 45 ; can have 2 forms: 46 ; 1)a vector containing indexes of lines we want to keep 47 ; 2)the string '*' if we want to keep all lines. 45 48 ; 46 ; @param indicey {in}{required} the same thing that indicex but for dim 2. 49 ; @param indicey {in}{required} 50 ; the same thing that indicex but for dim 2. 47 51 ; 48 ; @param indicez {in}{required} the same thing that indicex but for dim 3. 52 ; @param indicez {in}{required} 53 ; the same thing that indicex but for dim 3. 49 54 ; 50 ; @param indicet {in}{required} the same thing that indicex but for dim 4. 55 ; @param indicet {in}{required} 56 ; the same thing that indicex but for dim 4. 51 57 ; 52 ; @returns a matrix 1,2,3 or 4d extract from tab 58 ; @returns 59 ; a matrix 1,2,3 or 4d extract from tab 53 60 ; 54 ; @restrictions res=-1 in case of mistake 61 ; @restrictions 62 ; res=-1 in case of mistake 63 ; 64 ; @examples 65 ; I have a dim 2 matrix named A. I want extract a small intersection 66 ; matrix 2d of the line 2,3 and 7 and of the column 0 and 1: 67 ; 68 ; IDL> res=extrait(A,[2,3,7],[0,1]) 55 69 ; 70 ; other ex: 71 ; IDL> print, a 72 ; a b c 73 ; d e f 74 ; g h i 75 ; IDL> print, extrait(a,[0,2],[0,2]) 76 ; a c 77 ; g i 56 78 ; 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: 59 ; 60 ; res=extrait(A,[2,3,7],[0,1]) 61 ; 62 ;other ex: 63 ; IDL> print, a 64 ; a b c 65 ; d e f 66 ; g h i 67 ; IDL> print, extrait(a,[0,2],[0,2]) 68 ; a c 69 ; g i 70 ; 71 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) 72 ; 12/1/1999 73 ; 29/4/1999: correction of a bug and complement of the heading 79 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 80 ; 12/1/1999 81 ; 29/4/1999: correction of a bug and complement of the heading 74 82 ; 75 83 ; @version $Id$ -
trunk/SRC/Picture/image_viewer.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; The purpose of this program is to provide an interactive tool that can be used 5 5 ; to view JPEG, BMP, GIF, PNG, and TIFF picture files. Images are loaded into … … 11 11 ; @param event {in}{required} 12 12 ; 13 ; @restrictions While this program is running in an IDL session it will change the current 14 ; working directory, enables/disables color decomposition, and sets !QUIET=1, 15 ; !ORDER=0, & !P.BACKGROUND=0. These settings are returned to their initial 16 ; settings before the program was initiated once it is terminated. 17 ; 18 ; @restrictions This program is supported in IDL version 5.5 and newer. In order to open 19 ; GIF files or TIFF files with LZW compression the copy of IDL being used must 20 ; be licensed with these features. IDL only supports BMP files in the standard 21 ; Windows format and does not support OS2 bitmaps. 13 ; @restrictions 14 ; While this program is running in an IDL session it will change the current 15 ; working directory, enables/disables color decomposition, and sets !QUIET=1, 16 ; !ORDER=0, & !P.BACKGROUND=0. These settings are returned to their initial 17 ; settings before the program was initiated once it is terminated. 18 ; 19 ; @restrictions 20 ; This program is supported in IDL version 5.5 and newer. In order to open 21 ; GIF files or TIFF files with LZW compression the copy of IDL being used must 22 ; be licensed with these features. IDL only supports BMP files in the standard 23 ; Windows format and does not support OS2 bitmaps. 22 24 ; 23 25 ; @history Written by: AEB, 1/02. … … 972 974 ;********************************************************************************************* 973 975 ;+ 974 ; @param wid jetID {in}{required}976 ; @param widgetID {in}{required} 975 977 ;- 976 978 PRO IMAGE_VIEWER_CLEANUP,widgetID -
trunk/SRC/Picture/imdisp.pro
r134 r136 191 191 ;+ 192 192 ; 193 ; @file_comments 193 ; @file_comments 194 194 ; Display an image on the current graphics device. 195 195 ; IMDISP is an advanced replacement for TV and TVSCL. … … 216 216 ; @categories Image display 217 217 ; 218 ; @param IMAGE {in}{required} Array containing image data. 219 ; Pseudo (indexed) color images must have 2 dimensions. 220 ; True color images must have 3 dimensions, in either 221 ; [3, NX, NY], [NX, 3, NY], or [NX, NY, 3] form. 222 ; 223 ; @keyword RANGE For Pseudo Color images only, a vector with two elements 224 ; specifying the minimum and maximum values of the image 225 ; array to be considered when the image is byte-scaled 226 ; (default is minimum and maximum array values). 227 ; This keyword is ignored for True Color images, 228 ; or if the NOSCALE keyword is set. 229 ; 230 ; @keyword BOTTOM Bottom value in the color table to be used 231 ; for the byte-scaled image 232 ; (default is 0). 233 ; This keyword is ignored if the NOSCALE keyword is set. 234 ; 235 ; @keyword NCOLORS Number of colors in the color table to be used 236 ; for the byte-scaled image 237 ; (default is !D.TABLE_SIZE - BOTTOM). 238 ; This keyword is ignored if the NOSCALE keyword is set. 239 ; 240 ; @keyword MARGIN A scalar value specifying the margin to be maintained 241 ; around the image in normal coordinates 242 ; (default is 0.1, or 0.025 if !P.MULTI is set to display 243 ; multiple images). 244 ; 245 ; @keyword INTERP If set, the resized image will be interpolated using 246 ; bilinear interpolation 247 ; (default is nearest neighbor sampling). 248 ; 249 ; @keyword DITHER If set, true color images will be dithered when displayed 250 ; on an 8-bit graphics device 251 ; (default is no dithering). 252 ; 253 ; @keyword ASPECT A scalar value specifying the aspect ratio (height/width) 254 ; for the displayed image 255 ; (default is to maintain native aspect ratio). 256 ; 257 ; @keyword POSITION On input, a 4-element vector specifying the position 258 ; of the displayed image in the form [X0,Y0,X1,Y1] in 259 ; in normal coordinates 260 ; (default is [0.0,0.0,1.0,1.0]). 261 ; See the examples below to display an image where only the 262 ; offset and size are known (e.g. MAP_IMAGE output). 263 ; 264 ; @keyword OUT_POS On output, a 4-element vector specifying the position 265 ; actually used to display the image. 266 ; 267 ; @keyword NOSCALE If set, the image will not be byte-scaled 268 ; (default is to byte-scale the image). 269 ; 270 ; @keyword NORESIZE If set, the image will not be resized. 271 ; (default is to resize the image to fit the display). 272 ; 273 ; @keyword ORDER If set, the image is displayed from the top down 274 ; (default is to display the image from the bottom up). 275 ; Note that the system variable !ORDER is always ignored. 276 ; 277 ; @keyword USEPOS If set, the image will be sized to exactly fit a supplied 278 ; POSITION vector, over-riding ASPECT and MARGIN 279 ; (default is to honor ASPECT and MARGIN when a POSITION 280 ; vector is supplied). 281 ; 282 ; @keyword CHANNEL Display channel (Red, Green, or Blue) to be written. 283 ; 0 => All channels (the default) 284 ; 1 => Red channel 285 ; 2 => Green channel 286 ; 3 => Blue channel 287 ; This keyword is only recognized by graphics devices which 288 ; support 24-bit decomposed color (WIN, MAC, X). It is ignored 289 ; by all other graphics devices. However True color (RGB) 290 ; images can be displayed on any device supported by IMDISP. 291 ; 292 ; @keyword BACKGROUND If set to a positive integer, the background will be filled 293 ; with the color defined by BACKGROUND. 294 ; 295 ; @keyword ERASE If set, the screen contents will be erased. Note that if 296 ; !P.MULTI is set to display multiple images, the screen is 297 ; always erased when the first image is displayed. 298 ; 299 ; @keyword AXIS If set, plot axes will be drawn on the image. The default 300 ; x and y axis ranges are determined by the size of the image. 301 ; When the AXIS keyword is set, IMDISP accepts any keywords 302 ; supported by PLOT (e.g. TITLE, COLOR, CHARSIZE etc.). 303 ; 304 ; @keyword NEGATIVE If set, a photographic negative of the image is displayed. 305 ; The values of BOTTOM and NCOLORS are honored. This keyword 306 ; allows True color images scanned from color negatives to be 307 ; displayed. It also allows Pseudo color images to be displayed 308 ; as negatives without reversing the color table. This keyword 309 ; is ignored if the NOSCALE keyword is set. 310 ; 311 ; @restrictions The image is displayed on the current graphics device. 312 ; 313 ; @restrictions Requires IDL 5.0 or higher (square bracket array syntax). 218 ; @param IMAGE {in}{required} 219 ; Array containing image data. 220 ; Pseudo (indexed) color images must have 2 dimensions. 221 ; True color images must have 3 dimensions, in either 222 ; [3, NX, NY], [NX, 3, NY], or [NX, NY, 3] form. 223 ; 224 ; @keyword RANGE 225 ; For Pseudo Color images only, a vector with two elements 226 ; specifying the minimum and maximum values of the image 227 ; array to be considered when the image is byte-scaled 228 ; (default is minimum and maximum array values). 229 ; This keyword is ignored for True Color images, 230 ; or if the NOSCALE keyword is set. 231 ; 232 ; @keyword BOTTOM 233 ; Bottom value in the color table to be used 234 ; for the byte-scaled image 235 ; (default is 0). 236 ; This keyword is ignored if the NOSCALE keyword is set. 237 ; 238 ; @keyword NCOLORS 239 ; Number of colors in the color table to be used 240 ; for the byte-scaled image 241 ; (default is !D.TABLE_SIZE - BOTTOM). 242 ; This keyword is ignored if the NOSCALE keyword is set. 243 ; 244 ; @keyword MARGIN 245 ; A scalar value specifying the margin to be maintained 246 ; around the image in normal coordinates 247 ; (default is 0.1, or 0.025 if !P.MULTI is set to display 248 ; multiple images). 249 ; 250 ; @keyword INTERP 251 ; If set, the resized image will be interpolated using 252 ; bilinear interpolation 253 ; (default is nearest neighbor sampling). 254 ; 255 ; @keyword DITHER 256 ; If set, true color images will be dithered when displayed 257 ; on an 8-bit graphics device 258 ; (default is no dithering). 259 ; 260 ; @keyword ASPECT 261 ; A scalar value specifying the aspect ratio (height/width) 262 ; for the displayed image 263 ; (default is to maintain native aspect ratio). 264 ; 265 ; @keyword POSITION {default= [0.0,0.0,1.0,1.0]} 266 ; On input, a 4-element vector specifying the position 267 ; of the displayed image in the form [X0,Y0,X1,Y1] in 268 ; in normal coordinates 269 ; See the examples below to display an image where only the 270 ; offset and size are known (e.g. MAP_IMAGE output). 271 ; 272 ; @keyword OUT_POS 273 ; On output, a 4-element vector specifying the position 274 ; actually used to display the image. 275 ; 276 ; @keyword NOSCALE 277 ; If set, the image will not be byte-scaled 278 ; (default is to byte-scale the image). 279 ; 280 ; @keyword NORESIZE 281 ; If set, the image will not be resized. 282 ; (default is to resize the image to fit the display). 283 ; 284 ; @keyword ORDER 285 ; If set, the image is displayed from the top down 286 ; (default is to display the image from the bottom up). 287 ; Note that the system variable !ORDER is always ignored. 288 ; 289 ; @keyword USEPOS 290 ; If set, the image will be sized to exactly fit a supplied 291 ; POSITION vector, over-riding ASPECT and MARGIN 292 ; (default is to honor ASPECT and MARGIN when a POSITION 293 ; vector is supplied). 294 ; 295 ; @keyword CHANNEL 296 ; Display channel (Red, Green, or Blue) to be written. 297 ; 0 => All channels (the default) 298 ; 1 => Red channel 299 ; 2 => Green channel 300 ; 3 => Blue channel 301 ; This keyword is only recognized by graphics devices which 302 ; support 24-bit decomposed color (WIN, MAC, X). It is ignored 303 ; by all other graphics devices. However True color (RGB) 304 ; images can be displayed on any device supported by IMDISP. 305 ; 306 ; @keyword BACKGROUND 307 ; If set to a positive integer, the background will be filled 308 ; with the color defined by BACKGROUND. 309 ; 310 ; @keyword ERASE 311 ; If set, the screen contents will be erased. Note that if 312 ; !P.MULTI is set to display multiple images, the screen is 313 ; always erased when the first image is displayed. 314 ; 315 ; @keyword AXIS 316 ; If set, plot axes will be drawn on the image. The default 317 ; x and y axis ranges are determined by the size of the image. 318 ; When the AXIS keyword is set, IMDISP accepts any keywords 319 ; supported by PLOT (e.g. TITLE, COLOR, CHARSIZE etc.). 320 ; 321 ; @keyword NEGATIVE 322 ; If set, a photographic negative of the image is displayed. 323 ; The values of BOTTOM and NCOLORS are honored. This keyword 324 ; allows True color images scanned from color negatives to be 325 ; displayed. It also allows Pseudo color images to be displayed 326 ; as negatives without reversing the color table. This keyword 327 ; is ignored if the NOSCALE keyword is set. 328 ; 329 ; @restrictions 330 ; The image is displayed on the current graphics device. 331 ; 332 ; @restrictions 333 ; Requires IDL 5.0 or higher (square bracket array syntax). 314 334 ; 315 335 ; @examples … … 317 337 ;;- Load test data 318 338 ; 319 ; openr, lun, filepath('ctscan.dat', subdir='examples/data'), /get_lun339 ; openr, lun, filepath('ctscan.dat', subdir='examples/data'), /get_lun 320 340 ;ctscan = bytarr(256, 256) 321 341 ;readu, lun, ctscan … … 452 472 ;map_grid 453 473 ; 454 ; @history Liam.Gumley @ssec.wisc.edu474 ; @history Liam.Gumley\@ssec.wisc.edu 455 475 ; http://cimss.ssec.wisc.edu/~gumley 456 476 ; … … 471 491 ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 472 492 ; 473 ; @version $Id : imdisp.pro,v 1.47 2002/06/05 16:31:07 gumley Exp$493 ; @version $Id$ 474 494 ; 475 495 ;- … … 485 505 ; 486 506 487 rcs_id = '$Id : imdisp.pro,v 1.47 2002/06/05 16:31:07 gumley Exp$'507 rcs_id = '$Id$' 488 508 489 509 ;------------------------------------------------------------------------------- -
trunk/SRC/Picture/saveimage.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; Save the current graphics window to an output file (GIF by default). 5 5 ; … … 17 17 ; @categories Input/Output. 18 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 32 ; JPEG output (default 75). Ranges from 0 ("terrible") to 33 ; 100 ("excellent"). Smaller quality values yield higher 34 ; compression ratios and smaller output files. 35 ; 36 ;@keyword DITHER If set, dither the output image when creating 8-bit output 37 ; which is read from a 24-bit display (default is no dithering). 38 ; 39 ; @keyword CUBE If set, use the color cube method to quantize colors when 40 ; creating 8-bit output which is read from a 24-bit display 41 ; (default is to use the statistical method). This may improve 42 ; the accuracy of colors in the output image, especially white. 43 ; @keyword QUIET Set this keyword to suppress the information message 44 ; (default is to print an information message). 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). 19 ; @param FILE {in}{required} 20 ; Name of the output file (GIF format by default). 21 ; 22 ; @keyword BMP 23 ; Set this keyword to create BMP format (8-bit with color table). 24 ; 25 ; @keyword PNG 26 ; Set this keyword to create PNG format (8-bit with color table). 27 ; 28 ; @keyword PICT 29 ; Set this keyword to create PICT format (8-bit with color table). 30 ; 31 ; @keyword JPEG 32 ; Set this keyword to create JPEG format (24-bit true color). 33 ; 34 ; @keyword TIFF 35 ; Set this keyword to create TIFF format (24-bit true color). 36 ; 37 ; @keyword QUALITY 38 ; If set to a named variable, specifies the quality for 39 ; JPEG output (default 75). Ranges from 0 ("terrible") to 40 ; 100 ("excellent"). Smaller quality values yield higher 41 ; compression ratios and smaller output files. 42 ; 43 ; @keyword DITHER 44 ; If set, dither the output image when creating 8-bit output 45 ; which is read from a 24-bit display (default is no dithering). 46 ; 47 ; @keyword CUBE 48 ; If set, use the color cube method to quantize colors when 49 ; creating 8-bit output which is read from a 24-bit display 50 ; (default is to use the statistical method). This may improve 51 ; the accuracy of colors in the output image, especially white. 52 ; 53 ; @keyword QUIET 54 ; Set this keyword to suppress the information message 55 ; (default is to print an information message). 56 ; 57 ; @restrictions 58 ; The output file is overwritten if it exists. 59 ; 60 ; @restrictions 61 ; requires IDL 5.0 or higher (square bracket array syntax). 51 62 ; 52 63 ; @examples 53 64 ; 54 ; openr, lun, filepath('hurric.dat', subdir='examples/data'), /get_lun55 ; image = bytarr(440, 330)56 ; readu, lun, image57 ; free_lun, lun58 ; loadct, 1359 ; tvscl, image60 ; saveimage, 'hurric.gif'65 ; IDL> openr, lun, filepath('hurric.dat', subdir='examples/data'), /get_lun 66 ; IDL> image = bytarr(440, 330) 67 ; IDL> readu, lun, image 68 ; IDL> free_lun, lun 69 ; IDL> loadct, 13 70 ; IDL> tvscl, image 71 ; IDL> saveimage, 'hurric.gif' 61 72 ; 62 73 ; @history Liam.Gumley@ssec.wisc.edu -
trunk/SRC/Picture/showimage.pro
r134 r136 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; Show the contents of a graphics file in the current window. 5 5 ; … … 16 16 ; @categories Input/Output. 17 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 21 ; 24-bit images on an 8-bit display (default is no dithering). 22 ; @keyword CURRENT Set this keyword to display the image in the current window 23 ; (default is to create a new window sized to fit the image). 24 ; 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 18 ; @param FILE {in}{required} 19 ; Name of the output file (format is identified automatically). 20 ; 21 ; @keyword DITHER 22 ; Set this keyword to dither the input image when displaying 23 ; 24-bit images on an 8-bit display (default is no dithering). 24 ; 25 ; @keyword CURRENT 26 ; Set this keyword to display the image in the current window 27 ; (default is to create a new window sized to fit the image). 28 ; 29 ; @restrictions 30 ; The color table is modified. 31 ; 32 ; @restrictions 33 ; Requires IDL 5.2 or higher (image QUERY functions). 34 ; 35 ; @examples $ 36 ; IDL> showimage, filepath('rose.jpg', subdir='examples/data') 37 ; 38 ; @history Liam.Gumley\@ssec.wisc.edu 32 39 ; http://cimss.ssec.wisc.edu/~gumley 33 40 ; … … 46 53 ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 47 54 ; 48 ; @version $Id$ 55 ; @version $Id$ 49 56 ; 50 57 ;- -
trunk/SRC/Postscript/closeps.pro
r129 r136 6 6 ; Close the Postscript mode 7 7 ; 8 ; when archive_ps ne 0, we add the name and the date 9 ; at the bottom left corner of the postcript page. If the 10 ; postscript is called idl.ps we change its name to number.ps 11 ; (number automatically found to be 1 larger that any of the 12 ; existing ps file) 8 ; when archive_ps ne 0, we add the name and the date at the bottom left corner 9 ; of the postscript page. 10 ; If the postscript is called idl.ps we change its name to number.ps 11 ; (number automatically found to be 1 larger that any of the existing ps file) 13 12 ; 14 ; @keyword INFOWIDGET A long integer giving the id of the information15 ; widget (created by openps) that we have de destroy at16 ; the end of closeps (when the postscript is done)13 ; @keyword INFOWIDGET 14 ; A long integer giving the id of the information widget (created by openps) 15 ; that we have to destroy at the end of closeps (when the postscript is done). 17 16 ; 18 17 ; @uses cm_4ps … … 81 80 ENDIF 82 81 ;------------------------------------------------------------ 83 ; we annot e the postscript82 ; we annotate the postscript 84 83 ;------------------------------------------------------------ 85 84 date = byte(systime(0)) ; we get the date … … 89 88 ENDIF 90 89 ;------------------------------------------------------------ 91 ; close the post cript mode90 ; close the postscript mode 92 91 device, /close 93 92 ; -
trunk/SRC/Postscript/openps.pro
r129 r136 5 5 ; 6 6 ; @file_comments 7 ; switch to post cript mode and define it7 ; switch to postscript mode and define it 8 8 ; 9 ; @param namepsin {in}{optional} name of the postscript file.10 ; Extension '.ps' is added11 ; if missing. It will be stored in the psdir directory.9 ; @param namepsin {in}{optional} 10 ; name of the postscript file. 11 ; Extension '.ps' is added if missing. It will be stored in the psdir directory. 12 12 ; 13 13 ; @keyword FILENAME 14 ; to define the name of the post cript file through15 ; a keyword rather than with nameps in ut argument14 ; to define the name of the postscript file through 15 ; a keyword rather than with nameps input argument 16 16 ; (in this case the keyword can be pass through 17 17 ; different routines via _EXTRA keyword). … … 28 28 ; 29 29 ; @keyword PORTRAIT 30 ; 30 31 ; @keyword LANDSCAPE 31 ; @keyword KEEPPFONT same as keep_pfont32 32 ; 33 ; @keyword LIGHTNESS a scalar used to change the Lightness of the color 34 ; palette to be abble to adjust according to the printer we use, 35 ; the media (paper or slide)... 36 ; lightness < 1 to get lighter colors 37 ; > 1 to get darker colors 33 ; @keyword KEEPPFONT 34 ; same as keep_pfont 38 35 ; 39 ; @keyword _EXTRA used to pass any keyword to device procedure. 36 ; @keyword LIGHTNESS 37 ; a scalar used to change the Lightness of the color palette to be able to 38 ; adjust according to the printer we use, the media (paper or slide)... 39 ; > 1 to get darker colors 40 ; 41 ; @keyword _EXTRA 42 ; used to pass any keyword to device procedure. 40 43 ; 41 44 ; @uses cm_4ps … … 72 75 ENDIF 73 76 ;------------------------------------------------------------ 74 ; close the post cript device if we are already in postcsrit mode77 ; close the postscript device if we are already in postscript mode 75 78 IF !d.name EQ 'PS' THEN device, /close 76 79 ; switch to postscript mode -
trunk/SRC/Postscript/printps.pro
r129 r136 12 12 ; the archiving is done automatically whereas we ask if the postscript 13 13 ; file must be archived or not. 14 ; If the post cript name is "idl.ps" (default name) then this name will14 ; If the postscript name is "idl.ps" (default name) then this name will 15 15 ; be changed to number.ps (number automatically found to be 1 larger 16 16 ; that any of the existing ps file). … … 39 39 ; 25/8/19999 utilisation des widgets 40 40 ; 8/9/1999 utilisation de cw_bgroup 41 ; June 2005: Sebastien Masson: cleaning, english version with new commons41 ; June 2005: Sebastien Masson: cleaning, English version with new commons 42 42 ; 43 43 ; @version $Id$ … … 138 138 ; we destroy the widget 139 139 widget_control, event.top, /destroy 140 ; if the file was original y gzipped, then we re-gzip it and exit140 ; if the file was originally gzipped, then we re-gzip it and exit 141 141 IF uval.gzip THEN BEGIN 142 142 spawn, '\gzip ' + uval.nameps … … 149 149 AND keyword_set(archive_ps) THEN BEGIN 150 150 IF archive_ps NE 1 AND uval.name EQ 'print' then begin 151 wesave = report('Shall we archive the post cript?', /default_no, /question)151 wesave = report('Shall we archive the postscript?', /default_no, /question) 152 152 IF wesave EQ 0 THEN RETURN 153 153 ENDIF … … 159 159 allps = file_basename(allps,'.pdf') 160 160 ; find which of these names corresponds to numbers... 161 ; get asciicodes of the names161 ; get ASCII codes of the names 162 162 testnumb = byte(allps) 163 163 ; longest name 164 164 maxstrlen = (size(testnumb, /dimensions))[0] 165 ; asciicodes can be 0 or between byte('0') and byte('9')165 ; ASCII codes can be 0 or between byte('0') and byte('9') 166 166 testnumb = testnumb EQ 0 OR $ 167 167 (testnumb GE (byte('0'))[0] AND testnumb LE (byte('9'))[0]) … … 203 203 ; 25/8/19999 utilisation des widgets 204 204 ; 8/9/1999 utilisation de cw_bgroup 205 ; June 2005: Sebastien Masson: cleaning, english version with new commons205 ; June 2005: Sebastien Masson: cleaning, English version with new commons 206 206 ; 207 207 ; @version $Id$ -
trunk/SRC/ReadWrite/ncdf_timeget.pro
r130 r136 4 4 ;+ 5 5 ; @file_comments 6 ; get the time axis f om a netcdf_file and transforms it in7 ; julian days of IDL.6 ; get the time axis from a netcdf_file and transforms it in 7 ; Julian days of IDL. 8 8 ; 9 9 ; @categories reading ncdf_file … … 16 16 ; 17 17 ; @keyword YYYYMMDD 18 ; active to obtain the date as a long interger with18 ; active to obtain the date as a long integer with 19 19 ; the format YearYearYearYearMonthMonthDayDay 20 20 ; … … 23 23 ; 24 24 ; @returns 25 ; a long array of IDL julian days25 ; a long array of IDL Julian days 26 26 ; 27 27 ; @restrictions 28 28 ; the calendar variable must have the units attribute 29 ; following the syntax ebellow:29 ; following the syntax bellow: 30 30 ; 31 31 ; time_counter:units = "seconds since 0001-01-01 00:00:00" ; -
trunk/SRC/ReadWrite/read_grads.pro
r130 r136 16 16 ; 17 17 ; @param date2 {in}{optional} 18 ; last date. Option nal, if not scpecified date2=date118 ; last date. Optional, if not specified date2=date1 19 19 ; 20 20 ; @keyword FILENAME … … 141 141 varid = varid[0] 142 142 if varid EQ -1 then begin 143 print, var+' not found in the variable list eof '+filename143 print, var+' not found in the variable list of '+filename 144 144 return, -1 145 145 ENDIF … … 149 149 ;------------------------ 150 150 ;------------------------ 151 ; find the first file to be read according to the lile list,, the151 ; find the first file to be read according to the file list, the 152 152 ; number of time step in each file and t1 and t2 153 153 ;------------------------ … … 164 164 ;------------------------ 165 165 ;------------------------; 166 ; check the exist ance of the file166 ; check the existence of the file 167 167 f2read = isafile(filename = f2read, iodirectory = iodir, _EXTRA = ex) 168 168 ; if the file is stored on tape … … 306 306 triangles_list = triangule() 307 307 ;------------------------ 308 ; subdomain extra tion308 ; subdomain extraction 309 309 310 310 ;------------------------ 311 ; time a guments311 ; time arguments 312 312 ;------------------------ 313 313 time = time[t1:t2] -
trunk/SRC/ReadWrite/read_oasis.pro
r130 r136 4 4 ;+ 5 5 ; @file_comments 6 ; read the f77 unformat ed files used in Oasis (version < 2.5)6 ; read the f77 unformatted files used in Oasis (version < 2.5) 7 7 ; 8 8 ; @categories reading 9 9 ; 10 ; @param filename {in}{required} the filename 10 ; @param filename {in}{required} 11 ; the filename 11 12 ; 12 ; @param varname {in}{required} the name of the variable to be read 13 ; @param varname {in}{required} 14 ; the name of the variable to be read 13 15 ; 14 16 ; @param jpi {in}{required} -
trunk/SRC/ReadWrite/readoldopadistcoast.pro
r130 r136 10 10 ; @categories for OPA before NetCDF 11 11 ; 12 ; @returns a structure that contains two elements: tdistcoast (the 12 ; @returns 13 ; a structure that contains two elements: tdistcoast (the 13 14 ; distance for the t-points) and fdiscoast (the distance for the 14 15 ; f-points). -
trunk/SRC/ReadWrite/readoldoparestart.pro
r130 r136 6 6 ; @categories for OPA before NetCDF 7 7 ; 8 ; @restrictions bug for etab and etan written on the same record??? 8 ; @restrictions 9 ; bug for etab and etan written on the same record??? 9 10 ; 10 11 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) … … 210 211 ;CC ------- 211 212 ;CC Read the previous fields on the file numrst 212 ;CC the first record indicates previous characteri cs213 ;CC the first record indicates previous characteristics 213 214 ;CC after control with the present run, we read : 214 215 ;CC - prognostic variables on the second record -
trunk/SRC/ReadWrite/scanctl.pro
r130 r136 146 146 ;------------------------ 147 147 ; initial date: y0, m0, d0, h0, mn0 148 ; -> julian day of IDL: julady(m0, d0, y0, h0, mn0, 00)148 ; -> Julian day of IDL: julday(m0, d0, y0, h0, mn0, 00) 149 149 ;------------------------ 150 150 t0 = timedef[3] … … 197 197 ENDCASE 198 198 ;------------------------ 199 ; increment date and definition of the calendar with IDL julian days199 ; increment date and definition of the calendar with IDL Julian days 200 200 ;------------------------ 201 201 tstep = timedef[4] … … 241 241 files = strsplit(files,/extract) 242 242 if n_elements(files) NE 2 then begin 243 print, 'Bad definition of the filename. There shou d be 2 elements:'243 print, 'Bad definition of the filename. There should be 2 elements:' 244 244 print, 'DEST and 1 filename (that may define many files)' 245 245 stop -
trunk/SRC/ReadWrite/scanoasis.pro
r130 r136 8 8 ; @categories know what is inside 9 9 ; 10 ; @param filename {in}{required} the file name 10 ; @param filename {in}{required} 11 ; the file name 11 12 ; 12 ; @restrictions List the variable names included in a Oasis file 13 ; @restrictions 14 ; List the variable names included in a Oasis file 13 15 ; 14 16 ; @examples -
trunk/SRC/ReadWrite/write_oasis.pro
r130 r136 7 7 ; write an Oasis file (version < 2.5) 8 8 ; 9 ; @param filename {in}{required} the filename 10 ; @param varname {in}{required} the name of the variable to be written 11 ; @param z2d {in}{required} the variable (2D array) to be written 9 ; @param filename {in}{required} 10 ; the filename 11 ; 12 ; @param varname {in}{required} 13 ; the name of the variable to be written 14 ; 15 ; @param z2d {in}{required} 16 ; the variable (2D array) to be written 12 17 ; 13 18 ; @keyword I2 … … 17 22 ; to change the default format (R8) of the data to be written. 18 23 ; 19 ; @keyword APPEND to open the file with the file pointer at the end of 20 ; the file, ready for data to be appended. 24 ; @keyword APPEND 25 ; to open the file with the file pointer at the end of the file, ready for 26 ; data to be appended. 21 27 ; 22 ; 23 ; @restrictions varname is automatically written as a "charactere*8"24 ; 28 ; @restrictions 29 ; varname is automatically written as a "character*8" 30 ; by default z2d is written as an R8 array 25 31 ; 26 32 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) -
trunk/SRC/ReadWrite/writebat.pro
r130 r136 9 9 ; @categories for OPA 10 10 ; 11 ; @param zbat {in}{required} the bathymetry, a 2d array 12 ; @param filename {in}{required} a string containing the filename, 11 ; @param zbat {in}{required} 12 ; the bathymetry, a 2d array 13 ; 14 ; @param filename {in}{required} 15 ; a string containing the filename 13 16 ; 14 17 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) … … 24 27 ; basic checks 25 28 IF n_params() NE 2 THEN BEGIN 26 print, 'bad number of a guments in the call of writebat'29 print, 'bad number of arguments in the call of writebat' 27 30 return 28 31 ENDIF -
trunk/SRC/Utilities/createfunc.pro
r128 r136 4 4 ;+ 5 5 ; @file_comments 6 ; write an idlfunction, compile it and execute it.7 ; useful lto avoid the use of execute6 ; write an IDL function, compile it and execute it. 7 ; useful to avoid the use of execute 8 8 ; 9 ; @param command {in}{required} a scalar string defining the result to be 10 ; given back by the function. (see examples) 9 ; @param command {in}{required} 10 ; a scalar string defining the result to be given back by the function. 11 ; (see examples) 11 12 ; 12 13 ; @keyword FILENAMEIN {in} {default=for_createfunc.pro} 13 14 ; name of the function to be created. 14 15 ; 15 ; @keyword KWDLIST {in} a vector string. to specify a list of keywords that 16 ; must be included in the function definition. Warning: the string 17 ; must start with a ',' for example: KWDLIST = ', TOTO = toto' 16 ; @keyword KWDLIST {in} 17 ; a vector string. to specify a list of keywords that must be included in the 18 ; function definition. 19 ; Warning: the string must start with a ',' 20 ; for example: KWDLIST = ', TOTO = toto' 18 21 ; 19 ; @keyword _EXTRA used to pass your keywords to the created function. 22 ; @keyword _EXTRA 23 ; used to pass your keywords to the created function. 20 24 ; 21 25 ; @restrictions -
trunk/SRC/Utilities/createpro.pro
r128 r136 6 6 ; write an idl procedure, compile it and execute it. 7 7 ; 8 ; @param command {in}{required} a string array defining the procedure to be created. each element will be a line of the created procedure. 8 ; @param command {in}{required} 9 ; a string array defining the procedure to be created. 10 ; each element will be a line of the created procedure. 9 11 ; 10 12 ; @keyword FILENAMEIN {in} {default=for_createpro.pro} 11 ; 13 ; name of the procedure to be created. 12 14 ; 13 ; @keyword KWDLIST {in} a vector string. to specify a list of keywords that 14 ; must be included in the procedure definition. Warning: the string 15 ; must start with a ',' for example: KWDLIST = ', TOTO = toto' 15 ; @keyword KWDLIST {in} 16 ; a vector string. 17 ; to specify a list of keywords that must be included in the procedure 18 ; definition. 19 ; Warning: the string must start with a ',' 20 ; for example: KWDLIST = ', TOTO = toto' 16 21 ; 17 ; @keyword KWDUSED obsolote, please pass directly your keywords through _EXTRA 22 ; @keyword KWDUSED 23 ; obsolete, please pass directly your keywords through _EXTRA 18 24 ; 19 ; @keyword _EXTRA used to pass your keywords to the created procedure. 25 ; @keyword _EXTRA 26 ; used to pass your keywords to the created procedure. 20 27 ; 21 28 ; @restrictions … … 48 55 dummy = report(['keyword KWDUSED has been suppressed,' $ 49 56 , 'please pass directly your keywords through _extra,' $ 50 , 'see exa emples in createpro header'])57 , 'see examples in createpro header']) 51 58 return 52 59 ENDIF -
trunk/SRC/Utilities/find.pro
r128 r136 13 13 ; @categories find a file 14 14 ; 15 ; @param filein {in}{required} A scalar or array variable of string type, containing 16 ; file names to match. Input names specifications may contain 17 ; wildcard characters, enabling them to match multiple files 18 ; (see file_search for more informations). By default and if 19 ; necessary, find is looking for filename and also for filename 20 ; completed with '.pro' 15 ; @param filein {in}{required} 16 ; A scalar or array variable of string type, containing 17 ; file names to match. Input names specifications may contain 18 ; wildcard characters, enabling them to match multiple files 19 ; (see file_search for more informations). By default and if 20 ; necessary, find is looking for filename and also for filename 21 ; completed with '.pro' 21 22 ; 22 ; @keyword FIRSTFOUND activate this keyword to stop looking for the file as23 ; 23 ; @keyword FIRSTFOUND 24 ; activate this keyword to stop looking for the file as soon as we found one. 24 25 ; 25 ; @keyword IODIRECTORY {default=!path} A scalar or array variable of string type, containing 26 ; directories names where we are looking for the file. 27 ; Different directories can be separated by 28 ; path_sep(/search_path) (':' on unix type machine) as it is done 29 ; to define !path. 30 ; Note that if filename's dirname is different from '.', this 31 ; keyword is not taken into account. 26 ; @keyword IODIRECTORY {default=!path} 27 ; A scalar or array variable of string type, containing 28 ; directories names where we are looking for the file. 29 ; Different directories can be separated by 30 ; path_sep(/search_path) (':' on unix type machine) as it is done 31 ; to define !path. 32 ; Note that if filename's dirname is different from '.', this 33 ; keyword is not taken into account. 32 34 ; 33 ; @keyword LOOKALLDIR activate to look for the file with a recursive search 34 ; in iodir, homedir, !path + the DATA:TestsData directory if it exists. 35 ; @keyword LOOKALLDIR 36 ; activate to look for the file with a recursive search 37 ; in iodir, homedir, !path + the DATA:TestsData directory if it exists. 35 38 ; 36 ; @keyword NOPRO activate to avoid the automatic search of filename37 ; 39 ; @keyword NOPRO 40 ; activate to avoid the automatic search of filename completed with '.pro' 38 41 ; 39 ; @keyword ONLYPRO force to look only at file ending with .pro 42 ; @keyword ONLYPRO 43 ; force to look only at file ending with .pro 40 44 ; 41 ; @keyword ONLYNC force to look only at file ending with .nc 45 ; @keyword ONLYNC 46 ; force to look only at file ending with .nc 42 47 ; 43 ; @keyword RECURSIVE performs recursive searching of directory hierarchies.44 ; In a recursive search, find looks recursively for any and all45 ; subdirectories in the file hierarchy rooted at the IODIRECTORY46 ; 48 ; @keyword RECURSIVE 49 ; performs recursive searching of directory hierarchies. 50 ; In a recursive search, find looks recursively for any and all 51 ; subdirectories in the file hierarchy rooted at the IODIRECTORY argument. 47 52 ; 48 ; @keyword REPERTOIRE obsolete. keep for compatibility, use directory keyword 53 ; @keyword REPERTOIRE 54 ; obsolete. keep for compatibility, use directory keyword 49 55 ; 50 ; @keyword UNIQUE activate to make sure that each element of the output51 ; 56 ; @keyword UNIQUE 57 ; activate to make sure that each element of the output vector is unique. 52 58 ; 53 ; @keyword _EXTRA used to pass your keywords 59 ; @keyword _EXTRA 60 ; used to pass your keywords 54 61 ; 55 ; 56 ; @returnsA scalar or array variable of string type, containing the57 ; 58 ; 59 ; 62 ; @returns 63 ; A scalar or array variable of string type, containing the 64 ; name (with the full path of the matching files. If no files 65 ; exist with names matching the input arguments, find returns 66 ; the scalar string : 'NOT FOUND' 60 67 ; 61 68 ; @examples -
trunk/SRC/Utilities/fitintobox.pro
r134 r136 89 89 ; @param lastz {in}{optional}{default=define by grille.pro} 90 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... 91 ; @keyword WDEPTH 92 ; To specify that we are at W level 93 ; 94 ; @returns 95 ; an array with dimensions matching the domain 96 ; or -1 if there is an error... 95 97 ; 96 98 ; @uses cm_4mesh 97 99 ; @uses cm_4cal 98 100 ; 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 101 ; @examples 102 ; IDL> help, fitintobox(findgen(jpi,jpj)) 103 ; <Expression> FLOAT = Array[41, 3] 104 ; IDL> help, fitintobox(findgen(jpi,jpj,78)) 105 ; Error: 106 ; the array dimensions [180,148,78] are incompatible 107 ; with the the domain dimensions 108 ; [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/41, 148/3, 31/31, 1] 109 ; <Expression> INT = -1 107 110 ; 108 111 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Utilities/isadirectory.pro
r128 r136 9 9 ; @categories io 10 10 ; 11 ; @param directoryin {in}{optional} a proposed directory. If neither dirname 12 ; input parameter of IODIRECTORY keyword are defined, 13 ; the ask the user to choose a directory. 11 ; @param directoryin {in}{optional} 12 ; a proposed directory. If neither dirname 13 ; input parameter of IODIRECTORY keyword are defined, 14 ; the ask the user to choose a directory. 14 15 ; 15 ; @keyword IODIRECTORY a proposed directory 16 ; @keyword IODIRECTORY 17 ; a proposed directory 16 18 ; 17 ; @keyword TITLE the title of the window 19 ; @keyword TITLE 20 ; the title of the window 18 21 ; 19 ; @keyword _EXTRA used to pass your keywords 22 ; @keyword _EXTRA 23 ; used to pass your keywords 20 24 ; 21 ; @file_comments all dialog_pickfile keywords (like filter) can be used. 25 ; @file_comments 26 ; all dialog_pickfile keywords (like filter) can be used. 22 27 ; 23 ; @returns the directory name 28 ; @returns 29 ; the directory name 24 30 ; 25 31 ; @examples -
trunk/SRC/Utilities/isafile.pro
r128 r136 9 9 ; @categories io 10 10 ; 11 ; @param filein {in}{optional} a proposed name. If neither filein12 ; input parameter of filename keyword are defined,13 ; 11 ; @param filein {in}{optional} 12 ; a proposed name. If neither filein input parameter of filename keyword are 13 ; defined, the ask the user to choose a file. 14 14 ; 15 ; @keyword FILENAME a proposed filename. 15 ; @keyword FILENAME 16 ; a proposed filename. 16 17 ; 17 ; @keyword IODIRECTORY a directory where we look for the file. this 18 ; keyword is taken into account only if the dirname 19 ; of filein or filename is '.' 18 ; @keyword IODIRECTORY 19 ; a directory where we look for the file. this 20 ; keyword is taken into account only if the dirname 21 ; of filein or filename is '.' 20 22 ; 21 ; @keyword NEW to specify that filename is a new file and that 22 ; we should check only its path 23 ; @keyword NEW 24 ; to specify that filename is a new file and that we should check only its 25 ; path 23 26 ; 24 ; @keyword ONLYPRO force to look only at file ending with .pro 27 ; @keyword ONLYPRO 28 ; force to look only at file ending with .pro 25 29 ; 26 ; @keyword ONLYNC force to look only at file ending with .nc 30 ; @keyword ONLYNC 31 ; force to look only at file ending with .nc 27 32 ; 28 ; @keyword RECURSIVE performs recursive searching of directory hierarchies.29 ; In a recursive search, find looks recursively for any and all30 ; subdirectories in the file hierarchy rooted at the IODIRECTORY31 ; 33 ; @keyword RECURSIVE 34 ; performs recursive searching of directory hierarchies. 35 ; In a recursive search, find looks recursively for any and all 36 ; subdirectories in the file hierarchy rooted at the IODIRECTORY argument. 32 37 ; 33 ; @keyword _EXTRA used to pass your keywords 38 ; @keyword _EXTRA 39 ; used to pass your keywords 34 40 ; 35 ; @file_comments all find, file_search and dialog_pickfile keywords (like title) can be used 41 ; @file_comments 42 ; all find, file_search and dialog_pickfile keywords (like title) can be used 36 43 ; 37 ; @returns the filename with its path 44 ; @returns 45 ; the filename with its path 38 46 ; 39 47 ; @examples -
trunk/SRC/Utilities/linearequation.pro
r134 r136 11 11 ; @categories utilities 12 12 ; 13 ; @param point1 {in}{required} This is the first point of(the) straight 14 ; line(s) whose we want to calculate equation(s) 13 ; @param point1 {in}{required} 14 ; This is the first point of(the) straight line(s) whose we want to calculate 15 ; equation(s) 15 16 ; 16 ; @param point2 {in}{required} This is the second point of(the) straight 17 ; line(s) whose we want to calculate equation(s) 17 ; @param point2 {in}{required} 18 ; This is the second point of(the) straight line(s) whose we want to calculate 19 ; equation(s) 18 20 ; 19 ; 20 ; 1) point is a complex or a table of complex, where each element is the coordinates of the point.21 ; There is 2 possibilities: 22 ; 1) point is a complex or a table of complex, where each element is the coordinates of the point. 21 23 ; 2) point is a table of real of dimension 2,number_of_straight_line. 22 24 ; For each row of the table, we have coordinates of the point. 23 25 ; 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 26 ; @returns 27 ; abc is a table of dimension 3, number_of_straight_line, 28 ; where for each line of the table we obtain the 3 parameters 29 ; a, b and c of the linear equation ax+by+c=0 27 30 ; 28 ; @examples IDL> abc=linearequation(complex(1,2),[3,4]) 29 ; IDL> print, abc[0]*1+abc[1]*2+abc[2] 30 ; 0.00000 31 ; @examples 32 ; IDL> abc=linearequation(complex(1,2),[3,4]) 33 ; IDL> print, abc[0]*1+abc[1]*2+abc[2] 34 ; 0.00000 31 35 ; 32 36 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Utilities/lineintersection.pro
r134 r136 10 10 ; @categories utilities 11 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 12 ; @param abc1 {in}{required} 13 ; is the first table of dimension 3, number_of_pairs_of_straight_lines, 14 ; whose each line contain the 3 parameters a,b and c of the first linear 15 ; equation of the type ax+by+c=0 15 16 ; 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 17 ; @param abc2 {in}{required} 18 ; is second table of dimension 3, number_of_pairs_of_straight_lines, 19 ; whose each line contain the 3 parameters a,b and c of the second linear 20 ; equation of the type ax+by+c=0 19 21 ; 20 ; @keyword FLOAT To return the output as a table of real numbers instead of vectors of complex (by default) 22 ; @keyword FLOAT 23 ; To return the output as a table of real numbers instead of vectors of 24 ; complex (by default) 21 25 ; 22 ; @returns 2 possibilities: 26 ; @returns 27 ; 2 possibilities: 23 28 ; 1) by default: it is a vector of complex whose each element is the coordinates 24 29 ; of the intersection point of a pair of straight lines. … … 27 32 ; of the intersection point of a pair of straight line. 28 33 ; 29 ; @restrictions If the 2 straight line are parallel, we return coordinates (!values.f_nan,!values.f_nan) 34 ; @restrictions 35 ; If the 2 straight line are parallel, we return coordinates 36 ; (!values.f_nan,!values.f_nan) 30 37 ; 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. 38 ; @restrictions 39 ; Beware of the precision of the machine which make 40 ; that calculated coordinates may not exactly verify 41 ; equations of the pair of straight lines. 34 42 ; 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 43 ; @examples 44 ; IDL> abc1=linearequation(complex(1,2),[3,4]) 45 ; IDL> abc2=linearequation(complex(1,2),[8,15]) 46 ; IDL> print, lineintersection(abc1, abc2) 47 ; ( 1.00000, 2.00000) 48 ; IDL> print, lineintersection(abc1, abc2,/float) 49 ; 1.00000 2.00000 41 50 ; 42 51 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Utilities/protype.pro
r128 r136 8 8 ; @categories utilities 9 9 ; 10 ; @param file {in} A scalar of string type, the name of the ".pro" file to be tested 11 ; if necessary, the input name is completed with '.pro' 12 ; and its path found in !path 10 ; @param file {in} 11 ; A scalar of string type, the name of the ".pro" file to be tested 12 ; if necessary, the input name is completed with '.pro' 13 ; and its path found in !path 13 14 ; 14 ; @returns A scalar of string type: 'proc', 'func' or 'batch' 15 ; @returns 16 ; A scalar of string type: 'proc', 'func' or 'batch' 15 17 ; 16 18 ; @examples -
trunk/SRC/Utilities/pwd.pro
r134 r136 9 9 ; @categories like unix function 10 10 ; 11 ; @history Sebastien Masson (smasson @lodyc.jussieu.fr)11 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 12 12 ; 13 13 ; @version $Id$ -
trunk/SRC/Utilities/report.pro
r134 r136 9 9 ; To ask a question whose answer is not yes/no,use xquestion. 10 10 ; 11 ; @param text {in}{required} un string on un vecteur de string. Si le string ne 11 ; @param text {in}{required} 12 ; one string or one vector of string. Si le string ne 12 13 ; comporte qu''un element, on cherche les eventuels characteres de 13 14 ; retour a la ligne: '!C'. If text is set to an array of strings, each 14 15 ; array element is displayed as a separate line of text. 15 16 ; 16 ; @keyword SIMPLE activate to print only the message without the name 17 ; and the line of the routine (defined by calling routine_name) 17 ; @keyword SIMPLE 18 ; activate to print only the message without the name 19 ; and the line of the routine (defined by calling routine_name) 18 20 ; 19 ; @keyword _extra used to pass keywords from dialog_message.pro and message.pro 21 ; @keyword _extra 22 ; used to pass keywords from dialog_message.pro and message.pro 20 23 ; 21 ; @keyword PARENT same as DIALOG_PARENT de dialog_message.pro 24 ; @keyword PARENT 25 ; same as DIALOG_PARENT de dialog_message.pro 22 26 ; 23 ; @keyword QUESTION Set this keyword to create a "Question" dialog.24 ; The default dialog type is "Warning"27 ; @keyword QUESTION {default="Warning"} 28 ; Set this keyword to create a "Question" dialog. 25 29 ; 26 ; @keyword DEFAULT_NO Set this keyword to make the "No" button the default 27 ; selection for "Question" dialog. Normally, the default is yes. 30 ; @keyword DEFAULT_NO {default="Yes"} 31 ; Set this keyword to make the "No" button the default selection for 32 ; "Question" dialog. 28 33 ; 29 ; @keyword SIMPLE Activate to print the error message without printing 30 ; the routine name with its full path. 34 ; @keyword SIMPLE 35 ; Activate to print the error message without printing the routine name with 36 ; its full path. 31 37 ; 32 ; @returns -1 if the keyword QUESTION is not activated 33 ; If the keyword is activated, return 1 for yes and 0 for no. 38 ; @returns 39 ; -1 if the keyword QUESTION is not activated 40 ; If the keyword is activated, return 1 for yes and 0 for no. 34 41 ; 35 ; @example If there is not any widget activated: 42 ; @examples 43 ; If there is not any widget activated: 36 44 ; 37 ; 38 ; 39 ; 40 ; 41 ; 42 ; 43 ; 44 ; 45 ; 46 ; 45 ; IDL> help, report('toto tata') 46 ; % $MAIN$: toto tata 47 ; <Expression> INT = -1 48 ; IDL> help, report('does it works ?',/question) 49 ; does it works ? y/n (default answer is y) 50 ; <Expression> BYTE = 1 51 ; IDL> help, report('question1: !C does it works ?',/question) 52 ; question1: 53 ; does it works ? y/n (default answer is y) 54 ; <Expression> BYTE = 1 47 55 ; 48 56 ; If widgets are already activated, it is the same thing but with widgets! 49 57 ; 50 ; @history Sebastien Masson (smasson @lodyc.jussieu.fr)58 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 51 59 ; 21/10/1999 52 60 ; 53 ; @version $I D$61 ; @version $Id$ 54 62 ; 55 63 ;- -
trunk/SRC/Utilities/routine_name.pro
r134 r136 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Give us the name of the routine (procedure or function) where we are. 8 8 ; 9 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. 10 ; 11 ; @param pilingnum {in}{optional} 12 ; A whole number which give us how many level we have to reascend 13 ; in the piling up of routines and subroutines to find the looked for routine. 13 14 ; 14 15 ; 15 ; @returns a string giving either the full name of the routine (with the path) or '$MAIN$' 16 ; @returns 17 ; a string giving either the full name of the routine (with the path) or 18 ; '$MAIN$' 16 19 ; 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. 20 ; @restrictions 21 ; This function use the keyword OUTPUT in help.pro and it is specified 22 ; in the online help that the return syntax of this word can change in 23 ; function of the version of the code. This version works with IDL 5.2. 20 24 ; 21 ; @example IDL> print, routine_name() 25 ; @examples 26 ; IDL> print, routine_name() 22 27 ; /usr1/com/smasson/IDL_RD/UTILITAIRE/report.pro 23 28 ; IDL> print, routine_name(1) … … 30 35 ; $MAIN$ 31 36 ; 32 ; @history Sebastien Masson (smasson @lodyc.jussieu.fr)37 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 33 38 ; 21/10/1999 34 39 ; … … 45 50 ; 46 51 help, /traceback, output = name 47 name = strtrim(name, 1) ; we remove blanks at the beginning of lines and 48 ; we put elements of the vector stuck ones with 52 name = strtrim(name, 1) ; we remove blanks at the beginning of lines and 53 ; we put elements of the vector stuck ones with 49 54 ; each others to make an unique string. 50 55 allnames = '' 51 56 for i = 0, n_elements(name)-1 do allnames = allnames+name[i] 52 57 ; 53 name = str_sep(allnames, '%') ; we cut it out again. 58 name = str_sep(allnames, '%') ; we cut it out again. 54 59 name = strtrim(name, 2) ; we remouve blanks in front of and behind 55 60 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. 61 ; we do not hold back the two first elements who are a blanck and the line concerning 62 ; routine_name. 58 63 name = name[2: n_elements(name)-1] 59 64 ; we choose the line which concern us. -
trunk/SRC/Utilities/testvar.pro
r134 r136 5 5 ; 6 6 ; @file_comments 7 ; A 7 ; A kind of keyword_set but when the value exist, it send it back 8 8 ; 9 9 ; @categories utlities 10 10 ; 11 ; @keyword var any kind of 11 ; @keyword var 12 ; any kind of 12 13 ; 13 ; @returns 0 if the variable does not exist 14 ; @returns 15 ; 0 if the variable does not exist 14 16 ; 15 ; @examples IDL> print, testvar(var=toto) 16 ; 0 17 ; IDL> print, testvar(var='toto') 18 ; toto 17 ; @examples 18 ; IDL> print, testvar(var=toto) 19 ; 0 20 ; IDL> print, testvar(var='toto') 21 ; toto 19 22 ; 20 23 ; @history Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Utilities/text_box.pro
r134 r136 5 5 ; area in a graphics window. The message may be split at word 6 6 ; boundaries into several lines, and the character size and 7 ;orientation may be adjusted for the text to fit within the box.7 ; orientation may be adjusted for the text to fit within the box. 8 8 ; 9 ; @param TEXT {in}{required} ASCII text string containing the message. 9 ; @param TEXT {in}{required} 10 ; ASCII text string containing the message. 10 11 ; 11 ; @keyword pos 4 element vector specifying the box position and size 12 ; pos[0],pos[1] specify the lower left corner coordinate 13 ; pos[2],pos[3] specify the upper right corner coordinate 14 ; data window normalized coordinates are use 12 ; @keyword pos 13 ; 4 element vector specifying the box position and size 14 ; pos[0],pos[1] specify the lower left corner coordinate 15 ; pos[2],pos[3] specify the upper right corner coordinate 16 ; data window normalized coordinates are use 15 17 ; 16 ; @keyword fg_color color of box and legend titles (default=0) 18 ; @keyword fg_color 19 ; color of box and legend titles (default=0) 17 20 ; 18 ; @keyword bg_color background color. Setting BG_COLOR erases the area 21 ; @keyword bg_color 22 ; background color. Setting BG_COLOR erases the area 19 23 ; covered by the text box (filling it with color BG_COLOR) 20 24 ; prior to writing the text. If both BG_COLOR and !p.color … … 22 26 ; gaurantee a readability. 23 27 ; 24 ; @keyword right if set, right justify text 28 ; @keyword right 29 ; if set, right justify text 25 30 ; 26 ; @keyword center if set, center the text 31 ; @keyword center 32 ; if set, center the text 27 33 ; 28 ; @keyword vert_space {default=1.5}vertical spacing of lines in units of character height 34 ; @keyword vert_space {default=1.5} 35 ; vertical spacing of lines in units of character height 29 36 ; 30 ; @keyword _EXTRA used to pass your keyword 37 ; @keyword _EXTRA 38 ; used to pass your keyword 31 39 ; 32 ; @keyword box activate to show the box on graphics window. 40 ; @keyword box 41 ; activate to show the box on graphics window. 33 42 ; 34 43 ; @history Paul Ricchiazzi 7Jul93 -
trunk/SRC/Utilities/undefine.pro
r134 r136 11 11 ; @categories utilities 12 12 ; 13 ; @param varname {in}{required} The name of the variable we want erase 13 ; @param varname {in}{required} 14 ; The name of the variable we want erase 14 15 ; 15 ; @example IDL> a=1 16 ; IDL> undefine,a 17 ; % Compiled module: UNDEFINE. 18 ; IDL> help, a 19 ; A UNDEFINED = <Undefined> 16 ; @examples 17 ; IDL> a=1 18 ; IDL> undefine,a 19 ; % Compiled module: UNDEFINE. 20 ; IDL> help, a 21 ; A UNDEFINED = <Undefined> 20 22 ; 21 23 ; @history trouve sur la page web de D.Fanning … … 27 29 ;from Andrew Cool at the DSTO High Frequency Radar Division in 28 30 ;Adelaide, Australia. 31 ; 32 ; @version $Id$ 29 33 ; 30 34 ;- -
trunk/SRC/Utilities/xfile.pro
r134 r136 6 6 ; @file_comments 7 7 ; display in a widget an ASCII file. 8 ; It is the same thing that xdisplay dife but here, we use it8 ; It is the same thing that xdisplayfile but here, we use it 9 9 ; to display the content of a procedure or of a function, 10 10 ; even if it is not in the current directory (thanks to the path). … … 12 12 ; @categories utilities 13 13 ; 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). 14 ; @param filename {in}{required} 15 ; It is the name of the procedure or of the function 16 ; we want to display (with or without .pro at the end). 16 17 ; 17 ; @keyword _extra used to pass your keywords 18 ; @keyword _extra 19 ; used to pass your keywords 18 20 ; 19 21 ; @examples xfile,'plt' 20 22 ; 21 ; @history Sebastien Masson (smasson @lodyc.jussieu.fr)23 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 22 24 ; 7/1/99 23 ; 6/7/1999: compatibilit e mac etwindows25 ; 6/7/1999: compatibility mac and windows 24 26 ; 25 27 ; @version $Id$ -
trunk/SRC/Utilities/xhelp.pro
r134 r136 6 6 ; @categories Widgets. 7 7 ; 8 ; @param Filename {in}{required} A scalar string that contains the filename of the file9 ; to display. If FILENAME does not include a complete path10 ; specification, xhelp will search for the file in11 ; 12 ; 13 ; 8 ; @param Filename {in}{required} 9 ; A scalar string that contains the filename of the file to display. 10 ; If FILENAME does not include a complete path specification, xhelp will 11 ; search for the file in the current working directory and then each of the 12 ; directories listed in !PATH environment variable. The 13 ; ".pro" file suffix will be appended if it is not supplied. 14 14 ; 15 ; @keyword _extra used to pass your keywords 15 ; @keyword _extra 16 ; used to pass your keywords 16 17 ; 17 ; @restrictions Triggers the XMANAGER if it is not already in use. 18 ; @restrictions 19 ; Triggers the XMANAGER if it is not already in use. 18 20 ; 19 ; @examples Open a file and create a widget to display its contents. 21 ; @examples 22 ; Open a file and create a widget to display its contents. 20 23 ; 21 24 ; @history Written By Steve Richards, December 1990 … … 27 30 ; 7/1/99 : legeres mofification par Sebastien Masson : utilisation de 28 31 ; xdisplayfile, de findfile et de _extra. 29 ; 6/7/1999: compatibilit e mac etwindows32 ; 6/7/1999: compatibility mac and windows 30 33 ; 31 34 ; @version $Id$ … … 59 62 pfile = [current, multipath]+ pfile 60 63 ENDIF 61 ; We test each possi le name to find where the file is.64 ; We test each possible name to find where the file is. 62 65 nfile=n_elements(pfile) 63 66 n = 0
Note: See TracChangeset
for help on using the changeset viewer.