Changeset 151 for trunk/SRC/Documentation/idldoc_html_output/search.js
- Timestamp:
- 08/09/06 12:21:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/search.js
r143 r151 4 4 a[2] = new Array("./Calendar/date2jul.html", "date2jul.pro", "", " file_comments gives Julian day equivalent of a date in yyyymmdd format categories calendar param date in required date in yyyymmdd format keyword GRADS if 1 year 2000 year if 50 year 1900 year returns date in Julian day examples IDL jday juldate 19930124 IDL print date2jul 19931205 EQ julday 12 5 1993 1 IDL print date2jul 931205 grads EQ julday 12 5 1993 1 history Sebastien Masson smasson lodyc jussieu fr June 2005 version Id: date2jul pro 137 2006 07 12 09:33:44Z smasson function date2jul date GRADS grads compile_opt idl2 strictarrsubs year long date 10000 month long abs date 100 MOD 100 day long abs date MOD 100 if keyword_set grads then year year 1900 year GE 50 AND year LE 99 2000 year GE 1 AND year LE 49 return julday month day year end "); 5 5 a[3] = new Array("./Calendar/date2string.html", "date2string.pro", "", " file_comments create a nice and readable format to print a date categories calendar string param yyyymmdd in required the date in the format yyyymmdd Can be scalar or array keyword _EXTRA used to pass your keywords to other procedures for example keyword FORMAT of string function see example bellow returns a string containing the date in a easy readable format with the same number of elements than yyyymmdd examples IDL print date2string 19900123 Jan 23 1990 IDL print date2string 19900123 format C CMOA JAN 23 1990 history Sebastien Masson smasson lodyc jussieu fr Creation update review June 2005 Sebastien Masson version Id: date2string pro 137 2006 07 12 09:33:44Z smasson FUNCTION date2string yyyymmdd _EXTRA ex compile_opt idl2 strictarrsubs sday strtrim long yyyymmdd MOD 100 1 smonth strtrim long yyyymmdd 100 MOD 100 2 syear strtrim long yyyymmdd 10000 2 res string format C CMoa 31 fix smonth 1 _EXTRA ex sday syear return res end"); 6 a[4] = new Array("./Calendar/daysinmonth.html", "daysinmonth.pro", "", " file_comments give the number of days in a specific month categories calendar param year in optional default from time common variable of cm_4cal To specify the year of the onth Used only if the common variable key_caltype greg In that case month and year must have the same number of elements returns number of days in a month or 1 in case of error uses cm_4cal updatenew examples IDL ndays daysinmonth 2 2000 history Sebastien Masson smasson lodyc jussieu fr 2 7 98 update review english new commons: June 2005 Sebastien Masson version Id: daysinmonth pro 137 2006 07 12 09:33:44Z smassonfunction daysinmonth month year include commons compile_opt idl2 strictarrsubs cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF n_elements key_caltype EQ 0 THEN key_caltype greg CASE key_caltype OF 360d : if n_elements month GT 1 THEN return replicate 30 n_elements month ELSE return 30 noleap :BEGIN days_in_mth 31 28 31 30 31 30 31 31 30 31 30 31 IF n_elements month EQ 0 THEN caldat time month return days_in_mth month 1 END greg :BEGIN CASE n_params OF 0:caldat time month day year 2:IF n_elements month NE n_elements year THEN return report month and year must have the same number of elements ELSE:return report daysinmonth accept 0 or 2 input parameters ENDCASE days_in_mth 31 28 31 30 31 30 31 31 30 31 30 31 return days_in_mth month 1 leapyr year month EQ 2 END ELSE:return report only 3 types of calendar are accepted: greg 360d and noleap ENDCASE END");6 a[4] = new Array("./Calendar/daysinmonth.html", "daysinmonth.pro", "", " file_comments give the number of days in a specific month categories calendar param year in optional default from time common variable of cm_4cal To specify the year of the onth Used only if the common variable key_caltype greg In that case month and year must have the same number of elements param returns number of days in a month or 1 in case of error uses cm_4cal updatenew examples IDL ndays daysinmonth 2 2000 history Sebastien Masson smasson lodyc jussieu fr 2 7 98 update review english new commons: June 2005 Sebastien Masson version Id: daysinmonth pro 150 2006 08 09 10:12:54Z navarro function daysinmonth month year include commons compile_opt idl2 strictarrsubs cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF n_elements key_caltype EQ 0 THEN key_caltype greg CASE key_caltype OF 360d : if n_elements month GT 1 THEN return replicate 30 n_elements month ELSE return 30 noleap :BEGIN days_in_mth 31 28 31 30 31 30 31 31 30 31 30 31 IF n_elements month EQ 0 THEN caldat time month return days_in_mth month 1 END greg :BEGIN CASE n_params OF 0:caldat time month day year 2:IF n_elements month NE n_elements year THEN return report month and year must have the same number of elements ELSE:return report daysinmonth accept 0 or 2 input parameters ENDCASE days_in_mth 31 28 31 30 31 30 31 31 30 31 30 31 return days_in_mth month 1 leapyr year month EQ 2 END ELSE:return report only 3 types of calendar are accepted: greg 360d and noleap ENDCASE END"); 7 7 a[5] = new Array("./Calendar/jul2date.html", "jul2date.pro", "", " file_comments gives yyyymmdd date equivalent of a Julian day categories calendar param jday in required Julian day returns date in yyyymmdd format examples IDL print jul2date julday 12 23 1999 19991223 history Sebastien Masson smasson lodyc jussieu fr June 2005 version Id: jul2date pro 137 2006 07 12 09:33:44Z smasson function jul2date jday compile_opt idl2 strictarrsubs caldat jday month day year res 10000L year 100L month day year GE 0 10000L year 100L month day year LT 0 return long res end"); 8 8 a[6] = new Array("./Calendar/julday.html", "julday.pro", "", " file_comments Calculate the Julian Day Number for a given month day and year This is the inverse of the library function CALDAT 3 calendars are avalable according to the value of key_caltype variable of the common file cm_4cal : greg 360d noleap categories Calendar param MONTH in required Number of the desired month 1 January 12 December Can be scalar or array param DAY in required Number of day of the month Can be scalar or array param YEARin in required Number of the desired year Year parameters must be valid values from the civil calendar Years B C E are represented as negative integers Years in the common era are represented as positive integers In particular note that there is no year 0 in the civil calendar 1 B C E 1 is followed by 1 C E 1 Change: However for climatological year we do accept the year O but we change it for year 654321L the same trick is done in caldat so caldat julday 1 1 0 gives you back Jan 1st of year 0 Can be scalar or array param HOUR in optional default 12 Number of the hour of the day Can be scalar or array param MINUTE in optional default 0 Number of the minute of the hour Can be scalar or array param SECOND in optional default 0 Number of the second of the minute Can be scalar or array restrictions The Result will have the same dimensions as the smallest array or will be a scalar if all arguments are scalars keyword NDAYSPM default 30 To use a calendar with fixed number of days per months see also the use of key_caltype variable of the common file cm_4cal returns the Julian Day Number which begins at noon of the specified calendar date If Hour Minute and Second are not specified then the result will be a long integer otherwise the result is a double precision floating point number uses cm_4cal restrictions Accuracy using IEEE double precision numbers is approximately 1 10000th of a second with higher accuracy for smaller earlier Julian dates history Translated from Numerical Recipies in C by William H Press Brian P Flannery Saul A Teukolsky and William T Vetterling Cambridge University Press 1988 second printing AB September 1988 DMS April 1995 Added time of day Eric Guilyardi June 1999 Added key_work ndayspm for fixed number of days per months CT April 2000 Now accepts vectors or scalars Sebastien Masson Aug 2003 fix bug for negative and large values of month values eg julday 349 1 1970 Sebastien Masson May 2006 add diferent calendat with key_caltype variable of the common file cm_4cal version Id: julday pro 137 2006 07 12 09:33:44Z smasson function JULDAY MONTH DAY YEARin Hour Minute Second NDAYSPM ndayspm cm_4cal COMPILE_OPT idl2 ON_ERROR 2 Return to caller if errors IF n_elements key_caltype EQ 0 THEN key_caltype greg if keyword_set ndayspm then key_caltype 360d YEAR long yearin zero where year EQ 0 cnt IF cnt NE 0 THEN YEAR zero 654321L CASE key_caltype OF greg :BEGIN Gregorian Calender was adopted on Oct 15 1582 skipping from Oct 4 1582 to Oct 15 1582 GREG 2299171L incorrect Julian day for Oct 25 1582 Process the input if all are missing use todays date NP n_params IF np EQ 0 THEN RETURN SYSTIME JULIAN IF np LT 3 THEN MESSAGE Incorrect number of arguments Find the dimensions of the Result: 1 Find all of the input arguments that are arrays ignore scalars 2 Out of the arrays find the smallest number of elements 3 Find the dimensions of the smallest array Step 1: find all array arguments nDims SIZE month N_DIMENSIONS SIZE day N_DIMENSIONS SIZE year N_DIMENSIONS SIZE hour N_DIMENSIONS SIZE minute N_DIMENSIONS SIZE second N_DIMENSIONS arrays WHERE nDims GE 1 nJulian 1L assume everything is a scalar IF arrays 0 GE 0 THEN BEGIN Step 2: find the smallest number of elements nElement N_ELEMENTS month N_ELEMENTS day N_ELEMENTS year N_ELEMENTS hour N_ELEMENTS minute N_ELEMENTS second nJulian MIN nElement arrays whichVar step 3: find dimensions of the smallest array CASE arrays whichVar OF 0: julianDims SIZE month DIMENSIONS 1: julianDims SIZE day DIMENSIONS 2: julianDims SIZE year DIMENSIONS 3: julianDims SIZE hour DIMENSIONS 4: julianDims SIZE minute DIMENSIONS 5: julianDims SIZE second DIMENSIONS ENDCASE ENDIF d_Second 0d defaults d_Minute 0d d_Hour 0d convert all Arguments to appropriate array size type SWITCH np OF use switch so we fall thru all arguments 6: d_Second SIZE second N_DIMENSIONS GT 0 second 0:nJulian 1 : second 5: d_Minute SIZE minute N_DIMENSIONS GT 0 minute 0:nJulian 1 : minute 4: d_Hour SIZE hour N_DIMENSIONS GT 0 hour 0:nJulian 1 : hour 3: BEGIN convert m d y to type LONG L_MONTH SIZE month N_DIMENSIONS GT 0 LONG month 0:nJulian 1 : LONG month L_DAY SIZE day N_DIMENSIONS GT 0 LONG day 0:nJulian 1 : LONG day L_YEAR SIZE year N_DIMENSIONS GT 0 LONG year 0:nJulian 1 : LONG year END ENDSWITCH min_calendar 4716 max_calendar 5000000 minn MIN l_year MAX maxx IF minn LT min_calendar OR maxx GT max_calendar THEN MESSAGE Value of Julian date is out of allowed range change to accept year 0 if MAX L_YEAR eq 0 NE 0 then message There is no year zero in the civil calendar by seb Aug 2003 tochange where L_MONTH LT 0 IF tochange 0 NE 1 THEN BEGIN L_YEAR tochange L_YEAR tochange L_MONTH tochange 12 1 L_MONTH tochange 12 L_MONTH tochange MOD 12 ENDIF tochange where L_MONTH GT 12 IF tochange 0 NE 1 THEN BEGIN L_YEAR tochange L_YEAR tochange L_MONTH tochange 12 L_MONTH tochange L_MONTH tochange MOD 12 ENDIF by seb Aug 2003 end bc L_YEAR LT 0 L_YEAR TEMPORARY L_YEAR TEMPORARY bc inJanFeb L_MONTH LE 2 JY L_YEAR inJanFeb JM L_MONTH 1b 12b TEMPORARY inJanFeb JUL floor 365 25d JY floor 30 6001d TEMPORARY JM L_DAY 1720995L Test whether to change to Gregorian Calendar IF MIN JUL GE GREG THEN BEGIN change all dates JA long 0 01d TEMPORARY JY JUL TEMPORARY JUL 2L JA long 0 25d JA ENDIF ELSE BEGIN gregChange WHERE JUL ge GREG ngreg IF ngreg GT 0 THEN BEGIN JA long 0 01d JY gregChange JUL gregChange JUL gregChange 2L JA long 0 25d JA ENDIF ENDELSE hour minute second IF np GT 3 THEN BEGIN yes compute the fractional Julian date Add a small offset so we get the hours minutes seconds back correctly if we convert the Julian dates back This offset is proportional to the Julian date so small dates a long long time ago will be more accurate eps MACHAR DOUBLE eps eps eps ABS jul eps For Hours divide by 24 then subtract 0 5 in case we have unsigned integers jul TEMPORARY JUL TEMPORARY d_Hour 24d 0 5d TEMPORARY d_Minute 1440d TEMPORARY d_Second 86400d eps ENDIF check to see if we need to reform vector to array of correct dimensions IF N_ELEMENTS julianDims GT 1 THEN JUL REFORM TEMPORARY JUL julianDims RETURN jul END 360d :BEGIN Fixed number of days per month default 30 : IF keyword_set ndayspm THEN BEGIN IF ndayspm EQ 1 THEN ndayspm 30 ENDIF ELSE ndayspm 30 L_MONTH LONG MONTH L_DAY LONG DAY L_YEAR LONG YEAR neg where L_YEAR LT 0 IF neg 0 NE 1 THEN L_YEAR neg L_YEAR neg 1 JUL L_YEAR 1 12 L_MONTH 1 ndayspm L_DAY if n_elements Hour n_elements Minute n_elements Second eq 0 then return JUL if n_elements Hour eq 0 then Hour 0 if n_elements Minute eq 0 then Minute 0 if n_elements Second eq 0 then Second 0 IF Hour Minute Second EQ 0 THEN return JUL ELSE return JUL Hour 24 0d0 Minute 1440 0d0 Second 86400 0d0 END noleap :BEGIN L_MONTH LONG MONTH L_DAY LONG DAY L_YEAR LONG YEAR tochange where L_MONTH LT 0 IF tochange 0 NE 1 THEN BEGIN L_YEAR tochange L_YEAR tochange L_MONTH tochange 12 1 L_MONTH tochange 12 L_MONTH tochange MOD 12 ENDIF tochange where L_MONTH GT 12 IF tochange 0 NE 1 THEN BEGIN L_YEAR tochange L_YEAR tochange L_MONTH tochange 12 L_MONTH tochange L_MONTH tochange MOD 12 ENDIF L_YEAR L_YEAR 1 daysyear long total 0 0 31 28 31 30 31 30 31 31 30 31 30 cumulative return 365 L_YEAR daysyear L_MONTH L_DAY END ELSE:return report only 3 types of calendar are accepted: greg 360d and noleap ENDCASE END"); … … 114 114 a[112] = new Array("./ReadWrite/idl-NetCDF/ncdf_struct_free.html", "ncdf_struct_free.pro", "", "PRO ncdf_struct_free s compile_opt idl2 strictarrsubs free heap memory associated with struct returned by ncdf_struct for i 0 s nvars 1 do ptr_free s vars i data end"); 115 115 a[113] = new Array("./ReadWrite/ncdf_timeget.html", "ncdf_timeget.pro", "", " file_comments get the time axis from a netcdf_file and transforms it in Julian days of IDL categories reading ncdf_file param cdfid in required the ID of the ncdf_file which is already open param timeid in required the ID or the name of the variable which describe the calendar keyword YYYYMMDD active to obtain the date as a long integer with the format YearYearYearYearMonthMonthDayDay keyword _EXTRA the keyword parameters of ncdf_varget returns a long array of IDL Julian days restrictions the calendar variable must have the units attribute following the syntax bellow: time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 history Sebastien Masson smasson lodyc jussieu fr June 2001 version Id: ncdf_timeget pro 136 2006 07 10 15:20:19Z pinsard FUNCTION ncdf_timeget cdfid timeid YYYYMMDD yyyymmdd _EXTRA ex compile_opt idl2 strictarrsubs insidetime ncdf_varinq cdfid timeid if insidetime natts NE 0 then begin attnames strarr insidetime natts for attiq 0 insidetime natts 1 do attnames attiq strlowcase ncdf_attname cdfid timeid attiq ENDIF ELSE return report the variable timeid must have the units attribut reading of the time axis ncdf_varget cdfid timeid time _extra ex time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 if where attnames EQ units 0 NE 1 then begin ncdf_attget cdfid timeid units value value strtrim strcompress string value 2 words str_sep value unite words 0 start str_sep words 2 case strlowcase unite of seconds :time julday start 1 start 2 start 0 time long 24 3600 hours :time julday start 1 start 2 start 0 time long 24 days :time julday start 1 start 2 start 0 time months :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 time t start 2 start 0 endfor END years :BEGIN for t 0 n_elements time 1 do begin time t julday start 1 start 2 start 0 time t endfor END ELSE:return report bad syntax of the units attribut of the variable timeid ENDCASE ENDIF ELSE return report the variable timeid must have the units attribut if keyword_set yyyymmdd then time jul2date time return time end"); 116 a[114] = new Array("./ReadWrite/read_grads.html", "read_grads.pro", "", " file_comments reading grads file except data type station or grib from the grads control file even if there is multiple data files categories reading function param var in required the variable name param date1 in required date of the beginning yyyymmdd if TIMESTEP is not activate param date2 in optional last date Optional if not specified date2 date1 keyword FILENAME the grads control file name: xxxx ctl file_comments keyword GLAMBOUNDARY via computegrid pro a 2 elements vector lon1 lon2 giving the longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 eq 360 key_shift will be automatically defined according to GLAMBOUNDARY keyword TIMESTEP to specify that the dates are time steps instead of true calendar file_comments keyword IODIRECTORY a string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir todo NOT yet available BOX a 4 or 6 elements 1d array lon1 lon2 lat1 lat2 depth1 depth2 that specifies the area where data must be read EVERYTHING NOSTRUCTURE returns an array uses common restriction define all the grid parameters defined in common pro associated to the data restrictions this function call the procedure scanfile that use the unix commands grep and sed examples IDL a read_grads sst 19900101 19900131 filename outputs ctl IDL plt a history Sebastien Masson smasson lodyc jussieu fr version Id: read_grads pro 136 2006 07 10 15:20:19Z pinsardFUNCTION read_grads var date1 date2 FILENAME filename BOX box TIMESTEP timestep EVERYTHING everything NOSTRUCT nostruct _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we find the filename filename isafile FILENAME filename IODIRECTORY iodir _EXTRA ex if size filename type NE 7 then return report read_ncdf cancelled we scan the control file called filename scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex if n_elements varfmt EQ 0 then varfmt float check date1 and date2 and found the starting index t1 and the ending index t2 that corresponds to the time series specified by date1 and date2 for the time axis defined in the ctl file if n_elements date1 EQ 0 then begin t0 0 t1 0 ENDIF if n_elements date2 EQ 0 then date2 date1 if keyword_set timestep then BEGIN if date1 GT date2 then begin print date2 must be larger than date1 return 1 endif t1 0 long date1 long date2 date2jul date2 grads if jdate1 GT jdate2 then begin print date2 must be larger than date1 return 1 endif t1 where time GE jdate1 0 tmp where time LE jdate2 t2 t2 t2 1 ENDELSE if t2 LT t1 then begin print There is no date between date1 and date2 return 1 endif jpt2read t2 t1 1 index of the variable varid where strlowcase varsname EQ strlowcase var varid varid 0 if varid EQ 1 then begin print var not found in the variable list of filename return 1 ENDIF varname var if varslev varid EQ 1 then res fltarr jpi jpj jpt2read nozero ELSE res fltarr jpi jpj varslev varid jpt2read nozero find the first file to be read according to the file list the number of time step in each file and t1 and t2 indf2read t1 jpt1file startread t1 indf2read jpt1file alreadyread 0 readagain: jpt2read1file min jpt1file startread jpt2read f2read filesname indf2read opening check the existence of the file f2read isafile filename f2read iodirectory iodir _EXTRA ex if the file is stored on tape if version os_family EQ unix then spawn file f2read dev null open the file openr unit f2read get_lun error err swap_if_little_endian bigendian swap_if_big_endian littleendian swap_endian swapbytes if err ne 0 then begin print err_string return 1 endif case varfmt of byte :fmtsz 1l uint :fmtsz 2l int :fmtsz 2l long :fmtsz 4l float :fmtsz 4l endcase check its size addf77sec long 4 2 f77sequential xyblocsize xyheader addf77sec xyheader NE 0 jpi jpj fmtsz addf77sec nxybloc long total varslev filesize fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize jpt1file infof2read fstat unit if infof2read size NE filesize then begin print According to filename the file size must be strtrim filesize 1 instead of strtrim infof2read size 1 print jpi: strtrim jpi 2 print jpj: strtrim jpj 2 print jpt: strtrim jpt 2 print format size in byte: strtrim fmtsz 2 print number of xy arrays: strtrim nxybloc 2 return 1 endif reading loop on the time steps to be read in one file for i 0 jpt2read1file 1 do begin computing the offset offset fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize startread i theader addf77sec theader NE 0 if varid NE 0 THEN offset offset long total varslev 0:varid 1 xyblocsize if there is only one level IF varslev varid EQ 1 then begin case varfmt of byte :a assoc unit bytarr jpi jpj nozero offset 4 f77sequential uint :a assoc unit uintarr jpi jpj nozero offset 4 f77sequential int :a assoc unit intarr jpi jpj nozero offset 4 f77sequential long :a assoc unit lonarr jpi jpj nozero offset 4 f77sequential float :a assoc unit fltarr jpi jpj nozero offset 4 f77sequential endcase res i alreadyread a 0 ENDIF ELSE BEGIN more than 1 level to be read if f77sequential then BEGIN sequential access case varfmt of byte :a assoc unit bytarr jpi jpj 8 varslev varid nozero offset uint :a assoc unit uintarr jpi jpj 4 varslev varid nozero offset int :a assoc unit intarr jpi jpj 4 varslev varid nozero offset long :a assoc unit lonarr jpi jpj 2 varslev varid nozero offset float :a assoc unit fltarr jpi jpj 2 varslev varid nozero offset endcase tmp a 0 case varfmt OF we cut the headers and tailers of f77 write byte : tmp tmp 4:jpi jpj 3 uint : tmp tmp 2:jpi jpj 1 int : tmp tmp 2:jpi jpj 1 long : tmp tmp 1:jpi jpj 0 float :tmp tmp 1:jpi jpj 0 endcase if keyword_set key_zreverse then res i alreadyread reverse reform tmp jpi jpj varslev varid over 3 ELSE res i alreadyread reform tmp jpi jpj varslev varid over ENDIF ELSE BEGIN direct acces case varfmt of byte :a assoc unit bytarr jpi jpj varslev varid nozero offset uint :a assoc unit uintarr jpi jpj varslev varid nozero offset int :a assoc unit intarr jpi jpj varslev varid nozero offset long :a assoc unit lonarr jpi jpj varslev varid nozero offset float :a assoc unit fltarr jpi jpj varslev varid nozero offset endcase if keyword_set key_zreverse then res i alreadyread reverse a 0 3 ELSE res i alreadyread a 0 ENDELSE ENDELSE endfor close the file free_lun unit close unit do we need to read a new file to complete the time series if jpt2read1file NE jpt2read then BEGIN indf2read indf2read 1 startread 0 alreadyread alreadyread jpt2read1file jpt2read jpt2read jpt2read1file GOTO readagain ENDIF post processing if keyword_set key_yreverse then res reverse res 2 if keyword_set key_shift then begin case size res 0 of 2:res shift res key_shift 0 3:res shift res key_shift 0 0 4:res shift res key_shift 0 0 0 endcase endif mask IF varslev varid EQ 1 then begin if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDIF ELSE BEGIN if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDELSE if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood values f_nan valmask 1e20 if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood 1e20 valmask 1e20 triangles_list triangule subdomain extraction time arguments time time t1:t2 jpt t2 t1 1 if keyword_set timestep then vardate strtrim time 0 2 ELSE vardate date2string vairdate time 0 updateold return res end");116 a[114] = new Array("./ReadWrite/read_grads.html", "read_grads.pro", "", " file_comments reading grads file except data type station or grib from the grads control file even if there is multiple data files categories reading function param var in required the variable name param date1 in required date of the beginning yyyymmdd if TIMESTEP is not activate param date2 in optional last date Optional if not specified date2 date1 keyword FILENAME the grads control file name: xxxx ctl file_comments keyword GLAMBOUNDARY via computegrid pro a 2 elements vector lon1 lon2 giving the longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 eq 360 key_shift will be automatically defined according to GLAMBOUNDARY keyword TIMESTEP to specify that the dates are time steps instead of true calendar file_comments keyword IODIRECTORY a string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir NOT yet available BOX a 4 or 6 elements 1d array lon1 lon2 lat1 lat2 depth1 depth2 that specifies the area where data must be read EVERYTHING NOSTRUCTURE returns an array uses common restriction define all the grid parameters defined in common pro associated to the data restrictions this function call the procedure scanfile that use the unix commands grep and sed examples IDL a read_grads sst 19900101 19900131 filename outputs ctl IDL plt a history Sebastien Masson smasson lodyc jussieu fr version Id: read_grads pro 150 2006 08 09 10:12:54Z navarro FUNCTION read_grads var date1 date2 FILENAME filename BOX box TIMESTEP timestep EVERYTHING everything NOSTRUCT nostruct _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we find the filename filename isafile FILENAME filename IODIRECTORY iodir _EXTRA ex if size filename type NE 7 then return report read_ncdf cancelled we scan the control file called filename scanctl filename filesname jpt1file varsname varslev swapbytes bigendian littleendian f77sequential fileheader theader xyheader VARFMT varfmt _EXTRA ex if n_elements varfmt EQ 0 then varfmt float check date1 and date2 and found the starting index t1 and the ending index t2 that corresponds to the time series specified by date1 and date2 for the time axis defined in the ctl file if n_elements date1 EQ 0 then begin t0 0 t1 0 ENDIF if n_elements date2 EQ 0 then date2 date1 if keyword_set timestep then BEGIN if date1 GT date2 then begin print date2 must be larger than date1 return 1 endif t1 0 long date1 long date2 date2jul date2 grads if jdate1 GT jdate2 then begin print date2 must be larger than date1 return 1 endif t1 where time GE jdate1 0 tmp where time LE jdate2 t2 t2 t2 1 ENDELSE if t2 LT t1 then begin print There is no date between date1 and date2 return 1 endif jpt2read t2 t1 1 index of the variable varid where strlowcase varsname EQ strlowcase var varid varid 0 if varid EQ 1 then begin print var not found in the variable list of filename return 1 ENDIF varname var if varslev varid EQ 1 then res fltarr jpi jpj jpt2read nozero ELSE res fltarr jpi jpj varslev varid jpt2read nozero find the first file to be read according to the file list the number of time step in each file and t1 and t2 indf2read t1 jpt1file startread t1 indf2read jpt1file alreadyread 0 readagain: jpt2read1file min jpt1file startread jpt2read f2read filesname indf2read opening check the existence of the file f2read isafile filename f2read iodirectory iodir _EXTRA ex if the file is stored on tape if version os_family EQ unix then spawn file f2read dev null open the file openr unit f2read get_lun error err swap_if_little_endian bigendian swap_if_big_endian littleendian swap_endian swapbytes if err ne 0 then begin print err_string return 1 endif case varfmt of byte :fmtsz 1l uint :fmtsz 2l int :fmtsz 2l long :fmtsz 4l float :fmtsz 4l endcase check its size addf77sec long 4 2 f77sequential xyblocsize xyheader addf77sec xyheader NE 0 jpi jpj fmtsz addf77sec nxybloc long total varslev filesize fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize jpt1file infof2read fstat unit if infof2read size NE filesize then begin print According to filename the file size must be strtrim filesize 1 instead of strtrim infof2read size 1 print jpi: strtrim jpi 2 print jpj: strtrim jpj 2 print jpt: strtrim jpt 2 print format size in byte: strtrim fmtsz 2 print number of xy arrays: strtrim nxybloc 2 return 1 endif reading loop on the time steps to be read in one file for i 0 jpt2read1file 1 do begin computing the offset offset fileheader addf77sec fileheader NE 0 theader addf77sec theader NE 0 nxybloc xyblocsize startread i theader addf77sec theader NE 0 if varid NE 0 THEN offset offset long total varslev 0:varid 1 xyblocsize if there is only one level IF varslev varid EQ 1 then begin case varfmt of byte :a assoc unit bytarr jpi jpj nozero offset 4 f77sequential uint :a assoc unit uintarr jpi jpj nozero offset 4 f77sequential int :a assoc unit intarr jpi jpj nozero offset 4 f77sequential long :a assoc unit lonarr jpi jpj nozero offset 4 f77sequential float :a assoc unit fltarr jpi jpj nozero offset 4 f77sequential endcase res i alreadyread a 0 ENDIF ELSE BEGIN more than 1 level to be read if f77sequential then BEGIN sequential access case varfmt of byte :a assoc unit bytarr jpi jpj 8 varslev varid nozero offset uint :a assoc unit uintarr jpi jpj 4 varslev varid nozero offset int :a assoc unit intarr jpi jpj 4 varslev varid nozero offset long :a assoc unit lonarr jpi jpj 2 varslev varid nozero offset float :a assoc unit fltarr jpi jpj 2 varslev varid nozero offset endcase tmp a 0 case varfmt OF we cut the headers and tailers of f77 write byte : tmp tmp 4:jpi jpj 3 uint : tmp tmp 2:jpi jpj 1 int : tmp tmp 2:jpi jpj 1 long : tmp tmp 1:jpi jpj 0 float :tmp tmp 1:jpi jpj 0 endcase if keyword_set key_zreverse then res i alreadyread reverse reform tmp jpi jpj varslev varid over 3 ELSE res i alreadyread reform tmp jpi jpj varslev varid over ENDIF ELSE BEGIN direct acces case varfmt of byte :a assoc unit bytarr jpi jpj varslev varid nozero offset uint :a assoc unit uintarr jpi jpj varslev varid nozero offset int :a assoc unit intarr jpi jpj varslev varid nozero offset long :a assoc unit lonarr jpi jpj varslev varid nozero offset float :a assoc unit fltarr jpi jpj varslev varid nozero offset endcase if keyword_set key_zreverse then res i alreadyread reverse a 0 3 ELSE res i alreadyread a 0 ENDELSE ENDELSE endfor close the file free_lun unit close unit do we need to read a new file to complete the time series if jpt2read1file NE jpt2read then BEGIN indf2read indf2read 1 startread 0 alreadyread alreadyread jpt2read1file jpt2read jpt2read jpt2read1file GOTO readagain ENDIF post processing if keyword_set key_yreverse then res reverse res 2 if keyword_set key_shift then begin case size res 0 of 2:res shift res key_shift 0 3:res shift res key_shift 0 0 4:res shift res key_shift 0 0 0 endcase endif mask IF varslev varid EQ 1 then begin if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDIF ELSE BEGIN if abs valmask LE 1e5 then notgood where res 0 EQ valmask ELSE notgood where abs res 0 GE abs valmask 10 if notgood 0 NE 1 then tmask notgood 0b ENDELSE if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood values f_nan valmask 1e20 if abs valmask LE 1e5 then notgood where res EQ valmask ELSE notgood where abs res GE abs valmask 10 if notgood 0 NE 1 THEN res notgood 1e20 valmask 1e20 triangles_list triangule subdomain extraction time arguments time time t1:t2 jpt t2 t1 1 if keyword_set timestep then vardate strtrim time 0 2 ELSE vardate date2string vairdate time 0 updateold return res end"); 117 117 a[115] = new Array("./ReadWrite/read_oasis.html", "read_oasis.pro", "", " file_comments read the f77 unformatted files used in Oasis version a read_oasis grids_orca_t106 a106 lon 320 160 IDL m read_oasis masks_orca_t106 or1t msk 182 149 i4 see also IDL scanoasis grids_orca_t106 history Sebastien Masson smasson lodyc jussieu fr July 01 2002 version Id: read_oasis pro 136 2006 07 10 15:20:19Z pinsard FUNCTION read_oasis filename varname jpi jpj I2 I2 I4 i4 I8 i8 R4 r4 compile_opt idl2 strictarrsubs openr unit filename f77_unformatted get_lun swap_if_little_endian error err if err ne 0 then begin print err_string return 1 endif char8 12345678 readu unit char8 print char8 found char8 EQ varname WHILE NOT EOF unit AND found NE 1 DO BEGIN readu unit if EOF unit then begin print varname not found in filename return 1 endif readu unit char8 print char8 found char8 EQ varname ENDWHILE case 1 of keyword_set i2 :res intarr jpi jpj keyword_set i4 :res lonarr jpi jpj keyword_set i8 :res lon64arr jpi jpj keyword_set r4 :res fltarr jpi jpj ELSE:res dblarr jpi jpj endcase readu unit res free_lun unit return res end"); 118 118 a[116] = new Array("./ReadWrite/readbat.html", "readbat.pro", "", " file_comments reading the bathymetry ASCII file of OPA categories for OPA param filename in required a string containing the filename keyword ZERO to put 0 on land instead of negatives values for the islands returns a 2d array history Sebastien Masson smasson lodyc jussieu fr May 31 2002 based on batlec2 pro written by Maurice Imbard March 17 1998 version Id: readbat pro 130 2006 07 06 14:48:41Z pinsard FUNCTION readbat filename ZERO zero compile_opt idl2 strictarrsubs lecture de la bathymetrie iname_file findfile filename if iname_file 0 EQ then begin print Bad file name return 1 ENDIF ELSE iname_file iname_file 0 openr iunit iname_file get_lun readf iunit FORMAT 16x 2i8 iim ijm iim long iim ijm long ijm tmp readf iunit tmp tmp strsplit tmp extract iim long tmp n_elements tmp 2 ijm long tmp n_elements tmp 1 print iim ijm ifreq 40L ifin iim ifreq 1 irest iim ifin 1 ifreq print ifin irest ifreq zbati intarr ifreq zbati2 intarr irest zbat intarr iim ijm readf iunit FORMAT readf iunit FORMAT il1 0 FOR jn 1 ifin 1 DO BEGIN readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 jn 1 ifreq iformat string il3 2 i3 print jn il1 il2 il3 ifreq 1 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati zbat il1:il2 jj zbati ENDFOR il1 il1 ifreq ENDFOR readf iunit FORMAT readf iunit FORMAT il2 min iim 1 il1 ifreq 1 readf iunit FORMAT readf iunit FORMAT readf iunit FORMAT il3 il2 ifin 1 ifreq iformat string il3 2 i3 print irest 1 il1 il2 il3 FOR jj ijm 1 0 1 DO BEGIN readf iunit FORMAT iformat ij zbati2 zbat il1:il2 jj zbati2 ENDFOR close iunit free_lun iunit if keyword_set zero then zbat 0 zbat return zbat end"); … … 173 173 a[171] = new Array("./Textoidl/textoidl.html", "textoidl.pro", "", " NAME: TEXTOIDL PURPOSE: Convert a valid TeX string to a valid IDL string for plot labels CATEGORY: text strings CALLING SEQUENCE: new textoidl old INPUTS: old TeX string to be converted Will not be in modified old may be a string array KEYWORD PARAMETERS: FONT Set to 0 to use hardware font 1 to use vector Note that the only hardware font supported is PostScript TEX_SEQUENCES return the available TeX sequences HELP print out info on use of the function and exit OUTPUTS: new IDL string corresponding to old out COMMON BLOCKS: SIDE EFFECTS: NOTES: Use the procedure SHOWTEX to get a list of the available TeX control sequences The only hardware font for which translation is available is PostScript The only device for which hardware font translation is available is PostScript The FONT keyword overrides the font selected by p font EXAMPLE: out TeXtoIDL Gamma 2 5N_ ed The string out may be used in XYOUTS or other IDL text display routines It will be an uppercase Gamma with an exponent of 2 then a plus sign then an N with the subscript ed MODIFICATION HISTORY: Id: textoidl pro 134 2006 07 07 10:19:08Z navarro Log: textoidl pro v Revision 1 7 2004 06 15 17:25:54 mcraig Fixed bug in regular expression changed array notation to square brackets Revision 1 6 2004 01 11 01:49:00 mcraig Changed format of one array to newer style to avoidf conflict with function name in astro library Revision 1 5 2001 11 23 21:10:55 mcraig Added backslash to tex sequences in translation table to protect them during regexp search in strsplit Revision 1 4 1996 06 14 20:00:27 mcraig Updated Copyright info Revision 1 3 1996 05 09 00:22:17 mcraig Added error handling cleaned up documentation Revision 1 2 1996 02 08 18:52:50 mcraig Added ability to use hardware fonts for PostScript device Revision 1 1 1996 01 31 18:47:37 mcraig Initial revision RELEASE: Name: Rel_2_1_2 COPYRIGHT: Copyright C 1996 The Regents of the University of California All Rights Reserved Written by Matthew W Craig See the file COPYRIGHT for restrictions on distrubting this code This code comes with absolutely NO warranty see DISCLAIMER for details FUNCTION Textoidl InputString FONT fnt HELP hlp TEX_SEQUENCES tex_seq compile_opt idl2 strictarrsubs Return to caller if there is an error On_error 2 We begin by deciding on the font PostScript 0 means use vector PostScript 0 IF n_elements fnt EQ 0 THEN BEGIN get font from p font IF p font NE 1 THEN BEGIN User wants hardware font PostScript 1 ENDIF ENDIF ELSE BEGIN get font from FONT keyword IF fnt NE 1 THEN PostScript 1 ENDELSE Bomb out if user wants non PostScript hardware font IF PostScript EQ 1 AND d name NE PS THEN BEGIN Device isn t postscript and user wants hardware font Not good print Warning: No translation for device: d name return InputString ENDIF IF keyword_set tex_seq THEN BEGIN table textable return table 0 ENDIF IF keyword_set hlp OR n_params EQ 0 THEN BEGIN print Convert a TeX string to an IDL string print new TeXtoIDL old print old TeX string to translate in print new resulting IDL string out print Keywords: print FONT set to 1 to translate for vector fonts print DEFAULT Set to 0 to translate for print hardware font print TEX_SEQUENCES return the available TeX sequences print HELP print this message and exit print NOTES: print Use SHOWTEX to obtain a list of the available print TeX control sequences print old may be a string array If so new is too print The only device for which hardware font print translation is available is PostScript print The FONT keyword overrides the font selected print by p font return 1 ENDIF PostScript has been set to 1 if PostScript fonts are desired strn InputString table textable POSTSCRIPT PostScript Greek sub superscripts need to be protected by putting braces around them if they are unbraced This will have the result the it will be difficult to use as a sub superscript Get over it V2 11 Must include the in from of translation table TeX sequences to ensure that strsplit properly treats the in the TeX sequence Since strsplit is doing a regexp replace and is special in regexps need to escape it strn strtrans strn table 0 table 0 strn strtrans strn _ table 0 _ table 0 First we translate Greek letters and the like This makes guessing alignment of sub superscripts easier as all special characters will then be one character long V2 11 Must include the in from of translation table TeX sequences to ensure that strsplit properly treats the in the TeX sequence Since strsplit is doing a regexp replace and is special in regexps need to escape it strn strtrans strn table 0 table 1 FOR i 0L n_elements strn 1 DO BEGIN strn i translate_sub_super strn i Take care of sub superscripts ENDFOR return strn END "); 174 174 a[172] = new Array("./Textoidl/translate_sub_super.html", "translate_sub_super.pro", "", " NOTE to future maintainers: Make sure sub_sup_idl stays before translate_sub_super At least for now when IDL encounters a function and automatically compiles it it only compiles the functions in the file up to the named function So even if sub_sup_idl was declared with FORWARD_FUNCTION in translate_sub_super it would not properly compile SPECIAL NOTE: The file translate_sub_super pro contains two functions translate_sub_super and sub_sup_idl The former is the generic routine for processing TeX sub superscripts the latter is used only by translate_sub_super and has no general utility Hence it lives here You will see documentation for translate_sub_super second if you use DOC_LIBRARY NAME: SUB_SUP_IDL PURPOSE: Return the proper IDL font positioning command for TeX sub superscripts CATEGORY: TeXtoIDL CALLING SEQUENCE: fnt sub_sup_idl strn INPUTS: strn Either or _ the TeX super subscript in characters KEYWORD PARAMETERS: FORCE_UD Set this to use U D instead of E I for sub superscripts HELP Set to print useful message and exit OUTPUTS: fnt Either U or E for superscripts out or D or I for subscripts COMMON BLOCKS: SIDE EFFECTS: NOTES: Used only by translate_sub_super Should be kept in same file EXAMPLE: MODIFICATION HISTORY: Id: translate_sub_super pro 134 2006 07 07 10:19:08Z navarro Log: translate_sub_super pro v Revision 1 5 2000 06 14 19:09:22 mcraig Changed name of strtok str_token to avoid conflict in IDL 5 3 Revision 1 4 1996 06 14 20:00:27 mcraig Updated Copyright info Revision 1 3 1996 05 09 00:22:17 mcraig Changed some function calls to reflect changes in those functions moved some code out of the main loop that didn t need to be there added documentation Revision 1 1 1996 01 31 18:47:37 mcraig Initial revision RELEASE: Name: Rel_2_1_2 COPYRIGHT: Copyright C 1996 The Regents of the University of California All Rights Reserved Written by Matthew W Craig See the file COPYRIGHT for restrictions on distrubting this code This code comes with absolutely NO warranty see DISCLAIMER for details FUNCTION Sub_sup_idl token FORCE_UD force_ud compile_opt idl2 strictarrsubs provide help if needed IF n_params NE 1 OR keyword_set Help THEN BEGIN offset print offset Return the proper IDL font positioning command for TeX print offset sub superscripts print offset fnt sub_sup_idl strn print offset Inputs: print offset offset strn Either or _ the TeX super subscript in print offset offset characters print offset Keywords: print offset offset FORCE_UD Set this to use U D instead of E I for print offset offset sub superscripts print offset offset HELP Set to print useful message and exit print offset Outputs: print offset offset fnt Either U or E for superscripts out print offset offset or D or I for subscripts return 1 ENDIF IF keyword_set force_ud THEN BEGIN IF token EQ THEN return U IF token EQ _ THEN return D return ENDIF ELSE BEGIN IF token EQ THEN return E IF token EQ _ THEN return I return ENDELSE END NAME: TRANSLATE_SUB_SUPER PURPOSE: Translate TeX sub superscripts to IDL sub superscripts CATEGORY: text strings CALLING SEQUENCE: new translate_sub_super old INPUTS: old string to be translated from TeX to IDL in KEYWORD PARAMETERS: RECURSED set if this function is being called recursively HELP Set to print useful message and exit OUTPUTS: new string old converted from TeX to IDL out COMMON BLOCKS: SIDE EFFECTS: NOTES: For best results when both a sub and superscript are used place the shorter of the two first e g N a _ bbbb is better than N_ bbbb a Single character sub super scripts do not need to be protected by braces Sub superscripts may be nested e g N N_1 N EXAMPLE: out translate_sub_super N 2_ big Then out N U2 N Dbig N which looks like it should on the display LIBRARY FUNCTIONS CALLED: str_token Text string mcraig sub_sup_idl contained in this file MODIFICATION HISTORY: Id: translate_sub_super pro 134 2006 07 07 10:19:08Z navarro Log: translate_sub_super pro v Revision 1 5 2000 06 14 19:09:22 mcraig Changed name of strtok str_token to avoid conflict in IDL 5 3 Revision 1 4 1996 06 14 20:00:27 mcraig Updated Copyright info Revision 1 3 1996 05 09 00:22:17 mcraig Changed some function calls to reflect changes in those functions moved some code out of the main loop that didn t need to be there added documentation Revision 1 2 1996 02 08 18:54:20 mcraig Changed default sub superscript size to be D U rather than I E to improve readability of plat annotations Revision 1 1 1996 01 31 18:47:37 mcraig Initial revision RELEASE: Name: Rel_2_1_2 COPYRIGHT: Copyright C 1996 The Regents of the University of California All Rights Reserved Written by Matthew W Craig See the file COPYRIGHT for restrictions on distrubting this code This code comes with absolutely NO warranty see DISCLAIMER for details FUNCTION Translate_sub_super InputString RECURSED recursed HELP Help compile_opt idl2 strictarrsubs Return to caller if error On_error 2 Offer help if needed and or desired IF n_params NE 1 OR keyword_set help THEN BEGIN offset print offset Translate TeX sub superscripts to IDL sub superscripts print offset new translate_sub_super old print offset Inputs: print offset offset old string to be translated from TeX to IDL in print offset Keywords: print offset offset RECURSED set if this function is being called print offset offset recursively print offset offset HELP Set to print useful message and exit print offset Outputs: print offset offset new string old converted from TeX to IDL out print offset Notes: print offset offset For best results when both a sub and superscript are used print offset offset place the shorter of the two first e g N a _ bbbb is print offset offset better than N_ bbbb a print offset offset Single character sub super scripts do not need to be print offset offset protected by braces print offset offset Sub superscripts may be nested e g N N_1 N return 1 ENDIF To allow for nested scripts use E I instead of U D for scripts when called recursively IF NOT keyword_set recursed THEN ud 1 ELSE ud 0 Return to the normal level after making sub superscript unless we are recursed which indicates we are processing a nested script IF keyword_set recursed THEN fontRestore ELSE fontRestore N Initialize vars for processing scripts SpcByte byte 0 We need the BYTE value for a space below strn InputString pos 0 StorePos RecallPos OldToken LenLastScript 0 Grab next sub superscript Token will be either or _ RETURN if no scripts Token nexttok strn _ pos pos if pos EQ 1 then return InputString nothing to process FntChange sub_sup_idl Token Our approach will be to grab the input string up to the next or _ then process the script we ve found NewString str_token strn Token WHILE strlen strn GT 0 DO BEGIN Grab first char of sub superscript Script strmid strn 0 1 EndOfScript 0 Position of end of this script IF Script EQ THEN BEGIN Scripts of more than 1 char EndOfScript matchdelim strn Script translate_sub_super strmid strn 1 EndOfScript 1 recursed ENDIF Grab rest of string _after_ the end of the script strn strmid strn EndOfScript 1 strlen strn EndOfScript 1 Find the next script and prepare for processing it FntChange sub_sup_idl Token FORCE_UD ud OldToken Token Token nexttok strn _ POS pos If the input is n 2_j we want the 2 to be directly above the j rather than having the j below and to the right of the 2 In other words we want the first below not the second 2 2 N N J J To accomplish this we need to save the position at which we begin writing the 2 with a S and restore that position with a R after writing the 2 The first section in the IF block below handles the J above the thing after the first script We don t care if there is another script following We also padd the second script with spaces if it is shorter than the first to make sure that whatever comes out after the scripts starts in the proper place The worry is that without the spaces the input N looong _ s 1 will end up with the starting right the s ends IF StorePos EQ S THEN BEGIN StorePos RecallPos calculate the difference in length between this script and the previous stacked one removing font change commands crudely by guessing that the number of characters this takes is twice the number of exclamation points The 1 below is a kludge I don t know why but I need one extra space NumSpaces LenLastScript strlen script 2 strcnt Script NumSpaces NumSpaces 1 0 IF NumSpaces GT 0 THEN Script Script string replicate SpcByte NumSpaces ENDIF ELSE BEGIN IF Token NE OldToken AND pos EQ 0 THEN BEGIN The next script immediately folows this one Arrange to save the position of the current script so that both begin with the same horizontal position StorePos S RecallPos R LenLastScript strlen Script 2 strcnt Script ENDIF ENDELSE Continue building the IDL string adding on our just processed script NewString NewString StorePos FntChange Script RecallPos FontRestore IF pos NE 1 THEN BEGIN more left to process NewString NewString str_token strn Token ENDIF ELSE BEGIN we are done NewString NewString strn strn ENDELSE ENDWHILE return NewString END "); 175 a[173] = new Array("./ToBeReviewed/CALCULS/curl.html", "curl.pro", "", " file_comments Calculate the vertical component of the curl of a field of horizontal vectors categories Calculation on matrixes param UU Matrix representing coordinates of a field of vectors param VV Matrix representing coordinates of a field of vectors returns RES A 2d matrix uses common pro restrictions U and V matrixes can be 2 or 4d Beware to discern differents configuration of U and V xy xyz xyt xyzt we look at the variable of the common time which contain the calendar in IDL julian days to which U and V refered to in the same way as the variable jpt which is the number of time s step to consider in time U and V arrays ae cut in the same geographic domain Because of the gap of T U V and F grids it is possible that these two arrays hase not the same size and refered to different indexes In this case arrays are recut on common indexesand the domain is redifined to match with these common indexes To avoid these recuts use the keyword memeindice in domdef pro Points on the drawing edge are at values f_nan history Guillaume Roullet grlod ipsl jussieu fr Sebastien Masson smasson lodyc jussieu fr adaptation pour marcher avec un domaine reduit 21 5 1999: valeurs manquantes a values f_nan periodicite version Id: curl pro 142 2006 07 21 12:47:49Z navarro FUNCTION curl uu vv compile_opt idl2 strictarrsubs common tempsun systime 1 To key_performance IF finite glamu 0 finite gphiu 0 finite glamv 0 finite gphiv 0 EQ 0 THEN return report This version of curl is based on Arakawa C grid U and V grids must therefore be defined u litchamp uu v litchamp vv date1 time 0 if n_elements jpt EQ 0 then date2 date1 ELSE date2 time jpt 1 if size u 0 NE size v 0 then return 1 We find common points between U and V indicexu lindgen jpi firstxu:firstxu nxu 1 indicexv lindgen jpi firstxv:firstxv nxv 1 indicex inter indicexu indicexv indiceyu lindgen jpj firstyu:firstyu nyu 1 indiceyv lindgen jpj firstyv:firstyv nyv 1 indicey inter indiceyu indiceyv nx n_elements indicex ny n_elements indicey case 1 of xyz size u 0 EQ 3 AND date1 EQ date2 :BEGIN indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 extraction of U and V on the appropriated domain case 1 of size u 0 NE 3 OR size v 0 NE 3: return 1 size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN case 1 of nxu NE nx:if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx nxv NE nx:if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx nyu NE ny:if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny nyv NE ny:if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny ELSE : endcase END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 v v indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 END ELSE:return 1 endcase calculation of the curl coefu e1u indice2d replicate 1 nzt coefu reform coefu nx ny nzt over coefu coefu umask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefv e2v indice2d replicate 1 nzt coefv reform coefv nx ny nzt over coefv coefv vmask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan tabf fmask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt div e1f indice2d e2f indice2d replicate 1 nzt div reform div nx ny nzt over tabf tabf div zu u temporary coefu zv v temporary coefv psi shift zv 1 0 0 zv zu shift zu 0 1 0 psi tabf psi Edging put at values f_nan if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask For the graphic drawing domdef glagmt indice2d 0 0 glamu indice2d nx 1 0 gphit indice2d 0 0 gphiv indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi moyenne psi direc nan END xyt date1 NE date2 AND size u 0 EQ 3 :BEGIN indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 extraction of U and V on the appropriated domain case 1 of size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN if nxu NE nx then if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx IF nxv NE nx THEN if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx IF nyu NE ny THEN if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny IF nyv NE ny THEN if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 v v indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 END ELSE:BEGIN print problemes d adequation entre la taille du domaine et la taille des matrices necessaires a tracer des vecteurs return 1 end endcase Calculation of the curl coefu e1u indice2d umask indice2d jpi jpj firstzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefu temporary coefu replicate 1 jpt coefu reform coefu nx ny jpt over coefv e2v indice2d vmask indice2d jpi jpj firstzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan coefv temporary coefv replicate 1 jpt coefv reform coefv nx ny jpt over tabf fmask indice2d jpi jpj firstzt e1f indice2d e2f indice2d tabf temporary tabf replicate 1 jpt tabf reform tabf nx ny jpt over Calculation of the curl zu u temporary coefu zv v temporary coefv psi shift zv 1 0 0 zv zu shift zu 0 1 0 psi tabf psi extraction of U and V on the appropriated domain if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask domdef glamt indice2d 0 0 glamu indice2d nx 1 0 gphit indice2d 0 0 gphiv indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi grossemoyenne psi direc nan END xyzt date1 NE date2 AND size u 0 EQ 4:BEGIN return report non code END xy ELSE:BEGIN xy indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 case 1 of size u 0 NE 2 OR size v 0 NE 2: return 1 size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN if nxu NE nx then if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx IF nxv NE nx THEN if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx IF nyu NE ny THEN if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny IF nyv NE ny THEN if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indice2d v v indice2d END ELSE:return 1 endcase Calculation of the curl coefu e1u indice2d umask indice2d jpi jpj firstzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefv e2v indice2d vmask indice2d jpi jpj firstzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan tabf fmask indice2d jpi jpj firstzt e1f indice2d e2f indice2d zu u temporary coefu zv v temporary coefv psi shift zv 1 0 zv zu shift zu 0 1 psi tabf psi Edging put at values f_nan if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask for the graphic drawing domdef glamt indice2d 0 0 glamf indice2d nx 1 0 gphit indice2d 0 0 gphif indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi moyenne psi direc nan END endcase if keyword_set key_performance THEN print temps curl systime 1 tempsun vargrid F varname vorticity return psi end");175 a[173] = new Array("./ToBeReviewed/CALCULS/curl.html", "curl.pro", "", " file_comments Calculate the vertical component of the curl of a field of horizontal vectors categories Calculation on matrixes param UU Matrix representing coordinates of a field of vectors param VV Matrix representing coordinates of a field of vectors returns RES A 2d matrix uses common pro restrictions U and V matrixes can be 2 or 4d Beware to discern differents configuration of U and V xy xyz xyt xyzt we look at the variable of the common time which contain the calendar in IDL julian days to which U and V refered to in the same way as the variable jpt which is the number of time s step to consider in time U and V arrays ae cut in the same geographic domain Because of the gap of T U V and F grids it is possible that these two arrays hase not the same size and refered to different indexes In this case arrays are recut on common indexesand the domain is redifined to match with these common indexes To avoid these recuts use the keyword memeindice in domdef pro Points on the drawing edge are at values f_nan history Guillaume Roullet grlod ipsl jussieu fr Sebastien Masson smasson lodyc jussieu fr adaptation pour marcher avec un domaine reduit 21 5 1999: missing values at values f_nan periodicite version Id: curl pro 150 2006 08 09 10:12:54Z navarro FUNCTION curl uu vv compile_opt idl2 strictarrsubs common tempsun systime 1 To key_performance IF finite glamu 0 finite gphiu 0 finite glamv 0 finite gphiv 0 EQ 0 THEN return report This version of curl is based on Arakawa C grid U and V grids must therefore be defined u litchamp uu v litchamp vv date1 time 0 if n_elements jpt EQ 0 then date2 date1 ELSE date2 time jpt 1 if size u 0 NE size v 0 then return 1 We find common points between U and V indicexu lindgen jpi firstxu:firstxu nxu 1 indicexv lindgen jpi firstxv:firstxv nxv 1 indicex inter indicexu indicexv indiceyu lindgen jpj firstyu:firstyu nyu 1 indiceyv lindgen jpj firstyv:firstyv nyv 1 indicey inter indiceyu indiceyv nx n_elements indicex ny n_elements indicey case 1 of xyz size u 0 EQ 3 AND date1 EQ date2 :BEGIN indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 extraction of U and V on the appropriated domain case 1 of size u 0 NE 3 OR size v 0 NE 3: return 1 size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN case 1 of nxu NE nx:if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx nxv NE nx:if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx nyu NE ny:if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny nyv NE ny:if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny ELSE : endcase END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 v v indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 END ELSE:return 1 endcase calculation of the curl coefu e1u indice2d replicate 1 nzt coefu reform coefu nx ny nzt over coefu coefu umask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefv e2v indice2d replicate 1 nzt coefv reform coefv nx ny nzt over coefv coefv vmask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan tabf fmask indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 firstzt:lastzt div e1f indice2d e2f indice2d replicate 1 nzt div reform div nx ny nzt over tabf tabf div zu u temporary coefu zv v temporary coefv psi shift zv 1 0 0 zv zu shift zu 0 1 0 psi tabf psi Edging put at values f_nan if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask For the graphic drawing domdef glagmt indice2d 0 0 glamu indice2d nx 1 0 gphit indice2d 0 0 gphiv indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi moyenne psi direc nan END xyt date1 NE date2 AND size u 0 EQ 3 :BEGIN indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 extraction of U and V on the appropriated domain case 1 of size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN if nxu NE nx then if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx IF nxv NE nx THEN if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx IF nyu NE ny THEN if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny IF nyv NE ny THEN if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 v v indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 END ELSE:BEGIN print problemes d adequation entre la taille du domaine et la taille des matrices necessaires a tracer des vecteurs return 1 end endcase Calculation of the curl coefu e1u indice2d umask indice2d jpi jpj firstzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefu temporary coefu replicate 1 jpt coefu reform coefu nx ny jpt over coefv e2v indice2d vmask indice2d jpi jpj firstzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan coefv temporary coefv replicate 1 jpt coefv reform coefv nx ny jpt over tabf fmask indice2d jpi jpj firstzt e1f indice2d e2f indice2d tabf temporary tabf replicate 1 jpt tabf reform tabf nx ny jpt over Calculation of the curl zu u temporary coefu zv v temporary coefv psi shift zv 1 0 0 zv zu shift zu 0 1 0 psi tabf psi extraction of U and V on the appropriated domain if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask domdef glamt indice2d 0 0 glamu indice2d nx 1 0 gphit indice2d 0 0 gphiv indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi grossemoyenne psi direc nan END xyzt date1 NE date2 AND size u 0 EQ 4:BEGIN return report non code END xy ELSE:BEGIN xy indice2d lindgen jpi jpj indice2d indice2d indicex 0 :indicex 0 nx 1 indicey 0 :indicey 0 ny 1 case 1 of size u 0 NE 2 OR size v 0 NE 2: return 1 size u 1 EQ nxu AND size u 2 EQ nyu AND size v 1 EQ nxv AND size v 2 EQ nyv:BEGIN if nxu NE nx then if indicex 0 EQ firstxu then u u 0:nx 1 ELSE u u 1: nx IF nxv NE nx THEN if indicex 0 EQ firstxv then v v 0:nx 1 ELSE v v 1: nx IF nyu NE ny THEN if indicey 0 EQ firstyu then u u 0:ny 1 ELSE u u 1: ny IF nyv NE ny THEN if indicey 0 EQ firstyv then v v 0:ny 1 ELSE v v 1: ny END size u 1 EQ jpi AND size u 2 EQ jpj AND size v 1 EQ jpi AND size v 2 EQ jpj:BEGIN u u indice2d v v indice2d END ELSE:return 1 endcase Calculation of the curl coefu e1u indice2d umask indice2d jpi jpj firstzt terreu where coefu EQ 0 if terreu 0 NE 1 then coefu temporary terreu values f_nan coefv e2v indice2d vmask indice2d jpi jpj firstzt terrev where coefv EQ 0 if terrev 0 NE 1 then coefv temporary terrev values f_nan tabf fmask indice2d jpi jpj firstzt e1f indice2d e2f indice2d zu u temporary coefu zv v temporary coefv psi shift zv 1 0 zv zu shift zu 0 1 psi tabf psi Edging put at values f_nan if NOT keyword_set key_periodic OR nx NE jpi then begin psi 0 values f_nan psi nx 1 values f_nan endif psi 0 values f_nan psi ny 1 values f_nan if n_elements valmask EQ 0 THEN valmask 1e20 terref where tabf EQ 0 if terref 0 NE 1 then psi temporary terref valmask for the graphic drawing domdef glamt indice2d 0 0 glamf indice2d nx 1 0 gphit indice2d 0 0 gphif indice2d 0 ny 1 vert1 vert2 gridtype t f if keyword_set direc then psi moyenne psi direc nan END endcase if keyword_set key_performance THEN print temps curl systime 1 tempsun vargrid F varname vorticity return psi end"); 176 176 a[174] = new Array("./ToBeReviewed/CALCULS/depth2floatlevel.html", "depth2floatlevel.pro", "", " file_comments Rather comparable to depth2level but here the calculated level is in float For example the level 5 4 correspond to a depth equal to gdep 5 4 gdep 6 gdep 5 categories Without loop param TAB in required 2d depth array or a structure respecting litchamp criterions keyword NOMASK To do not mask land points returns An 2d array of float containing levels s values uses common pro restrictions Accept values at values f_nan and mask land points at valmask examples IDL a jpk 1 1 jpi jpj findgen jpi jpj IDL plt 1e6 a floatlevel2depth depth2floatlevel a nocontour champ nul a 1e 6 pres history Sebastien Masson smasson lodyc jussieu fr 15 06 2000 version Id: depth2floatlevel pro 142 2006 07 21 12:47:49Z navarro FUNCTION depth2floatlevel tab NOMASK nomask compile_opt idl2 strictarrsubs tempsun systime 1 for key_performance common depthin litchamp tab levelup depth2level depthin UPPER nomask depthup level2depth levelup nomask levellow depth2level depthin lower nomask depthlow level2depth levellow nomask calculate the distance depthlow depthup and management of the case of this distance is null or eqal to values f_nan divi depthlow depthup nan where finite divi EQ 0 if nan 0 NE 1 then divi nan 0 nan where divi EQ 0 if nan 0 NE 1 then divi nan values f_nan calculation of the result res levelup depthin depthup divi We mask land point at valmask if NOT keyword_set nomask then begin grille mask if n_elements valmask EQ 0 then valmask 1e20 terre where temporary mask 0 EQ 0 if terre 0 NE 1 then res terre valmask endif if keyword_set key_performance THEN print temps depth2floatlevel systime 1 tempsun return res end"); 177 177 a[175] = new Array("./ToBeReviewed/CALCULS/depth2level.html", "depth2level.pro", "", " file_comments Allows to pass from a 2d depth array to a corresponding 2d level array categories Without loop param TAB 2d depth array or a structure respecting litchamp critrions keyword UPPER activated by default We select the level just above the depth keyword LOWER We select the level just below the depth keyword CLOSER We select the depth s closer level keyword NOMASK To do not mask land points returns It is a 2d array containing level s values uses common pro restrictions For depthes out of gdep s values the value values f_nan is sent back if the depth is superior to this one of the bottom we send back jpk 1 in the upper case and values f_nan in the lower case history Sebastien Masson smasson lodyc jussieu fr 17 6 1999 15 6 2000 accepte values f_nan version Id: depth2level pro 142 2006 07 21 12:47:49Z navarro FUNCTION depth2level tab LOWER lower UPPER upper CLOSER closer NOMASK nomask _extra ex compile_opt idl2 strictarrsubs tempsun systime 1 for key_performance common upper 1 if keyword_set lower THEN upper 0 Reading of the input field and recuperation of the used subdomain s size in litchamp tab grille mask 1 1 gdep nx ny nz firstx firsty firstz lastx lasty lastz Verification of the coherence between array s size and the defined by domdef domain IF ny EQ 1 THEN in reform in nx ny over taille size in if taille 0 NE 2 then return report le champ en entree doit contenir un tableau 2d case 1 of taille 1 eq jpi and taille 2 eq jpj:in in firstx:lastx firsty:lasty taille 1 eq nx and taille 2 eq ny: else:return report Probleme d adequation entre les tailles du domaine et celle du champ endcase delete points at values f_nan notanumber where finite in nan EQ 1 if notanumber 0 NE 1 then in notanumber 0 We transform the 2d deth value in a 2d array of levels corresponding to depthes We go on array who have the size of 3d arrays prof replicate 1 nx ny gdep firstz:lastz in in replicate 1 nz mask01 prof LT in mask01 reform mask01 nx ny nz levels total mask01 3 notvalid where levels EQ nz if keyword_set upper then begin levels levels 1 notvalid where levels EQ 1 ENDIF ELSE notvalid where levels EQ nz IF notvalid 0 NE 1 THEN levels notvalid values f_nan If closer is activated if keyword_set closer then begin test litchamp tab level2depth levels level2depth levels 1 jpk 1 litchamp tab test test 0 test 1 changer where test GE 0 if changer 0 NE 1 then levels changer levels changer 1 jpk 1 endif We put back points at values f_nan if notanumber 0 NE 1 then levels notanumber values f_nan We mask land points at valmask if NOT keyword_set nomask then begin if n_elements valmask EQ 0 then valmask 1e20 terre where mask 0 EQ 0 if terre 0 NE 1 then levels terre valmask endif if keyword_set key_performance THEN print temps depth2level systime 1 tempsun return levels end"); … … 218 218 a[216] = new Array("./ToBeReviewed/HOPE/sortdim.html", "sortdim.pro", "", " todo seb function sortdim dims inverse inverse IDL a x y t z IDL b a sortdim a IDL print a x y t z IDL print b x y z t IDL print b sortdim a inv x y t z IDL a xytz IDL print sortdim a 0 1 3 2 compile_opt idl2 strictarrsubs tosort dims if n_elements tosort eq 1 then tosort string reform byte tosort 1 strlen tosort 0 tosort strrepl tosort strwhere tosort x a tosort strrepl tosort strwhere tosort y b tosort strrepl tosort strwhere tosort z c tosort strrepl tosort strwhere tosort t d tosort uniq tosort sort tosort if keyword_set inverse then tosort sort tosort return tosort end "); 219 219 a[217] = new Array("./ToBeReviewed/HOPE/xrh.html", "xrh.pro", "", " todo seb procedure to call read_hope in the widget mode PRO xrh _extra ex compile_opt idl2 strictarrsubs a read_hope _extra ex return end"); 220 a[218] = new Array("./ToBeReviewed/IMAGE/animgif.html", "animgif.pro", "", " file_comments Build a gif animation categories Animated drawings param NOMFIC in required It is the name of the gif file containing the animation Comment: this file is placed in the directory defined by iodir uses common pro restrictions We use the Z buffer to go faster So if it failed in animgif you have to do: IDL device close IDL set_plot x IDL retall restrictions If we want to delete the common we have to define manually the picture s size variables xsize and ysize just as iodir history Guillaume Roullet grlod ipsl jussieu fr Sebastien Masson smasson lodyc jussieu fr 30 4 1999 version Id: animgif pro 142 2006 07 21 12:47:49Z navarro PRO animgif nomfic compile_opt idl2 strictarrsubs common It recuperates the color palette and put it in red green blue tvlct rouge vert bleu get It completes the current palette on 256 colors red rouge replicate 255 256 n_elements rouge green vert replicate 255 256 n_elements rouge blue bleu replicate 255 256 n_elements rouge It rocks on the z device allowing to create the picture without display it thisOS VERSION OS_FAMILY thisOS STRMID thisOS 0 3 thisOS STRUPCASE thisOS set_plot z size of the picture in pixel : xsize 30 min page_size max ma key_portrait ma 1 key_portrait ysize 30 min page_size max ma 1 key_portrait ma key_portrait device set_resolution xsize ysize Beginning of the gif file Writing of an empty picture reinitplt plot 0 0 nodata write_gif iodir nomfic tvrd red green blue multiple Beggining of the part we want to change Loop of picture s creation calen TIMEGEN 366 START JULDAY 1 1 2000 debut where calen EQ 19810105 debut where calen EQ 19790105 debut debut 0 if debut EQ 1 then begin device close CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE stop endif for i 0 73 15 1 do begin for i 0 3 2 1 do begin for i 0 73 2 1 do begin print Image numero : strtrim i 2 date calen debut i erase 255 plt nlec sst date ATF 19 29 int 5 noerase plt nlec sss date ATF label 2 noerase plt nlec htoth date RE3 nlec hpycn date RE3 10 60 int 5 inv noerase domdef 290 340 5 15 plt norme nlec unsurf date RE3 nlec vnsurf date RE3 0 1 2 int 1 noerase Writing of the picture in the file gif write_gif iodir nomfic tvrd red green blue multiple ENDFOR End of the part we want to change Closing of the file write_gif iodir nomfic close Rerock on terminal X mode device close CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE return end");220 a[218] = new Array("./ToBeReviewed/IMAGE/animgif.html", "animgif.pro", "", " file_comments Build a gif animation categories Animated drawings param NOMFIC in required It is the name of the gif file containing the animation Comment: this file is placed in the directory defined by iodir uses common pro restrictions We use the Z buffer to go faster So if it failed in animgif you have to do: IDL device close IDL set_plot x IDL retall restrictions If we want to delete the common we have to define manually the picture s size variables xsize and ysize just as iodir history Guillaume Roullet grlod ipsl jussieu fr Sebastien Masson smasson lodyc jussieu fr 30 4 1999 version Id: animgif pro 150 2006 08 09 10:12:54Z navarro PRO animgif nomfic compile_opt idl2 strictarrsubs common It recuperates the color palette and put it in red green blue tvlct rouge vert bleu get It completes the current palette on 256 colors red rouge replicate 255 256 n_elements rouge green vert replicate 255 256 n_elements rouge blue bleu replicate 255 256 n_elements rouge It rocks on the z device allowing to create the picture without display it thisOS VERSION OS_FAMILY thisOS STRMID thisOS 0 3 thisOS STRUPCASE thisOS set_plot z size of the picture in pixel : xsize 30 min page_size max ma key_portrait ma 1 key_portrait ysize 30 min page_size max ma 1 key_portrait ma key_portrait device set_resolution xsize ysize Beginning of the gif file Writing of an empty picture reinitplt plot 0 0 nodata write_gif iodir nomfic tvrd red green blue multiple Beggining of the part we want to change Loop of picture s creation calen TIMEGEN 366 START JULDAY 1 1 2000 debut where calen EQ 19810105 debut where calen EQ 19790105 debut debut 0 if debut EQ 1 then begin device close CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE stop endif for i 0 73 15 1 do begin for i 0 3 2 1 do begin for i 0 73 2 1 do begin print Image numero : strtrim i 2 date calen debut i erase 255 plt nlec sst date ATF 19 29 int 5 noerase plt nlec sss date ATF label 2 noerase plt nlec htoth date RE3 nlec hpycn date RE3 10 60 int 5 inv noerase domdef 290 340 5 15 plt norme nlec unsurf date RE3 nlec vnsurf date RE3 0 1 2 int 1 noerase Writing of the picture in the file gif write_gif iodir nomfic tvrd red green blue multiple ENDFOR End of the part we want to change Closing of the file write_gif iodir nomfic close Rerock on terminal X mode device close CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE return end"); 221 221 a[219] = new Array("./ToBeReviewed/INIT/initncdf.html", "initncdf.pro", "", " file_comments Initfile for Netcdf file define all the grid parameters categories param NCFILEIN in required A string giving the name of the NetCdf file keyword INVMASK To inverse the mask: mask 1 mask keyword MASKNAME A string giving the name of the variable in the file that contains the land sea mask keyword MISSING_VALUE To define or redifine if the attribute is already existing the missing values used with USEASMASK keyword keyword START1 Index the axis from 1 instead of 0 when using xyindex and or zindex keyword USEASMASK A string giving the name of the variable in the file that will be used to build the land sea mask In this case the mask is based on the first record if record dimension exists The mask is build according to : 1 the keyword missing_value if existing 2 the attribute missing_value if existing 3 NaN values if existing keyword XAXISNAME A string giving the name of the variable in the file that contains the xyz axis for X axis default name must be x longitude nav_lon or lon keyword YAXISNAME A string giving the name of the variable in the file that contains the xyz axis for Y axis default name must be y latitude nav_lat or lat keyword ZAXISNAME A string giving the name of the variable in the file that contains the xyz axis for Z axis default name must be z level lev depth keyword XYINDEX To define the x y axis with index instead of using the values contained in X YAXISNAME x yaxis keyword_set start1 findgen jpi jpj this forces key_onearth 0 keyword ZINDEX To define the z axis with index instead of using the values contained in ZAXISNAME zaxis keyword_set start1 findgen jpk keyword _EXTRA Used to pass your keywords uses common pro restrictions Change the grid parameters of the common pro restrictions the file must contain an x and an y axis 1 ou 2 dimentional array examples IDL initncdf toto nc glam 180 180 history Sebastien Masson smasson lodyc jussieu fr 8 May 2002 version Id: initncdf pro 142 2006 07 21 12:47:49Z navarro PRO initncdf ncfilein XAXISNAME xaxisname YAXISNAME yaxisname ZAXISNAME zaxisname MASKNAME maskname INVMASK invmask USEASMASK useasmask MISSING_VALUE missing_value START1 start1 XYINDEX xyindex ZINDEX zindex _EXTRA ex compile_opt idl2 strictarrsubs common check the name of the file ncfile isafile FILENAME ncfilein IODIRECTORY iodir _extra ex if size ncfile type NE 7 then BEGIN print initncdf cancelled return endif if the file is stored on tape if version os_family EQ unix then spawn file ncfile dev null open the file cdfid ncdf_open ncfile what is inside the file inside ncdf_inquire cdfid name of the variables namevar strarr inside nvars for varid 0 inside nvars 1 do begin invar ncdf_varinq cdfid varid namevar varid strlowcase invar name ENDFOR find the xaxis if keyword_set xaxisname then xaxisname strlowcase xaxisname ELSE xaxisname x xvarid where namevar EQ xaxisname OR namevar EQ longitude OR namevar EQ nav_lon OR namevar EQ lon xvarid xvarid 0 if xvarid EQ 1 then begin print the xaxis was not found check the use of XAXISNAME keyword stop endif get the size of xaxis xinq ncdf_varinq cdfid xvarid ncdf_diminq cdfid xinq dim 0 blabla jpifromx should we read or compute the xaxis IF NOT keyword_set xyindex THEN BEGIN read the xaxis ncdf_varget cdfid xvarid xaxis make sure of the shape of xaxis IF xinq ndims GE 2 THEN BEGIN ncdf_diminq cdfid xinq dim 1 blabla jpjfromx xaxis reform xaxis jpifromx jpjfromx over ENDIF ENDIF ELSE xaxis keyword_set start1 findgen jpifromx find the yaxis if keyword_set yaxisname then yaxisname strlowcase yaxisname ELSE yaxisname y yvarid where namevar EQ yaxisname OR namevar EQ latitude OR namevar EQ nav_lat OR namevar EQ lat yvarid yvarid 0 if yvarid EQ 1 then begin print the yaxis was not found check the use of YAXISNAME keyword stop endif get the size of yaxis and check it is ok with the values found for x yinq ncdf_varinq cdfid yvarid IF xinq ndims GE 2 THEN BEGIN ncdf_diminq cdfid yinq dim 0 blabla jpifromy ncdf_diminq cdfid yinq dim 1 blabla jpjfromy IF jpifromy NE jpifromx THEN BEGIN print xaxis and y axis do not have the same x dimension ENDIF ENDIF ELSE ncdf_diminq cdfid yinq dim 0 blabla jpjfromy IF n_elements jpjfromx NE 0 THEN BEGIN IF jpjfromy NE jpjfromx THEN BEGIN print xaxis and y axis do not have the same y dimension ENDIF ENDIF should we read or compute the xaxis IF NOT keyword_set xyindex THEN BEGIN read the yaxis ncdf_varget cdfid yvarid yaxis make sure of the shape of xaxis IF xinq ndims GE 2 THEN yaxis reform yaxis jpifromy jpjfromy over ENDIF ELSE yaxis keyword_set start1 findgen jpjfromy find the zaxis if keyword_set zaxisname then zaxisname strlowcase zaxisname ELSE zaxisname z zvarid where namevar EQ nav_lev or namevar EQ zaxisname OR namevar EQ level OR namevar EQ lev OR strmid namevar 0 5 EQ depth zvarid zvarid 0 if zvarid EQ 1 AND inside ndims GT 3 then begin print initncdf: the zaxis was not found check the the use of ZAXISNAME keyword if you whant to find one stop endif read the zaxis if zvarid NE 1 THEN ncdf_varget cdfid zvarid zaxis IF keyword_set zindex THEN zaxis keyword_set start1 findgen n_elements zaxis mask CASE 1 OF keyword_set maskname :BEGIN mskid where namevar EQ strlowcase maskname 0 if mskid NE 1 THEN BEGIN mskinq ncdf_varinq cdfid mskid is the mask variable containing the record dimension withrcd where mskinq dim EQ inside recdim 0 IF withrcd NE 1 THEN BEGIN in order to read only the first record we need to get the size of each dimension count replicate 1L mskinq ndims FOR d 0 mskinq ndims 1 DO BEGIN IF d NE withrcd THEN BEGIN ncdf_diminq cdfid mskinq dim d name size count d size ENDIF ENDFOR read the variable for the first record ncdf_varget cdfid mskid tmask count count ENDIF ELSE ncdf_varget cdfid mskid tmask check if we need to applay add_offset and scale factor FOR a 0 mskinq natts 1 DO BEGIN attname ncdf_attname cdfid mskid a CASE strlowcase attname OF add_offset :ncdf_attget cdfid mskid attname add_offset scale_factor :ncdf_attget cdfid mskid attname scale_factor ELSE: ENDCASE ENDFOR IF n_elements scale_factor NE 0 THEN tmask tmask scale_factor IF n_elements add_offset NE 0 THEN tmask tmask add_offset if keyword_set invmask then tmask 1 tmask tmask byte round tmask ENDIF ELSE tmask 1 END keyword_set useasmask :BEGIN mskid where namevar EQ strlowcase useasmask 0 if mskid NE 1 THEN BEGIN mskinq ncdf_varinq cdfid mskid is the mask variable containing the record dimension withrcd where mskinq dim EQ inside recdim 0 IF withrcd NE 1 THEN BEGIN in order to read only the first record we need to get the size of each dimension count replicate 1L mskinq ndims FOR d 0 mskinq ndims 1 DO BEGIN IF d NE withrcd THEN BEGIN ncdf_diminq cdfid mskinq dim d name size count d size ENDIF ENDFOR read the variable for the first record ncdf_varget cdfid mskid tmask count count ENDIF ELSE ncdf_varget cdfid mskid tmask check if we need to applay add_offset and scale factor FOR a 0 mskinq natts 1 DO BEGIN attname ncdf_attname cdfid mskid a CASE strlowcase attname OF add_offset :ncdf_attget cdfid mskid attname add_offset scale_factor :ncdf_attget cdfid mskid attname scale_factor missing_value :IF n_elements missing_value EQ 0 THEN ncdf_attget cdfid mskid attname missing_value ELSE: ENDCASE ENDFOR IF n_elements scale_factor NE 0 THEN tmask tmask scale_factor IF n_elements add_offset NE 0 THEN tmask tmask add_offset IF n_elements missing_value NE 0 THEN BEGIN we have to take care of the float accuracy CASE 1 OF missing_value GE 1 e6:tmask tmask LT missing_value 10 missing_value LE 1 e6:tmask tmask GT missing_value 10 abs missing_value LE 1 e 6:tmask abs tmask GT 1 e 6 ELSE:tmask tmask NE missing_value ENDCASE if keyword_set invmask then tmask 1 tmask ENDIF ELSE BEGIN tmask finite tmask IF min tmask EQ 1 THEN BEGIN print missing or nan values not found tmask 1 ENDIF ENDELSE ENDIF ELSE tmask 1 END ELSE:tmask 1 ENDCASE ncdf_close cdfid compute the grid if zvarid EQ 1 then BEGIN computegrid xaxis xaxis yaxis yaxis mask tmask onearth 1b keyword_set xyindex _EXTRA ex ENDIF ELSE BEGIN computegrid xaxis xaxis yaxis yaxis zaxis zaxis mask tmask onearth 1b keyword_set xyindex _EXTRA ex ENDELSE IF n_elements time EQ 0 THEN time 0 jpt n_elements time return end"); 222 222 a[220] = new Array("./ToBeReviewed/INIT/initncdfxxx.html", "initncdfxxx.pro", "", ""); … … 224 224 a[222] = new Array("./ToBeReviewed/INIT/initorca2.html", "initorca2.pro", "", ""); 225 225 a[223] = new Array("./ToBeReviewed/INIT/initorca2full.html", "initorca2full.pro", "", ""); 226 a[224] = new Array("./ToBeReviewed/LECTURE/GRIB/bit2int.html", "bit2int.pro", "", " FUNCTION bit2int bitin checkneg checkneg compile_opt idl2 strictarrsubs res 0L n n_elements bitin 1 IF keyword_set checkneg THEN BEGIN IF bitin 0 EQ 1 THEN BEGIN bitin 0 0 neg 1 ENDIF ELSE neg 1 ENDIF ELSE neg 1 FOR i 0 n DO res res 2L i bitin n i RETURN neg res END");226 a[224] = new Array("./ToBeReviewed/LECTURE/GRIB/bit2int.html", "bit2int.pro", "", " todo seb FUNCTION bit2int bitin checkneg checkneg compile_opt idl2 strictarrsubs res 0L n n_elements bitin 1 IF keyword_set checkneg THEN BEGIN IF bitin 0 EQ 1 THEN BEGIN bitin 0 0 neg 1 ENDIF ELSE neg 1 ENDIF ELSE neg 1 FOR i 0 n DO res res 2L i bitin n i RETURN neg res END"); 227 227 a[225] = new Array("./ToBeReviewed/LECTURE/GRIB/read_grib.html", "read_grib.pro", "", "function read_grib varcode date1 date2 file file compile_opt idl2 strictarrsubs common http: www wmo ch web www WDM Guides Guide binary 2 html gribfile d1fes2 raid6 SINTEX common ES10 d 00 atm 5d ES10 d 00_5d_00911201_00911230 grib IF keyword_set file THEN gribfile isafile file file iodir iodir ELSE gribfile d1fes2 raid6 SINTEX common ES10 atm 5d ZOOM_IND ES10_5d_00210101_00301230 grib openr num gribfile GET_LUN ERROR err SWAP_IF_LITTLE_ENDIAN if err ne 0 then begin print err_string return 1 ENDIF recstart scan_grib_recstart num messize scan_grib_messize num recstart addoff lonarr n_elements recstart FOR i 1L n_elements recstart 1 DO addoff i recstart i recstart i 1 messize i 1 nbits scan_grib_nbits num recstart print nbits uniq nbits sort nbits codes scan_grib_code num recstart nbcodes uniq codes sort codes dates scan_grib_date num recstart nbdates uniq dates sort dates goodvar where codes EQ varcode IF goodvar 0 EQ 1 THEN BEGIN print no var code strtrim varcode 2 in the file return 1 ENDIF recstart recstart goodvar dates dates goodvar gooddate where dates GE date1 AND dates LE date2 IF gooddate 0 EQ 1 THEN BEGIN print no dates between strtrim date1 2 and strtrim date2 2 in the file return 1 ENDIF recstart recstart gooddate dates dates gooddate key_caltype 360d time date2jul dates jpt n_elements time IF jpt EQ 1 THEN vardate strtrim dates 0 2 ELSE vardate strtrim dates 0 2 strtrim dates jpt 1 2 varname vargrid T varexp varunit grib_pds read_grib_pds num recstart 0 grid parameters IF grib_pds gdsnotomitted THEN BEGIN grib_gds read_grib_gds num recstart 0 min max of the latitude with a precision of 10 2 lat1 fix 100 grib_gds la1 100 lat2 fix 100 grib_gds la2 100 CASE grib_gds gridtype OF Latitude Longitude Grid 0:BEGIN computegrid grib_gds lo1 grib_gds la1 grib_gds di grib_gds dj grib_gds ni grib_gds nj END Gaussian Latitude Longitude Grid 4:BEGIN find the latitude axis CASE 1 OF n48 grib_gds n EQ 48 AND lat1 EQ 88 57 AND lat2 EQ 88 57: gphit n48gaussian n80 grib_gds n EQ 80 AND lat1 EQ 89 14 AND lat2 EQ 89 14: gphit n80gaussian n128 grib_gds n EQ 128 AND lat1 EQ 89 46 AND lat2 EQ 89 46: gphit n128gaussian n160 grib_gds n EQ 160 AND lat1 EQ 89 57 AND lat2 EQ 89 57: gphit n160gaussian n256 grib_gds n EQ 256 AND lat1 EQ 89 73 AND lat2 EQ 89 73: gphit n256gaussian part of one of the gaussian grids defined above ELSE:BEGIN cnt 0 REPEAT BEGIN CASE cnt OF 0:gphit n48gaussian 1:gphit n80gaussian 2:gphit n128gaussian 3:gphit n160gaussian 4:gphit n256gaussian 5:BEGIN gphit n80gaussian lat1 29 71 lat2 19 62 END ELSE:stop ENDCASE nfix fix gphit 100 100 nlat1 where nfix EQ lat1 0 nlat2 where nfix EQ lat2 0 IF nlat1 NE 1 AND nlat2 NE 1 AND nlat2 nlat1 1 EQ grib_gds nj THEN gphit gphit nlat1:nlat2 ELSE gphit 1 cnt cnt 1 ENDREP UNTIL gphit 0 NE 1 END ENDCASE computegrid grib_gds lo1 1 grib_gds di 1 grib_gds ni 1 YAXIS gphit END Mercator Projection Grid gridtype EQ 1: Gnomonic Projection Grid gridtype EQ 2: Lambert Conformal secant or tangent conical or bipolar normal or oblique Projection Grid gridtype EQ 3: Polar Stereographic Projection Grid gridtype EQ 5: Oblique Lambert conformal secant or tangent conical or bipolar projection gridtype EQ 13: Spherical Harmonic Coefficients gridtype EQ 50: Space view perspective or orthographic grid gridtype EQ 90: reserved see Manual on Codes ELSE: ENDCASE ENDIF ELSE stop res fltarr grib_gds ni grib_gds nj n_elements recstart FOR i 0 n_elements recstart 1 DO BEGIN res i read_grib_bds num recstart i grib_gds ni grib_gds nj ENDFOR free_lun num IF keyword_set key_yreverse THEN res reverse res 2 RETURN res END"); 228 228 a[226] = new Array("./ToBeReviewed/LECTURE/GRIB/read_grib_bds.html", "read_grib_bds.pro", "", "FUNCTION read_grib_bds num recstart ni nj compile_opt idl2 strictarrsubs offset recstart 8 a assoc num bytarr 1 nozero offset 1 sizepds bit2int binary a 1 binary a 2 binary a 3 flag binary a 8 gdsnotomitted flag 0 bmsnotomitted flag 1 ddd bit2int binary a 27 binary a 28 checkneg offset offset sizepds IF gdsnotomitted THEN BEGIN a assoc num bytarr 1 nozero offset 1 sizedds bit2int binary a 1 binary a 2 binary a 3 offset offset sizedds ENDIF IF bmsnotomitted THEN BEGIN a assoc num bytarr 1 nozero offset 1 sizebms bit2int binary a 1 binary a 2 binary a 3 offset offset sizebms ENDIF a assoc num bytarr 1 nozero offset 1 sizebds bit2int binary a 1 binary a 2 binary a 3 flags binary a 4 BIT VALUE MEANING 1 0 Grid point data 1 Spherical Harmonic Coefficients 2 0 Simple packing 1 Second order Complex Packing 3 0 Original data were floating point values 1 Original data were integer values 4 0 No additional flags at octet 14 1 Octet 14 contains flag bits 5 12 5 Reserved set to 0 6 0 Single datum at each grid point 1 Matrix of values at each grid point 7 0 No secondary bit maps 1 Secondary bit maps present 8 0 Second order values have constant width 1 Second order values have different widths 9 12 Reserved set to 0 eee bit2int binary a 5 binary a 6 checkneg aaa bit2int binary a 7 checkneg bbb bit2int binary a 8 binary a 9 binary a 10 IF aaa LT 0 THEN rrr 2 24 bbb 16 aaa 64 ELSE rrr 2 24 bbb 16 aaa 64 nbits a 11 0 CASE 1 OF flags 0 EQ 0 AND flags 1 EQ 0:BEGIN CASE nbits OF 8 :a assoc num bytarr ni nj nozero offset 1 12 16:a assoc num uintarr ni nj nozero offset 1 12 32:a assoc num ulonarr ni nj nozero offset 1 12 64:a assoc num ulon64arr ni nj nozero offset 1 12 ELSE: ENDCASE END ENDCASE RETURN rrr a 0 2 eee 10 ddd END"); … … 242 242 a[240] = new Array("./ToBeReviewed/LECTURE/litchamp.html", "litchamp.pro", "", " file_comments Allows to read an array or a sructure cooresponding to a field If we have in input: an array litchamp send back the array a structure litchamp send back the first element of the structure which must be the field in an array Litchamp profit of this to look other elements of the structure et update if needed global variables which refer to the field: vargrid varname varunit vardate varexp valmask et time categories graphic param STRUCT in required It is either an array or a structure If STRUCT is a structure it must follow following rules: the first element is the array containing the field other elements are strings containing informations on the field exept for the one about the date This one can be either a string to designate a particular date ex: August 1999 or a vector of julian days of IDL corresponding to the calendar to be associated with the field if it is a temporal series the order of elements exept the first has not any importance the other elements exept the first are optional they are recognize by the first letter of their names: g to update vargrid u to update varunit e to update varexp d to update vardate n to update varname m to update valmask keyword GRID We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by g if it exist and if it does not keyword UNIT We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by u if it exist and if it does not keyword EXP We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by u if it exist and if it does not keyword DATE We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by d if it exist and if it does not keyword NAME We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by n if it exist and if it does not keyword LEVEL We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by l if it exist and 1 if it does not keyword MASK We activate this keyword if we want litchamp to send back the variable associated with the element of the structure starting by m if it exist and 1 if it does not returns It is the array containing the field uses common pro restrictions Update if needed global variables vargrid varname varunit vardate varexp valmask and time examples IDL print vargrid varname varunit vardate varexp T 0 IDL help litchamp a:indgen 5 u: C name: toto INT Array 5 IDL print vargrid varname varunit vardate varexp T toto C 0 IDL help litchamp a:indgen 5 da: 1999 INT Array 5 IDL print vargrid varname varunit vardate varexp T toto C 1999 history Sebastien Masson smasson lodyc jussieu fr 28 5 1999 version Id: litchamp pro 142 2006 07 21 12:47:49Z navarro FUNCTION litchamp struct GRID grid NAME name UNIT unit EXP exp DATE date LEVEL level MASK mask compile_opt idl2 strictarrsubs common if size struct type ne 8 then BEGIN so contour is not a structure if keyword_set grid then return if keyword_set name then return if keyword_set unit then return if keyword_set exp then return if keyword_set date then return if keyword_set level then return 1 if keyword_set mask then return 1 return struct ENDIF IF n_tags struct EQ 1 then BEGIN The structure has only one element if keyword_set grid then return if keyword_set name then return if keyword_set unit then return if keyword_set exp then return if keyword_set date then return if keyword_set level then return 1 if keyword_set mask then return 1 return struct 0 ENDIF nomelements tag_names struct for i 1 n_tags struct 1 do begin case strlowcase strmid nomelements i 0 1 of g :BEGIN if keyword_set grid then return strupcase struct i vargrid strupcase struct i END n :BEGIN if keyword_set name then return struct i varname struct i END u :BEGIN if keyword_set unit then return struct i varunit struct i END e :BEGIN if keyword_set exp then return struct i varexp struct i END m :BEGIN if keyword_set mask then return struct i valmask struct i END d :BEGIN if size struct i type EQ 7 THEN BEGIN vardate struct i ENDIF ELSE BEGIN time struct i jpt n_elements time if jpt EQ 1 then vardate strtrim vairdate struct i 0 2 ELSE vardate strtrim vairdate struct i 0 2 strtrim vairdate struct i jpt 1 2 ENDELSE if keyword_set date then return vardate END h :BEGIN computehopegrid struct i xaxis struct i yaxis struct i zaxis struct i linetype FIRSTS struct i firsts LASTS struct i lasts FORTHEMASK struct 0 pttype struct i pttype END ELSE:BEGIN ras report Le nom nomelements i ne correspont a aucun element reconnu de la structure cf IDL xhelp litchamp end endcase endfor if keyword_set grid then return if keyword_set name then return if keyword_set unit then return if keyword_set exp then return if keyword_set date then return if keyword_set level then return 1 if keyword_set mask then return 1 return struct 0 end"); 243 243 a[241] = new Array("./ToBeReviewed/LECTURE/ncdf_lec.html", "ncdf_lec.pro", "", " file_comments Give informations on a file net cdf and allows to recuperate variables which are write in categories Reading param NOM in required Name of a file net cdf situated in the directory stipulated by iodir keyword ATT global or at the name of a variable Allows to see all attributes joined at a variable keyword DIM Give the list of dimensions keyword VAR 1 var: Gove the list of dimensions 2 var nom de variable : in this case the function send back the variable keyword IODIR String containing the directory containing the file to be read keyword _EXTRA Allows to pass keywords defined by IDL to functions NETCDF particularly OFFSET and COUNT in ncdf_varget returns 1 exept if var nom de variable then the function send back the variable restrictions Variables s names of the program are similar to these used by the IDL manual scientific data formats history Sebastien Masson smasson lodyc jussieu fr 4 1 98 version Id: ncdf_lec pro 142 2006 07 21 12:47:49Z navarro function ncdf_lec nom ATT att DIM dim VAR var IODIR iodir _extra ex compile_opt idl2 strictarrsubs res 1 if NOT keyword_set IODIR then iodir if not keyword_set att or keyword_set dim or keyword_set var then BEGIN att 1 dim 1 var 1 commande ncdump c iodir nom spawn commande goto fini endif opening of the file name cdfid ncdf_open iodir nom Wht does the file contain wathinside ncdf_inquire cdfid print in the file iodir nom there are: if keyword_set dim then begin print nombre de dimensions: strtrim wathinside ndims 1 print numero de la dimension dont la valeur est infini: strtrim wathinside recdim 1 endif if keyword_set var then if size var type NE 7 then print nombre de variables : strtrim wathinside nvars 1 if keyword_set att then begin if strlowcase att ne global then goto nonglobal print nombre de attributs globaux : strtrim wathinside ngatts 1 endif Global attributes if keyword_set att then begin print print ATTRIBUTS GLOBAUX for attiq 0 wathinside ngatts 1 do begin name ncdf_attname cdfid attiq global attribute s name ncdf_attget cdfid name value global attribute s value print name : string value endfor endif nonglobal: Display of different dimensions if keyword_set dim then begin print print DIMENSIONS endif nomdim strarr wathinside ndims tailledim lonarr wathinside ndims for dimiq 0 wathinside ndims 1 do begin ncdf_diminq cdfid dimiq name value dimension s name and value nomdim dimiq name tailledim dimiq value if keyword_set dim then begin print dimension numero strtrim dimiq 1 nom: nomdim dimiq valeur: strtrim tailledim dimiq 1 endif endfor Display of different variables if keyword_set att or keyword_set var then begin var s value string or 1 help var output nature if strpos nature STRING 0 NE 1 then nature string ELSE nature 1 If we just have to read the variable if nature EQ string then begin ncdf_varget cdfid var res _extra ex GOTO sortie ENDIF If it is to have pieces of information if not keyword_set att then att rien print for varid 0 wathinside nvars 1 do begin varcontent ncdf_varinq cdfid varid What does variable contain if strlowcase att eq strlowcase varcontent name or keyword_set var then begin print variable numero: strtrim varid 1 nom: varcontent name type: varcontent datatype dimensions: nomdim varcontent dim if strlowcase att eq strlowcase varcontent name then begin for attiq 0 varcontent natts 1 do begin name ncdf_attname cdfid varid attiq ncdf_attget cdfid varid name value print strtrim attiq name : strtrim string value 1 endfor goto sortie endif endif endfor endif sortie: ncdf_close cdfid fini: return res end"); 244 a[242] = new Array("./ToBeReviewed/LECTURE/read_ftp.html", "read_ftp.pro", "", " pro ftp_post u cmd res out out count count compile_opt idl2 if cmd ne then begin printf u cmd format a comment out the following line to disable debug info print cmd endif if size out type eq 0 then out 2 catch err if err ne 0 then return line count 0 while arg_present res do begin readf u line if count eq 0 then res line else res res line count count 1 comment out the following line to disable debug info print READ_FTP ftp: ftp rsinc com pub gzip README GZIP DATA data IDL help data DATA BYTE Array 2134 IDL print string data README file: Research Systems Anonymous FTP site ftp rsinc com pub directory gzip directory 2 Retrieve some files from podaac jpl nasa gov and store the files in the current working directory: IDL files string lindgen 10 50 format MGB370 3 3d gz IDL READ_FTP podaac jpl nasa gov files IDL pub sea_surface_height topex_poseidon mgdrb data MGB_370 FILE IDL spawn dir MGB log_output Volume in drive C is Local Disk Volume Serial Number is 34CE 24DF Directory of C: test test0307 07 28 2003 11:58a 362 167 MGB370 050 gz 07 28 2003 11:58a 333 005 MGB370 051 gz 07 28 2003 11:58a 310 287 MGB370 052 gz 07 28 2003 11:58a 358 771 MGB370 053 gz 07 28 2003 11:59a 387 282 MGB370 054 gz 07 28 2003 11:59a 361 633 MGB370 055 gz 07 28 2003 11:59a 383 075 MGB370 056 gz 07 28 2003 11:59a 365 844 MGB370 057 gz 07 28 2003 11:59a 383 918 MGB370 058 gz 07 28 2003 12:00p 372 712 MGB370 059 gz 10 File s 3 618 694 bytes These compressed files can cosequently be opened with OPENR and the COMPRESSED keyword history version Id: read_ftp pro 1 42 2006 07 21 12:47:49Z navarro todo seb: que fait on de syntax au debut du headerpro read_ftp site files dir port data data file file user user pass pass ptr ptr compile_opt idl2 if n_elements port eq 0 then port ftp if n_elements files eq 0 then begin if strcmp site ftp: 6 then host strmid site 6 else host site pos strpos host dir strmid host pos host strmid host 0 pos pos strpos dir reverse_search files strmid dir pos 1 dir strmid dir 0 pos endif else host site if size user type eq 0 then user anonymous if size pass type eq 0 then pass test test com socket u host port connect_timeout 5 read_timeout 5 get_lun ftp_post u res ftp_post u USER user res out 3 ftp_post u PASS pass res ftp_post u TYPE I res if size dir type ne 0 then ftp_post u CWD dir res if keyword_set file or arg_present data then begin bufsize 512 buffer bytarr bufsize n n_elements files if arg_present data then dat ptrarr n for i 0 n 1 do begin ftp_post u SIZE files i res out 213 sz long64 strmid res n_elements res 1 4 if arg_present data then dat i ptr_new bytarr sz ftp_post u PASV res ftp_parse_pasv res host port ftp_post u RETR files i res out 1 socket v host port connect_timeout 5 read_timeout 5 get_lun rawio tc 0ll if keyword_set file then openw w files i get_lun while tc lt sz do begin if sz tc lt bufsize then begin bufsize sz tc buffer bytarr bufsize endif readu v buffer transfer_count dtc if arg_present data then dat i tc dtc eq bufsize buffer:buffer 0:dtc 1 if keyword_set file then writeu w dtc eq bufsize buffer:buffer 0:dtc 1 tc tc dtc endwhile free_lun v if keyword_set file then free_lun w ftp_post u res endfor if arg_present data then begin if n gt 1 or keyword_set ptr then data dat else data temporary dat 0 endif endif ftp_post u QUIT res free_lun u end");245 a[243] = new Array("./ToBeReviewed/LECTURE/read_ncdf.html", "read_ncdf.pro", "", " PURPOSE:fonction de lecture pour fichier net_cdf Ce programme est moins universel que ncdf_lec il fait appelle au variables declarees dans common pro mais il est du cop bcp plus facile d utilisation Il prend en compte la declaration des differents zoom qui ont ete definis ixminmesh premierx la declaration de la variable key_shift bref le resultat de read_ncdf peut dorectement etre utilise dans plt C est aussi ce programme qui est utilise par defaut dans mes widgets pour la partie lecture CATEGORY:lecture de fichiers NetCdf CALLING SEQUENCE:res read_ncdf name debut fin INPUTS: name: un string definissant le champ a lire debut et fin: sont relatifs a l axe des temps Ce peut etre 2 dates du type yyyymmdd et ds ce cas on selectionne les dates qui sont comprisent entre ces 2 dates 2 indices qui definissent entre quel et quel pas de temps on doit extraire la dimension temporelle exp: ne sert a rien KEYWORD PARAMETERS: utilisables hors du contexte des widgets BOXZOOM: contient la boxzoom sur laquelle on doit faire la lecture FILENAME: string contennant le nom du fichier INIT to call automatically initncdf filename and thus redefine all the grid parameters GRID UTVWF to specify the type of grid Defaut is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found IODIRECTORY a string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir TIMESTEP:activer pour specifier que debut et fin font reference a des indices de l axe du temps et non pas a des dates TOUT: activer si on veut lire le ficher sur l ensemble du domaine sans tenir compte du sous domaine definit par boxzoom ou lon1 lon2 lat1 lat2 vert1 vert2 NOSTRUCT: activer si on ne veut pas que read_ncdf reourne une structure mais uniquement le tableau se rapportant au champ TIMEVAR: a string to define the name of the variable that contains the time axis This keyword can be usefull if there is no unlimited dimension or if the time axis selected by defaut the first 1D array with unlimited dimension is not the good one OUTPUTS:une stucture lisible par litchamp pro ou un simple tableau si NOSTRUCT est active COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS:le champ doit avoir une dimension temporelle EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 15 10 1999 FUNCTION read_ncdf name debut fin pour_etre_compatible BOXZOOM boxzoom FILENAME filename PARENTIN parentin TIMESTEP timestep TIMEVAR timevar TOUT tout NOSTRUCT nostruct CONT_NOFILL CONT_NOFILL INIT init GRID grid FBASE2TBASE fbase2tbase _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF we find the filename print filename is parent a valid widget if keyword_set parentin then BEGIN parent long parentin parent parent widget_info parent managed ENDIF filename isafile filename filename IODIRECTORY iodir _EXTRA ex ouverture du fichier nom if size filename type NE 7 then return report read_ncdf cancelled IF version OS_FAMILY EQ unix THEN spawn file filename dev null cdfid ncdf_open filename contient ncdf_inquire cdfid we check if the variable name exists in the file if ncdf_varid cdfid name EQ 1 then BEGIN ncdf_close cdfid return report variable name C not found in the file filename ENDIF varcontient ncdf_varinq cdfid name shall we redefine the grid parameters if keyword_set init THEN initncdf filename _extra ex check the time axis and the debut and fin dates if n_elements debut EQ 0 then begin debut 0 timestep 1 endif if keyword_set timestep then begin firsttps debut 0 if n_elements fin NE 0 then lasttps fin 0 ELSE lasttps firsttps jpt lasttps firsttps 1 time julday 1 1 1 lindgen jpt ENDIF ELSE BEGIN if keyword_set parent then BEGIN widget_control parent get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF filelist 0 EQ many THEN filelist filename currentfile where filelist EQ filename 0 time extractatt top_uvalue fileparameters currentfile time_counter date1 date2jul debut 0 if n_elements fin NE 0 then date2 date2jul fin 0 ELSE date2 date1 firsttps where time EQ date1 firsttps firsttps 0 lasttps where time EQ date2 lasttps lasttps 0 ENDIF ELSE BEGIN IF keyword_set timevar THEN BEGIN timeid ncdf_varid cdfid timevar IF timeid EQ 1 THEN BEGIN ncdf_close cdfid return report the file filename as no variable timevar C Use the TIMESTEP keyword endif timecontient ncdf_varinq cdfid timeid contient recdim timecontient dim 0 ENDIF ELSE BEGIN we find the infinite dimension timedim contient recdim if timedim EQ 1 then BEGIN ncdf_close cdfid return report the file filename as no infinite dimension C Use TIMESTEP or TIMEVAR keyword endif we find the FIRST time axis timeid 0 repeat BEGIN tant que l on a pas trouve une variable qui n a qu une dimension: la dimension infinie timecontient ncdf_varinq cdfid timeid que contient la variable timeid timeid 1 endrep until n_elements timecontient dim EQ 1 AND timecontient dim 0 EQ contient recdim OR timeid EQ contient nvars 1 if timeid EQ contient nvars 1 then BEGIN ncdf_close cdfid return report the file filename as no time axis variable C Use the TIMESTEP keyword endif timeid timeid 1 ENDELSE we must found the time origin of the julian calendar used in the time axis does the attribut units an dcalendar exist for the variable time axis if timecontient natts EQ 0 then BEGIN ncdf_close cdfid return report the variable timecontient name has no attribut C Use the TIMESTEP keyword or add the attribut units to the variable endif attnames strarr timecontient natts for attiq 0 timecontient natts 1 do attnames attiq ncdf_attname cdfid timeid attiq if where attnames EQ units 0 EQ 1 then BEGIN ncdf_close cdfid return report Attribut units not found for the variable timecontient name C Use the TIMESTEP keyword ENDIF now we try to find the attribut called calendar the the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid timeid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE now we take acre of units attribut ncdf_attget cdfid timeid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 we decript the units attribut to find the time origin value strtrim strcompress string value 2 mots str_sep value unite mots 0 depart str_sep mots 2 ncdf_varget cdfid timeid time time double time unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 case unite of second :time julday depart 1 depart 2 depart 0 time 86400 d hour :time julday depart 1 depart 2 depart 0 time 24 d day :time julday depart 1 depart 2 depart 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday depart 1 depart 2 depart 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday depart 1 time t depart 2 depart 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday depart 1 depart 2 depart 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday depart 1 depart 2 depart 0 time t END ELSE:BEGIN ncdf_close cdfid return report The units attribu of the time axis must be something like: C seconds since 0001 01 01 C days since 1979 01 01 C months since 1979 01 01 C years since 1979 01 01 end ENDCASE date1 date2jul debut 0 if n_elements fin NE 0 then date2 date2jul fin 0 ELSE date2 date1 time double time firsttps where time GE date1 firsttps firsttps 0 if firsttps EQ 1 THEN BEGIN ncdf_close cdfid return report date 1: strtrim jul2date date1 1 is not found in the time axis ENDIF lasttps where time LE date2 if lasttps 0 EQ 1 THEN BEGIN ncdf_close cdfid return report the time axis as no date before date 2: strtrim jul2date date2 1 endif lasttps lasttps n_elements lasttps 1 if lasttps LT firsttps then BEGIN ncdf_close cdfid return report the time axis as no dates between date1 and date 2: strtrim jul2date date1 1 strtrim jul2date date2 1 endif ENDELSE time time firsttps:lasttps jpt lasttps firsttps 1 ENDELSE nom de la grille a laquelle se rapporte le champ IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN pattern GRID GRID_ GRID UPID_ 30ID_ gdtype T U V W F fnametest strupcase filename FOR i 0 n_elements pattern 1 DO BEGIN FOR j 0 n_elements gdtype 1 DO BEGIN substr pattern i gdtype j pos strpos fnametest substr IF pos NE 1 THEN vargrid strmid fnametest pos strlen substr 1 1 ENDFOR ENDFOR ENDIF ENDELSE call the init function redefinition du domaine if keyword_set tout then begin nx jpi ny jpj nz jpk firstx 0 firsty 0 firstz 0 lastx jpi 1 lasty jpj 1 lastz jpk 1 case strupcase vargrid of T :mask tmask U :mask umask V :mask vmask W :mask tmask F :mask fmask endcase ENDIF ELSE BEGIN if keyword_set boxzoom then BEGIN Case 1 Of N_Elements Boxzoom Eq 1:bte lon1 lon2 lat1 lat2 0 boxzoom 0 N_Elements Boxzoom Eq 2:bte lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 N_Elements Boxzoom Eq 4:bte Boxzoom vert1 vert2 N_Elements Boxzoom Eq 5:bte Boxzoom 0:3 0 Boxzoom 4 N_Elements Boxzoom Eq 6:bte Boxzoom Else: BEGIN ncdf_close cdfid return report Wrong Definition of Boxzoom end ENDCASE savedbox 1b saveboxparam boxparam4rdncdf dat domdef bte GRIDTYPE T vargrid _extra ex ENDIF grille mask glam gphi gdep nx ny nz firstx firsty firstz lastx lasty lastz undefine glam undefine gphi on libere un peu de memoire ENDELSE on initialise les ixmindta iymindta au besoin if n_elements jpidta EQ 0 THEN jpidta jpiglo if n_elements jpjdta EQ 0 THEN jpjdta jpjglo if n_elements jpkdta EQ 0 THEN jpkdta jpkglo if n_elements ixmindta EQ 0 THEN ixmindta 0 if n_elements ixmaxdta EQ 0 then ixmaxdta jpidta 1 if ixmindta EQ 1 THEN ixmindta 0 IF ixmaxdta EQ 1 then ixmaxdta jpidta 1 if n_elements iymindta EQ 0 THEN iymindta 0 IF n_elements iymaxdta EQ 0 then iymaxdta jpjdta 1 if iymindta EQ 1 THEN iymindta 0 IF iymaxdta EQ 1 then iymaxdta jpjdta 1 if n_elements izmindta EQ 0 THEN izmindta 0 IF n_elements izmaxdta EQ 0 then izmaxdta jpkdta 1 if izmindta EQ 1 THEN izmindta 0 IF izmaxdta EQ 1 then izmaxdta jpkdta 1 on va lire le fichier if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride key_shift long testvar var key_shift IF n_elements key_yreverse EQ 0 THEN key_yreverse 0 IF keyword_set key_yreverse THEN BEGIN tmp jpj 1 firsty firsty jpj 1 lasty lasty tmp ENDIF IF keyword_set fbase2tbase THEN BEGIN case strupcase vargrid of U :BEGIN IF NOT keyword_set key_periodic THEN BEGIN firstx firstx 1 lastx lastx 1 ENDIF END V :BEGIN firsty firsty 1 lasty lasty 1 END F :BEGIN firsty firsty 1 lasty lasty 1 IF NOT keyword_set key_periodic THEN BEGIN firstx firstx 1 lastx lastx 1 ENDIF END ELSE: endcase ENDIF IF keyword_set fbase2tbase AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 read_ncdf_varget IF keyword_set fbase2tbase AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 on definit les variables globales rattachees a la variable varname varname name varunit if varcontient natts NE 0 then begin attnames strarr varcontient natts for attiq 0 varcontient natts 1 do attnames attiq ncdf_attname cdfid name attiq lowattnames strlowcase attnames found where lowattnames EQ units 0 IF found NE 1 then ncdf_attget cdfid name attnames found value ELSE value varunit strtrim string value 2 found where lowattnames EQ add_offset 0 if found NE 1 then ncdf_attget cdfid name attnames found add_offset ELSE add_offset 0 found where lowattnames EQ scale_factor 0 if found NE 1 then ncdf_attget cdfid name attnames found scale_factor ELSE scale_factor 1 missing_value no found where lowattnames EQ _fillvalue 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value found where lowattnames EQ missing_value 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value ENDIF ELSE BEGIN varunit add_offset 0 scale_factor 1 missing_value no ENDELSE vardate on construit une belle date lisible en fonction du langage specifie year long debut 0 10000 month long debut 0 100 MOD 100 day long debut 0 MOD 100 vardate string format C CMoA 31 month 1 strtrim day 1 strtrim year 1 varexp file_basename filename we apply reverse if keyword_set key_yreverse then res reverse temporary res 2 if keyword_set key_zreverse AND size res 0 EQ 3 AND jpt EQ 1 then res reverse temporary res 3 if keyword_set key_zreverse AND size res 0 EQ 4 THEN res reverse temporary res 3 on applique la valeur valmask sur les points terre if NOT keyword_set cont_nofill then begin valmask 1e20 case 1 of varcontient ndims eq 2:BEGIN xy array mask mask 0 earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 EQ 1:BEGIN xyz array earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 NE 1:BEGIN xyt array mask mask 0 earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny n_elements earth lindgen jpt END END varcontient ndims eq 4:BEGIN xyzt array earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny nz n_elements earth lindgen jpt END END endcase ENDIF ELSE earth 1 we look for missing_value IF size missing_value type NE 7 then BEGIN IF size missing_value type EQ 1 THEN BEGIN IF isnumber string missing_value tmp EQ 1 THEN missing_value tmp ENDIF if missing_value NE valmask then begin if abs missing_value LT 1e6 then missing where res EQ missing_value ELSE missing where abs res gt abs missing_value 10 ENDIF ELSE missing 1 ENDIF ELSE missing 1 on applique les add_offset scale_factor et missing_valueif scale_factor NE 1 then res temporary res scale_factor if add_offset NE 0 then res temporary res add_offset if missing 0 NE 1 then res temporary missing values f_nan if earth 0 NE 1 then res temporary earth 1e20 ncdf_close cdfid if keyword_set savedbox THEN restoreboxparam boxparam4rdncdf dat if keyword_set nostruct then return res ELSE BEGIN IF keyword_set key_forgetold THEN BEGIN return arr:res grid:vargrid unit:varunit experiment:varexp name:varname ENDIF ELSE BEGIN return tab:res grille:vargrid unite:varunit experience:varexp nom:varname ENDELSE ENDELSE END ");244 a[242] = new Array("./ToBeReviewed/LECTURE/read_ftp.html", "read_ftp.pro", "", " pro ftp_post u cmd res out out count count compile_opt idl2 if cmd ne then begin printf u cmd format a comment out the following line to disable debug info print cmd endif if size out type eq 0 then out 2 catch err if err ne 0 then return line count 0 while arg_present res do begin readf u line if count eq 0 then res line else res res line count count 1 comment out the following line to disable debug info print READ_FTP ftp: ftp rsinc com pub gzip README GZIP DATA data IDL help data DATA BYTE Array 2134 IDL print string data README file: Research Systems Anonymous FTP site ftp rsinc com pub directory gzip directory 2 Retrieve some files from podaac jpl nasa gov and store the files in the current working directory: IDL files string lindgen 10 50 format MGB370 3 3d gz IDL READ_FTP podaac jpl nasa gov files IDL pub sea_surface_height topex_poseidon mgdrb data MGB_370 FILE IDL spawn dir MGB log_output Volume in drive C is Local Disk Volume Serial Number is 34CE 24DF Directory of C: test test0307 07 28 2003 11:58a 362 167 MGB370 050 gz 07 28 2003 11:58a 333 005 MGB370 051 gz 07 28 2003 11:58a 310 287 MGB370 052 gz 07 28 2003 11:58a 358 771 MGB370 053 gz 07 28 2003 11:59a 387 282 MGB370 054 gz 07 28 2003 11:59a 361 633 MGB370 055 gz 07 28 2003 11:59a 383 075 MGB370 056 gz 07 28 2003 11:59a 365 844 MGB370 057 gz 07 28 2003 11:59a 383 918 MGB370 058 gz 07 28 2003 12:00p 372 712 MGB370 059 gz 10 File s 3 618 694 bytes These compressed files can cosequently be opened with OPENR and the COMPRESSED keyword history version Id: read_ftp pro 150 2006 08 09 10:12:54Z navarro todo seb: que fait on de syntax au debut du header give examples with date in year 0 should not exists but may happen pro read_ftp site files dir port data data file file user user pass pass ptr ptr compile_opt idl2 if n_elements port eq 0 then port ftp if n_elements files eq 0 then begin if strcmp site ftp: 6 then host strmid site 6 else host site pos strpos host dir strmid host pos host strmid host 0 pos pos strpos dir reverse_search files strmid dir pos 1 dir strmid dir 0 pos endif else host site if size user type eq 0 then user anonymous if size pass type eq 0 then pass test test com socket u host port connect_timeout 5 read_timeout 5 get_lun ftp_post u res ftp_post u USER user res out 3 ftp_post u PASS pass res ftp_post u TYPE I res if size dir type ne 0 then ftp_post u CWD dir res if keyword_set file or arg_present data then begin bufsize 512 buffer bytarr bufsize n n_elements files if arg_present data then dat ptrarr n for i 0 n 1 do begin ftp_post u SIZE files i res out 213 sz long64 strmid res n_elements res 1 4 if arg_present data then dat i ptr_new bytarr sz ftp_post u PASV res ftp_parse_pasv res host port ftp_post u RETR files i res out 1 socket v host port connect_timeout 5 read_timeout 5 get_lun rawio tc 0ll if keyword_set file then openw w files i get_lun while tc lt sz do begin if sz tc lt bufsize then begin bufsize sz tc buffer bytarr bufsize endif readu v buffer transfer_count dtc if arg_present data then dat i tc dtc eq bufsize buffer:buffer 0:dtc 1 if keyword_set file then writeu w dtc eq bufsize buffer:buffer 0:dtc 1 tc tc dtc endwhile free_lun v if keyword_set file then free_lun w ftp_post u res endfor if arg_present data then begin if n gt 1 or keyword_set ptr then data dat else data temporary dat 0 endif endif ftp_post u QUIT res free_lun u end"); 245 a[243] = new Array("./ToBeReviewed/LECTURE/read_ncdf.html", "read_ncdf.pro", "", " file_comments Reading function for the file net_cdf This program is less universal than ncdf_lec it appeal to declarated variables in common pro but it is very easier to be used It considerate the declaration of the different zooms which have been defined ixminmesh premierx the declaration of the variable key_shift To put it in a nutshell the result of read_ncdf can be directly used in plt This is also this program which is used by default inour reading widgets categories reading param NAME in required It is a string defining the field to be read param BEGINNING in required Relative with the time axis These can be 2 date of the type yyyymmdd and in this case we select dates which are included between these two dates 2 indexes which define between which and which time step we have to extract the telporal dimension param ENDING in required Relative with the time axis See BEGINNING param COMPATIBILITY in required Useless keyword BOXZOOM Contain the boxzoom on which we have to do the reading keyword FILENAME It is a string containing the file s name keyword INIT To call automatically initncdf filename and thus redefine all the grid parameters keyword GRID UTVWF to specify the type of grid Defaut is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found keyword IODIRECTORY It isa string giving the name of iodirectory see isafile pro for all possibilities default value is common variable iodir keyword TIMESTEP We activate to specify that BEGINNING and ENDING refer to indexes of the time axis and not to dates keyword TOUT We activate it if we want to read the file on the whole domain without considerate the sub domain defined by the boxzoom or lon1 lon2 lat1 lat2 vert1 vert2 keyword NOSTRUCT We activate it if we do not want that read_ncdf send back a structure but only the array refering to the field keyword TIMEVAR It is a string which define the name of the variable that contains the time axis This keyword can be usefull if there is no unlimited dimension or if the time axis selected by defaut the first 1D array with unlimited dimension is not the good one keyword _EXTRA Used to pass your keywords returns Structure readable by litchamp pro or an array if NOSRUCT is activated uses common pro restrictions The field must have a temporal dimension history Sebastien Masson smasson lodyc jussieu fr 15 10 1999 version Id: read_ncdf pro 150 2006 08 09 10:12:54Z navarro FUNCTION read_ncdf name beginning ending compatibility BOXZOOM boxzoom FILENAME filename PARENTIN parentin TIMESTEP timestep TIMEVAR timevar TOUT tout NOSTRUCT nostruct CONT_NOFILL CONT_NOFILL INIT init GRID grid FBASE2TBASE fbase2tbase _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF we find the filename print filename is parent a valid widget if keyword_set parentin then BEGIN parent long parentin parent parent widget_info parent managed ENDIF filename isafile filename filename IODIRECTORY iodir _EXTRA ex Opening of the name file if size filename type NE 7 then return report read_ncdf cancelled IF version OS_FAMILY EQ unix THEN spawn file filename dev null cdfid ncdf_open filename contient ncdf_inquire cdfid we check if the variable name exists in the file if ncdf_varid cdfid name EQ 1 then BEGIN ncdf_close cdfid return report variable name C not found in the file filename ENDIF varcontient ncdf_varinq cdfid name shall we redefine the grid parameters if keyword_set init THEN initncdf filename _extra ex check the time axis and the debut and ending dates if n_elements beginning EQ 0 then begin beginning 0 timestep 1 endif if keyword_set timestep then begin firsttps beginning 0 if n_elements ending NE 0 then lasttps ending 0 ELSE lasttps firsttps jpt lasttps firsttps 1 time julday 1 1 1 lindgen jpt ENDIF ELSE BEGIN if keyword_set parent then BEGIN widget_control parent get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF filelist 0 EQ many THEN filelist filename currentfile where filelist EQ filename 0 time extractatt top_uvalue fileparameters currentfile time_counter date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 firsttps where time EQ date1 firsttps firsttps 0 lasttps where time EQ date2 lasttps lasttps 0 ENDIF ELSE BEGIN IF keyword_set timevar THEN BEGIN timeid ncdf_varid cdfid timevar IF timeid EQ 1 THEN BEGIN ncdf_close cdfid return report the file filename as no variable timevar C Use the TIMESTEP keyword endif timecontient ncdf_varinq cdfid timeid contient recdim timecontient dim 0 ENDIF ELSE BEGIN we find the infinite dimension timedim contient recdim if timedim EQ 1 then BEGIN ncdf_close cdfid return report the file filename as no infinite dimension C Use TIMESTEP or TIMEVAR keyword endif we find the FIRST time axis timeid 0 repeat BEGIN As long as we have not find a variable having only one dimension: the infinite one timecontient ncdf_varinq cdfid timeid that the variable contain timeid timeid 1 endrep until n_elements timecontient dim EQ 1 AND timecontient dim 0 EQ contient recdim OR timeid EQ contient nvars 1 if timeid EQ contient nvars 1 then BEGIN ncdf_close cdfid return report the file filename as no time axis variable C Use the TIMESTEP keyword endif timeid timeid 1 ENDELSE we must found the time origin of the julian calendar used in the time axis does the attribut units an dcalendar exist for the variable time axis if timecontient natts EQ 0 then BEGIN ncdf_close cdfid return report the variable timecontient name has no attribut C Use the TIMESTEP keyword or add the attribut units to the variable endif attnames strarr timecontient natts for attiq 0 timecontient natts 1 do attnames attiq ncdf_attname cdfid timeid attiq if where attnames EQ units 0 EQ 1 then BEGIN ncdf_close cdfid return report Attribut units not found for the variable timecontient name C Use the TIMESTEP keyword ENDIF now we try to find the attribut called calendar the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid timeid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE now we take acre of units attribut ncdf_attget cdfid timeid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 we decript the units attribut to find the time origin value strtrim strcompress string value 2 mots str_sep value unite mots 0 depart str_sep mots 2 ncdf_varget cdfid timeid time time double time unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 case unite of second :time julday depart 1 depart 2 depart 0 time 86400 d hour :time julday depart 1 depart 2 depart 0 time 24 d day :time julday depart 1 depart 2 depart 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday depart 1 depart 2 depart 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday depart 1 time t depart 2 depart 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday depart 1 depart 2 depart 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday depart 1 depart 2 depart 0 time t END ELSE:BEGIN ncdf_close cdfid return report The units attribu of the time axis must be something like: C seconds since 0001 01 01 C days since 1979 01 01 C months since 1979 01 01 C years since 1979 01 01 end ENDCASE date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 time double time firsttps where time GE date1 firsttps firsttps 0 if firsttps EQ 1 THEN BEGIN ncdf_close cdfid return report date 1: strtrim jul2date date1 1 is not found in the time axis ENDIF lasttps where time LE date2 if lasttps 0 EQ 1 THEN BEGIN ncdf_close cdfid return report the time axis as no date before date 2: strtrim jul2date date2 1 endif lasttps lasttps n_elements lasttps 1 if lasttps LT firsttps then BEGIN ncdf_close cdfid return report the time axis as no dates between date1 and date 2: strtrim jul2date date1 1 strtrim jul2date date2 1 endif ENDELSE time time firsttps:lasttps jpt lasttps firsttps 1 ENDELSE Name of the grid on which the field refer to IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN pattern GRID GRID_ GRID UPID_ 30ID_ gdtype T U V W F fnametest strupcase filename FOR i 0 n_elements pattern 1 DO BEGIN FOR j 0 n_elements gdtype 1 DO BEGIN substr pattern i gdtype j pos strpos fnametest substr IF pos NE 1 THEN vargrid strmid fnametest pos strlen substr 1 1 ENDFOR ENDFOR ENDIF ENDELSE call the init function redefinition of the domain if keyword_set tout then begin nx jpi ny jpj nz jpk firstx 0 firsty 0 firstz 0 lastx jpi 1 lasty jpj 1 lastz jpk 1 case strupcase vargrid of T :mask tmask U :mask umask V :mask vmask W :mask tmask F :mask fmask endcase ENDIF ELSE BEGIN if keyword_set boxzoom then BEGIN Case 1 Of N_Elements Boxzoom Eq 1:bte lon1 lon2 lat1 lat2 0 boxzoom 0 N_Elements Boxzoom Eq 2:bte lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 N_Elements Boxzoom Eq 4:bte Boxzoom vert1 vert2 N_Elements Boxzoom Eq 5:bte Boxzoom 0:3 0 Boxzoom 4 N_Elements Boxzoom Eq 6:bte Boxzoom Else: BEGIN ncdf_close cdfid return report Wrong Definition of Boxzoom end ENDCASE savedbox 1b saveboxparam boxparam4rdncdf dat domdef bte GRIDTYPE T vargrid _extra ex ENDIF grille mask glam gphi gdep nx ny nz firstx firsty firstz lastx lasty lastz undefine glam undefine gphi We liberate some memoty ENDELSE We initializate ixmindta iymindta if needed if n_elements jpidta EQ 0 THEN jpidta jpiglo if n_elements jpjdta EQ 0 THEN jpjdta jpjglo if n_elements jpkdta EQ 0 THEN jpkdta jpkglo if n_elements ixmindta EQ 0 THEN ixmindta 0 if n_elements ixmaxdta EQ 0 then ixmaxdta jpidta 1 if ixmindta EQ 1 THEN ixmindta 0 IF ixmaxdta EQ 1 then ixmaxdta jpidta 1 if n_elements iymindta EQ 0 THEN iymindta 0 IF n_elements iymaxdta EQ 0 then iymaxdta jpjdta 1 if iymindta EQ 1 THEN iymindta 0 IF iymaxdta EQ 1 then iymaxdta jpjdta 1 if n_elements izmindta EQ 0 THEN izmindta 0 IF n_elements izmaxdta EQ 0 then izmaxdta jpkdta 1 if izmindta EQ 1 THEN izmindta 0 IF izmaxdta EQ 1 then izmaxdta jpkdta 1 We will read the file if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride key_shift long testvar var key_shift IF n_elements key_yreverse EQ 0 THEN key_yreverse 0 IF keyword_set key_yreverse THEN BEGIN tmp jpj 1 firsty firsty jpj 1 lasty lasty tmp ENDIF IF keyword_set fbase2tbase THEN BEGIN case strupcase vargrid of U :BEGIN IF NOT keyword_set key_periodic THEN BEGIN firstx firstx 1 lastx lastx 1 ENDIF END V :BEGIN firsty firsty 1 lasty lasty 1 END F :BEGIN firsty firsty 1 lasty lasty 1 IF NOT keyword_set key_periodic THEN BEGIN firstx firstx 1 lastx lastx 1 ENDIF END ELSE: endcase ENDIF IF keyword_set fbase2tbase AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 read_ncdf_varget IF keyword_set fbase2tbase AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 We define global variable joined with the variable varname varname name varunit if varcontient natts NE 0 then begin attnames strarr varcontient natts for attiq 0 varcontient natts 1 do attnames attiq ncdf_attname cdfid name attiq lowattnames strlowcase attnames found where lowattnames EQ units 0 IF found NE 1 then ncdf_attget cdfid name attnames found value ELSE value varunit strtrim string value 2 found where lowattnames EQ add_offset 0 if found NE 1 then ncdf_attget cdfid name attnames found add_offset ELSE add_offset 0 found where lowattnames EQ scale_factor 0 if found NE 1 then ncdf_attget cdfid name attnames found scale_factor ELSE scale_factor 1 missing_value no found where lowattnames EQ _fillvalue 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value found where lowattnames EQ missing_value 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value ENDIF ELSE BEGIN varunit add_offset 0 scale_factor 1 missing_value no ENDELSE vardate We make a legible date in function of the specified language year long beginning 0 10000 month long beginning 0 100 MOD 100 day long beginning 0 MOD 100 vardate string format C CMoA 31 month 1 strtrim day 1 strtrim year 1 varexp file_basename filename we apply reverse if keyword_set key_yreverse then res reverse temporary res 2 if keyword_set key_zreverse AND size res 0 EQ 3 AND jpt EQ 1 then res reverse temporary res 3 if keyword_set key_zreverse AND size res 0 EQ 4 THEN res reverse temporary res 3 We apply the value valmask on land points if NOT keyword_set cont_nofill then begin valmask 1e20 case 1 of varcontient ndims eq 2:BEGIN xy array mask mask 0 earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 EQ 1:BEGIN xyz array earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 NE 1:BEGIN xyt array mask mask 0 earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny n_elements earth lindgen jpt END END varcontient ndims eq 4:BEGIN xyzt array earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny nz n_elements earth lindgen jpt END END endcase ENDIF ELSE earth 1 we look for missing_value IF size missing_value type NE 7 then BEGIN IF size missing_value type EQ 1 THEN BEGIN IF isnumber string missing_value tmp EQ 1 THEN missing_value tmp ENDIF if missing_value NE valmask then begin if abs missing_value LT 1e6 then missing where res EQ missing_value ELSE missing where abs res gt abs missing_value 10 ENDIF ELSE missing 1 ENDIF ELSE missing 1 we apply add_offset scale_factor and missing_value if scale_factor NE 1 then res temporary res scale_factor if add_offset NE 0 then res temporary res add_offset if missing 0 NE 1 then res temporary missing values f_nan if earth 0 NE 1 then res temporary earth 1e20 ncdf_close cdfid if keyword_set savedbox THEN restoreboxparam boxparam4rdncdf dat if keyword_set nostruct then return res ELSE BEGIN IF keyword_set key_forgetold THEN BEGIN return arr:res grid:vargrid unit:varunit experiment:varexp name:varname ENDIF ELSE BEGIN return tab:res grille:vargrid unite:varunit experience:varexp nom:varname ENDELSE ENDELSE END "); 246 246 a[244] = new Array("./ToBeReviewed/LECTURE/read_ncdf_varget.html", "read_ncdf_varget.pro", "", ""); 247 a[245] = new Array("./ToBeReviewed/LECTURE/xncdf_lec.html", "xncdf_lec.pro", "", " La lecture de ce programme se fait de bas en haut: 1 xncdf_lec 2 xncdf_lec_event 3 wid_var wid_var_event pro wid_var_event event NAME:wid_var_event PURPOSE:procedure appele par xmanager qd on appuie sur un bouton du 2eme widget cree par wid_var INPUTS: event une structure caracterisant le type d evenement qui arrive au widget numero1 2 COMMON BLOCKS:wididbase resultat infovariable indicewid motcle compile_opt idl2 strictarrsubs COMMON wididbase base COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar quel est le type d evenement widget_control event id get_uvalue uval tailledimvar tailledim varcontient dim if n_elements uval EQ 0 then return case sur le type d evenement case uval OF 1:BEGIN on change des valeurs dans le tableau on controle que les valeurs mises dans le tableau ne sont pas completement fausses widget_control widbase1 get_value table agument du bon type si le type est mauvais on change automatiquement par des valeurs par defaut if event x GT size table 1 then return if event y GT size table 2 then return if size table event x event y type GE 6 OR size table event x event y type EQ 0 then BEGIN if event x EQ 1 then widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y ELSE widget_control widbase1 use_table_select event x event y event x event y set_value 0 endif agument avec une valeur nom debile table fix table case event x of 0:BEGIN on a touche a l offset: if table 0 event y LT 0 then BEGIN table 0 event y 0 widget_control widbase1 use_table_select 0 event y 0 event y set_value 0 endif si il depasse la dim du tableau on le met au max et le cont a 1 if table 0 event y GT tailledimvar event y table 3 event y then begin widget_control widbase1 use_table_select 0 event y 1 event y set_value tailledimvar event y table 3 event y 1 ENDIF ELSE BEGIN si avec le nouvel offset le count est trop grand on le diminue juste de ce qu il faut if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END 1:BEGIN on a touche au count if table 1 event y LT 1 then BEGIN table 1 event y 1 widget_control widbase1 use_table_select 1 event y 1 event y set_value 1 endif si il est trop grand on le diminue juste de ce qu il faut if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then BEGIN widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif END 2:BEGIN on a touche au shift widget_control widbase1 use_table_select 2 event y 2 event y set_value table 2 event y MOD tailledimvar event y table 3 event y END 3:BEGIN on touche au stride if table 3 event y LT 1 then BEGIN table 3 event y 1 widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 endif if table 3 event y EQ 0 then il ne doit pas etre nul widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 il ne doit pas etre trop grand if table 3 event y GT tailledimvar event y then widget_control widbase1 use_table_select 0 event y 3 event y set_value 0 1 0 tailledimvar event y ELSE BEGIN if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END ELSE: endcase END 2111:BEGIN on a touche aux boutons oui non on actualise le vecteur selectatt a 0 ou 1 pour l attribut concerne numero event id selectatt where widbase2111 EQ event id event select end 31:BEGIN on a appuye sur get widget_control widbase1 get_value table table fix table mcshift where table 2 NE 0 mcoffset table 0 mccount table 1 mcstride table 3 if mcshift 0 NE 1 then BEGIN il y a des shifts on lit l integralite des dimensions pour lesquelles il y a un shift mcoffset mcshift 0 mccount mcshift tailledimvar mcshift on active pas stride qd il n y en a pas besoin car ca fait ecrire a l ecran qqch de louche if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride pour faire le shift mcshift table 2 mcoffset table 0 mccount table 1 on definit commende qui permet de faire un shift commande res shift res for dim 0 varcontient ndims 1 do commande commande string table 2 dim commande commande rien execute commande on redefinit commnade qui permet de couper les dimensions qui n ont pas ete encore coupees c est celles que l on shift commande res res initialisation de la commende for dim 0 varcontient ndims 1 do BEGIN if mcshift dim EQ 0 then commande commande ELSE commande commande string mcoffset dim : string mccount dim mcoffset dim 1 ENDFOR commande strmid commande 0 strlen commande 1 rien execute commande cas sans shift on lit directement le bon bout de tableau ENDIF ELSE BEGIN if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride ENDELSE faut il constituer une structure avec les attributs qui on ete selectionnes if total selectatt NE 0 then BEGIN il y a des attributs selectionnes res create_struct varcontient name res on cree la structure selectatt where selectatt EQ 1 on trouve les attributs selectiones for attid 0 n_elements selectatt 1 do BEGIN pour lesquels on prend widget_control widbase212 selectatt attid get_value attname le nom widget_control widbase213 selectatt attid get_value attvalue la valeur res create_struct res attname 0 attvalue 0 on concatene la structe endfor endif widget_control event top destroy on ferme le 2eme widget widget_control base destroy on ferme le 1eme widget ncdf_close cdfid END 32: cas de l affichage d un held avec xdisplayfile 33:widget_control event top destroy on ferme le 2eme widget ELSE: endcase return end PRO wid_var widid_pere NAME: wid_var PURPOSE: cette procedure gere le 2eme widget cree qd on appelle xncdf_lec ce widget concerne la lecture de la variable INPUTS: widid_pere: un scalere contenant l identite du widget pere qui a etait cree par xncdf_lec et qui a permis de selectionner la variable a lire OUTPUTS: indirectement res le tableau ou la structure resultat COMMON BLOCKS:resultat infovariable indicewid_var motcle compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar res 1 ouverture de la fenetre de base sous forme de colonnes widbase widget_base column title variable: varcontient name align_center group_leader widid_pere ouverture de sous fenetres de base widbase1 tableau des offsets rien widget_label widbase value on saute une ligne defintion des lables des lignes du tableau rowlab string tailledim varcontient dim for i 0 n_elements rowlab 1 do rowlab i strtrim rowlab i 1 rowlab nomdim varcontient dim replicate : n_elements varcontient dim rowlab definition des valeurs initiales du tableau valinit lonarr 4 n_elements varcontient dim colonne 0 : les offset if keyword_set mcoffset AND n_elements mcoffset EQ varcontient ndims THEN valinit 0 mcoffset ELSE valinit 0 0 colonne 1 : les counts if keyword_set mccount AND n_elements mccount EQ varcontient ndims THEN valinit 1 mccount ELSE valinit 1 tailledim varcontient dim colonne 2 : les shifts if keyword_set mcshift AND n_elements mcshift EQ varcontient ndims THEN valinit 2 mcshift ELSE valinit 2 0 colonne 3 : les strides if keyword_set mcstride AND n_elements mcstride EQ varcontient ndims THEN valinit 3 mcstride ELSE valinit 3 1 test des valeurs initiales du tableau valinit fix valinit valinit 3 1 valinit 3 valinit 0 valinit 1 tailledim varcontient dim valinit 3 valinit 0 valinit 2 valinit 2 MOD tailledim varcontient dim valinit 3 test des shifts declaration du tableau widbase1 widget_table widbase row_labels rowlab value valinit editable column_labels Offset Count Shift Stride uvalue 1 un petit blabla rien widget_label widbase value ATTENTION: Faire des return pour que les valeurs align_center rien widget_label widbase value du tableau ou des textes soient bien prises en compte align_center widbase2 choix des attributs rien widget_label widbase value on saute une ligne widbase2 widget_base widbase column pour chaque attribut on cree un widget widbase21 qui contient en ligne un bouton oui non widbase211 et deux wigdet text widbase212 widbase213 comportant le nom et la valeur de l attribut widbase21 lonarr varcontient natts widbase211 lonarr varcontient natts widbase2111 lonarr varcontient natts vecteur qui serviera a savoir quels boutons oui non sont selectiones cf wid_var_event selectatt lonarr varcontient natts selectatt 0 widbase212 lonarr varcontient natts widbase213 lonarr varcontient natts for attid 0 varcontient natts 1 do BEGIN boucle sur le nombre d attributs widbase21 attid widget_base widbase2 row name ncdf_attname cdfid varid attid ncdf_attget cdfid varid name value widbase211 attid widget_base widbase21 attid nonexclusive widbase2111 attid widget_button widbase211 attid value uvalue 2111 widbase212 attid widget_text widbase21 attid value name editable widbase213 attid widget_text widbase21 attid value strtrim string value 1 editable endfor widbase3 boutons du bas widbase3 widget_base widbase row align_center widbase31 widget_button widbase3 value GET uvalue 31 widbase32 widget_button widbase3 value Help uvalue 32 widbase33 widget_button widbase3 value DONE uvalue 33 execution de la fentre de base et des sous fenetres widget_control widbase realize xmanager wid_var widbase return end PRO xncdf_lec_event event NAME:xncdf_lec_event PURPOSE: procedure appele par xmanager qd on appuie sur un bouton du 1ere widget cree par xncdf_lec INPUTS: event une structure caracterisant le type d evenement qui arrive au widget numero1 COMMON BLOCKS:resultat infovariable motcle compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar quel est le type d evenement widget_control event id get_uvalue uval case sur le type d evenement case uval of 1:BEGIN on veut lire un autre fichier widget_control event id get_value nom on recupere le nom widget_control event top destroy on ferme le widget ncdf_close cdfid on ferme le mauvais fichier qui a ete ouvert on reapelle xncdf_lec res xncdf_lec nom 0 ATT mcatt COUNT mccount OFFSET mcoffset IODIR mciodir SHIFT mcshift STRIDE mcstride VAR mcvar return END 2:BEGIN une variable est selectionee varid event index on recupere son numero ds le fichier Netcdf varcontient ncdf_varinq cdfid varid wid_var event top on appelle le programme qui lance le 2eme widget cf haut END 3:BEGIN bouton done widget_control event top destroy on tue le widget ncdf_close cdfid on ferme le fichier END ELSE: endcase return end NAME: xncdf_lec PURPOSE: lecture d un fichier Net Cdf avec des widgets CATEGORY: lecture de fichiers avec widgets CALLING SEQUENCE: res xncdf_lec nom_fichier INPUTS: OPTIONNEL nom_fichier: c est un string qui donne le nom du fichier a ouvrir Si nomfichier ne contient pas le caractere separateur de repertoirte sous unix par ex Le fichier sera cherche ds le repertoire courant KEYWORD PARAMETERS: IODIR: string contenant le repertoire ou aller chercher le fichier a lire Si nomfichier ne contient pas le caractere separateur de repertoirte sous unix par ex Le fichier cherche s appelera iodir nom_fichier COUNT: An optional vector containing the counts to be used in reading Value COUNT is a 1 based vector with an element for each dimension of the data to be written The default matches the size of the variable so that all data is written out GROUP: The widget ID of the widget that calls XNCDF_LEC When this ID is specified a death of the caller results in a death of XNCDF_LEC OFFSET: An optional vector containing the starting position for the read The default start position is 0 0 SHIFT: un vecteur d entiers specifiant pour chaque dimension de combien il faut la shifter Par defaut c est 0 0 cf la fonction shift pour d explications ATTENTION le shift est effectue sur le tableau de taille maximum avant la reduction eventuelle determinee par OFFSET et COUNT Par contre il est effectue apres l extraction eventuelle cree par le STRIDE STRIDE: An optional vector containing the strides or sampling intervals between accessed values of the netCDF variable The default stride vector is that for a contiguous read 1 1 OUTPUTS: 2 cas possibles: 1 aucun attributs n a ete selectionne Dans ce cas res est le tableau que l on voulait lire 2 Des attributs ont ete selectionnes Dans ce cas res est une structre dont le premier element portant le nom de la variable est le tableau de valeurs et les autre auguments sont les arguments selectiones COMMON BLOCKS: wididbase infovariable resultat motcle SIDE EFFECTS: RESTRICTIONS: EXAMPLE: help xncdf_lec MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 24 8 1999 FUNCTION xncdf_lec nom ATT att COUNT count GROUP group OFFSET offset IODIR iodir SHIFT shift STRIDE stride VAR var compile_opt idl2 strictarrsubs COMMON wididbase base COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON resultat res COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar bidouille pour utiliser les mots cles on passe par des variables declarees ds un common res 1 if keyword_set att then mcatt att ELSE mcatt 0 if keyword_set count then mccount count ELSE mccount 0 if keyword_set offset then mcoffset offset ELSE mcoffset 0 if keyword_set shift then mcshift shift ELSE mcshift 0 if keyword_set stride then mcstride stride ELSE mcstride 0 if keyword_set var then mcvar var ELSE mcvar 0 choix du nom du fichier Quel type de machine est utiliee thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :sep : WIN :sep ELSE: sep ENDCASE si iodir n est pas definit on l initialise au repertoire courant if NOT keyword_set iodir then cd current iodir mciodir iodir on complete iodir d un caractere separateur de repertoire si besoin est IF rstrpos iodir sep NE strlen iodir 1 THEN iodir iodir sep if n_elements nom EQ 0 then BEGIN si nom n est pas definit on en trouve un grace au programme dialog_pickfile nom dialog_pickfile filter iodir nc if nom 0 EQ then return 1 si on a rien trouve on sort on complete nom par iodir si nom ne contient pas de caractere separateur derepertoire ENDIF ELSE if strpos nom sep EQ 1 then nom iodir nom test findfile nom le nom cherche correspond bien a un fichier while test 0 EQ OR n_elements test GT 1 do BEGIN on en cherche un tant qu il ne correspond a rien test test 0 nom dialog_pickfile filter iodir nc if nom EQ then return 1 test findfile nom endwhile ouverture du fichier nom cdfid ncdf_open nom contient ncdf_inquire cdfid que contient le fichier ouverture de la fenetre de base sous forme de colonnes if n_elements group EQ 0 then base widget_base column title Fichier: nom align_left ELSE base widget_base column title Fichier: nom align_left GROUP_LEADER group ouverture de sous fenetres de base base 1 titre portant le nom du fichier base1 widget_base base column align_center rien widget_label base1 value Net Cdf filename align_center blabla rien widget_text base1 value nom align_center uvalue 1 editable nom du fichier que l on peut changer rien widget_label base1 value on saute une ligne base 2 informations generales sur le fichier base2 widget_base base column informations sur les attributs globaux if contient ngatts NE 1 then begin rien widget_label base2 value Nombre de attributs globaux: strtrim contient ngatts 1 align_left for attiq 0 contient ngatts 1 do BEGIN bouble sur le nombre d attributs globaux name ncdf_attname cdfid attiq global nom de l atribut ncdf_attget cdfid name value global valeur de l atribut rien widget_text base2 value name : strtrim string value 1 xsize 60 scroll wrap align_right endfor rien widget_label base2 value endif informations sur les dimensions rien widget_label base2 value Nombre de dimensions: strtrim contient ndims 1 align_left if contient recdim NE 1 then begin bouble sur le nombre de dimensions ncdf_diminq cdfid contient recdim name value nom et valeur de la dimension rien widget_label base2 value nom de la dimension infinie: name align_left endif nomdim strarr contient ndims vecteur contenant le nom des dimensions tailledim lonarr contient ndims vecteur contenant la valeur des dimensions for dimiq 0 contient ndims 1 do begin bouble sur le nombre de dimensions ncdf_diminq cdfid dimiq name value nom et valeur de la dimension nomdim dimiq name tailledim dimiq value rien widget_label base2 value name de taille: strtrim value 1 align_right ENDFOR rien widget_label base2 value on saute une ligne base 3 choix de la variable base3 widget_base base column rien widget_label base3 value Nombre de variables: strtrim contient nvars 1 align_left base31 widget_base base3 row align_center creation d un vecteur listename contenant le nom de toutes les variables du fichier listename strarr contient nvars for varid 0 contient nvars 1 do begin varcontient ncdf_varinq cdfid varid que contient la variable listename varid varcontient name endfor rien widget_label base31 value variable creation d un bouton a menu deroulant base311 widget_droplist base31 value listename uvalue 2 rien widget_label base3 value base 4 bouton done base4 widget_base base row base42 widget_button base4 value done uvalue 3 align_right execution de la fentre de base et des sous fenetres widget_control base realize xmanager xncdf_lec base return resend");247 a[245] = new Array("./ToBeReviewed/LECTURE/xncdf_lec.html", "xncdf_lec.pro", "", " file_comments Reading of a Net Cdf file with widgets categories widget param NAME in optional It is a string giving the name of the file to be opened If NAME does not contain the separating character of directories under unix for example the file will be looked for in the current directory keyword IODIR It is a string containing the directory where to go look for the file to be read If NAME does not contain the separating character of directories under unix for example the file will be called iodir nom_fichier keyword COUNT An optional vector containing the counts to be used in reading Value COUNT is a 1 based vector with an element for each dimension of the data to be written The default matches the size of the variable so that all data is written out keyword GROUP The widget ID of the widget that calls XNCDF_LEC When this ID is specified a death of the caller results in a death of XNCDF_LEC keyword OFFSET An optional vector containing the starting position for the read The default start position is 0 0 keyword SHIFT A vector of integers specifing for each dimension how much we have to shift it By default it is 0 0 See the function shift for more explanations BEWARE the shift is done on the biggest array before a possible reduction determinated by OFFSET and COUNT On the other hand it is done after the possible extraction created by the STRIDE keyword STRIDE An optional vector containing the strides or sampling intervals between accessed values of the netCDF variable The default stride vector is that for a contiguous read 1 1 returns 2 different cases: 1 None attribute has been selected In this case res is the array we wanted to read 2 Some attributes has been selected In this case res is a structure whose the first element having the name of the variable is the values array and the other arguments are the select arguments uses wididbase infovariable resultat motcle examples help xncdf_lec history Sebastien Masson smasson lodyc jussieu fr 24 8 1999 version Id: xncdf_lec pro 150 2006 08 09 10:12:54Z navarro FUNCTION xncdf_lec name ATT att COUNT count GROUP group OFFSET offset IODIR iodir SHIFT shift STRIDE stride VAR var compile_opt idl2 strictarrsubs COMMON wididbase base COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON resultat res COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar Trick for using keywords we pass by variables declarated in a common res 1 if keyword_set att then mcatt att ELSE mcatt 0 if keyword_set count then mccount count ELSE mccount 0 if keyword_set offset then mcoffset offset ELSE mcoffset 0 if keyword_set shift then mcshift shift ELSE mcshift 0 if keyword_set stride then mcstride stride ELSE mcstride 0 if keyword_set var then mcvar var ELSE mcvar 0 choice of the file s name What type of machine is used thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :sep : WIN :sep ELSE: sep ENDCASE If IODIR is not defined we initialize it at the current directory if NOT keyword_set iodir then cd current iodir mciodir iodir We complete IODIR with a separating character if needed IF rstrpos iodir sep NE strlen iodir 1 THEN iodir iodir sep if n_elements name EQ 0 then BEGIN If NAME is not defined we find one thanks to the program dialog_pickfile name dialog_pickfile filter iodir nc if name 0 EQ then return 1 If we do not have find anything we go out We complete NAME by IODIR if NAME does not contain any directory separating character ENDIF ELSE if strpos name sep EQ 1 then name iodir name test findfile name Does the name looked for correspond to a file while test 0 EQ OR n_elements test GT 1 do BEGIN We look for one as long as it correspond to nothing test test 0 name dialog_pickfile filter iodir nc if name EQ then return 1 test findfile name endwhile Opening of the file name cdfid ncdf_open name contient ncdf_inquire cdfid What does this file contain Opening of the base window as columns if n_elements group EQ 0 then base widget_base column title Fichier: name align_left ELSE base widget_base column title Fichier: name align_left GROUP_LEADER group Opening of base sub windows base 1 title having the file s name base1 widget_base base column align_center rien widget_label base1 value Net Cdf filename align_center rien widget_text base1 value name align_center uvalue 1 editable File s name we can change rien widget_label base1 value We jump a line base 2 General informations on the file base2 widget_base base column Informations on global attributes if contient ngatts NE 1 then begin rien widget_label base2 value Nombre de attributs globaux: strtrim contient ngatts 1 align_left for attiq 0 contient ngatts 1 do BEGIN Loop on the number of global attributes name ncdf_attname cdfid attiq global Attribute s name ncdf_attget cdfid name value global Attribute s value rien widget_text base2 value name : strtrim string value 1 xsize 60 scroll wrap align_right endfor rien widget_label base2 value endif Informations on dimensions rien widget_label base2 value Nombre de dimensions: strtrim contient ndims 1 align_left if contient recdim NE 1 then begin Loop on the number of global attributes ncdf_diminq cdfid contient recdim name value Name and value of the dimension rien widget_label base2 value name de la dimension infinie: name align_left endif nomdim strarr contient ndims Vector containing dimensions s name tailledim lonarr contient ndims Vector containing dimensions s value for dimiq 0 contient ndims 1 do begin Loop on the number of dimensions ncdf_diminq cdfid dimiq name value Name and value of the dimension nomdim dimiq name tailledim dimiq value rien widget_label base2 value name de taille: strtrim value 1 align_right ENDFOR rien widget_label base2 value We jump a line base 3 choice of the variable base3 widget_base base column rien widget_label base3 value Nombre de variables: strtrim contient nvars 1 align_left base31 widget_base base3 row align_center Creation of a listename containing the name of all file s variables listename strarr contient nvars for varid 0 contient nvars 1 do begin varcontient ncdf_varinq cdfid varid that the variable contain listename varid varcontient name endfor rien widget_label base31 value variable Creation of a button with a pop up menu base311 widget_droplist base31 value listename uvalue 2 rien widget_label base3 value base 4 button done base4 widget_base base row base42 widget_button base4 value done uvalue 3 align_right Execution of the base window and of sub windows widget_control base realize xmanager xncdf_lec base return res end La lecture de ce programme se fait de bas en haut: 1 xncdf_lec 2 xncdf_lec_event 3 wid_var wid_var_event file_comments Procedure called by xmanager when we press on a button of a second widget created by wid_var param EVENT in required A structure caracterizing the type of event which arrive to a widget number1 2 uses wididbase resultat infovariable indicewid motcle version Id: xncdf_lec pro 150 2006 08 09 10:12:54Z navarro pro wid_var_event event compile_opt idl2 strictarrsubs COMMON wididbase base COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar What is the type of event widget_control event id get_uvalue uval tailledimvar tailledim varcontient dim if n_elements uval EQ 0 then return case on the type of event case uval OF 1:BEGIN We change values in the array We check that values put in the array are not totally false widget_control widbase1 get_value table Is it the good type of argument If the type is wrong we automatically change it by default values if event x GT size table 1 then return if event y GT size table 2 then return if size table event x event y type GE 6 OR size table event x event y type EQ 0 then BEGIN if event x EQ 1 then widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y ELSE widget_control widbase1 use_table_select event x event y event x event y set_value 0 endif Argument with a wrong name value table fix table case event x of 0:BEGIN We touched the offset if table 0 event y LT 0 then BEGIN table 0 event y 0 widget_control widbase1 use_table_select 0 event y 0 event y set_value 0 endif If it exceed the dimension of the array we put it at the max and the cont at 1 if table 0 event y GT tailledimvar event y table 3 event y then begin widget_control widbase1 use_table_select 0 event y 1 event y set_value tailledimvar event y table 3 event y 1 ENDIF ELSE BEGIN If with the new offset the cont is too big we reduce it until it goes well if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END 1:BEGIN We touched the cont if table 1 event y LT 1 then BEGIN table 1 event y 1 widget_control widbase1 use_table_select 1 event y 1 event y set_value 1 endif If it is too big we reduce it until it goes well if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then BEGIN widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif END 2:BEGIN We touched the shift widget_control widbase1 use_table_select 2 event y 2 event y set_value table 2 event y MOD tailledimvar event y table 3 event y END 3:BEGIN We touched the stride if table 3 event y LT 1 then BEGIN table 3 event y 1 widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 endif if table 3 event y EQ 0 then It must not be null widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 It must not be too big if table 3 event y GT tailledimvar event y then widget_control widbase1 use_table_select 0 event y 3 event y set_value 0 1 0 tailledimvar event y ELSE BEGIN if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END ELSE: endcase END 2111:BEGIN We touched buttons yes no We update the vector selectatt at 0 or 1 for the concerned attribute number event id selectatt where widbase2111 EQ event id event select end 31:BEGIN We pressed on get widget_control widbase1 get_value table table fix table mcshift where table 2 NE 0 mcoffset table 0 mccount table 1 mcstride table 3 if mcshift 0 NE 1 then BEGIN There are some shifts We read the wholeness of dimensions for which ones there is a shift mcoffset mcshift 0 mccount mcshift tailledimvar mcshift We do not activate stride when there is no need because it makes write something weird on the screen if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride To do the shift mcshift table 2 mcoffset table 0 mccount table 1 We define the command allowing to do a shift commande res shift res for dim 0 varcontient ndims 1 do commande commande string table 2 dim commande commande rien execute commande We redefine the command allowing to cut dimensions which has not been cut yet ones we shift commande res res initialization of the command for dim 0 varcontient ndims 1 do BEGIN if mcshift dim EQ 0 then commande commande ELSE commande commande string mcoffset dim : string mccount dim mcoffset dim 1 ENDFOR commande strmid commande 0 strlen commande 1 rien execute commande Case without shift we read directly the good part of the array ENDIF ELSE BEGIN if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride ENDELSE Do we have to constitute a structure with selected attributes if total selectatt NE 0 then BEGIN There are selected attributes res create_struct varcontient name res We create the structure selectatt where selectatt EQ 1 We find selected attributes for attid 0 n_elements selectatt 1 do BEGIN for which we take widget_control widbase212 selectatt attid get_value attname the name widget_control widbase213 selectatt attid get_value attvalue the value res create_struct res attname 0 attvalue 0 We concatenate the structure endfor endif widget_control event top destroy We shut the second widget widget_control base destroy We shut the first widget ncdf_close cdfid END 32: Case of the display of a held with xdisplayfile 33:widget_control event top destroy We shut the second widget ELSE: endcase return end file_comments This procedure manage the second created whiget when we call xncdf_lec This widget concern the reading of the variable param WIDID_PERE in required It is a scalar containing the identity of the father widget which was created by xncdf_lec and which has allowed to select the variable to be read OUTPUTS: indirectement res le tableau ou la structure resultat uses resultat infovariable indicewid_var motcle version Id: xncdf_lec pro 150 2006 08 09 10:12:54Z navarro PRO wid_var widid_pere compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar res 1 Opening of the base window as columns widbase widget_base column title variable: varcontient name align_center group_leader widid_pere Opening of the base subwindow widbase1 array of offsets rien widget_label widbase value We jump a line Definition of labels of lines of the array rowlab string tailledim varcontient dim for i 0 n_elements rowlab 1 do rowlab i strtrim rowlab i 1 rowlab nomdim varcontient dim replicate : n_elements varcontient dim rowlab Definition of array s initial values valinit lonarr 4 n_elements varcontient dim column 0 : offsets if keyword_set mcoffset AND n_elements mcoffset EQ varcontient ndims THEN valinit 0 mcoffset ELSE valinit 0 0 colomn 1 : counts if keyword_set mccount AND n_elements mccount EQ varcontient ndims THEN valinit 1 mccount ELSE valinit 1 tailledim varcontient dim column 2 : shifts if keyword_set mcshift AND n_elements mcshift EQ varcontient ndims THEN valinit 2 mcshift ELSE valinit 2 0 column 3 : strides if keyword_set mcstride AND n_elements mcstride EQ varcontient ndims THEN valinit 3 mcstride ELSE valinit 3 1 test of initial values of the array valinit fix valinit valinit 3 1 valinit 3 valinit 0 valinit 1 tailledim varcontient dim valinit 3 valinit 0 valinit 2 valinit 2 MOD tailledim varcontient dim valinit 3 test of shifts declaration of the array widbase1 widget_table widbase row_labels rowlab value valinit editable column_labels Offset Count Shift Stride uvalue 1 un petit blabla rien widget_label widbase value ATTENTION: Faire des return pour que les valeurs align_center rien widget_label widbase value du tableau ou des textes soient bien prises en compte align_center widbase2 choice of attributes rien widget_label widbase value We jump a line widbase2 widget_base widbase column To each attribute we created a widget widbase21 containing in line a button yes no widbase211 and two wigdet text widbase212 widbase213 comprising the name and the value of the attribute widbase21 lonarr varcontient natts widbase211 lonarr varcontient natts widbase2111 lonarr varcontient natts Vector which will serve to know which yes no are selected see wid_var_event selectatt lonarr varcontient natts selectatt 0 widbase212 lonarr varcontient natts widbase213 lonarr varcontient natts for attid 0 varcontient natts 1 do BEGIN Lop on the number of attribute widbase21 attid widget_base widbase2 row name ncdf_attname cdfid varid attid ncdf_attget cdfid varid name value widbase211 attid widget_base widbase21 attid nonexclusive widbase2111 attid widget_button widbase211 attid value uvalue 2111 widbase212 attid widget_text widbase21 attid value name editable widbase213 attid widget_text widbase21 attid value strtrim string value 1 editable endfor widbase3 buttons of the bottom widbase3 widget_base widbase row align_center widbase31 widget_button widbase3 value GET uvalue 31 widbase32 widget_button widbase3 value Help uvalue 32 widbase33 widget_button widbase3 value DONE uvalue 33 execution of the base window and of sub window widget_control widbase realize xmanager wid_var widbase return end file_comments Procedure called by xmanager when we press a button of the first widget created by par xncdf_lec param EVENT A structure caracterising the event type which arrive at the widget number 1 uses resultat infovariable motcle version Id: xncdf_lec pro 150 2006 08 09 10:12:54Z navarro PRO xncdf_lec_event event compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar What is the type of event widget_control event id get_uvalue uval case on the type of event case uval of 1:BEGIN We want to read an other file widget_control event id get_value nom We recuperate the name widget_control event top destroy We shut the widget ncdf_close cdfid We shut the wrong file which has been opened We call back xncdf_lec res xncdf_lec nom 0 ATT mcatt COUNT mccount OFFSET mcoffset IODIR mciodir SHIFT mcshift STRIDE mcstride VAR mcvar return END 2:BEGIN A variable is selected varid event index We recuperat its number in the file Netcdf varcontient ncdf_varinq cdfid varid wid_var event top We call the program which launch the second widget See sooner END 3:BEGIN button done widget_control event top destroy We delete the widget ncdf_close cdfid We shut the file END ELSE: endcase return end"); 248 248 a[246] = new Array("./ToBeReviewed/MATRICE/colle.html", "colle.pro", "", " file_comments This concatenation function exist in IDL so long as we do not try to stick with a dimension superior or equal at 4 categories utilities param a0 in required param a1 in required param a2 in required param a3 in required param a4 in required param a5 in required param a6 in required param a7 in required param a8 in required param a9 in required param a10 in required param a11 in required param a12 in required param a13 in required param a14 in required param a15 in required param a16 in required param a17 in required param a18 in required param a19 in required param a20 in required keyword SAUVE mot cle qui force a sauvegarder le tableau de pointeur et les tableaux a coller returns res matrice resultat examples IDL print colle replicate 1 2 2 2 indgen 2 2 2 2 1 1 1 1 0 1 2 3 1 1 1 1 4 5 6 7 history Sebastien Masson smasson lodyc jussieu fr 13 1 98 version Id: colle pro 142 2006 07 21 12:47:49Z navarro FUNCTION colle a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 SAUVE sauve compile_opt idl2 strictarrsubs res 1 We put in place ptrtab and direc in function of input arguments case 1 of n_params EQ 2:BEGIN case where we directly give the pointer array ptrtab a0 direc a1 if NOT keyword_set sauve then undefine a0 on recuperate the number of array to be pasted nbretab size ptrtab 1 end n_params GT 2:BEGIN on recuperate the number of array to be pasted nbretab n_params 1 bidon execute direc a strtrim n_params 1 2 We write the pointer array whose each element point on an array ptrtab ptrarr nbretab allocate_heap for n 0 nbretab 1 do begin bidon execute ptrtab n a strtrim n 2 if NOT keyword_set sauve then bidon execute undefine a strtrim n 2 endfor sauve 0 end ELSE: endcase case on the direct s value case direc of 1:BEGIN we paste following the dimension 1 res ptrtab 0 if NOT keyword_set sauve then ptr_free ptrtab 0 FOR n 1 nbretab 1 DO BEGIN res temporary res ptrtab n if NOT keyword_set sauve then ptr_free ptrtab n ENDFOR END 2:BEGIN we paste following the dimension 2 res ptrtab 0 if NOT keyword_set sauve then ptr_free ptrtab 0 FOR n 1 nbretab 1 DO BEGIN res temporary res ptrtab n if NOT keyword_set sauve then ptr_free ptrtab n ENDFOR END 3:BEGIN we paste following the dimension 3 res ptrtab 0 if NOT keyword_set sauve then ptr_free ptrtab 0 FOR n 1 nbretab 1 DO BEGIN res temporary res ptrtab n if NOT keyword_set sauve then ptr_free ptrtab n ENDFOR END ELSE:BEGIN We transpose res in order to put the dimension to be pasted number 1 To this we contain the permuter vector which give the place that dimension in the transposed matrix must take siz size ptrtab 0 0 if siz LT direc then ptrtab 0 reform ptrtab 0 size ptrtab 0 1:siz replicate 1 direc siz over permute indgen size ptrtab 0 0 permute 0 direc 1 permute direc 1 0 res transpose ptrtab 0 permute if NOT keyword_set sauve then ptr_free ptrtab 0 FOR n 1 nbretab 1 DO BEGIN we paste following the dimension 1on colle suivant la dimension 1 if size ptrtab n 0 LT direc then ptrtab n reform ptrtab n size ptrtab n 1:siz replicate 1 direc siz res temporary res transpose ptrtab n permute if NOT keyword_set sauve then ptr_free ptrtab n ENDFOR res transpose temporary res permute END ENDCASE if NOT keyword_set sauve then undefine ptrtab sortie: return res END "); 249 249 a[247] = new Array("./ToBeReviewed/PLOTS/DESSINE/bar_plot.html", "bar_plot.pro", "", " file_comments Create a bar graph or overplot on an existing one categories Graphics param Values in required A vector containing the values to be represented by the bars Each element in VALUES corresponds to a single bar in the output keyword BASELINES A vector the same size as VALUES that contains the base value associated with each bar If not specified a base value of zero is used for all bars keyword COLORS A vector the same size as VALUES containing the color index to be used for each bar If not specified the colors are selected based on spacing the color indices as widely as possible within the available colors specified by D N_COLORS keyword BARNAMES A string array containing one string label per bar If the bars are vertical the labels are placed beneath them If horizontal rotated bars are specified the labels are placed to the left of the bars keyword TITLE A string containing the main title to for the bar plot keyword XTITLE A string containing the title for the X axis keyword YTITLE A string containing the title for the Y axis keyword BASERANGE A floating point scalar in the range 0 0 to 1 0 that determines the fraction of the total available plotting area in the direction perpendicular to the bars to be used If not specified the full available area is used keyword BARWIDTH A floating point value that specifies the width of the bars in units of nominal bar width The nominal bar width is computed so that all the bars and the space between them set by default to 20 of the width of the bars will fill the available space optionally controlled with the BASERANGE keyword keyword BARSPACE A scalar that specifies in units of nominal bar width the spacing between bars For example if BARSPACE is 1 0 then all bars will have one bar width of space between them If not specified the bars are spaced apart by 20 of the bar width keyword BAROFFSET A scalar that specifies the offset to be applied to the first bar in units of nominal bar width This keyword allows for example different groups of bars to be overplotted on the same graph If not specified the default offset is equal to BARSPACE keyword OUTLINE If set this keyword specifies that an outline should be drawn around each bar keyword OVERPLOT If set this keyword specifies that the bar plot should be overplotted on an existing graph keyword BACKGROUND A scalar that specifies the color index to be used for the background color By default the normal IDL background color is used keyword ROTATE If set this keyword indicates that horizontal rather than vertical bars should be drawn The bases of horizontal bars are on the left Y axis and the bars extend to the right examples By using the overplotting capability it is relatively easy to create stacked bar charts or different groups of bars on the same graph For example if ARRAY is a two dimensional array of 5 columns and 8 rows it is natural to make a plot with 5 bars each of which is a stacked composite of 8 sections First create a 2D COLORS array equal in size to ARRAY that has identical color index values across each row to ensure that the same item is represented by the same color in all bars With ARRAYS and COLORS defined the following code fragment illustrates the creation of stacked bars note that the number of rows and columns is arbitrary : Y RANGE 0 ymax Scale range to accommodate the total bar lengths BASE INTARR NROWS FOR I 0 NROWS 1 DO BEGIN BAR_PLOT ARRAY I COLORS COLORS I BASELINES BASE BARWIDTH 0 75 BARSPACE 0 25 OVER I GT 0 BASE BASE ARRAY I ENDFOR To plot each row of ARRAY as a clustered group of bars within the same graph use the BASERANGE keyword to restrict the available plotting region for each set of bars The sample code fragment below illustrates this method: FOR I 0 NROWS 1 DO BAR_PLOT ARRAY I COLORS COLORVECT BARWIDTH 0 8 BARSPACE 0 2 BAROFFSET I 1 0 BARSPACE NCOLS OVER I GT 0 BASERANGE 0 19 where NCOLS is the number of columns in ARRAY and COLORVECT is a vector containing the color indices to be used for each group of bars In this example each group uses the same set of colors but this could easily be changed history August 1990 T J Armitage RSI initial programming Replacement for PLOTBAR and OPLOTBAR routines written by William Thompson September 1990 Steve Richards RSI changed defaults to improve the appearance of the bar plots in the default mode Included spacing the bars slightly Id: bar_plot pro 142 2006 07 21 12:47:49Z navarro pro bar_plot values baselines baselines colors colors barnames barnames title title xtitle xtitle ytitle ytitle baserange baserange barwidth barwidth barspace barspace baroffset baroffset outline outline overplot overplot background background rotate rotate _EXTRA ex compile_opt idl2 strictarrsubs if n_params d eq 0 then begin Print call return if no parameters print bar_test values baselines baselines colors colors barnames barnames print title title xtitle xtitle ytitle ytitle baserange baserange print barwidth barwidth barspace barspace baroffset baroffset print outline outline overplot overplot background background print rotate rotate return endif nbars n_elements values Determine number of bars Baselines bars extend from baselines through values default 0 if not keyword_set baselines then baselines intarr nbars Default colors spaced evenly in current color table if not keyword_set colors then colors fix d n_colors float nbars indgen nbars 0 5 Labels for the individual bars none by default if not keyword_set barnames then barnames strarr nbars Main title if not keyword_set title then title Centered title under X axis if not keyword_set xtitle then xtitle Title for Y axis if not keyword_set ytitle then ytitle Fraction 0 1 of full X range to use if not keyword_set baserange then baserange 1 0 Space betw bars taken from nominal bar widths default is none If not keyword_set barspace then barspace 0 2 Bar width scaling factor relative to nominal if not keyword_set barwidth then barwidth 1 0 barspace barspace nbars Initial X offset in scaled bar widths default is none if not keyword_set baroffset then baroffset barspace barwidth Outline of bars default is none outline keyword_set outline Overplot do not erase the existing display default is to create new plot overplot keyword_set overplot Background color index defaults to 0 usually black if not specified if not keyword_set background then background 0 Rotate make horizontal bars default is vertical bars rotate keyword_set rotate mnB MIN baselines MAX mxB NAN mnV MIN values MAX mxV NAN range mnB mxV Maximum of bases values if rotate then begin Horizontal bars if x range 0 eq 0 and x range 1 eq 0 Determine range for X axis then xrange range else xrange x range Or use range specified if y range 0 eq 0 and y range 1 eq 0 Plot will calculate then defaults for X but not yrange 0 n_elements values for Ys so fill in here else yrange y range Axis perpend to bars yticks 1 Suppress ticks in plot ytickname strarr 2 xticks 0 xtickname strarr 1 endif else begin Vertical bars if y range 0 eq 0 and y range 1 eq 0 Determine range for Y axis then yrange range else yrange y range Or use range specified xrange x range Axis perpend to bars xticks 1 Suppress ticks in plot xtickname strarr 2 yticks 0 ytickname strarr 1 endelse if overplot eq 0 then Create new plot no data plot values nodata title title xtitle xtitle ytitle ytitle noerase overplot xrange xrange yrange yrange xticks xticks xtickname xtickname yticks yticks ytickname ytickname xstyle 1 ystyle 1 data background background _EXTRA ex if rotate then begin Horizontal bars base_win y window Window range in Y scal_fact x s Scaling factors tick_scal_fact y s Tick scaling factors endif else begin Vertical bars base_win x window Window range in X scal_fact y s Scaling factors tick_scal_fact x s Tick scaling factors endelse winrange baserange base_win 1 base_win 0 Normal window range barsize barwidth winrange nbars Normal bar width winoffset base_win 0 baroffset barsize Normal first offset bases scal_fact 0 scal_fact 1 baselines Baselines in normal coor normal scal_fact 0 scal_fact 1 values Values in normal coor barstart indgen nbars barsize barspace winrange nbars Coor at left edges tickv winoffset barstart 0 5 barsize Tick coor centered for i 0 nbars 1 do begin Draw the bars width winoffset barstart i barstart i Compute bar width barstart i barsize barstart i barsize length bases i normal i normal i bases i Compute bar length if rotate then begin Horizontal bars x length X axis is length axis y width Y axis is width axis endif else begin Vertical bars x width X axis is width axis y length Y axis is length axis endelse polyfill x y color colors i normal Polyfill with color if outline then plots x y normal Outline using p color endfor tickv tickv tick_scal_fact 0 tick_scal_fact 1 Locations of the ticks if rotate then Label the bars Y axis axis yaxis 0 ystyle 1 yticks nbars 1 ytickv tickv ytickname barnames yticklen 0 0 else Label the bars X axis axis xaxis 0 xstyle 1 xticks nbars 1 xtickv tickv xtickname barnames xticklen 0 0 return end"); … … 288 288 a[286] = new Array("./ToBeReviewed/PLOTS/style.html", "style.pro", "", " file_comments Choose the way to trace isolines categories graphic param LABSTYLE in required Number to which the style of drawing choosen refer to param LEVEL_Z2D in required Vector containing values of isolignes to be traced param LINESTYLE out Vector used to define the isocontour s style Comment: remenber: Index Linestyle 0 Solid 1 Dotted 2 Dashed 3 Dash Dot 4 Dash Dot Dot Dot 5 Long Dashes param THICK out Vector defining the thick of the isoline history Sebastien Masson smasson lodyc jussieu fr version Id: style pro 142 2006 07 21 12:47:49Z navarro pro style labstyle level_z2d linestyle thick compile_opt idl2 strictarrsubs case labstyle of 0: begin series: Two thin continuous lines one boldface continuous line thick 1 1 2 linestyle 0 return end 1: begin series: Before the middle of levels: thin dash Then thin continuous trait If the middle of the drawing is drawn it is in boldface continuous trait impair n_elements level_z2d 2 fix n_elements level_z2d 2 a replicate 0 fix n_elements level_z2d 2 b replicate 1 fix n_elements level_z2d 2 c replicate 2 fix n_elements level_z2d 2 if impair then begin thick b 2 b linestyle c 0 a endif else begin thick 0 linestyle c a endelse return end 2: begin series: Before the sill defined by answering to a question : thin dash Then thin continuous trait If the sill is drawn it is in boldface continuous trait seuil xquestion Quelle est la limite tirets trait continu 0 seuil float seuil rien where level_z2d lt seuil n a replicate 0 n_elements level_z2d n c replicate 2 n if seuil eq level_z2d n then begin thick replicate 1 n 2 replicate 1 n_elements level_z2d 1 n linestyle c a endif else begin thick 0 linestyle c a endelse return end 3: begin n n_elements level_z2d seuil level_z2d 1 n 2 thick intarr n thick indgen n 4 4 1 thick indgen n 4 4 1 1 thick indgen n 4 4 2 2 thick indgen n 4 4 3 1 linestyle intarr n linestyle indgen n 4 4 3 linestyle indgen n 4 4 1 0 linestyle indgen n 4 4 2 0 linestyle indgen n 4 4 3 0 labels intarr n labels indgen n 2 2 1 labels n 2 0 return end 4: begin Boldface continuous trait seuil 1 e 6 thick replicate 5 n_elements level_z2d linestyle 0 rien where abs level_z2d max abs level_z2d LT seuil if rien 0 NE 1 then thick rien 0 3 end else: begin ras report Le numero de labstyle demande n existe pas stop end endcase return end"); 289 289 a[287] = new Array("./ToBeReviewed/PLOTS/symbols.html", "symbols.pro", "", " file_comments Create custom plotting symbols param NSYM in required 1 open circle 2 filled circle 3 arrow pointing right 4 arrow pointing left 5 arrow pointing up 6 arrow pointing down 7 arrow pointing up and left 45 degrees 8 arrow pointing down and left 9 arrow pointing down and right 10 arrow pointing up and right 11 through 18 are bold versions of 3 through 10 19 horizontal line 20 box 21 diamond 22 triangle 30 filled box 31 filled diamond 32 filled triangle param SCALE in required size of symbols keyword COLOR color of symbols restrictions The desired symbol is stored in the user buffer and will be plotted if P PSYM 8 history Jeff Bennett U of Colorado 198 version Id: symbols pro 142 2006 07 21 12:47:49Z navarro pro symbols nsym scale color col compile_opt idl2 strictarrsubs on_error 2 fill 0 case 1 of nsym le 2 : begin circles for large scales increase number of points for res if scale ge 4 then a findgen 25 else a findgen 13 a a 3 14159 6 0 12 or 24 pi 6 xarr cos a yarr sin a if nsym eq 2 then fill 1 end nsym ge 3 nsym le 18 : begin arrow heads xarr fltarr 5 yarr xarr xarr 1 10 xarr 2 6 yarr 2 2 nsyms greater than 10 should be filled arrows if nsym gt 10 then begin xarr 3 6 xarr 4 10 yarr 3 2 fill 1 endif else begin xarr 3 10 xarr 4 6 yarr 4 2 endelse case 1 of nsym eq 3 : dummy 0b nsym eq 4 : xarr 1 xarr nsym eq 11 nsym eq 12 : begin xarr extrac xarr 0 11 yarr extrac yarr 0 11 yarr 6 0 5 xarr 7 6 yarr 7 0 5 xarr 8 6 yarr 8 0 5 yarr 9 0 5 if nsym eq 12 then begin rotation xarr yarr 180 nx ny xarr nx yarr ny endif end nsym eq 5 nsym eq 13 : begin temp xarr xarr yarr yarr temp end nsym eq 6 nsym eq 14 : begin temp 1 xarr xarr yarr yarr temp end nsym ge 7 nsym le 10 nsym ge 15 nsym le 18 : begin case 1 of nsym eq 7 nsym eq 15 : deg 45 nsym eq 8 nsym eq 16 : deg 135 nsym eq 9 nsym eq 17 : deg 225 nsym eq 10 nsym eq 18 : deg 315 endcase rotation xarr yarr deg nx ny xarr nx yarr ny end end nsym ge 7 endcase end nsym between 3 and 18 nsym eq 20 nsym eq 21 nsym eq 30 nsym eq 31 : begin xarr fltarr 5 3 yarr xarr xarr 1 3 xarr 2 3 yarr 2 3 yarr 3 3 if nsym eq 21 nsym eq 31 then begin rotation xarr yarr 45 nx ny nx 0 70 nx shrink the x direction xarr nx yarr ny endif if nsym ge 30 then fill 1 end nsym 20 21 30 31 nsym eq 22 nsym eq 32 : begin side length 6 0 at centroid yarr fltarr 4 6 4 xarr fltarr 4 6 2 xarr 1 6 2 xarr 2 0 yarr 2 6 sqrt 3 2 6 4 if nsym eq 32 then fill 1 end else: begin xarr fltarr 2 1 yarr xarr 0 xarr 1 1 end endcase xarr xarr scale yarr yarr scale set symbol buffer if keyword_set col then usersym xarr yarr fill fill color col else usersym xarr yarr fill fill return end"); 290 a[288] = new Array("./ToBeReviewed/POSTSCRIPT/calibre.html", "calibre.pro", "", " NAME: calibre PURPOSE:a partir d un rapport d aspect et des valeurs en ligne de characteres des differentes marges calcul posfenetre et posbar qui servent a placer le dessin et la barre de couleur grace a p position sur une feuille ou sur une sortie ecran dont la fenetre a les memes proportions CATEGORY: positionnement du graphe CALLING SEQUENCE: calibre rapportyx marge margebar smalldraw posfenetre posbar INPUTS: rapportyx: rapport d echelle entre la longueur de l axe des y et celle des x par ex pour une carte xy rapportyx lat2 lat1 lon2 lon1 marge: vecteur de 4 elements contenant la taille des marges a gauche a droite en bas et en haut devant entourer le graphe tout est mesure en lignes de characteres margebar: vecteur de 4 elements contenant la taille des marges a gauche a droite en bas et ATTENTION le dernier element est cette fois ci la position de coin en haut a droite devant entourer la barre de couleur tout est mesure en lignes de characteres smalldraw: 2 possiblites un vecteur de 4 elements donnant en portrait ou en landscape la position de cadre ds lequel doit rentrer le dessin cette position est donne par les coordonnes des 2 coins du cadre: en bas a gauche et en haut a droite elle s exprime tjs pour un postscript ou une sortie ecran en cm l origine etant le coin en bas a gauche un vecteur de 3 elements donnant le nombre de colonnes a faire de le dessin le nombre de lignes et enfin le numero de la case que doit occuper le dessin cf matlab par ex pour faire 6 dessin en 2 colonnes et 3 lignes et occuper la 4 eme case small 2 3 4 KEYWORD PARAMETERS: REMPLI:oblige le dessin a occuper l espace maximum definit par smalldraw sans resperter le rapport y sur x YXASPECT: force le rapport y sur x a prendre la valeur rapportyx yxaspect ce mot cle est utile ds deux cas: 1 yxaspect 1 : oblige rapportyx a etre bien respecte sinon calibre se reserve le droit de changer un peu celui ci dans le cas ou le rapport d aspect de small dessin est trop different de celui de smalldraw 2 yxaspect n : multiplie par n le rapport d aspect donne par defaut par ex ds plt rapportyx est calcule pour que le repere soit orthonorme pour avoir un repere ou l axe des y est 2 fois plus dilate que celui des y YXASPECT 2 PORTRAIT et LANDSCAPE: mots cles plus utilises mais tjs fonctionnels OUTPUTS: posfenetre: un vecteur de 4 elements contenant la position de cadre contenant les legendes le graphe en coordonnes normalises Rq: pour positionner le dessin il faut apres l appelle de calibre faire p position posfenetre posbar: cf posfentre mais pour la barre de couleur meme remarque pour positionner la barre de couleur p position posbar COMMON BLOCKS: common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY: Sebastien Masson smasson lodyc jussieu fr 11 12 98 pro calibre rapportyx marge margebar smalldraw posfenetre posbar REMPLI rempli YXASPECT yxaspect PORTRAIT portrait LANDSCAPE lanscape _extra ex compile_opt idl2 strictarrsubs cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 pour key_performance if keyword_set portrait then key_portrait 1 if keyword_set landscape then key_portrait 0 if keyword_set yxaspect then begin rapportyx rapportyx yxaspect test2 0 endif else begin yxaspect 1 test2 1 ENDELSE mipgsz min page_size max mapgsz choix de Landscape ou Portrait if n_elements key_portrait eq 0 then begin if rapportyx ge 1 then key_portrait 1 if rapportyx lt 1 then key_portrait 0 endif si smalldraw est compte comme ds matlab if n_elements smalldraw EQ 3 then begin if n_elements page_margins EQ 0 then page_margins 1 1 1 1 smalldraw long smalldraw nbrecol smalldraw 0 nbrelig smalldraw 1 numero smalldraw 2 1 numlig numero nbrecol numcol numero numlig nbrecol bas mipgsz key_portrait mapgsz 1 key_portrait cote mapgsz key_portrait mipgsz 1 key_portrait poscol page_margins 0 findgen nbrecol 1 1 bas page_margins 0 page_margins 1 nbrecol poslig cote page_margins 3 findgen nbrelig 1 1 cote page_margins 2 page_margins 3 nbrelig smalldraw poscol numcol poslig numlig 1 poscol numcol 1 poslig numlig endif determination de la taille des characteres p charsize nombre_de_mots_ds_titre 60 p charsize 1 smalldraw 2 smalldraw 0 d x_px_cm nombre_de_mots_ds_titre d y_ch_size if p charsize gt 1 then p charsize 1 transfert de marge en cm cm 1 d x_px_cm marge 1 marge d y_ch_size p charsize cm margebar 1 margebar d y_ch_size p charsize cm definition de la portion de feuille ou on dessine if key_portrait eq 0 then begin big smalldraw 2 smalldraw 0 small smalldraw 3 smalldraw 1 endif else begin small smalldraw 2 smalldraw 0 big smalldraw 3 smalldraw 1 endelse if key_portrait eq 0 then rapportmax 1 small marge 3 marge 1 big marge 2 marge 0 else rapportmax 1 small marge 2 marge 0 big marge 3 marge 1 si yxaspect n est pas specifie on modifie la valeur de rapportyx pour que ca colle un peu plus aux proportions de la feuille if rapportyx le rapportmax then begin if test2 then begin rap 1 rapportmax rapportyx if rap ge 5 and rap lt 6 then rapportyx rapportyx 1 5 if rap ge 6 and rap lt 7 then rapportyx rapportyx 2 if rap ge 7 and rap lt 8 then rapportyx rapportyx 2 5 if rap ge 8 then rapportyx rapportyx 3 endif endif else begin if test2 then begin rap 1 rapportmax rapportyx if rap lt 1 5 and rap ge 1 6 then rapportyx rapportyx 1 5 if rap lt 1 6 and rap ge 1 7 then rapportyx rapportyx 2 if rap lt 1 7 and rap ge 1 8 then rapportyx rapportyx 2 5 if rap lt 1 8 then rapportyx rapportyx 3 endif endelse dans le cas ou on fait un Landscape: if key_portrait eq 0 then begin if keyword_set rempli then begin xs big ys small endif else begin if rapportyx le rapportmax then begin xs big ys 1 big marge 0 marge 1 rapportyx marge 2 marge 3 if ys gt small then begin xs 1 small marge 2 marge 3 rapportyx marge 0 marge 1 ys small endif endif else begin xs 1 small marge 2 marge 3 rapportyx marge 0 marge 1 ys small if xs gt big then begin xs big ys 1 big marge 0 marge 1 rapportyx marge 2 marge 3 endif endelse endelse xoff 1 small ys 2 smalldraw 1 yoff 1 big xs 2 xs mapgsz smalldraw 2 a 1 mapgsz yoff mapgsz b 1 xoff mipgsz c a 1 xs mapgsz d b 1 ys mipgsz endif dans le cas ou on fait unportrait: else begin if keyword_set rempli then begin xs small ys big endif else begin if rapportyx le rapportmax then begin xs small ys 1 small marge 0 marge 1 rapportyx marge 2 marge 3 if ys gt big then begin xs 1 big marge 2 marge 3 rapportyx marge 0 marge 1 ys big endif endif else begin xs 1 big marge 2 marge 3 rapportyx marge 0 marge 1 ys big if xs gt small then begin xs small ys 1 small marge 0 marge 1 rapportyx marge 2 marge 3 endif endelse endelse xoff 1 small xs 2 smalldraw 0 yoff 1 big ys 2 smalldraw 1 a 1 xoff mipgsz b 1 yoff mapgsz c a 1 xs mipgsz d b 1 ys mapgsz xset xoff yset yoff endelse bas mapgsz 1 key_portrait mipgsz key_portrait cote mipgsz 1 key_portrait mapgsz key_portrait posfenetre a b c d marge 0 bas marge 2 cote marge 1 bas marge 3 cote posbar a b c d margebar 0 bas margebar 2 cote margebar 1 bas ys margebar 3 cote if keyword_set key_performance THEN print temps calibre systime 1 tempsun IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF return end");290 a[288] = new Array("./ToBeReviewed/POSTSCRIPT/calibre.html", "calibre.pro", "", " file_comments From a rapport of aspect and values in line of character of different margins it calculate POSFENETRE and POSBAR which serve to place the drawing and the color bar thanks to p position on a leaf or a screen output whose the window has the same proportion categories graphics param RAPPORTYX in required Scale rapport between the lenght of the y axis and the x one For example for an xy map: RAPPORTYX lat2 lat1 lon2 lon1 param MARGE in required Vector made of 4 elements containing the size of the left right up and bottom margin having to surround the graph All is measured in lines of characters param MARGEBAR in required Vector made of 4 elements containing the size of the left right and bottom margin and BEWARE the last element is this time the positio of the right up corner having to surround the color bar All is measured in lines of characters param SMALLDRAW in required 2 possibilities: It is vector made of 4 elements giving in portrait or landscape the position of the frame in which the drawing must go in This position is given by coordinates of the 2 corners of the frame: in the left bottom and the right up It is always for a postscript or a screen output express in cm the origin being the left bottom corner It is a vector made of 3 elements giving the number of column to be done in the drawing the number of line and the number of the case the number have to occupy see matlab For example to do 6 drawing in 3 columns and 2 lines and occupy the 4th case small 2 3 4 keyword REMPLI Force the drawing to occupy the biggest possible place defined by SMALLDRAW without respect the rapport y on x keyword YXASPECT Force the rapport y on x to take the value RAPPORTYX YXASPECT This keyword can be used in 2 cases: 1 YXASPECT 1 : force RAPPORTYX to be respected otherwise Calibre take the initiative to change it a little inthe case of the aspect rapport of SMALL is too different of the one of SMALLDRAW 2 YXASPECT n : multiply by n the aspect rapport given by default For example in plt RAPPORTYX is calculated to the reference be orthonormal to have a reference where the y axis is 2 time bigger than the x one YXASPECT 2 keyword PORTRAIT Force the page or the window to be in standing position keyword LANDSCAPE Force the page or the window on the screen to be in lenthened position keyword _EXTRA Used to pass your keywords param POSFENETRE It is a vector made of 4 elements containing the position of the frame containing captions the graph in normalized coordinates Comment: to position the drawing we have to do p position POSFENETRE after the call of calibre param POSBAR See POSFENTRE but for the color bar Same comment to position the color bar p position POSBAR uses common pro history Sebastien Masson smasson lodyc jussieu fr 11 12 98 version Id: calibre pro 150 2006 08 09 10:12:54Z navarro pro calibre rapportyx marge margebar smalldraw posfenetre posbar REMPLI rempli YXASPECT yxaspect PORTRAIT portrait LANDSCAPE lanscape _extra ex compile_opt idl2 strictarrsubs cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 For key_performance if keyword_set portrait then key_portrait 1 if keyword_set landscape then key_portrait 0 if keyword_set yxaspect then begin rapportyx rapportyx yxaspect test2 0 endif else begin yxaspect 1 test2 1 ENDELSE mipgsz min page_size max mapgsz choice of Landscape or Portrait if n_elements key_portrait eq 0 then begin if rapportyx ge 1 then key_portrait 1 if rapportyx lt 1 then key_portrait 0 endif If smalldraw is count like in matlab if n_elements smalldraw EQ 3 then begin if n_elements page_margins EQ 0 then page_margins 1 1 1 1 smalldraw long smalldraw nbrecol smalldraw 0 nbrelig smalldraw 1 numero smalldraw 2 1 numlig numero nbrecol numcol numero numlig nbrecol bas mipgsz key_portrait mapgsz 1 key_portrait cote mapgsz key_portrait mipgsz 1 key_portrait poscol page_margins 0 findgen nbrecol 1 1 bas page_margins 0 page_margins 1 nbrecol poslig cote page_margins 3 findgen nbrelig 1 1 cote page_margins 2 page_margins 3 nbrelig smalldraw poscol numcol poslig numlig 1 poscol numcol 1 poslig numlig endif determination of the size of characters p charsize nombre_de_mots_ds_titre 60 p charsize 1 smalldraw 2 smalldraw 0 d x_px_cm nombre_de_mots_ds_titre d y_ch_size if p charsize gt 1 then p charsize 1 transfert of margin in cm cm 1 d x_px_cm marge 1 marge d y_ch_size p charsize cm margebar 1 margebar d y_ch_size p charsize cm definition of the part of the leaf where we draw if key_portrait eq 0 then begin big smalldraw 2 smalldraw 0 small smalldraw 3 smalldraw 1 endif else begin small smalldraw 2 smalldraw 0 big smalldraw 3 smalldraw 1 endelse if key_portrait eq 0 then rapportmax 1 small marge 3 marge 1 big marge 2 marge 0 else rapportmax 1 small marge 2 marge 0 big marge 3 marge 1 If YXASPECT is not specified we modify the value of RAPPORTYX to it match better with the leaf s proportions if rapportyx le rapportmax then begin if test2 then begin rap 1 rapportmax rapportyx if rap ge 5 and rap lt 6 then rapportyx rapportyx 1 5 if rap ge 6 and rap lt 7 then rapportyx rapportyx 2 if rap ge 7 and rap lt 8 then rapportyx rapportyx 2 5 if rap ge 8 then rapportyx rapportyx 3 endif endif else begin if test2 then begin rap 1 rapportmax rapportyx if rap lt 1 5 and rap ge 1 6 then rapportyx rapportyx 1 5 if rap lt 1 6 and rap ge 1 7 then rapportyx rapportyx 2 if rap lt 1 7 and rap ge 1 8 then rapportyx rapportyx 2 5 if rap lt 1 8 then rapportyx rapportyx 3 endif endelse in the case where we do a Landscape: if key_portrait eq 0 then begin if keyword_set rempli then begin xs big ys small endif else begin if rapportyx le rapportmax then begin xs big ys 1 big marge 0 marge 1 rapportyx marge 2 marge 3 if ys gt small then begin xs 1 small marge 2 marge 3 rapportyx marge 0 marge 1 ys small endif endif else begin xs 1 small marge 2 marge 3 rapportyx marge 0 marge 1 ys small if xs gt big then begin xs big ys 1 big marge 0 marge 1 rapportyx marge 2 marge 3 endif endelse endelse xoff 1 small ys 2 smalldraw 1 yoff 1 big xs 2 xs mapgsz smalldraw 2 a 1 mapgsz yoff mapgsz b 1 xoff mipgsz c a 1 xs mapgsz d b 1 ys mipgsz endif In the case where we do a portrait: else begin if keyword_set rempli then begin xs small ys big endif else begin if rapportyx le rapportmax then begin xs small ys 1 small marge 0 marge 1 rapportyx marge 2 marge 3 if ys gt big then begin xs 1 big marge 2 marge 3 rapportyx marge 0 marge 1 ys big endif endif else begin xs 1 big marge 2 marge 3 rapportyx marge 0 marge 1 ys big if xs gt small then begin xs small ys 1 small marge 0 marge 1 rapportyx marge 2 marge 3 endif endelse endelse xoff 1 small xs 2 smalldraw 0 yoff 1 big ys 2 smalldraw 1 a 1 xoff mipgsz b 1 yoff mapgsz c a 1 xs mipgsz d b 1 ys mapgsz xset xoff yset yoff endelse bas mapgsz 1 key_portrait mipgsz key_portrait cote mipgsz 1 key_portrait mapgsz key_portrait posfenetre a b c d marge 0 bas marge 2 cote marge 1 bas marge 3 cote posbar a b c d margebar 0 bas margebar 2 cote margebar 1 bas ys margebar 3 cote if keyword_set key_performance THEN print temps calibre systime 1 tempsun IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF return end"); 291 291 a[289] = new Array("./ToBeReviewed/POSTSCRIPT/chcolps.html", "chcolps.pro", "", "PRO format_colortable_hexa table compile_opt idl2 strictarrsubs tvlct r g b get z strarr 256 y strarr 256 for k 0 255 do z k 00 strtrim string r k format Z 2 for k 0 255 do y k y k strmid z k strlen z k 2 2 for k 0 255 do z k 00 strtrim string g k format Z 2 for k 0 255 do y k y k strmid z k strlen z k 2 2 for k 0 255 do z k 00 strtrim string b k format Z 2 for k 0 255 do y k y k strmid z k strlen z k 2 2 table strlowcase y END PRO build_table tableout Fabrique le bloc de colortable compile_opt idl2 strictarrsubs format_colortable_hexa table tableout strarr 25 tableout 0 COLORTAB def END PRO chcolps n1 n2 file PALIT1 palit1 PALIT2 palit2 Modifie les couleurs d un fichier postscript Creation : G Roullet 1999 recupere les palettes compile_opt idl2 strictarrsubs lct n1 IF keyword_set palit1 THEN palit palit1 tvlct red green blue get lct n2 IF keyword_set palit2 THEN palit palit2 tvlct red1 green1 blue1 get filein file fileout file new openr numin filein get_lun openw numout fileout get_lun ligne nl 0 colortab 0 Scan le fichier WHILE NOT eof numin DO BEGIN readf numin ligne format A nl nl 1 Replace setrgbcolor statements pos strpos ligne setrgbcolor IF pos NE 1 THEN BEGIN r round float strmid ligne pos 18 6 255 g round float strmid ligne pos 12 6 255 b round float strmid ligne pos 6 6 255 ind where r EQ red AND g EQ green AND b EQ blue ind ind 0 IF ind 0 NE 1 THEN BEGIN r1 red1 ind 255 g1 green1 ind 255 b1 blue1 ind 255 color string r1 g1 b1 format 3 F5 3 : X strput ligne color pos 18 ENDIF ELSE BEGIN print erreur ligne : nl dist abs r red abs g green abs b blue ind where dist EQ min dist 0 ind ind 0 print je trouve long r g b print je remplace par red ind green ind blue ind r1 red1 ind 255 g1 green1 ind 255 b1 blue1 ind 255 color string r1 g1 b1 format 3 F5 3 : X strput ligne color pos 18 ENDELSE ENDIF Replace COLORTAB pos strpos ligne COLORTAB IF pos NE 1 THEN BEGIN build_table table n 0 colortab 1 ENDIF IF colortab THEN BEGIN ligne table n n n 1 IF n EQ 24 THEN colortab 0 ENDIF Ecrit le fichier de sorti printf numout ligne format A ENDWHILE close numin close numout free_lun numin free_lun numout spawn gs fileout END "); 292 292 a[290] = new Array("./ToBeReviewed/POSTSCRIPT/ps.html", "ps.pro", "", ""); 293 a[291] = new Array("./ToBeReviewed/STATISTICS/a_correlate2d.html", "a_correlate2d.pro", "", " NAME: A_CORRELATE2d PURPOSE: This function computes the autocorrelation Px K L or autocovariance Rx K L of a sample population X nx ny as a function of the lag K L CATEGORY: Statistics CALLING SEQUENCE: Result a_correlate2d X Lag INPUTS: X: an 2 dimension Array nx ny LAG: 2 element vector in the intervals nx 2 nx 2 ny 2 ny 2 of type integer that specifies the absolute distance s between indexed elements of X KEYWORD PARAMETERS: COVARIANCE: If set to a non zero value the sample autocovariance is computed DOUBLE: If set to a non zero value computations are done in double precision arithmetic EXAMPLE: PROCEDURE: nx k 1 ny l 1 sigma sigma X i j Xmean X i k j l Ymean i 0 j 0 correlation X k l nx 1 ny 1 sigma sigma X i j Xmean 2 i 0 j 0 nx k 1 ny l 1 sigma sigma X i j Xmean Y i k j l Ymean i 0 j 0 covariance X k l nx ny Where Xmean is the mens of the sample population x x 0 0 x 1 0 x nx 1 ny 1 REFERENCE: MODIFICATION HISTORY: 28 2 2000 Sebastien Masson smasson lodyc jussieu fr Based on the A_CORRELATE procedure of IDL FUNCTION Auto_Cov2d X Lag Double Double zero2nan zero2nan compile_opt idl2 strictarrsubs XDim SIZE X dimensions nx XDim 0 ny XDim 1 Sample autocovariance function Xmean TOTAL X Double Double 1 nx ny res TOTAL X 0:nx 1 lag 0 0:ny 1 lag 1 Xmean X lag 0 :nx 1 lag 1 :ny 1 Xmean Double Double if keyword_set zero2nan AND res EQ 0 then res values f_nan RETURN res ENDFUNCTION A_Correlate2d X Lag Covariance Covariance Double Double compile_opt idl2 strictarrsubs Compute the sample autocorrelation or autocovariance of Xt Xt l as a function of the lag l ON_ERROR 2 XDim SIZE X dimensions XNDim SIZE X n_dimensions nx XDim 0 ny XDim 1 if XNDim NE 2 then MESSAGE X array must contain 2 dimensions Check length if nx lt 2 then MESSAGE first dimension of X array must contain 2 or more elements if ny lt 2 then MESSAGE second dimension of X array must contain 2 or more elements if n_elements Lag NE 2 THEN MESSAGE Lag array must contain 2 elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double SIZE X type eq 5 if KEYWORD_SET Covariance eq 0 then begin Compute Autocorrelation Auto Auto_Cov2d X ABS Lag Double Double Auto_Cov2d X 0L 0L Double Double zero2nan endif else begin Compute Autocovariance Auto Auto_Cov2d X ABS Lag Double Double n_elements X endelse if Double eq 0 then RETURN FLOAT Auto else RETURN Auto END");294 a[292] = new Array("./ToBeReviewed/STATISTICS/a_timecorrelate.html", "a_timecorrelate.pro", "", " NAME: A_TIMECORRELATE PURPOSE: Same function as A_CORRELATE but accept array until 4 dimension for input and do the autocorrelation or the autocovariance along the time dimension which must be the last one of the input array This function computes the autocorrelation Px L or autocovariance Rx L of a sample population X as a function of the lag L CATEGORY: Statistics CALLING SEQUENCE: Result a_timecorrelate X Lag INPUTS: X: an Array which last dimension is the time dimension os size n LAG: A scalar or n element vector in the interval n 2 n 2 of type integer that specifies the absolute distance s between indexed elements of X KEYWORD PARAMETERS: COVARIANCE: If set to a non zero value the sample autocovariance is computed DOUBLE: If set to a non zero value computations are done in double precision arithmetic EXAMPLE Define an n element sample population x 3 73 3 67 3 77 3 83 4 67 5 87 6 70 6 97 6 40 5 57 Compute the autocorrelation of X for LAG 3 0 1 3 4 8 lag 3 0 1 3 4 8 result a_correlate x lag The result should be: 0 0146185 1 00000 0 810879 0 0146185 0 325279 0 151684 PROCEDURE: n L 1 sigma X k Xmean X k L Xmean k 0 correlation X L n 1 sigma X k Xmean 2 k 0 n L 1 sigma X k Xmean X k L Xmean k 0 covariance X L n Where Xmean is the Time mean of the sample population x x t 0 x t 1 x t n 1 REFERENCE: INTRODUCTION TO STATISTICAL TIME SERIES Wayne A Fuller ISBN 0 471 28715 6 MODIFICATION HISTORY: 24 2 2000 Sebastien Masson smasson lodyc jussieu fr Based on the A_CORRELATE procedure of IDL FUNCTION TimeAuto_Cov X M nT Double Double zero2nan zero2nan Sample autocovariance function compile_opt idl2 strictarrsubs TimeDim size X n_dimensions Xmean TOTAL X TimeDim Double Double nT if double then one 1 0d ELSE one 1 0 Xmean Xmean replicate one nT M case TimeDim of 1:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 2:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 3:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 4:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double ENDCASE if keyword_set zero2nan then begin zero where res EQ 0 if zero 0 NE 1 then res zero values f_nan endif RETURN res ENDFUNCTION A_TimeCorrelate X Lag COVARIANCE Covariance DOUBLE Double compile_opt idl2 strictarrsubs Compute the sample autocorrelation or autocovariance of Xt Xt l as a function of the lag l ON_ERROR 2 XDim SIZE X dimensions XNDim SIZE X n_dimensions nT XDim XNDim 1 Check length if nT lt 2 then MESSAGE Time axis of X array must contain 2 or more elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double SIZE X type eq 5 if n_elements lag EQ 0 then lag 0 nLag N_ELEMENTS Lag if nLag eq 1 then Lag Lag Create a 1 element vector case XNDim of 1:if Double eq 0 then Auto FLTARR nLag else Auto DBLARR nLag 2:if Double eq 0 then Auto FLTARR XDim 0 nLag else Auto DBLARR XDim 0 nLag 3:if Double eq 0 then Auto FLTARR XDim 0 XDim 1 nLag else Auto DBLARR XDim 0 XDim 1 nLag 4:if Double eq 0 then Auto FLTARR XDim 0 XDim 1 XDim 2 nLag else Auto DBLARR XDim 0 XDim 1 XDim 2 nLag endcase if KEYWORD_SET Covariance eq 0 then begin Compute Autocorrelation for k 0 nLag 1 do case XNDim of 1:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 2:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 3:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 4:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan endcase endif else begin Compute Autocovariance for k 0 nLag 1 do case XNDim of 1:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 2:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 3:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 4:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT endcase endelse if Double eq 0 then RETURN FLOAT Auto else RETURN Auto END");295 a[293] = new Array("./ToBeReviewed/STATISTICS/c_timecorrelate.html", "c_timecorrelate.pro", "", " NAME: C_TIMECORRELATE PURPOSE: This function computes the time cross correlation Pxy L or the time cross covariance between 2 arrays this is some kind of c_correlate but for multidimenstionals arrays as a function of the lag L CATEGORY: Statistics CALLING SEQUENCE: Result c_timecorrelate X Y Lag INPUTS: X: an Array which last dimension is the time dimension of size n float or double Y: an Array which last dimension is the time dimension of size n float or double LAG: A scalar or n element vector in the interval n 2 n 2 of type integer that specifies the absolute distance s between indexed elements of X KEYWORD PARAMETERS: COVARIANCE: If set to a non zero value the sample cross covariance is computed DOUBLE: If set to a non zero value computations are done in double precision arithmetic EXAMPLE Define two n element sample populations x 3 73 3 67 3 77 3 83 4 67 5 87 6 70 6 97 6 40 5 57 y 2 31 2 76 3 02 3 13 3 72 3 88 3 97 4 39 4 34 3 95 Compute the cross correlation of X and Y for LAG 5 0 1 5 6 7 lag 5 0 1 5 6 7 result c_timecorrelate x y lag The result should be: 0 428246 0 914755 0 674547 0 405140 0 403100 0 339685 PROCEDURE: FOR L 0 n L 1 sigma X k Xmean Y k L Ymean k 0 correlation X Y L n 1 n 1 sqrt sigma X k Xmean 2 sigma Y k Ymean 2 k 0 k 0 n L 1 sigma X k Xmean Y k L Ymean k 0 covariance X Y L n FOR L 0 n L 1 sigma X k L Xmean Y k Ymean k 0 correlation X Y L n 1 n 1 sqrt sigma X k Xmean 2 sigma Y k Ymean 2 k 0 k 0 n L 1 sigma X k L Xmean Y k Ymean k 0 covariance X Y L n Where Xmean and Ymean are the time means of the sample populations x x t 0 x t 1 x t n 1 and y y t 0 y t 1 y t n 1 respectively REFERENCE: INTRODUCTION TO STATISTICAL TIME SERIES Wayne A Fuller ISBN 0 471 28715 6 MODIFICATION HISTORY: 01 03 2000 Sebastien Masson smasson lodyc jussieu fr Based on the C_CORRELATE procedure of IDL August 2003 Sebastien Masson update according to the update made in C_CORRELATE by W Biagiotti and available in IDL 5 5 FUNCTION TimeCross_Cov Xd Yd M nT Ndim Double Double ZERO2NAN zero2nan Sample cross covariance function compile_opt hidden case Ndim OF 1:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Double Double 2:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double 3:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double 4:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double ENDCASE if keyword_set zero2nan then begin zero where res EQ 0 if zero 0 NE 1 then res zero values f_nan ENDIF RETURN res ENDFUNCTION C_Timecorrelate X Y Lag Covariance Covariance Double Double Compute the sample cross correlation or cross covariance of Xt Xt l and Yt Yt l as a function of the lag l ON_ERROR 2 xsize SIZE X ysize SIZE Y nt float xsize xsize 0 NDim xsize 0 if total xsize 0:xsize 0 NE ysize 0:ysize 0 NE 0 then MESSAGE X and Y arrays must have the same size and the same dimensions Check length if nt lt 2 then MESSAGE Time dimension of X and Y arrays must contain 2 or more elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double Xsize Xsize 0 1 eq 5 or ysize ysize 0 1 eq 5 if n_elements lag EQ 0 then lag 0 nLag N_ELEMENTS Lag Deviations if double then one 1 0d ELSE one 1 0 Ndim size X n_dimensions Xd TOTAL X Ndim Double Double nT Xd X Xd replicate one nT Yd TOTAL Y Ndim Double Double nT Yd Y Yd replicate one nT if nLag eq 1 then Lag Lag Create a 1 element vector case NDim of 1:if Double eq 0 then Cross FLTARR nLag else Cross DBLARR nLag 2:if Double eq 0 then Cross FLTARR Xsize 1 nLag else Cross DBLARR Xsize 1 nLag 3:if Double eq 0 then Cross FLTARR Xsize 1 Xsize 2 nLag else Cross DBLARR Xsize 1 Xsize 2 nLag 4:if Double eq 0 then Cross FLTARR Xsize 1 Xsize 2 Xsize 3 nLag else Cross DBLARR Xsize 1 Xsize 2 Xsize 3 nLag endcase if KEYWORD_SET Covariance eq 0 then begin Compute Cross Crossation for k 0 nLag 1 do begin if Lag k ge 0 then BEGIN case NDim of 1: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 2: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 3: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 4: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double endcase ENDIF else BEGIN case NDim of 1: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 2: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 3: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 4: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double endcase ENDELSE ENDFOR div sqrt TimeCross_Cov Xd Xd 0L nT Ndim Double Double zero2nan TimeCross_Cov Yd Yd 0L nT Ndim Double Double zero2nan Cross temporary Cross temporary div replicate one nLag endif else begin Compute Cross Covariance for k 0 nLag 1 do begin if Lag k ge 0 then BEGIN case NDim of 1: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 2: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 3: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 4: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT ENDCASE ENDIF else BEGIN case NDim of 1: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 2: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 3: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 4: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT ENDCASE ENDELSE endfor endelse if Double eq 0 then RETURN FLOAT Cross else RETURN Cross END ");293 a[291] = new Array("./ToBeReviewed/STATISTICS/a_correlate2d.html", "a_correlate2d.pro", "", " FUNCTION Auto_Cov2d X Lag Double Double zero2nan zero2nan compile_opt idl2 strictarrsubs XDim SIZE X dimensions nx XDim 0 ny XDim 1 Sample autocovariance function Xmean TOTAL X Double Double 1 nx ny res TOTAL X 0:nx 1 lag 0 0:ny 1 lag 1 Xmean X lag 0 :nx 1 lag 1 :ny 1 Xmean Double Double if keyword_set zero2nan AND res EQ 0 then res values f_nan RETURN res END file_comments This function computes the autocorrelation Px K L or autocovariance Rx K L of a sample population X nx ny as a function of the lag K L categories Statistics param X in required An 2 dimension Array nx ny param LAG in required 2 element vector in the intervals nx 2 nx 2 ny 2 ny 2 of type integer that specifies the absolute distance s between indexed elements of X keyword COVARIANCE If set to a non zero value the sample autocovariance is computed keyword DOUBLE If set to a non zero value computations are done in double precision arithmetic history 28 2 2000 Sebastien Masson smasson lodyc jussieu fr Based on the A_CORRELATE procedure of IDL version Id: a_correlate2d pro 150 2006 08 09 10:12:54Z navarro FUNCTION A_Correlate2d X Lag Covariance Covariance Double Double compile_opt idl2 strictarrsubs Compute the sample autocorrelation or autocovariance of Xt Xt l as a function of the lag l ON_ERROR 2 XDim SIZE X dimensions XNDim SIZE X n_dimensions nx XDim 0 ny XDim 1 if XNDim NE 2 then MESSAGE X array must contain 2 dimensions Check length if nx lt 2 then MESSAGE first dimension of X array must contain 2 or more elements if ny lt 2 then MESSAGE second dimension of X array must contain 2 or more elements if n_elements Lag NE 2 THEN MESSAGE Lag array must contain 2 elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double SIZE X type eq 5 if KEYWORD_SET Covariance eq 0 then begin Compute Autocorrelation Auto Auto_Cov2d X ABS Lag Double Double Auto_Cov2d X 0L 0L Double Double zero2nan endif else begin Compute Autocovariance Auto Auto_Cov2d X ABS Lag Double Double n_elements X endelse if Double eq 0 then RETURN FLOAT Auto else RETURN Auto END"); 294 a[292] = new Array("./ToBeReviewed/STATISTICS/a_timecorrelate.html", "a_timecorrelate.pro", "", "FUNCTION TimeAuto_Cov X M nT Double Double zero2nan zero2nan Sample autocovariance function compile_opt idl2 strictarrsubs TimeDim size X n_dimensions Xmean TOTAL X TimeDim Double Double nT if double then one 1 0d ELSE one 1 0 Xmean Xmean replicate one nT M case TimeDim of 1:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 2:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 3:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double 4:res TOTAL X 0:nT M 1L Xmean X M:nT 1L Xmean TimeDim Double Double ENDCASE if keyword_set zero2nan then begin zero where res EQ 0 if zero 0 NE 1 then res zero values f_nan endif RETURN res END file_comments Same function as A_CORRELATE but accept array until 4 dimension for input and do the autocorrelation or the autocovariance along the time dimension which must be the last one of the input array This function computes the autocorrelation Px L or autocovariance Rx L of a sample population X as a function of the lag L categories Statistics param X in required An Array which last dimension is the time dimension os size n param LAG in required A scalar or n element vector in the interval n 2 n 2 of type integer that specifies the absolute distance s between indexed elements of X keyword COVARIANCE If set to a non zero value the sample autocovariance is computed keyword DOUBLE If set to a non zero value computations are done in double precision arithmetic examples Define an n element sample population x 3 73 3 67 3 77 3 83 4 67 5 87 6 70 6 97 6 40 5 57 Compute the autocorrelation of X for LAG 3 0 1 3 4 8 lag 3 0 1 3 4 8 result a_correlate x lag The result should be: 0 0146185 1 00000 0 810879 0 0146185 0 325279 0 151684 history 24 2 2000 Sebastien Masson smasson lodyc jussieu fr Based on the A_CORRELATE procedure of IDL INTRODUCTION TO STATISTICAL TIME SERIES Wayne A Fuller ISBN 0 471 28715 6 version Id: a_timecorrelate pro 150 2006 08 09 10:12:54Z navarro FUNCTION A_TimeCorrelate X Lag COVARIANCE Covariance DOUBLE Double compile_opt idl2 strictarrsubs Compute the sample autocorrelation or autocovariance of Xt Xt l as a function of the lag l ON_ERROR 2 XDim SIZE X dimensions XNDim SIZE X n_dimensions nT XDim XNDim 1 Check length if nT lt 2 then MESSAGE Time axis of X array must contain 2 or more elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double SIZE X type eq 5 if n_elements lag EQ 0 then lag 0 nLag N_ELEMENTS Lag if nLag eq 1 then Lag Lag Create a 1 element vector case XNDim of 1:if Double eq 0 then Auto FLTARR nLag else Auto DBLARR nLag 2:if Double eq 0 then Auto FLTARR XDim 0 nLag else Auto DBLARR XDim 0 nLag 3:if Double eq 0 then Auto FLTARR XDim 0 XDim 1 nLag else Auto DBLARR XDim 0 XDim 1 nLag 4:if Double eq 0 then Auto FLTARR XDim 0 XDim 1 XDim 2 nLag else Auto DBLARR XDim 0 XDim 1 XDim 2 nLag endcase if KEYWORD_SET Covariance eq 0 then begin Compute Autocorrelation for k 0 nLag 1 do case XNDim of 1:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 2:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 3:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan 4:Auto k TimeAuto_Cov X ABS Lag k nT Double Double TimeAuto_Cov X 0L nT Double Double zero2nan endcase endif else begin Compute Autocovariance for k 0 nLag 1 do case XNDim of 1:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 2:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 3:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT 4:Auto k TimeAuto_Cov X ABS Lag k nT Double Double nT endcase endelse if Double eq 0 then RETURN FLOAT Auto else RETURN Auto END"); 295 a[293] = new Array("./ToBeReviewed/STATISTICS/c_timecorrelate.html", "c_timecorrelate.pro", "", "FUNCTION TimeCross_Cov Xd Yd M nT Ndim Double Double ZERO2NAN zero2nan Sample cross covariance function compile_opt hidden case Ndim OF 1:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Double Double 2:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double 3:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double 4:res TOTAL Xd 0:nT M 1L Yd M:nT 1L Ndim Double Double ENDCASE if keyword_set zero2nan then begin zero where res EQ 0 if zero 0 NE 1 then res zero values f_nan ENDIF RETURN res END file_comments This function computes the time cross correlation Pxy L or the time cross covariance between 2 arrays this is some kind of c_correlate but for multidimenstionals arrays as a function of the lag L categories Statistics param X in required An Array which last dimension is the time dimension of size n float or double param Y in required An Array which last dimension is the time dimension of size n float or double param LAG in required A scalar or n element vector in the interval n 2 n 2 of type integer that specifies the absolute distance s between indexed elements of X keyword COVARIANCE If set to a non zero value the sample cross covariance is computed keyword DOUBLE If set to a non zero value computations are done in double precision arithmetic examples Define two n element sample populations x 3 73 3 67 3 77 3 83 4 67 5 87 6 70 6 97 6 40 5 57 y 2 31 2 76 3 02 3 13 3 72 3 88 3 97 4 39 4 34 3 95 Compute the cross correlation of X and Y for LAG 5 0 1 5 6 7 lag 5 0 1 5 6 7 result c_timecorrelate x y lag The result should be: 0 428246 0 914755 0 674547 0 405140 0 403100 0 339685 history 01 03 2000 Sebastien Masson smasson lodyc jussieu fr Based on the C_CORRELATE procedure of IDL August 2003 Sebastien Masson update according to the update made in C_CORRELATE by W Biagiotti and available in IDL 5 5 INTRODUCTION TO STATISTICAL TIME SERIES Wayne A Fuller ISBN 0 471 28715 6 version Id: c_timecorrelate pro 150 2006 08 09 10:12:54Z navarro FUNCTION C_Timecorrelate X Y Lag Covariance Covariance Double Double Compute the sample cross correlation or cross covariance of Xt Xt l and Yt Yt l as a function of the lag l ON_ERROR 2 xsize SIZE X ysize SIZE Y nt float xsize xsize 0 NDim xsize 0 if total xsize 0:xsize 0 NE ysize 0:ysize 0 NE 0 then MESSAGE X and Y arrays must have the same size and the same dimensions Check length if nt lt 2 then MESSAGE Time dimension of X and Y arrays must contain 2 or more elements If the DOUBLE keyword is not set then the internal precision and result are identical to the type of input if N_ELEMENTS Double eq 0 then Double Xsize Xsize 0 1 eq 5 or ysize ysize 0 1 eq 5 if n_elements lag EQ 0 then lag 0 nLag N_ELEMENTS Lag Deviations if double then one 1 0d ELSE one 1 0 Ndim size X n_dimensions Xd TOTAL X Ndim Double Double nT Xd X Xd replicate one nT Yd TOTAL Y Ndim Double Double nT Yd Y Yd replicate one nT if nLag eq 1 then Lag Lag Create a 1 element vector case NDim of 1:if Double eq 0 then Cross FLTARR nLag else Cross DBLARR nLag 2:if Double eq 0 then Cross FLTARR Xsize 1 nLag else Cross DBLARR Xsize 1 nLag 3:if Double eq 0 then Cross FLTARR Xsize 1 Xsize 2 nLag else Cross DBLARR Xsize 1 Xsize 2 nLag 4:if Double eq 0 then Cross FLTARR Xsize 1 Xsize 2 Xsize 3 nLag else Cross DBLARR Xsize 1 Xsize 2 Xsize 3 nLag endcase if KEYWORD_SET Covariance eq 0 then begin Compute Cross Crossation for k 0 nLag 1 do begin if Lag k ge 0 then BEGIN case NDim of 1: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 2: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 3: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double 4: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double endcase ENDIF else BEGIN case NDim of 1: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 2: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 3: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double 4: Cross k TimeCross_Cov Yd Xd ABS Lag k nT Ndim Double Double endcase ENDELSE ENDFOR div sqrt TimeCross_Cov Xd Xd 0L nT Ndim Double Double zero2nan TimeCross_Cov Yd Yd 0L nT Ndim Double Double zero2nan Cross temporary Cross temporary div replicate one nLag endif else begin Compute Cross Covariance for k 0 nLag 1 do begin if Lag k ge 0 then BEGIN case NDim of 1: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 2: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 3: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT 4: Cross k TimeCross_Cov Xd Yd Lag k nT Ndim Double Double nT ENDCASE ENDIF else BEGIN case NDim of 1: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 2: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 3: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT 4: Cross k TimeCross_Cov yd xd ABS Lag k nT Ndim Double Double nT ENDCASE ENDELSE endfor endelse if Double eq 0 then RETURN FLOAT Cross else RETURN Cross END "); 296 296 a[294] = new Array("./ToBeReviewed/STRING/chkeywd.html", "chkeywd.pro", "", " file_comments In a string containing an order to executewith EXECUTE by example We change the value of one of keywords More generally in a string we look for the caracter chain: keywdname and we change the value of categories string keywords param STRINGIN in required it is a string param KEYWDNAME in required it is a string designating the name of keyword to look for param KEYWDVALUE in required The new value of the keyword to considerate in STRINGIN keyword SEPARATOR To look for the keyword we look for the first sign which follow the position of keywdname By default we substitute the string before the comma With the keyword SEPARATOR we can modify the cut of the string SEPARATOR give a caractere before the one we have to look for the comma which delimit the keyword in the string see examples keyword AFTER To look for the keyword we look for the first sign which follow the position of keywdname By default we substitute the string before the comma With the keyword AFTER we can modify the cut of the string AFTER give a caractere after the one we have to look for the comma which delimit the keyword in the string see examples returns stringout stringin modified if keywdname has been found in stringin uses common pro restrictions If keywdvalue is an array it will be convert in a vector restrictions Beware this function has loops ifs ad cases everywhere So it can not be used by big keywords with a lot of elements which are big arrays The input keyword must not contain Complex floatings structure Double precision complex Pointer Object reference Unsigned Integer Unsigned Longword Integer 64 bit Integer or Unsigned 64 bit Integer examples IDL b ok 111 year 1997 1998 1999 age_capitaine 35 IDL print b ok 111 year 1997 1998 1999 age_capitaine 35 IDL print chkeywd b ok c est bon ok c est bon year 1997 1998 1999 age_capitaine 35 IDL print chkeywd b YEAR indgen 5 sep ok 111 year 0 1 2 3 4 age_capitaine 35 IDL print chkeywd b YEAR indgen 5 sep after ok 111 year 0 1 2 3 4 age_capitaine 35 IDL b ok 111 year age_capitaine IDL print chkeywd b year c est bon ok 111 year c est bon age_capitaine history Sebastien Masson smasson lodyc jussieu fr 18 10 1999 24 11 1999: adaptation for keywords starting by version Id: chkeywd pro 142 2006 07 21 12:47:49Z navarro FUNCTION chkeywd stringin keywdname keywdvalue SEPARATOR separator AFTER after compile_opt idl2 strictarrsubs stringout stringin poskeywd strpos strlowcase stringout strlowcase keywdname if poskeywd EQ 1 then return stringout while poskeywd NE 1 do BEGIN change a keyword starting by toto if strmid stringout poskeywd 1 1 EQ then BEGIN ajoute keywdname tostr keywdvalue stringout strmid stringout 0 poskeywd 1 ajoute strmid stringout poskeywd strlen keywdname poskeywd poskeywd strlen ajoute poskeywd strpos stringout keywdname poskeywd ENDIF ELSE BEGIN change a keyword sarting by toto posegal strpos stringout poskeywd if posegal EQ 1 then return stringout if NOT keyword_set separator then separator posvirgule strpos stringout separator posegal 1 if keyword_set after then posvirgule strpos stringout posvirgule 1 ELSE posvirgule rstrpos stringout posvirgule 1 if posvirgule EQ 1 then posvirgule strlen stringout stringout strmid stringout 0 posegal 1 tostr keywdvalue strmid stringout posvirgule poskeywd strpos stringout keywdname posvirgule 1 ENDELSE endwhile return stringout end"); 297 297 a[295] = new Array("./ToBeReviewed/STRING/delchr.html", "delchr.pro", "", " file_comments Delete all occurrences of a character from a text string categories param OLD in required original text string param C in required character to delete keyword HELP returns new resulting string history R Sterner 5 Jul 1988 Johns Hopkins Applied Physics Lab RES 11 Sep 1989 converted to SUN R Sterner 27 Jan 1993 dropped reference to array Copyright C 1988 Johns Hopkins University Applied Physics Laboratory This software may be used copied or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made This routine is provided as is without any express or implied warranties whatsoever Other limitations apply as described in the file disclaimer txt version Id: delchr pro 142 2006 07 21 12:47:49Z navarro FUNCTION DELCHR OLD C help hlp compile_opt idl2 strictarrsubs if n_params 0 lt 2 or keyword_set hlp then begin print Delete all occurrences of a character from a text string print new delchr old char print old original text string in print char character to delete in print new resulting string out return 1 endif B BYTE OLD convert string to a byte array CB BYTE C convert char to byte w where b ne cb 0 if w 0 eq 1 then return Nothing left return string b w Return new string END"); … … 311 311 a[309] = new Array("./ToBeReviewed/STRING/strwhere.html", "strwhere.pro", "", " file_comments return position array for occurence of a character in a string categories string tools param STR in required the string param SCHAR in required the character to look for returns COUNT out optional The number of matches that were found The function returns an index array similar to the result of the where function examples ind strwhere abcabcabc a returns 0 3 6 history mgs 02 Jun 1998: VERSION 1 00 bmy 30 Jun 1998: now returns COUNT the number of matches that are found this is analogous to the WHERE command version Id: strwhere pro 142 2006 07 21 12:47:49Z navarro Copyright C 1998 Martin Schultz Harvard University This software is provided as is without any warranty whatsoever It may be freely used copied or distributed for non commercial purposes This copyright notice must be kept with any copy of this software If this software shall be used commercially or sold as part of a larger package please contact the author to arrange payment Bugs and comments should be directed to mgs io harvard edu with subject IDL routine strwhere function strwhere str schar Count compile_opt idl2 strictarrsubs if n_elements str eq 0 then return 1 convert to byte BStr byte Str BSC byte schar 0 Search for matches Ind where Bstr eq BSC Count bmy return where BStr eq BSC return Ind end "); 312 312 a[310] = new Array("./ToBeReviewed/STRING/tostr.html", "tostr.pro", "", " file_comments Convert an input in a string categories param INPUT in required input can not contain or be of the type of: Complex floating structure Double precision complex Pointer Object reference Unsigned Integer Unsigned Longword Integer 64 bit Integer Unsigned 64 bit Integer returns a string restrictions If keywdvalue is an array it will be convert in a vector restrictions Beware this function has loops ifs ad cases everywhere So it can not be used by big keywords with a lot of elements which are big arrays examples IDL help tostr 1 tostr a tostr indgen 4 tostr a jkfjo STRING 1 STRING a STRING 0 1 2 3 STRING a jkfjo IDL print tostr c est bon c est bon c est bon c est bon history Sebastien Masson smasson lodyc jussieu fr 18 10 1999 version Id: tostr pro 142 2006 07 21 12:47:49Z navarro FUNCTION tostr input compile_opt idl2 strictarrsubs case 1 of size input type LE 5:BEGIN if size input type EQ 1 then input long input if n_elements input EQ 1 then res strtrim input 1 ELSE BEGIN res strtrim input 0 1 for i 1 n_elements input 1 do res res strtrim input i 1 res res ENDELSE END size input type eq 7:BEGIN if n_elements input EQ 1 then BEGIN sinput strrepl input res sinput ENDIF ELSE BEGIN res strrepl input 0 for i 1 n_elements input 1 do res res strrepl input i res res ENDELSE END ELSE:BEGIN ras report la fonction tostr ne marche pas pour input qui est de type size input tname res END ENDCASE return res end"); 313 a[311] = new Array("./ToBeReviewed/STRUCTURE/chkstru.html", "chkstru.pro", "", " Id: chkstru pro 134 2006 07 07 10:19:08Z navarro NAME: CHKSTRU function PURPOSE: check validity of a structure and test if necessary fields are contained CATEGORY: tools CALLING SEQUENCE: res CHKSTRU STRUCTURE FIELDS VERBOSE INPUTS: STRUCTURE the structure to be tested If STRUCTURE is not of type structure the function will return 0 FIELDS a string or string array with field names to be contained in STRUCTURE CHKSTRU returns 1 true only if all field names are contained in STRUCTURE The entries of FIELDS may be upper or lowercase KEYWORD PARAMETERS: INDEX a named variable that will contain the indices of the required field names in the structure They can then be assessed through structure index i Index will contain 1 for all fields entries that are not in the structure VERBOSE set this keyword to return an error message in case of an error EXTRACT set this keyword to extract a fields from the structure 1 is return is fields or structure are incorrect OUTPUTS: CHKSTRU returns 1 if successful otherwise 0 SUBROUTINES: REQUIREMENTS: NOTES: EXAMPLE: test a:1 b:2 c:3 required a c if CHKSTRU test required then print found a and c IDL print CHKSTRU test b 1 IDL print CHKSTRU test b extract 2 MODIFICATION HISTORY: mgs 02 Mar 1998: VERSION 1 00 mgs 07 Apr 1998: second parameter FIELDS now optional 12 Jan 2001: EXTRACT keyword by S Masson smasson lodyc jussieu frCopyright C 1998 Martin Schultz Harvard University This software is provided as is without any warranty whatsoever It may be freely used copied or distributed for non commercial purposes This copyright notice must be kept with any copy of this software If this software shall be used commercially or sold as part of a larger package please contact the author to arrange payment Bugs and comments should be directed to mgs io harvard edu with subject IDL routine chkstru function chkstru structure fields index index verbose verbose extract extract compile_opt idl2 strictarrsubs default index index 1 first check number of parameters must be at least 1 if n_params lt 1 then begin if keyword_set verbose then ras report CHKSTRU: invalid number of parameters if keyword_set extract THEN return 1 ELSE return 0 endif check if the user really passed a structure s size structure if s 1 s 0 ne 8 then begin if keyword_set verbose then ras report CHKSTRU: No structure passed if keyword_set extract THEN return 1 ELSE return 0 endif only one parameter: then we are finished if n_params eq 1 then return 1 see if required field names are contained in the structure and return indices of these fields names tag_names structure index intarr n_elements fields 1 default index to not found for i 0 n_elements fields 1 do begin ind where names eq strupcase fields i if ind 0 lt 0 then begin if keyword_set verbose then ras report CHKSTRU: Cannot find field fields i endif else index i ind 0 endfor check minimum value of index field: 1 indicates error if keyword_set extract then BEGIN if index 0 NE 1 THEN return structure index 0 ELSE return 1 ENDIF ELSE return min index ge 0 end ");314 a[312] = new Array("./ToBeReviewed/STRUCTURE/extractstru.html", "extractstru.pro", "", " NAME:extractstru PURPOSE:extrait des elements d une structure pour constituer une nouvelle structure CATEGORY: dibouille sur les structures CALLING SEQUENCE: res extractstru stru liste INPUTS: stru: une structure liste: un vecteur de string comportant les noms des elements de stru a virer par DEFAUT ou a garder si GARDE est active KEYWORD PARAMETERS: GARDE: specifie que la liste donnee concerne les elements de stru a garder VIRE: specifie que la liste donnee concerne les elements de stru a virer Ce mot cle est active par defaut OUTPUTS:une stucture ou 1 en cas de pb COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: none liste peut contenir des noms d elements qui ne sont pas ds stru le programme se debrouille avec EXAMPLE: IDL extra get_extra ok year 1999 age_capitaine 35 IDL help extra struct Structure 3 tags length 6 refs 1: AGE_CAPITAINE INT 35 OK INT 1 YEAR INT 1999 IDL help extractstru extra ok hhuihi YEAR stru Structure 1 tags length 2 refs 1: AGE_CAPITAINE INT 35 IDL help extractstru extra ok hhuihi YEAR garde stru Structure 2 tags length 4 refs 1: OK INT 1 YEAR INT 1999 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 8 10 1999 FUNCTION extractstru stru liste GARDE garde VIRE vire compile_opt idl2 strictarrsubs if size stru type NE 8 then return 1 if size liste type NE 7 then return 1 cheking for garde and vire keywords garde keyword_set garde 1 keyword_set vire vire keyword_set vire 1 keyword_set garde keyword_set vire EQ garde tname tag_names stru index make_selection tname strupcase liste only_valid quiet if garde then BEGIN on garde que la liste if index 0 EQ 1 then return 1 if n_elements index EQ n_elements tname then return stru res create_struct tname index 0 stru index 0 if n_elements index GT 1 then for i 1 n_elements index 1 do res create_struct res tname index i stru index i ENDIF ELSE BEGIN on vire la liste if n_elements index EQ n_elements tname then return 1 if index 0 EQ 1 then return stru on prend le complementaire de index pour obtenir les indices que l on gardeindex different indgen n_elements tname index res create_struct tname index 0 stru index 0 if n_elements index GT 1 then for i 1 n_elements index 1 do res create_struct res tname index i stru index i ENDELSE return res end");315 a[313] = new Array("./ToBeReviewed/STRUCTURE/mixstru.html", "mixstru.pro", "", " NAME: mixstru PURPOSE: concatene 2 structures ensemble La difference avec CREATE_STRUCT etant que si les 2 stuctures ont les memes noms d elements alors mixstru ne plante pas mais choisit pour valeur de l element commun celle specifiee par la premiere structure CATEGORY: structure CALLING SEQUENCE: rs mixstru stru1 stru2 INPUTS: stru1 et stu2 sont 2 structures qui peuvent avoir des elements portant le meme nom mais avec une valeur differente KEYWORD PARAMETERS: none OUTPUTS: une stucture COMMON BLOCKS: SIDE EFFECTS: si stru1 ou stru2 ne sont pas des structures mixstru renvoie 1 RESTRICTIONS: EXAMPLE: IDL a get_extra toto ok 123 IDL b get_extra ok 111 year 1999 age_capitaine 35 IDL help a b struct Structure 2 tags length 4 refs 1: OK INT 123 TOTO INT 1 Structure 3 tags length 6 refs 1: AGE_CAPITAINE INT 35 OK INT 111 YEAR INT 1999 IDL help mixstru a b struct Structure 4 tags length 8 refs 1: AGE_CAPITAINE INT 35 YEAR INT 1999 OK INT 123 TOTO INT 1 IDL help mixstru b a struct Structure 4 tags length 8 refs 1: TOTO INT 1 AGE_CAPITAINE INT 35 OK INT 111 YEAR INT 1999 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 7 10 1999FUNCTION mixstru stru1 stru2 compile_opt idl2 strictarrsubs cm_general IF size stru1 type EQ 0 AND size stru2 type EQ 8 THEN return stru2 IF size stru2 type EQ 0 AND size stru1 type EQ 8 THEN return stru1 if size stru1 type NE 8 then return 1 if size stru2 type NE 8 then return 1 tname tag_names stru2 str FOR i 0 n_tags stru2 1 DO str str tname i stru2 strtrim i 2 res createfunc get_extra str _extra stru1 kwdlist stru1 stru1 stru2 stru2 stru1 stru1 stru2 stru2 filename myuniquetmpdir for_createfunc pro return res end");316 a[314] = new Array("./ToBeReviewed/STRUCTURE/struct2string.html", "struct2string.pro", "", " NAME:struct2string PURPOSE:convert a structure to an executable string CATEGORY:bidouille CALLING SEQUENCE:sting struct2string struct INPUTS:struct: a structure KEYWORD PARAMETERS: MAX_STRUCT_LENGTH : the maximum length of the structure permetted to convert the structure to string Default is 10000l DIRECT2STRING: to get a string instead an executable string CUT_IN_STRING: try it OUTPUTS: SIDE EFFECTS:use tostr pro cf this function header RESTRICTIONS:use tostr pro cf this function header EXAMPLE: IDL print struct2string d create_struct NAME X X_SIZE 891 Y_SIZE 630 X_VSIZE 891 Y_VSIZE 630 X_CH_SIZE 6 Y_CH_SIZE 10 X_PX_CM 40 0000 Y_PX_CM 40 0000 N_COLORS 16777216 TABLE_SIZE 256 FILL_DIST 1 WINDOW 32 UNIT 0 FLAGS 328124 ORIGIN 0 0 ZOOM 1 1 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 2000 07 03FUNCTION struct2string struct CUT_IN_STRING cut_in_string MAX_STRUCT_LENGTH max_struct_length DIRECT2STRING direct2string compile_opt idl2 strictarrsubs if size struct type NE 8 then return if NOT keyword_set max_struct_length then max_struct_length 10000l if n_tags struct length GT max_struct_length then begin rien report The structure is too big to be converted to string C See the MAX_STRUCT_LENGTH keyword return endif names tag_names struct case 1 of keyword_set direct2string :BEGIN res names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res names i tostr struct i endfor endif END keyword_set CUT_IN_STRING :BEGIN res create_struct names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res create_struct res names i tostr struct i endfor endif END ELSE:BEGIN res create_struct names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res names i tostr struct i endfor endif res res END endcase return res end");317 a[315] = new Array("./ToBeReviewed/STRUCTURE/where_tag.html", "where_tag.pro", "", " NAME: WHERE_TAG PURPOSE: Like WHERE but works on structure tag names EXPLANATION: Obtain subscripts of elements in structure array for which a particular Tag has values in a range or matching specified values Like the WHERE function but for use with structures CATEGORY: Structures CALLING SEQUENCE: w where_tag struct Nfound TAG_NAME TAG_NUMBER RANGE VALUES RANGE ISELECT NOPRINT INPUTS: Struct structure array to search INPUT KEYWORDS: User must specify 1 TAG_NAME or TAG_NUMBER to search and 2 the VALUES or RANGE to search on TAG_NAME Scalar string specifying Tag Name TAG_NUMBER otherwise give the Tag Number RANGE min max range to search for in Struct VALUES one or array of numbers to match for in Struct ISELECT specifies indices to select only part of structure array use it to recycle subscripts from previous searches NOPRINT suppress informational messages about nothing found OUTPUTS: Nfound of occurences found RESULT: Function returns subscripts indices to desired elements EXAMPLES: Suppose STR is a structure with tags CAT_NO:indgen 10 and NAME:strarr 10 Find the indices where STR CAT_NO is between 3 and 5 IDL print WHERE_TAG str TAG_NAME CAT_NO VALUE 3 4 5 or IDL print WHERE_TAG str TAG_NUM 0 RANGE 3 5 PROCEDURE: Get tag number and apply the WHERE function appropriately MODIFICATION HISTORY: written 1990 Frank Varosi STX NASA GSFC Stop printing Tag not found with NOPRINT CD Pike 8 Jun 93function where_Tag Struct Nfound TAG_NAME Tag_Name TAG_NUMBER Tag_Num ISELECT ipart NOPRINT noprint RANGE range VALUES values First check required parameters compile_opt idl2 strictarrsubs Ntag N_tags Struct if Ntag LE 1 then begin message expecting a Structure Array try again CONTIN return 1 endif if N_elements Tag_Num NE 1 AND N_elements Tag_Name NE 1 then begin message specify TAG_NAME or TAG_NUMBER to search CONTIN return 1 endif Tags Tag_names Struct if N_elements Tag_Name EQ 1 then begin Tag_Name strupcase Tag_Name Tag_Num where Tags EQ Tag_Name Tag_Num Tag_Num 0 if Tag_Num LT 0 then begin if NOT keyword_set noprint then message Tag not found CONTIN return 2 endif endif if Tag_Num LT 0 OR Tag_Num GE Ntag then begin message Tag strtrim Tag_Num 2 exceeds Max Tag strtrim Ntag 1 2 in structure CONTIN return 1 endif if N_elements ipart GT 0 then begin check if any searching on a subset of input w where ipart GE 0 nf if nf LE 0 then return 1 if nf LT N_elements ipart then ipart ipart w endif Now find out where for RANGE : if N_elements range EQ 2 then begin if N_elements ipart GT 0 then begin w where Struct ipart Tag_Num GE range 0 AND Struct ipart Tag_Num LE range 1 Nfound if Nfound GT 0 then windex ipart w else windex w endif else windex where Struct Tag_Num GE range 0 AND Struct Tag_Num LE range 1 Nfound if Nfound LE 0 AND NOT keyword_set noprint then begin strnums strtrim range 2 string strnums 0 strnums 1 message NO values of found in the Range string CONTIN endif where Values: endif else if N_elements values GE 1 then begin Nval N_elements values vals values Nfound 0 if N_elements ipart GT 0 then begin for v 0 Nval 1 do begin w where Struct ipart Tag_Num EQ vals v Nf if Nf GT 0 then begin if Nfound GT 0 then ww ww w else ww w endif Nfound Nfound Nf endfor if Nfound GT 0 then windex ipart ww sort ww else windex w endif else begin for v 0 Nval 1 do begin w where Struct Tag_Num EQ vals v Nf if Nf GT 0 then begin if Nfound GT 0 then ww ww w else ww w endif Nfound Nfound Nf endfor if Nfound GT 0 then windex ww sort ww else windex w endelse if Nfound LE 0 AND NOT keyword_set noprint then begin strnums strtrim vals 2 string strnums 0 for i 1 Nval 1 do string string strnums i message NO values of found Equaling string CONTIN endif endif else begin message must specify a RANGE or VALUES s CONTIN windex 1 endelse return windex end");318 a[316] = new Array("./ToBeReviewed/TRIANGULATION/ciseauxtri.html", "ciseauxtri.pro", "", " NAME: PURPOSE:vire les tableaux qui ne doivent pas etre dessines grace a 2 tests: 1 les coins du tableau doivent etre ds la fenetre 2 les clongeurs des cotes des triangfles exprimes en coordonnees normalisesne doivent pas depasser une certaine longueur seuil CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS: common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY: Sebastien Masson smasson lodyc jussieu fr 20 2 99 FUNCTION ciseauxtri triang glam gphi TOUT tout _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF NOT keyword_set key_periodic AND NOT keyword_set key_irregular AND NOT map projection LE 7 AND map projection NE 0 AND NOT map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 THEN return triang tempsun systime 1 pour key_performance taille size glam nx taille 1 ny taille 2 tempdeux systime 1 pour key_performance 2 z convert_coord glam gphi data to_normal x z 0 y z 1 tempvar SIZE TEMPORARY z delete z IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: convert_coord data to_normal systime 1 tempdeux attention suivant la projection certains points x ou y peuvent devenir NaN cf points deriere la terre ds une projection orthographique il faut dans ce cas enlever tous les triangles qui contiennent un de ces points if map projection LE 7 AND map projection NE 0 OR map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 then begin tempdeux systime 1 pour key_performance 2 test x y triang test finite temporary test nan test total temporary test 1 ind where temporary test EQ 0 if ind 0 NE 1 then triang triang temporary ind ELSE return 1 trichanged 1b IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: recherche points a NAN systime 1 tempdeux endif seuil 5 indxtriang2 indxtriang indxmin nx 1 indxmin EQ 0 AND indxmax EQ nx 1 ENDIF ELSE indxtriang indxmin listrect nx indytriang indxtriang IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: liste des rectangles systime 1 tempdeux maintenant qu on a cette liste on va s assuter que l on a pas de triangles qui n ont qu on sommet en commun test bytarr nx ny test listrect 1 dejavire 1b test tempdeux systime 1 pour key_performance 2 vire1 0 vire2 0 while vire1 0 NE 1 OR vire2 0 NE 1 ne 0 do begin vire1 where test shift test 1 1 1 shift test 0 1 1 shift test 1 0 EQ 1 if vire1 0 NE 1 THEN test vire1 0 on vire le rectangle vire2 where 1 test 1 shift test 1 1 shift test 0 1 shift test 1 0 EQ 1 on vire le rectangle du dessus meme indice x mais egale a 1 if vire2 0 NE 1 THEN test vire2 nx 0 ENDWHILE stop test test temporary dejavire avirer where temporary test EQ 0 IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: determinationdes rectangles a virer systime 1 tempdeux if avirer 0 NE 1 then begin tempdeux systime 1 pour key_performance 2 indnx n_elements listrect indny n_elements avirer ind listrect replicate 1l indny ind ind EQ replicate 1 indnx avirer if indny GT 1 then ind total ind 2 ind where ind EQ 0 if ind 0 NE 1 then triang triang ind ELSE return 1 endif IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: derniere retouche de la triangulation systime 1 tempdeux endif if keyword_set key_performance THEN print temps ciseauxtri systime 1 tempsun return triang end");319 a[317] = new Array("./ToBeReviewed/TRIANGULATION/completecointerre.html", "completecointerre.pro", "", " NAME: COMPLETECOINTERRE PURPOSE: pour colorier proprement les continents c est une longue histoire CATEGORY: pour plt CALLING SEQUENCE: completecointerre INPUTS: non KEYWORD PARAMETERS: _EXTRA CONT_COLOR: the color of the continent defaut value is d n_colors 1 white OUTPUTS: non COMMON BLOCKS: common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 01 10 1999 PRO draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex compile_opt idl2 strictarrsubs cm_4mesh the triangle must not be out of the domain IF min lons max maxlon GE lon1 AND maxlon LE lon2 AND min lats max maxlat GE lat1 AND maxlat LE lat2 then BEGIN the triangle must not be too big z convert_coord lons lats data to_normal alldist z 0 2 z 0 0 2 z 1 2 z 1 0 2 z 0 0 z 0 1 2 z 1 0 z 1 1 2 z 0 1 z 0 2 2 z 1 1 z 1 2 2 IF max alldist LT seuil 2 THEN polyfill lons lats color cont_color _extra ex return ENDIF end PRO completecointerre COINMONTE coinmonte COINDESCEND coindescend CONT_COLOR cont_color INDICEZOOM indicezoom _extra ex compile_opt idl2 strictarrsubs common if NOT keyword_set coinmonte then return if NOT keyword_set coindescend then return if NOT keyword_set indicezoom then return tempsun systime 1 pour key_performance definitions des vecteurs coinmont et coindesc if keyword_set coinmonte then coinmont coinmonte ELSE coinmont twin_corners_up if keyword_set coindescend then coindesc coindescend ELSE coindesc twin_corners_dn IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 definition descoordonnees des points numerotes 1 2 3 4 5 6 cf les schemas en dessous tempdeux systime 1 pour key_performance 2 if coinmont 0 NE 1 OR coindesc 0 NE 1 then BEGIN if keyword_set indicezoom then BEGIN if we use key_stide the t u v and f points are no more related to the same cell because glamf and gphif has be recomputed to be in the middle of two t points IF total key_stride EQ 3 AND finite glamv 0 gphiv 0 NE 0 THEN BEGIN long1 glamv indicezoom lati1 gphiv indicezoom ENDIF ELSE BEGIN long1 glamt indicezoom lati1 gphif indicezoom ENDELSE IF total key_stride EQ 3 AND finite glamu 0 gphiu 0 NE 0 THEN BEGIN long2 glamu indicezoom lati2 gphiu indicezoom ENDIF ELSE BEGIN long2 glamf indicezoom lati2 gphit indicezoom ENDELSE long3 glamf indicezoom lati3 gphif indicezoom ENDIF ELSE BEGIN IF total key_stride EQ 3 AND finite glamv 0 gphiv 0 NE 0 THEN BEGIN long1 glamv lati1 gphiv ENDIF ELSE BEGIN long1 glamt lati1 gphif ENDELSE IF total key_stride EQ 3 AND finite glamu 0 gphiu 0 NE 0 THEN BEGIN long2 glamu lati2 gphiu ENDIF ELSE BEGIN long2 glamf lati2 gphit ENDELSE long3 glamf lati3 gphif ENDELSE nx size long1 dimensions 0 ny size long1 dimensions 1 seuil 5 min nx ny 2 seuil min p position 2 p position 0 seuil p position 3 p position 1 seuil ENDIF IF testvar var key_performance EQ 2 THEN print temps completecointerre: positions des points systime 1 tempdeux cas coin terre en montee: 2 points terre en diagonale montante avec 2 points mer sur la diagonale descendante 4 t i nx 1 u i nx t i nx 1 0 1 3 5 v i f i v i 1 t i 0 2 u i t i 1 1 if coinmont 0 NE 1 then BEGIN tempdeux systime 1 pour key_performance 2 for id 0 n_elements coinmont 1 do BEGIN i coinmont id ii i MOD nx ij i nx bottom triangle lons long1 i long2 i long3 i lats lati1 i lati2 i lati3 i draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex upper triangle IF ii NE nx 1 AND ij NE ny 1 THEN BEGIN lons long3 i long1 i 1 long2 i nx lats lati3 i lati1 i 1 lati2 i nx draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex ENDIF ENDFOR IF testvar var key_performance EQ 2 THEN print temps completecointerre: trace de cointerremonte systime 1 tempdeux ENDIF cas coin terre en descendante : 2 points terre en diagonale descendante avec 2 points mer sur la diagonale montante 4 t i nx 1 u i nx t i nx 1 0 3 5 v i f i v i 1 1 t i 0 2 u i t i 1 1 if coindesc 0 NE 1 then begin tempdeux systime 1 pour key_performance 2 for id 0 n_elements coindesc 1 do BEGIN i coindesc id ii i MOD nx ij i nx IF ii NE nx 1 AND ij NE ny 1 THEN BEGIN left triangle lons long1 i long3 i long2 i nx lats lati1 i lati3 i lati2 i nx draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex right triangle lons long3 i long2 i long1 i 1 lats lati3 i lati2 i lati1 i 1 draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex ENDIF ENDFOR IF testvar var key_performance EQ 2 THEN print temps completecointerre: trace de cointerredescend systime 1 tempdeux ENDIF IF keyword_set key_performance THEN print temps completecointerre systime 1 tempsun return end");320 a[318] = new Array("./ToBeReviewed/TRIANGULATION/definetri.html", "definetri.pro", "", " NAME:definetri PURPOSE:Define a triangulation array like TRIANGULATE But in a VERY SIMPLE CASE: the points are regulary gridded on nx ny array Find a Delaunay triangulation for this set of points is easy: Points define nx 1 ny 1 rectangles which we can cut in 2 triangles cf figure above ny 1 ny 2 1 0 0 1 2 nx 3 nx 2 nx 1 You have 2 ways to cut a rectangle: 1 the upward diagonal 2 the downward diagonal CATEGORY: to understand how TRIANGULATE and TRIANGULATION work CALLING SEQUENCE:triangles definetri nx ny downward INPUTS: nx and ny are the array dimensions OPTIONAL INPUTS: downward: When downward is undefine all rectangles are cut in using the upward diagonal Downward is a vector which contains the rectangles numbers which are cut in using the downward diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle KEYWORD PARAMETERS: OUTPUTS: triangles is a 2d array and is dimensions are 3 and 2 nx 1 ny 1 triangles is define like in the TRIANGULATE procedure OPTIONAL OUTPUTS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: EXAMPLE: triangles definetri 3 3 1 3 triangles will be a this kind of triangulation: MODIFICATION HISTORY: sebastien Masson smlod ipsl jussieu fr 4 3 1999FUNCTION definetri nx ny downward compile_opt idl2 strictarrsubs nx long nx ny long ny if n_elements downward NE 0 THEN BEGIN if n_elements downward GT nx 1 ny 1 then begin print downward a trop d elements par rapport a nx et ny return 1 endif downward long downward ENDIF we define triangles triangles lonarr 3 2 nx 1 ny 1 we cut the rectangles with the upward diagonal if n_elements downward NE nx 1 ny 1 then BEGIN there is some rectangle to cut we define upward: upward is a vector which contains the rectangles numbers which are cut in using the upward diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle upward bytarr nx ny 1 upward ny 1 0 upward nx 1 0 if n_elements downward NE 0 then upward downward 0 upward where upward EQ 1 n1 n_elements upward 4 corners indexes of a rectangle number i are i nx i nx 1 i i 1 trinumber 2 upward upward nx we define the right triangles triangles 0 trinumber upward triangles 1 trinumber upward 1 triangles 2 trinumber upward 1 nx we define the left triangles triangles 0 trinumber 1 upward 1 nx triangles 1 trinumber 1 upward nx triangles 2 trinumber 1 upward ENDIF ELSE n1 0 we cut the rectangles with the downward diagonal if n_elements downward NE 0 then BEGIN n2 n_elements downward trinumber 2 downward downward nx we define the right triangles triangles 0 trinumber downward 1 triangles 1 trinumber downward nx 1 triangles 2 trinumber downward nx we define the left triangles triangles 0 trinumber 1 downward nx triangles 1 trinumber 1 downward triangles 2 trinumber 1 downward 1 endif return triangles end");321 a[319] = new Array("./ToBeReviewed/TRIANGULATION/definetri_e.html", "definetri_e.pro", "", "function numtri index nx ny compile_opt idl2 strictarrsubs y index nx x index y nx numtri y NE 0 nx 1 2 y 1 1 2 y EQ ny 1 OR y EQ ny 1 x return numtri end NAME:definetri PURPOSE:Define a triangulation array like TRIANGULATE but for a E grid type CATEGORY: make contours with E grid type CALLING SEQUENCE:triangles definetri nx ny vertical INPUTS: nx and ny are the array dimensions OPTIONAL INPUTS: vertical: When vertical is undefine all rectangles are cut in using the horizontal diagonal Vertical is a vector which contains the rectangles numbers which are cut in using the vertical diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle KEYWORD PARAMETERS: OUTPUTS: triangles is a 2d array and is dimensions are 3 and 2 nx 1 ny 1 triangles is define like in the TRIANGULATE procedure OPTIONAL OUTPUTS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: EXAMPLE: MODIFICATION HISTORY: sebastien Masson smlod ipsl jussieu fr June 2001FUNCTION definetri_e nx ny singular SHIFTED shifted compile_opt idl2 strictarrsubs nx long nx ny long ny triangles lonarr 3 2 nx 1 ny 1 build the base triangulation with the diamond cut in two triangles by the vertical diagonal first line index lindgen nx 1 trinumber index triangles 0 trinumber index triangles 1 trinumber index 1 triangles 2 trinumber index nx 1 shifted last line index ny 1 nx lindgen nx 1 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx index nx 1 shifted MOD 2 triangles 2 trinumber index 1 other lines if ny GT 2 then begin index lindgen nx ny index index 0:nx 2 1:ny 2 index index oddeven index nx 1 shifted MOD 2 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx oddeven triangles 2 trinumber index nx oddeven triangles 0 trinumber 1 index nx oddeven triangles 1 trinumber 1 index nx oddeven triangles 2 trinumber 1 index 1 endif cut the diamond specified by singular in two triangles by the horizontal diagonal IF keyword_set singular then BEGIN yindex singular nx otherline where yindex NE 0 AND yindex NE ny 1 if otherline 0 NE 1 then begin index singular otherline oddeven index nx 1 shifted MOD 2 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx oddeven triangles 2 trinumber index 1 triangles 0 trinumber 1 index triangles 1 trinumber 1 index 1 triangles 2 trinumber 1 index nx oddeven endif endif return triangles end ");322 a[320] = new Array("./ToBeReviewed/TRIANGULATION/dessinetri.html", "dessinetri.pro", "", " NAME:dessinetri PURPOSE:dessine la triangulation CATEGORY:pour comprendre comment ca marche CALLING SEQUENCE:dessinetri tri x y INPUTS:optionnels par defaut on choisit la triangulation qui est utilise pour les plots et on la trace aux points definites par vargrid sinon il faut fournir les tableaux tri definissant la triangulation fournis par triangule pro ou triangulate x et y qui sont les positions de points a laquelle se raporte la triangulation cf les tableau x et y fournis ds triangulate KEYWORD PARAMETERS: All plots or polyfill keywords WAIT x to call wait x second between each triangle draw ONEBYONE: to draw the triangles one by one FILL: to fill the triangles using polyfill instead of plotting them CHANGECOLOR n to change the color of each traingle n colors will be used and repeted if necessary OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO dessinetri tri x y WAIT wait ONEBYONE onebyone FILL fill CHANGECOLOR changecolor _extra ex compile_opt idl2 strictarrsubs common tempsun systime 1 pour key_performance a if n_params EQ 3 then BEGIN CASE size x n_dimensions size y n_dimensions OF 2:BEGIN nx n_elements x ny n_elements y glam x replicate 1 ny gphi replicate 1 nx y END 4:BEGIN glam x gphi y END ELSE:BEGIN dummy report x and y inputs of dessinetri must have the same number of dimensions 1 or 2 return END ENDCASE ENDIF ELSE BEGIN grille mask glam gphi tri tri undefine mask tri ciseauxtri tri glam gphi ENDELSE IF keyword_set changecolor THEN BEGIN oldname d name if d name EQ PS OR d name EQ Z then BEGIN thisos strupcase strmid version os_family 0 3 CASE thisOS of MAC : set_plot thisOS WIN : set_plot thisOS ELSE: set_plot X ENDCASE ncolors d n_colors 1 255 set_plot oldname ENDIF ELSE ncolors d n_colors 1 255 color 1 indgen changecolor ncolors changecolor 1 ENDIF ELSE color 0 color color replicate 1 n_elements tri 3 n_elements color 1 tempdeux systime 1 pour key_performance 2 for i 0L n_elements tri 3 1 do begin t tri i tri 0 i IF keyword_set fill THEN polyfill glam t gphi t color color i _extra ex ELSE plots glam t gphi t color color i _extra ex IF keyword_set wait THEN wait wait IF keyword_set onebyone THEN read a prompt press a key ENDFOR IF testvar var key_performance EQ 2 THEN print temps dessinetri: trace des triangles systime 1 tempdeux if keyword_set key_performance THEN print temps dessinetri systime 1 tempsun return end");323 a[321] = new Array("./ToBeReviewed/TRIANGULATION/drawcoast_c.html", "drawcoast_c.pro", "", " PRO drawcoast_c mask xf yf nx ny COAST_COLOR coast_color COAST_THICK coast_thick YSEUIL yseuil XSEUIL xseuil _extra ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 pour key_performance on trace les segments verticaux: if NOT keyword_set yseuil then yseuil 5 min nx ny 2 distanceseuil p position 3 p position 1 yseuil liste: liste des points i pourlesquels on va tracer un segment entre le point i j 1 et i j tempdeux systime 1 pour key_performance 2 liste where mask shift mask 1 0 EQ 1 AND xf shift xf 0 1 2 yf shift yf 0 1 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN on recupere lx et ly qui sont les indices ds un tableau 2d des points donnes par liste ly liste nx lx temporary liste nx ly indice where ly NE 0 on ne prend pas les points concernant if indice 0 NE 1 then begin la premiere ligne car ds ce cas le pt j 1 n est pas definit lx lx indice ly ly temporary indice boucle sur les points concernes et trace du segment rq: on utilise plost au lieu de plot car plots est bcp plus rapide IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner liste des points concernes par un trait vertical systime 1 tempdeux tempdeux systime 1 pour key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i j 1 xf i j yf i j 1 yf i j color coast_color thick coast_thick normal _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracecote: trace des traits verticaux systime 1 tempdeux endif ENDIF pour le trace des segments horizontaux c est la meme chose sauf qu il faut faire attention si on est periodique: si on est periodique on duplique la premiere colonne et on la met a la fin ceci est fait non pas pour le shift qui est par defaut periodique mais pour le plots tempdeux systime 1 pour key_performance 2 if keyword_set key_periodic AND nx EQ jpi then begin mask mask mask 0 xf xf xf 0 yf yf yf 0 nx nx 1 ENDIF if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste where mask shift mask 0 1 EQ 1 AND xf shift xf 1 0 2 yf shift yf 1 0 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN ly liste nx lx temporary liste nx ly indice where ly NE ny 1 AND lx NE 0 if indice 0 NE 1 then begin on ne prend pas les points de la premiere colonne et de la derniere ligne car on l a rajoute artificiellement lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner liste des points concernes par un trait horizontal systime 1 tempdeux tempdeux systime 1 pour key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i 1 j xf i j yf i 1 j yf i j color coast_color thick coast_thick normal _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracecote: trace des traits horizontaux systime 1 tempdeux endif endif if keyword_set key_performance THEN print temps drawcoast_c systime 1 tempsun return end");324 a[322] = new Array("./ToBeReviewed/TRIANGULATION/drawcoast_e.html", "drawcoast_e.pro", "", " PRO drawcoast_e mask xf yf nx ny COAST_COLOR coast_color COAST_THICK coast_thick YSEUIL yseuil XSEUIL xseuil onemore onemore _extra ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 pour key_performance if keyword_set key_periodic AND nx EQ jpi then begin mask mask mask 0 xf xf xf 0 yf yf yf 0 nx nx 1 ENDIF we plot the borders of the diamond in this sense : if NOT keyword_set onemore then onemore 0 if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste: liste des points i pourlesquels on va tracer un segment index lindgen nx ny index index 0:nx 2 1:ny 1 indexbis index nx index nx onemore MOD 2 liste where mask index 1 mask indexbis EQ 1 AND xf index xf indexbis 2 yf index yf indexbis 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN index index liste indexbis indexbis liste for pt 0 n_elements index 1 do begin plots xf index pt xf indexbis pt yf index pt yf indexbis pt color coast_color thick coast_thick normal _extra ex endfor ENDIF we plot the borders of the diamond in this sense : if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste: liste des points i pourlesquels on va tracer un segment index lindgen nx ny 1 index index 0:nx 2 indexbis index nx index nx onemore MOD 2 liste where mask index 1 mask indexbis EQ 1 AND xf index xf indexbis 2 yf index yf indexbis 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN index index liste indexbis indexbis liste for pt 0 n_elements index 1 do begin plots xf index pt xf indexbis pt yf index pt yf indexbis pt color coast_color thick coast_thick normal _extra ex endfor ENDIF if keyword_set key_performance THEN print temps drawcoast_e systime 1 tempsun return end");325 a[323] = new Array("./ToBeReviewed/TRIANGULATION/drawsectionbottom.html", "drawsectionbottom.pro", "", " NAME:drawsectionbottom PURPOSE:fill and draw the bottom continents for a real section CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: COAST_COLOR: the color of the coastline defaut value is 0 black COAST_THICK: the thickness of the coastline defaut value is 1 CONT_COLOR: the color of the continent defaut value is d n_colors 1 white OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS:simple way to fill continents for a section using the fact that continents are wider at the bottom than at the top EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 14 2002PRO drawsectionbottom maskin xxaxisin depthsin COAST_COLOR coast_color COAST_THICK coast_thick CONT_COLOR cont_color CONT_NOFILL cont_nofill OVERPLOT overplot _extra ex compile_opt idl2 strictarrsubs cm_general IF NOT keyword_set key_forgetold THEN BEGIN updatekwd ENDIF if keyword_set overplot then return mask is from bottom to top boundaries conditions: nx size maskin 1 nz size maskin 2 1 IF size xxaxisin n_dimensions EQ 1 THEN xxaxisin temporary xxaxisin replicate 1 nz IF size depthsin n_dimensions EQ 1 THEN depthsin replicate 1 nx temporary depthsin for the mask : we add ocean at the top then it is always possible to find one ocean point on each water column mask maskin replicate 1 nx for x axis we also add one level xxaxis xxaxisin xxaxisin 0 x axis must cover nx 1 points because we will draw the edge of the mask if it was mot possible in decoupeterre pro to extend the xxaxis we do it now by hand xxaxis xxaxisin 0 if size xxaxis 1 EQ nx then begin if n_elements xxaxis EQ nx then begin deltax abs x range 1 x range 0 10 xxaxis xxaxis 0 deltax xxaxis x0 xxaxis 0 deltax xxaxis replicate x0 1 nz xxaxis ENDIF for the depth usepartial total depthsin 2 usepartial total usepartial NE usepartial 0 GE 1 depths depthsin 0:nx 1 we add one level according to the ocean level we had to the mask deltaz abs y range 1 y range 0 10 zmax max depthsin deltaz depths depths replicate zmax nx 1 depths depths replicate zmax nx if min depths gt 1 then we must add one line at the bottom this appens when the bottom limit is defined between T k and W k points IF min depthsin GT 1 OR max total mask 2 EQ nz THEN BEGIN zmin min y range deltaz depths replicate zmin nx depths mask replicate 0 nx mask nz nz 1 ENDIF xleft xxaxis 0:nx 1 xright xxaxis 1:nx looking for the position of the bottom of the ocean pos nz 1 total mask 2 depths depths lindgen nx nx pos xx transpose xleft xright xx x range 0 xx zz max y range xx float xx zz float zz filling of the continents IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 if NOT keyword_set cont_nofill then polyfill min xx max maxx xx maxx min zz max mazz zz mazz color cont_color if NOT keyword_set cont_nofill then polyfill min xx max maxx xx maxx y range 0 zz y range 0 color cont_color drawing of the coast bottom line we could have plot directly xx and yy but if countout ne 0 doing this will draw an non existing bottom line along y range values which is not so good we thus do this ugly for if loops to make sure that we don t draw these lines but we keep all vertical lines IF countout NE 0 THEN BEGIN FOR i 0 countout 1 DO BEGIN CASE 1 OF out i EQ 0:BEGIN if we start with a out point xxx values f_nan zzz values f_nan END i EQ 0:BEGIN i eq 0 but out i ne 0 xxx xx 0:out i values f_nan zzz zz 0:out i values f_nan END ELSE:BEGIN two consecutive out values at the same depth: we just keep values f_nan values until the next change of depth IF out i 1 EQ out i 1 AND zz out i 1 EQ zz out i THEN BEGIN xxx xxx values f_nan zzz zzz values f_nan ENDIF ELSE BEGIN we keep everything inbetween the out values including themselves for the vertical lines but we had values f_nan to remove the horizontal lines xxx xxx xx out i 1 :out i values f_nan zzz zzz zz out i 1 :out i values f_nan ENDELSE END ENDCASE IF i EQ countout 1 AND out i NE n_elements xx 1 THEN BEGIN xxx xxx xx out i : zzz zzz zz out i : ENDIF ENDFOR plots xxx zzz color coast_color thick coast_thick _extra ex ENDIF ELSE plots xx zz color coast_color thick coast_thick _extra ex return end ");326 a[324] = new Array("./ToBeReviewed/TRIANGULATION/fillcornermask.html", "fillcornermask.pro", "", " NAME: FILLCORNERMASK PURPOSE: pour colorier proprement les continents c est une longue histoire CATEGORY: pour plt CALLING SEQUENCE: completecointerre INPUTS: non KEYWORD PARAMETERS: _EXTRA CONT_COLOR: the color of the continent defaut value is d n_colors 1 white OUTPUTS: non COMMON BLOCKS: common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 8 8 2002 PRO fillcornermask xin yin COINMONTE coinmonte COINDESCEND coindescend CONT_COLOR cont_color INDICEZOOM indicezoom _extra ex compile_opt idl2 strictarrsubs common if NOT keyword_set coinmonte AND NOT keyword_set coindescend then return tempsun systime 1 pour key_performance IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 definition descoordonnees des points numerotes 1 2 3 4 5 6 cf les schemas en dessous x1 reform xin y1 reform yin IF size x1 0 EQ 2 THEN x1 x1 0 IF size y1 0 EQ 2 THEN y1 y1 0 x2 5 x1 shift x1 1 y2 5 y1 shift y1 1 nx n_elements x1 ny n_elements y1 cas coin terre en montee: 2 points terre en diagonale montante avec 2 points mer sur la diagonale descendante 3 t i nx 1 u i nx t i nx 1 0 1 4 v i f i v i 1 t i 0 2 u i t i 1 1 if keyword_set coinmonte then BEGIN if coinmonte 0 NE 1 then BEGIN iup coinmonte MOD nx jup coinmonte nx for id 0 n_elements coinmonte 1 do BEGIN i iup id j jup id IF i NE nx 1 AND j NE ny 1 THEN BEGIN polyfill x1 i x2 i x2 i x1 i 1 x1 i y2 j y1 j y1 j 1 y2 j y2 j color cont_color _extra ex ENDIF endfor endif endif cas coin terre en descendante : 2 points terre en diagonale descendante avec 2 points mer sur la diagonale montante4 t i nx 1 u i nx t i nx 1 0 3 5 v i f i v i 1 1 t i 0 2 u i t i 1 1 if keyword_set coindescend then BEGIN if coindescend 0 NE 1 then begin idw coindescend MOD nx jdw coindescend nx for id 0 n_elements coindescend 1 do BEGIN i idw id j jdw id IF i NE nx 1 AND j NE ny 1 THEN BEGIN polyfill x1 i x2 i x2 i x1 i 1 x1 i y2 j y1 j 1 y1 j y2 j y2 j color cont_color _extra ex ENDIF endfor endif endif IF keyword_set key_performance THEN print temps fillcornermask systime 1 tempsun return end");327 a[325] = new Array("./ToBeReviewed/TRIANGULATION/section.html", "section.pro", "", " NAME: PURPOSE: CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO section field res glamaxe gphiaxe ENDPOINTS endpoints BOXZOOM boxzoom TYPE type WDEPTH wdepth DIREC direc SHOWBUILD showbuild ONLYBOX onlybox _extra ex include common compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF definition de boxzoom en fonction de endpoints puis redefinition du domaine boxzoom2d min endpoints 0 endpoints 2 max ma02 ma02 min endpoints 1 endpoints 3 max ma13 ma13 minprof 0 profdefault 200 if n_elements type EQ 0 then type nothing Case N_Elements Boxzoom OF 0:localbox boxzoom2d minprof profdefault 1:localbox boxzoom2d minprof boxzoom 0 2:localbox boxzoom2d boxzoom 0 4:if strpos type z NE 1 THEN localbox boxzoom2d minprof profdefault ELSE localbox boxzoom2d 5:localbox boxzoom2d minprof boxzoom 4 6:localbox boxzoom2d boxzoom 4:5 Else:BEGIN print report Bad definition of the box stop END ENDCASE nelbox n_elements localbox if keyword_set wdepth then grillechoice vargrid W ELSE grillechoice vargrid domdef localbox GRIDTYPE grillechoice findalways _extra ex grille 1 1 1 1 nx ny if less than 10 points where found we apply domdef over the whole domain problem why 10 points as a test value how can we find a good test value IF nx ny LE 10 THEN domdef GRIDTYPE grillechoice _extra ex on redefinit lon1 au cas ou findalways ait ete utilise ds domdef lon1 min endpoints 0 endpoints 2 max lon2 lat1 min endpoints 1 endpoints 3 max lat2 we extend the box along the z axis i that way the plot will be drawn until its bottom part if strpos type z NE 1 THEN BEGIN on garde les yranges axe z avant de changer la boxzoom y range localbox nelbox 1 localbox nelbox 2 if vargrid EQ W OR keyword_set wdepth then BEGIN firstzw 0 firstzw 1 lastzw lastzw 1 firstzt 1 lastzt lastzt 1 firstx 1 lastx lastx 1 firsty 1 lasty lasty 1 jpj 1 domdef firstx lastx firsty lasty firstz lastz index gridtype vargrid IF keyword_set onlybox THEN return grille mask glam gphi gdep nx ny nz firstx firsty firstz lastx lasty lastz on definit la triangulation qui va nous permetre de determiner la section on la recalcule car elle doit etre definie sur la terre aussi bien que sur la mer suivant le sens de la section plutot longitude ou plutot latitude on definit la facon de trianguler if strpos type x NE 1 then BEGIN downward lindgen nx ny 0:nx 2 0:ny 2 tri definetri nx ny downward ENDIF ELSE tri definetri nx ny If we have an irregular grid that is periodic then it is possible that some of the triangle have a very large size neighborg points on the sphere but far away when doing the projection and should not be taken into account IF keyword_set key_irregular AND keyword_set key_periodic THEN BEGIN glamtri glam tri glamtri abs glamtri shift glamtri 1 0 good temporary glamtri LT 10 max glam nx good where total temporary good 1 EQ 3 tri temporary tri temporary good ENDIF equation de la droite suivant laquelle on fait la section abc linearequation endpoints 0:1 endpoints 2:3 glamtri glam tri gphitri gphi tri quels sont les points de la triangulation qui sont au dessus et au dessous de la droite if abc 1 NE 0 THEN test temporary gphitri GE abc 0 abc 1 temporary glamtri abc 2 abc 1 ELSE test temporary glamtri GE abc 1 abc 0 temporary gphitri abc 2 abc 0 zero123 total test 1 to keep: triangles de la triangulation qui sont a cheval sur la droite tokeep1 where zero123 EQ 1 tokeep2 where temporary zero123 EQ 2 tokeep tokeep1 tokeep2 test test tokeep tri tri tokeep quel est le sommet du triangle qui est seul d un cote de la droite single1 where test 0:n_elements tokeep1 1 EQ 1 single1 single1 single1 3 3 single2 where test n_elements tokeep1 :n_elements tokeep 1 EQ 0 single2 single2 single2 3 3 undefine tokeep undefine tokeep1 undefine tokeep2 undefine test single temporary single1 temporary single2 points1 le point du triangles qui est seul d un cote de la droite point2 l autre point du triangle de l autre cote de la droite point1 single single point2 single EQ 0 1 single LE 1 undefine single ntri size tri 2 index lindgen ntri lindgen ntri points1 tri point1 index points2 tri point2 temporary index points : complexe contenant les couples de points de part et d autre de la droite Ils faut supprimer les doublons points dcomplex points1 points2 points points uniq points sort points symetrique dcomplex imaginary points double points points points where points shift temporary symetrique 1 NE 0 points1 les coordnnees du point du triangles qui est seul d un cote de la droite point2 les coordnnees de l autre point du triangle de l autre cote de la droite points1 complex glam double points gphi double points points2 complex glam imaginary points gphi imaginary points droites les equations des droites dont on cherche l intersection avec la section droites linearequation points1 points2 inter lineintersection droites abc replicate 1 n_elements points1 les ccordonnes geographiques des points que l on cherche sur la section glamaxe float inter gphiaxe imaginary inter on les range ds l ordre croissant entre les bornes de la section if strpos type x NE 1 then BEGIN sort sort glamaxe glamaxe glamaxe sort inbox where glamaxe GE lon1 AND glamaxe LE lon2 glamaxe glamaxe inbox sort sort inbox gphiaxe gphiaxe sort ENDIF ELSE BEGIN sort sort gphiaxe gphiaxe gphiaxe sort inbox where gphiaxe GE lat1 AND gphiaxe LE lat2 gphiaxe gphiaxe inbox sort sort inbox glamaxe glamaxe sort ENDELSE points points sort points1 points1 sort points2 points2 sort inter inter sort poids abs points2 inter abs points2 points1 array litchamp field array fitintobox array if array 0 EQ 1 THEN BEGIN res 1 return ENDIF if n_elements valmask EQ 0 THEN valmask 1e20 taille size array if jpt GT 1 AND taille 0 GE 3 AND strpos type t EQ 1 then BEGIN direc t array grossemoyenne array t taille size array jpt 1 ENDIF case 1 of xy taille 0 EQ 2:BEGIN value1 array double points terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan value2 array imaginary points terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan res poids value1 1 poids value2 END xyz taille 0 EQ 3 AND jpt EQ 1:BEGIN npoints n_elements points index double points replicate 1 nz replicate nx ny npoints lindgen nz value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 nz replicate nx ny npoints lindgen nz value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 nz res poids value1 1 poids value2 moyenne suivant z if strpos type z EQ 1 then begin nan where finite res EQ 0 if vargrid EQ W then e3 e3w firstzw:lastzw ELSE e3 e3t firstzt:lastzt weight replicate 1 npoints e3 if nan 0 NE 1 then weight nan values f_nan totalweight total weight 2 nan zero where totalweight EQ 0 if zero 0 NE 1 then totalweight zero values f_nan res total res weight 2 nan totalweight direc z string byte testvar var toto endif END xyt taille 0 EQ 3 AND jpt NE 1:BEGIN npoints n_elements points index double points replicate 1 jpt replicate nx ny npoints lindgen jpt value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 jpt replicate nx ny npoints lindgen jpt value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 jpt res poids value1 1 poids value2 END xyzt taille 0 EQ 4:BEGIN npoints n_elements points index double points replicate 1 nz jpt replicate nx ny npoints lindgen nz jpt index reform index npoints nz jpt over value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 nz jpt replicate nx ny npoints lindgen nz jpt index reform index npoints nz jpt over value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 nz jpt poids reform poids npoints nz jpt over res poids value1 1 poids value2 moyenne suivantz if strpos type z EQ 1 then begin nan where finite res EQ 0 if vargrid EQ W then e3 e3w firstzw:lastzw ELSE e3 e3t firstzt:lastzt weight replicate 1 npoints e3 weight weight replicate 1 jpt weight reform weight npoints nz jpt over if nan 0 NE 1 then weight nan values f_nan totalweight total weight 2 nan zero where totalweight EQ 0 if zero 0 NE 1 then totalweight zero values f_nan res total res weight 2 nan totalweight direc z string byte testvar var toto endif END endcase terre where finite res EQ 0 if terre 0 NE 1 then res terre valmask if n_elements showbuild then BEGIN winsave window psave p xsave x ysave y plt findgen nx ny nodata nofill rempli title subtitle coast_thick 2 window showbuild p title p subtitle plots endpoints 0 endpoints 2 endpoints 1 endpoints 3 color 50 plots endpoints 0 endpoints 2 endpoints 1 endpoints 3 color 50 psym 2 thick 2 FOR i 0 n_elements points1 1 DO plots float points1 i float points2 i imaginary points1 i imaginary points2 i color 150 plots float points1 imaginary points1 color 150 psym 1 plots float points2 imaginary points2 color 150 psym 1 plots float inter imaginary inter color 250 psym 1 bug IF terre 0 NE 1 THEN plots float terre inter imaginary terre inter color 0 psym 1 dummy read dummy prompt press return to continue IF d name EQ PS THEN erase ELSE wset winsave p psave x xsave y ysave ENDIF restoreboxparam boxparam4section dat return end");328 a[326] = new Array("./ToBeReviewed/TRIANGULATION/tracecote.html", "tracecote.pro", "", " NAME:tracecote PURPOSE: dessine les cotes ds plt CATEGORY: pour faire un joli dessin CALLING SEQUENCE:tracecote mask INPUTS:mask le tableau mask sur la zone consideree pour le dessin KEYWORD PARAMETERS: COAST_COLOR: the color of the coastline defaut value is 0 black COAST_THICK: l epaisseur du trait pour tracer les continents par defaut c est 1 SURFACE_COASTLINE: to draw the furface coast line instead of the coast line at level firstz tw Usefull only for deep plots XSEUIL: pour eliminer les segments de cote qui sont trop grand qui relient des points qui peuvent etre tres proches sur la sphere mais tres eloignes sur le dessin on supprime tous les egments dot la taille depasse: taille de la fenetre suivant X xseuil Par defaut xseuil est egale a 5 masi peut etre trop grand si on fait un fort zoom ou trout petit pour certaines projections le specifier alors a l aide de ce mot cle YSEUIL: cf xseuil OUTPUTS: rien COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 30 9 1999 PRO tracecote SURFACE_COASTLINE surface_coastline _EXTRA ex include commons compile_opt idl2 strictarrsubs cm_4data cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF tempsun systime 1 pour key_performance if n_elements key_gridtype EQ 0 then key_gridtype c on agrandi un peu le cadre definit par les premier dernier de facon a bien recuperer les bords de cote qui sont en bordure du domaine a tracer tempdeux systime 1 pour key_performance 2 firstx 0 min firstxt firstxf 1 lastx max lastxt lastxf 1 min firstyt firstyf 1 lasty max lastyt lastyf 1 jpj 1 nx lastx firstx 1 ny lasty firsty 1 quel niveau vertical choisir IF keyword_set surface_coastline THEN firstz 0 ELSE IF strupcase vargrid eq W THEN firstz firstzw ELSE firstz firstzt attribution du masque et des coordonnes delimitant les limites de la terre coordonnees f mask tmask firstx:lastx firsty:lasty firstz xf glamf firstx:lastx firsty:lasty yf gphif firstx:lastx firsty:lasty IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner mask xf yf systime 1 tempdeux if key_gridtype EQ e then onemore xf 0 0 gT xf 0 1 on passe en coordonnee normaliser pour pouvoir s affranchir du type de projection choisie et du suport surlequel on fait le dessin ecran ou postscript z convert_coord xf yf data to_normal xf reform z 0 nx ny yf reform z 1 nx ny tempvar SIZE TEMPORARY z attention suivant la projection certains points x ou y peuvent devenir NaN cf points deriere la terre ds une projection orthographique on met les points a eliminer a une tres gande valeur comme ca il ne passerons pas le test avec distanceseuil cf plus bas if map projection LE 7 AND map projection NE 0 OR map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 then begin ind where finite xf yf EQ 0 IF ind 0 NE 1 THEN BEGIN xf ind 1e5 yf ind 1e5 ENDIF ENDIF ind where xf LT p position 0 OR xf GT p position 2 IF ind 0 NE 1 THEN xf ind 1e5 ind where yf LT p position 1 OR yf GT p position 3 IF ind 0 NE 1 THEN yf ind 1e5 tempvar SIZE TEMPORARY ind on efface ind if n_elements key_gridtype EQ 0 then key_gridtype c case key_gridtype of c :drawcoast_c mask xf yf nx ny _extra ex e :drawcoast_e mask xf yf nx ny onemore onemore _extra ex endcase if keyword_set key_performance THEN print temps tracecote systime 1 tempsun return end");329 a[327] = new Array("./ToBeReviewed/TRIANGULATION/tracemask.html", "tracemask.pro", "", " NAME:tracemask PURPOSE:dessiner des contour d un mask CATEGORY:plus simple que tracecote car ne s occuppe pas du type de projection et de la periodicite de la grille CALLING SEQUENCE: tracemask maskentree xentree yentree INPUTS:maskentree xentree yentree tableaux 2d specifiant le mask et ses coordonees en longitude te latitude KEYWORD PARAMETERS: COAST_COLOR: the color of the coastline defaut value is 0 black COAST_THICK: l epaisseur du trait pour tracer les continents par defaut c est 1 OUTPUTS: none COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO tracemask maskentree xin yin COAST_COLOR coast_color COAST_THICK coast_thick OVERPLOT overplot _extra ex compile_opt idl2 strictarrsubs if keyword_set overplot then return cm_general IF NOT keyword_set key_forgetold THEN BEGIN updatekwd ENDIF tempsun systime 1 pour key_performance on s afranchit des problemes de bord: tempdeux systime 1 pour key_performance 2 tailleentree size maskentree nx tailleentree 1 1 ny tailleentree 2 1 we check the input axis IF n_elements xin EQ 0 THEN xentree findgen nx 1 ELSE xentree xin IF size xentree 0 EQ 1 THEN xentree xentree replicate 1 ny 1 IF n_elements yin EQ 0 THEN yentree findgen ny 1 ELSE yentree yin IF size yentree 0 EQ 1 THEN yentree replicate 1 nx 1 yentree on agrandi le mask de une colonne a gauche et de une colonne en bas mask intarr tailleentree 1 1 tailleentree 2 1 mask 1:tailleentree 1 1:tailleentree 2 maskentree les 2 premieres colonnes sont identiques mask 0 1:tailleentree 2 maskentree 0 les 2 premieres lignes sont identiques mask 1:tailleentree 1 0 maskentree 0 on calcul la position suivant x des points qui seviront a tracer le masque ils sont situes entre chaque points du masque sauf pour la derniere colonne que l on ne peut pas calculer et que l on met donc a max x range xrange x range sort x range si reverse_x est utilise xentree 5 xentree shift xentree 1 0 IF not keyword_set overplot THEN xentree nx 2 xrange 1 ELSE xentree nx 2 xentree nx 3 on seuil xentree xrange 0 xentree yentree yrange 1 yf fltarr nx ny yf 1:nx 1 1:ny 1 yentree yf 0 1:ny 1 yentree 0 IF not keyword_set overplot THEN BEGIN if yinverse then yf 0 yrange 1 ELSE yf 0 yrange 0 ENDIF ELSE yentree 0 yentree 1 IF testvar var key_performance EQ 2 THEN print temps tracemask: determination du mask et des ses coordonnes systime 1 tempdeux on trace les segments verticaux: tempdeux systime 1 pour key_performance 2 liste where mask shift mask 1 0 EQ 1 IF liste 0 NE 1 THEN BEGIN on recupere lx et ly qui sont les indices ds un tableau 2d des points donnes par liste ly liste nx lx temporary liste nx ly indice where ly NE 0 on ne prend pas les points concernant la premiere ligne car ds ce cas le pt j 1 n est pas definit if indice 0 NE 1 then begin lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracemask: liste traits verticaux systime 1 tempdeux tempdeux systime 1 pour key_performance 2 boucle sur les points concernes et trace du segment rq: on utilise plots au lieu de plot car plots est bcp plus rapide for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i j 1 xf i j yf i j 1 yf i j color coast_color thick coast_thick _extra ex if pt LT 5 then begin endif endfor IF testvar var key_performance EQ 2 THEN print temps tracemask: trace traits verticaux systime 1 tempdeux endif ENDIF on trace les segments horizontaux: tempdeux systime 1 pour key_performance 2 liste where mask shift mask 0 1 EQ 1 IF liste 0 NE 1 THEN BEGIN ly liste nx lx temporary liste nx ly indice where lx NE 0 on ne prend pas les points de la premiere colonne if indice 0 EQ 1 then return lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracemask: liste traits horizontaux systime 1 tempdeux tempdeux systime 1 pour key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i 1 j xf i j yf i 1 j yf i j color coast_color thick coast_thick _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracemask: trace traits horizontaux systime 1 tempdeux endif if keyword_set key_performance THEN print temps tracemask systime 1 tempsun return end ");330 a[328] = new Array("./ToBeReviewed/TRIANGULATION/triangule.html", "triangule.pro", "", " FUNCTION triangule maskentree BASIC basic COINMONTE coinmonte COINDESCEND coindescend _extra ex compile_opt idl2 strictarrsubs common szmsk size maskentree IF szmsk 0 EQ 0 THEN BEGIN nx jpi ny jpj ENDIF ELSE BEGIN nx szmsk 1 ny szmsk 2 ENDELSE IF nx EQ 1 OR ny EQ 1 THEN return 1 IF arg_present coinmonte THEN coinmonte 1 IF arg_present coindescend THEN coindescend 1 if keyword_set basic then return triangule_c maskentree BASIC COINMONTE coinmonte COINDESCEND coindescend _extra ex if n_elements key_gridtype EQ 0 then key_gridtype c if n_elements maskentree EQ 0 then maskentree tmask 0 case key_gridtype of e :res triangule_e maskentree _extra ex c :res triangule_c maskentree COINMONTE coinmonte COINDESCEND coindescend _extra ex endcase return res end");331 a[329] = new Array("./ToBeReviewed/TRIANGULATION/triangule_c.html", "triangule_c.pro", "", " NAME:triangule_c PURPOSE:construit le tableau de triangulation L idee est de construire une liste de triangles qui relient les points entre eux Ceci est fait automatiquement avec la fonction TRIANGULATE ICI: on tient compte du fait que les points sont disposes sur une grille reguliere ou pas mais pas destructuree cad que les points sont ecrits suivant une matrice rectangulaire Un moyen tres simple de faire des triangles entre tous les points est alors: pour chaque point i j de la matrice sauf ceux de la derniere ligne et de la derniere colonne on on appelle le rectangle i j le rectangle forme par les 4 points i j i 1 j i j 1 i 1 j 1 Pour tracer tous les triangles il suffit de tracer les 2 triangles contenus ds les rectangles i j au passage on remarque que chaque rectangle i j possede 2 diagonales si si faites un dessin c est vrai il y a donc 2 choix possibles pour chaque rectangles qd on veut le couper en 2 triangles C est grace a ce choix que l on va pouvoir tracer les cotes avec des angles droits A chaque angle de cote remarquable par l existance d un unique point terre ou d un unique point mer sur les 4 cotes d un rectangle i j il faut couper le rectangle suivant la diagonale qui qui passe par le point singulier CATEGORY:pour faire de beaux graphiques masques CALLING SEQUENCE:res triangule mask INPUTS:optionnel:mask c est le tableau 2d qui sevira a masquer le champ que l on tracera apres avec CONTOUR TRIANGULATION triangule mask si cet argument n est pas specifie la function utilise tmask KEYWORD PARAMETERS: BASIC: specifie que le masque est sur une grille basice utiliser pour la triangulation ds les coupes verticales et des hovmoellers KEEP_CONT: to keep the triangulation even on the continents COINMONTE tableau pour obtenir le tableau de coins de terre montant a traiter avec completecointerre pro ds la variable tableau plutot que de la faire passer par la variable globale twin_corners_up COINDESCEND tableau cf COINMONTE OUTPUTS: res: tableau 2d 3 nbre de triangles chaque ligne de res represente les indices des points constituants les sommets d un triangle cf comment on trace les triangles ds dessinetri pro COMMON BLOCKS: common pro different pro definetri pro SIDE EFFECTS: RESTRICTIONS:les donnees dont un veut ensuite faire le contour doivent etre disposees dans une matrice Par contre dans la matrice la disposition des points peut ne pas etre irreguliere Si les donnees sont disposees completement de facon irreguliere utiliser TRIANGULE EXAMPLE: MODIFICATION HISTORY: Sebastien Masson smasson lodyc jussieu fr 26 4 1999 FUNCTION triangule_c maskentree COINMONTE coinmonte COINDESCEND coindescend BASIC basic KEEP_CONT keep_cont compile_opt idl2 strictarrsubs tempsun systime 1 pour key_performance cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF le masque est donne ou il faut prendre tmask msk maskentree taille size msk nx taille 1 ny taille 2 IF n_elements keep_cont EQ 0 THEN keep_cont 1 key_irregular if keyword_set key_periodic nx EQ jpi AND NOT keyword_set basic then BEGIN msk msk msk 0 nx nx 1 ENDIF on va trouver la liste des rectangles i j reperes par leur coin en bas a gauche qu il faut couper suivant une diagonale descendante on appellera cette liste : pts_downward pts_downward 0 on construit le test qui permet de trouver un tel triangle: shift msk 0 1 shift msk 1 1 msk shift msk 1 0 sum1 msk shift msk 1 0 shift msk 1 1 pts qui entourrent le pt en haut a gauche sum2 msk shift msk 0 1 shift msk 1 1 pts qui entourrent le pt en bas a droite tempdeux systime 1 pour key_performance 2 pt terre en haut a gauche entoure de pts mer liste where 4 sum1 1 shift msk 0 1 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste pt mer en haut a gauche entoure de pts terre liste where 1 sum1 shift msk 0 1 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste pt terre en bas a droite entoure de pts mer liste where 4 sum2 1 shift msk 1 0 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste pt mer en bas a droite entoure de pts terre liste where 1 sum2 shift msk 1 0 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste undefine liste IF testvar var key_performance EQ 2 THEN print temps triangule: trouver pts_downward systime 1 tempdeux if NOT keyword_set basic OR keyword_set coinmonte OR keyword_set coindescend then begin tempdeux systime 1 pour key_performance 2 2 points terre en diagonale montante avec 2 points mer sur la diagonale descendante coinmont where 1 msk 1 shift msk 1 1 shift msk 0 1 shift msk 1 0 EQ 1 if coinmont 0 NE 1 THEN pts_downward pts_downward coinmont IF testvar var key_performance EQ 2 THEN print temps triangule: trouver coinmont systime 1 tempdeux tempdeux systime 1 pour key_performance 2 2 points terre en diagonale descendante avec 2 points mer sur la diagonale montante coindesc where 1 shift msk 0 1 1 shift msk 1 0 msk shift msk 1 1 EQ 1 IF testvar var key_performance EQ 2 THEN print temps triangule: trouver coindesc systime 1 tempdeux ENDIF if n_elements pts_downward EQ 1 then BEGIN tempdeux systime 1 pour key_performance 2 triang definetri nx ny IF testvar var key_performance EQ 2 THEN print temps triangule: definetri systime 1 tempdeux coinmont 1 coindesc 1 ENDIF ELSE BEGIN tempdeux systime 1 pour key_performance 2 pts_downward pts_downward 1:n_elements pts_downward 1 pts_downward pts_downward uniq pts_downward sort pts_downward aucun rectangle ne peut avoir comme coin en bas a gauche un element de la derniere colonne ou de la derniere ligne il faut donc enlever ces points si ils ont ete selectionnes dans pts_downward derniere_colonne lindgen ny 1 nx 1 derniere_ligne lindgen nx ny 1 nx pts_downward different pts_downward derniere_colonne pts_downward different pts_downward derniere_ligne if NOT keyword_set basic OR keyword_set coinmonte OR keyword_set coindescend then begin if coinmont 0 NE 1 then begin coinmont different coinmont derniere_colonne coinmont different coinmont derniere_ligne endif if coindesc 0 NE 1 then begin coindesc different coindesc derniere_colonne coindesc different coindesc derniere_ligne endif ENDIF ELSE BEGIN coinmont 1 coindesc 1 ENDELSE IF testvar var key_performance EQ 2 THEN print temps triangule: menage ds pts_downward coinmont et coindesc systime 1 tempdeux tempdeux systime 1 pour key_performance 2 if pts_downward 0 EQ 1 then triang definetri nx ny ELSE triang definetri nx ny pts_downward IF testvar var key_performance EQ 2 THEN print temps triangule: definetri systime 1 tempdeux ENDELSE on vire les triangles qui ne contiennent que des points terre tres bonne idee qui ne marche pas encore a 200 avec IDL 5 2 ca devrait aller mieux dans les prochaines versions d IDL if NOT keyword_set basic AND NOT keyword_set keep_cont then begin tempdeux systime 1 pour key_performance 2 on enleve les rectangles qui sont entierement dans la terre recdsterre where 1 msk 1 shift msk 1 0 1 shift msk 0 1 1 shift msk 1 1 EQ 1 IF testvar var key_performance EQ 2 THEN print temps triangule: tous les recdsterre systime 1 tempdeux en attendant une version qui marche parfaitement on est contraint de faire un nouveau tri: il ne faut pas enlever les rectangles qui n ont qu un sommet en commun t1 systime 1 indice intarr nx ny trimask intarr nx ny trimask 0:nx 2 0:ny 2 1 IF recdsterre 0 NE 1 then BEGIN tempdeux systime 1 pour key_performance 2 indice recdsterre 1 if NOT keyword_set basic then begin vire1 0 vire2 0 while vire1 0 NE 1 OR vire2 0 NE 1 ne 0 do begin vire sont les rectangles qu il faut retirer de recsterre en fait qu il faut garder bien qu ils soient entirement dans la terre vire1 where indice shift indice 1 1 1 shift indice 0 1 1 shift indice 1 0 trimask EQ 1 if vire1 0 NE 1 THEN BEGIN indice vire1 0 indice vire1 nx 1 0 endif vire2 where 1 indice 1 shift indice 1 1 shift indice 0 1 shift indice 1 0 trimask EQ 1 if vire2 0 NE 1 THEN BEGIN indice vire2 1 0 indice vire2 nx 0 endif endwhile IF testvar var key_performance EQ 2 THEN print temps triangule: trier les recdsterre systime 1 tempdeux endif indice ny 1 1 la deriere colonne te la derniere ligne indice nx 1 1 ne peuvent definir de rectangle tempdeux systime 1 pour key_performance 2 recgarde where indice EQ 0 on recupere les numeros des triangles que l on va garder trigarde 2 recgarde recgarde nx trigarde transpose temporary trigarde trigarde trigarde trigarde 1 triang triang temporary trigarde IF testvar var key_performance EQ 2 THEN print temps triangule: virer les triangle de la liste systime 1 tempdeux endif endif print temps tri triangles systime 1 t1 quand key_periodic eq 1 triang est une liste d indice d un tableau qui a une colonne de trop il faut ramener ca a la matrice initiale en mettant les indivces de la derniere colonne egaux a ceux de la derniere colonne tempdeux systime 1 pour key_performance 2 if keyword_set key_periodic nx 1 EQ jpi AND NOT keyword_set basic then BEGIN indicey triang nx indicex triang indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 then indicex liste 0 triang indicex nx indicey nx nx 1 if coinmont 0 NE 1 then begin indicey coinmont nx indicex coinmont indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coinmont indicex nx indicey nx nx 1 endif if coindesc 0 NE 1 then begin indicey coindesc nx indicex coindesc indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coindesc indicex nx indicey nx nx 1 endif endif IF testvar var key_performance EQ 2 THEN print temps triangule: finitions systime 1 tempdeux if keyword_set coinmonte THEN coinmonte coinmont ELSE twin_corners_up coinmont if keyword_set coindescend THEN coindescend coindesc ELSE twin_corners_dn coindesc IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF IF keyword_set key_performance THEN print temps triangule systime 1 tempsunreturn triang END ");332 a[330] = new Array("./ToBeReviewed/TRIANGULATION/triangule_e.html", "triangule_e.pro", "", " NAME:triangule_e PURPOSE:buid the triangulation for a E grid type CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr june 2001 FUNCTION triangule_e maskentree COINMONTE coinmonte COINDESCEND coindescend SHIFTED shifted BASIC basic compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF tempsun systime 1 pour key_performance le masque est donne ou il faut prendre tmask msk maskentree sizem size msk nx sizem 1 ny sizem 2 if keyword_set key_periodic nx EQ jpi AND NOT keyword_set basic then BEGIN msk msk msk 0 nx nx 1 ENDIF we will find the diamond that must be cut in two triangle using the horizontal diagonal index lindgen nx ny index index 0:nx 2 1:ny 2 if n_elements shifted EQ 0 then shifted 1 oddeven index nx 1 shifted MOD 2 msk1 msk index msk2 msk index 1 sum msk index nx oddeven msk index nx oddeven sum1 msk2 sum sum2 msk1 sum horizontal singularpoint where msk1 EQ 0 AND sum1 EQ 3 OR msk1 EQ 1 AND sum1 EQ 0 OR msk2 EQ 0 AND sum2 EQ 3 OR msk2 EQ 1 AND sum2 EQ 0 OR sum EQ 0 AND msk1 msk2 EQ 2 if singularpoint 0 NE 1 then begin horizontal index singularpoint triang definetri_e nx ny horizontal SHIFTED shifted ENDIF ELSE triang definetri_e nx ny SHIFTED shifted coinmont index where sum EQ 2 AND msk1 msk2 EQ 0 coindesc index where sum EQ 0 AND msk1 msk2 EQ 2 we keep only the triangles which are outside the land but for some reasons we will in fact delete the land diamond allrecinland where sum1 msk1 EQ 0 indexallinland index allrecinland otherrec lindgen nx ny 0:nx 2 1:ny 2 otherrec different otherrec indexallinland index lindgen nx ny index index 0:nx 3 2:ny 3 out inter index indexallinland IF out 0 NE 1 THEN begin out inter out 1 indexallinland IF out 0 NE 1 THEN begin out out 1 oddeven out nx 1 shifted MOD 2 out inter out nx oddeven otherrec IF out 0 NE 1 THEN begin out inter out 2 nx otherrec IF out 0 NE 1 THEN begin out out nx out nx shifted MOD 2 endif endif endif ENDIF help out index lindgen nx ny index index 0:nx 3 2:ny 3 out inter index otherrec IF out 0 NE 1 THEN begin out inter out 1 otherrec IF out 0 NE 1 THEN begin out out 1 oddeven out nx 1 shifted MOD 2 out inter out nx oddeven indexallinland IF out 0 NE 1 THEN begin out inter out 2 nx indexallinland IF out 0 NE 1 THEN begin out out nx out nx shifted MOD 2 endif endif endif endif help out IF out 0 EQ 1 THEN out different indexallinland out ELSE out indexallinland triout numtri out nx ny triout triout triout 1 goodtri lindgen 2 nx 1 ny 1 goodtri different goodtri triout triang triang temporary goodtri quand key_periodic eq 1 triang est une liste d indice d un tableau qui a une colonne de trop il faut ramener ca a la matrice initiale en mettant les indivces de la derniere colonne egaux a ceux de la derniere colonne tempdeux systime 1 pour key_performance 2 if keyword_set key_periodic nx 1 EQ jpi AND NOT keyword_set basic then BEGIN indicey triang nx indicex triang indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 then indicex liste 0 triang indicex nx indicey nx nx 1 if coinmont 0 NE 1 then begin indicey coinmont nx indicex coinmont indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coinmont indicex nx indicey nx nx 1 endif if coindesc 0 NE 1 then begin indicey coindesc nx indicex coindesc indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coindesc indicex nx indicey nx nx 1 endif endif IF testvar var key_performance EQ 2 THEN print temps triangule: finitions systime 1 tempdeux if arg_present coinmonte THEN coinmonte coinmont ELSE twin_corners_up coinmont if arg_present coindescend THEN coindescend coindesc ELSE twin_corners_dn coindesc IF NOT keyword_set key_forgetold THEN BEGIN updateoldENDIF IF keyword_set key_performance THEN print temps triangule systime 1 tempsun return triang END ");333 a[331] = new Array("./ToBeReviewed/UTILITAIRE/get_extra.html", "get_extra.pro", "", " todo seb elle fait quoi elle permet : soit de creer une variable extra contenant les mots clefs que tu desires soit de completer une variable extra avec des mots clefs que tu rajoutes imagine : tu es dans une routine et tu veux passer un mot clef en extra car la routine que tu appelles ne le connait pas mais la routine suivante oui tu fais extra get_extra ok year 1999 age_capitaine 35 et tu obtiens la bonne variable extra fait un help extra struc ou alors tu completes un extra existant : extra get_extra _extra extra name Guillaume FUNCTION get_extra _extra extra compile_opt idl2 strictarrsubs return extra END ");313 a[311] = new Array("./ToBeReviewed/STRUCTURE/chkstru.html", "chkstru.pro", "", " file_comments check validity of a structure and test if necessary fields are contained categories tools param STRUCTURE in required The structure to be tested If STRUCTURE is not of type structure the function will return 0 param FIELDS in required A string or string array with field names to be contained in STRUCTURE CHKSTRU returns 1 true only if all field names are contained in STRUCTURE The entries of FIELDS may be upper or lowercase keyword INDEX A named variable that will contain the indices of the required field names in the structure They can then be assessed through structure index i Index will contain 1 for all fields entries that are not in the structure keyword VERBOSE set this keyword to return an error message in case of an error keyword EXTRACT set this keyword to extract a fields from the structure 1 is return is fields or structure are incorrect returns CHKSTRU returns 1 if successful otherwise 0 examples test a:1 b:2 c:3 required a c if CHKSTRU test required then print found a and c IDL print CHKSTRU test b 1 IDL print CHKSTRU test b extract 2 history mgs 02 Mar 1998: VERSION 1 00 mgs 07 Apr 1998: second parameter FIELDS now optional 12 Jan 2001: EXTRACT keyword by S Masson smasson lodyc jussieu fr version Id: chkstru pro 150 2006 08 09 10:12:54Z navarro Copyright C 1998 Martin Schultz Harvard University This software is provided as is without any warranty whatsoever It may be freely used copied or distributed for non commercial purposes This copyright notice must be kept with any copy of this software If this software shall be used commercially or sold as part of a larger package please contact the author to arrange payment Bugs and comments should be directed to mgs io harvard edu with subject IDL routine chkstru function chkstru structure fields index index verbose verbose extract extract compile_opt idl2 strictarrsubs default index index 1 first check number of parameters must be at least 1 if n_params lt 1 then begin if keyword_set verbose then ras report CHKSTRU: invalid number of parameters if keyword_set extract THEN return 1 ELSE return 0 endif check if the user really passed a structure s size structure if s 1 s 0 ne 8 then begin if keyword_set verbose then ras report CHKSTRU: No structure passed if keyword_set extract THEN return 1 ELSE return 0 endif only one parameter: then we are finished if n_params eq 1 then return 1 see if required field names are contained in the structure and return indices of these fields names tag_names structure index intarr n_elements fields 1 default index to not found for i 0 n_elements fields 1 do begin ind where names eq strupcase fields i if ind 0 lt 0 then begin if keyword_set verbose then ras report CHKSTRU: Cannot find field fields i endif else index i ind 0 endfor check minimum value of index field: 1 indicates error if keyword_set extract then BEGIN if index 0 NE 1 THEN return structure index 0 ELSE return 1 ENDIF ELSE return min index ge 0 end "); 314 a[312] = new Array("./ToBeReviewed/STRUCTURE/extractstru.html", "extractstru.pro", "", " file_comments extract elements of a structure to constitute a new structure categories utilities param STRU in required A structure param LISTE in required A vector of string including names of STRU to be deleted by default or to be kept if KEEP is activated keyword KEEP Specify that the given liste concern elements of STRU to be kept keyword DELETE: Specify that the given liste concern elements of STRU to be deleted This keyword is activated by default returns A structure or 1 in case of problem examples IDL extra get_extra ok year 1999 age_capitaine 35 IDL help extra struct Structure 3 tags length 6 refs 1: AGE_CAPITAINE INT 35 OK INT 1 YEAR INT 1999 IDL help extractstru extra ok hhuihi YEAR stru Structure 1 tags length 2 refs 1: AGE_CAPITAINE INT 35 IDL help extractstru extra ok hhuihi YEAR keep stru Structure 2 tags length 4 refs 1: OK INT 1 YEAR INT 1999 history Sebastien Masson smasson lodyc jussieu fr 8 10 1999 version Id: extractstru pro 150 2006 08 09 10:12:54Z navarro FUNCTION extractstru stru liste KEEP keep DELETE delete compile_opt idl2 strictarrsubs if size stru type NE 8 then return 1 if size liste type NE 7 then return 1 cheking for keep and vire keywords keep keyword_set keep 1 keyword_set delete delete keyword_set delete 1 keyword_set keep keyword_set delete EQ keep tname tag_names stru index make_selection tname strupcase liste only_valid quiet if keep then BEGIN We just keep the list if index 0 EQ 1 then return 1 if n_elements index EQ n_elements tname then return stru res create_struct tname index 0 stru index 0 if n_elements index GT 1 then for i 1 n_elements index 1 do res create_struct res tname index i stru index i ENDIF ELSE BEGIN We delete the list if n_elements index EQ n_elements tname then return 1 if index 0 EQ 1 then return stru We take the complementary one of index to obtain indexes we keep index different indgen n_elements tname index res create_struct tname index 0 stru index 0 if n_elements index GT 1 then for i 1 n_elements index 1 do res create_struct res tname index i stru index i ENDELSE return res end"); 315 a[313] = new Array("./ToBeReviewed/STRUCTURE/mixstru.html", "mixstru.pro", "", " file_comments Concatenate 2 structures together The difference with CREATE_STRUCT is that if the 2 structure have same elements s name then mixstru do not break down but choose for the common element the value specified by the first structure categories structure param STRU1 in required Structure which can have same elements s name than STRU2 but with a different value param STRU2 in required Structure which can have same elements s name than STRU1 but with a different value returns A stucture restrictions If STRU1 or STRU2 is not a structure mixstru send back 1 examples IDL a get_extra toto ok 123 IDL b get_extra ok 111 year 1999 age_capitaine 35 IDL help a b struct Structure 2 tags length 4 refs 1: OK INT 123 TOTO INT 1 Structure 3 tags length 6 refs 1: AGE_CAPITAINE INT 35 OK INT 111 YEAR INT 1999 IDL help mixstru a b struct Structure 4 tags length 8 refs 1: AGE_CAPITAINE INT 35 YEAR INT 1999 OK INT 123 TOTO INT 1 IDL help mixstru b a struct Structure 4 tags length 8 refs 1: TOTO INT 1 AGE_CAPITAINE INT 35 OK INT 111 YEAR INT 1999 history Sebastien Masson smasson lodyc jussieu fr 7 10 1999 version Id: mixstru pro 150 2006 08 09 10:12:54Z navarro FUNCTION mixstru stru1 stru2 compile_opt idl2 strictarrsubs cm_general IF size stru1 type EQ 0 AND size stru2 type EQ 8 THEN return stru2 IF size stru2 type EQ 0 AND size stru1 type EQ 8 THEN return stru1 if size stru1 type NE 8 then return 1 if size stru2 type NE 8 then return 1 tname tag_names stru2 str FOR i 0 n_tags stru2 1 DO str str tname i stru2 strtrim i 2 res createfunc get_extra str _extra stru1 kwdlist stru1 stru1 stru2 stru2 stru1 stru1 stru2 stru2 filename myuniquetmpdir for_createfunc pro return res end"); 316 a[314] = new Array("./ToBeReviewed/STRUCTURE/struct2string.html", "struct2string.pro", "", " file_comments Convert a structure to an executable string categories utilities param STRUCT in required A structure keyword MAX_STRUCT_LENGTH The maximum length of the structure permetted to convert the structure to string Default is 10000l keyword DIRECT2STRING To get a string instead an executable string keyword CUT_IN_STRING Try it restrictions Use tostr pro cf this function header examples IDL print struct2string d create_struct NAME X X_SIZE 891 Y_SIZE 630 X_VSIZE 891 Y_VSIZE 630 X_CH_SIZE 6 Y_CH_SIZE 10 X_PX_CM 40 0000 Y_PX_CM 40 0000 N_COLORS 16777216 TABLE_SIZE 256 FILL_DIST 1 WINDOW 32 UNIT 0 FLAGS 328124 ORIGIN 0 0 ZOOM 1 1 history Sebastien Masson smasson lodyc jussieu fr 2000 07 03 version Id: struct2string pro 150 2006 08 09 10:12:54Z navarro FUNCTION struct2string struct CUT_IN_STRING cut_in_string MAX_STRUCT_LENGTH max_struct_length DIRECT2STRING direct2string compile_opt idl2 strictarrsubs if size struct type NE 8 then return if NOT keyword_set max_struct_length then max_struct_length 10000l if n_tags struct length GT max_struct_length then begin rien report The structure is too big to be converted to string C See the MAX_STRUCT_LENGTH keyword return endif names tag_names struct case 1 of keyword_set direct2string :BEGIN res names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res names i tostr struct i endfor endif END keyword_set CUT_IN_STRING :BEGIN res create_struct names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res create_struct res names i tostr struct i endfor endif END ELSE:BEGIN res create_struct names 0 tostr struct 0 if n_tags struct GT 1 then begin FOR i 1 n_tags struct 1 do begin res res names i tostr struct i endfor endif res res END endcase return res end"); 317 a[315] = new Array("./ToBeReviewed/STRUCTURE/where_tag.html", "where_tag.pro", "", " file_comments Like WHERE but works on structure tag names Obtain subscripts of elements in structure array for which a particular Tag has values in a range or matching specified values Like the WHERE function but for use with structures categories Structures param STRUCT in required structure array to search keyword TAG_NAME Scalar string specifying Tag Name keyword TAG_NUMBER Otherwise give the Tag Number keyword RANGE min max range to search for in Struct keyword VALUES One or array of numbers to match for in Struct keyword ISELECT Specifies indices to select only part of structure array use it to recycle subscripts from previous searches keyword NOPRINT Suppress informational messages about nothing found returns Nfound out of occurences found restrictions User must specify 1 TAG_NAME or TAG_NUMBER to search and 2 the VALUES or RANGE to search on examples Suppose STR is a structure with tags CAT_NO:indgen 10 and NAME:strarr 10 Find the indices where STR CAT_NO is between 3 and 5 IDL print WHERE_TAG str TAG_NAME CAT_NO VALUE 3 4 5 or IDL print WHERE_TAG str TAG_NUM 0 RANGE 3 5 history written 1990 Frank Varosi STX NASA GSFC Stop printing Tag not found with NOPRINT CD Pike 8 Jun 93 version Id: where_tag pro 150 2006 08 09 10:12:54Z navarro function where_Tag Struct Nfound TAG_NAME Tag_Name TAG_NUMBER Tag_Num ISELECT ipart NOPRINT noprint RANGE range VALUES values First check required parameters compile_opt idl2 strictarrsubs Ntag N_tags Struct if Ntag LE 1 then begin message expecting a Structure Array try again CONTIN return 1 endif if N_elements Tag_Num NE 1 AND N_elements Tag_Name NE 1 then begin message specify TAG_NAME or TAG_NUMBER to search CONTIN return 1 endif Tags Tag_names Struct if N_elements Tag_Name EQ 1 then begin Tag_Name strupcase Tag_Name Tag_Num where Tags EQ Tag_Name Tag_Num Tag_Num 0 if Tag_Num LT 0 then begin if NOT keyword_set noprint then message Tag not found CONTIN return 2 endif endif if Tag_Num LT 0 OR Tag_Num GE Ntag then begin message Tag strtrim Tag_Num 2 exceeds Max Tag strtrim Ntag 1 2 in structure CONTIN return 1 endif if N_elements ipart GT 0 then begin check if any searching on a subset of input w where ipart GE 0 nf if nf LE 0 then return 1 if nf LT N_elements ipart then ipart ipart w endif Now find out where for RANGE : if N_elements range EQ 2 then begin if N_elements ipart GT 0 then begin w where Struct ipart Tag_Num GE range 0 AND Struct ipart Tag_Num LE range 1 Nfound if Nfound GT 0 then windex ipart w else windex w endif else windex where Struct Tag_Num GE range 0 AND Struct Tag_Num LE range 1 Nfound if Nfound LE 0 AND NOT keyword_set noprint then begin strnums strtrim range 2 string strnums 0 strnums 1 message NO values of found in the Range string CONTIN endif where Values: endif else if N_elements values GE 1 then begin Nval N_elements values vals values Nfound 0 if N_elements ipart GT 0 then begin for v 0 Nval 1 do begin w where Struct ipart Tag_Num EQ vals v Nf if Nf GT 0 then begin if Nfound GT 0 then ww ww w else ww w endif Nfound Nfound Nf endfor if Nfound GT 0 then windex ipart ww sort ww else windex w endif else begin for v 0 Nval 1 do begin w where Struct Tag_Num EQ vals v Nf if Nf GT 0 then begin if Nfound GT 0 then ww ww w else ww w endif Nfound Nfound Nf endfor if Nfound GT 0 then windex ww sort ww else windex w endelse if Nfound LE 0 AND NOT keyword_set noprint then begin strnums strtrim vals 2 string strnums 0 for i 1 Nval 1 do string string strnums i message NO values of found Equaling string CONTIN endif endif else begin message must specify a RANGE or VALUES s CONTIN windex 1 endelse return windex end"); 318 a[316] = new Array("./ToBeReviewed/TRIANGULATION/ciseauxtri.html", "ciseauxtri.pro", "", " file_comments Delete arrays which do not have to be drawn thanks to 2 tests: 1 Corners of the array must be in the window 2 Lenghtes of side of triangles expressed in normalized coordinates must not surpass a sill lenght categories param TRIANG param GLAM param GPHI keyword ALL keyword _EXTRA Used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr 20 2 99 version Id: ciseauxtri pro 150 2006 08 09 10:12:54Z navarro FUNCTION ciseauxtri triang glam gphi ALL all _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF NOT keyword_set key_periodic AND NOT keyword_set key_irregular AND NOT map projection LE 7 AND map projection NE 0 AND NOT map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 THEN return triang tempsun systime 1 For key_performance taille size glam nx taille 1 ny taille 2 tempdeux systime 1 For key_performance 2 z convert_coord glam gphi data to_normal x z 0 y z 1 tempvar SIZE TEMPORARY z delete z IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: convert_coord data to_normal systime 1 tempdeux Beware following the projection some points x or y can become NaN see points behind the Earth in an orthographic projection In this case we have to remove all triangle which contain one of these points if map projection LE 7 AND map projection NE 0 OR map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 then begin tempdeux systime 1 For key_performance 2 test x y triang test finite temporary test nan test total temporary test 1 ind where temporary test EQ 0 if ind 0 NE 1 then triang triang temporary ind ELSE return 1 trichanged 1b IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: recherche points a NAN systime 1 tempdeux endif seuil 5 indxtriang2 indxtriang indxmin nx 1 indxmin EQ 0 AND indxmax EQ nx 1 ENDIF ELSE indxtriang indxmin listrect nx indytriang indxtriang IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: liste des rectangles systime 1 tempdeux Now we have this list we will make sure that we do not have triangles with only a common summit test bytarr nx ny test listrect 1 dejavire 1b test tempdeux systime 1 For key_performance 2 vire1 0 vire2 0 while vire1 0 NE 1 OR vire2 0 NE 1 ne 0 do begin vire1 where test shift test 1 1 1 shift test 0 1 1 shift test 1 0 EQ 1 if vire1 0 NE 1 THEN test vire1 0 We delete the rectangle vire2 where 1 test 1 shift test 1 1 shift test 0 1 shift test 1 0 EQ 1 We delete the top rectangle same x index but equal to 1 if vire2 0 NE 1 THEN test vire2 nx 0 ENDWHILE stop test test temporary dejavire avirer where temporary test EQ 0 IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: determinationdes rectangles a virer systime 1 tempdeux if avirer 0 NE 1 then begin tempdeux systime 1 For key_performance 2 indnx n_elements listrect indny n_elements avirer ind listrect replicate 1l indny ind ind EQ replicate 1 indnx avirer if indny GT 1 then ind total ind 2 ind where ind EQ 0 if ind 0 NE 1 then triang triang ind ELSE return 1 endif IF testvar var key_performance EQ 2 THEN print temps ciseauxtri: derniere retouche de la triangulation systime 1 tempdeux endif if keyword_set key_performance THEN print temps ciseauxtri systime 1 tempsun return triang end"); 319 a[317] = new Array("./ToBeReviewed/TRIANGULATION/completecointerre.html", "completecointerre.pro", "", "PRO draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex compile_opt idl2 strictarrsubs cm_4mesh the triangle must not be out of the domain IF min lons max maxlon GE lon1 AND maxlon LE lon2 AND min lats max maxlat GE lat1 AND maxlat LE lat2 then BEGIN the triangle must not be too big z convert_coord lons lats data to_normal alldist z 0 2 z 0 0 2 z 1 2 z 1 0 2 z 0 0 z 0 1 2 z 1 0 z 1 1 2 z 0 1 z 0 2 2 z 1 1 z 1 2 2 IF max alldist LT seuil 2 THEN polyfill lons lats color cont_color _extra ex return ENDIF end file_comments To color cleanly continents categories graphic keyword _EXTRA Used to pass your keywords keyword CONT_COLOR The color of the continent defaut value is d n_colors 1 white uses common pro history Sebastien Masson smasson lodyc jussieu fr 01 10 1999 version Id: completecointerre pro 150 2006 08 09 10:12:54Z navarro PRO completecointerre COINMONTE coinmonte COINDESCEND coindescend CONT_COLOR cont_color INDICEZOOM indicezoom _extra ex compile_opt idl2 strictarrsubs common if NOT keyword_set coinmonte then return if NOT keyword_set coindescend then return if NOT keyword_set indicezoom then return tempsun systime 1 For key_performance definitions of vectors coinmont and coindesc if keyword_set coinmonte then coinmont coinmonte ELSE coinmont twin_corners_up if keyword_set coindescend then coindesc coindescend ELSE coindesc twin_corners_dn IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 definition of coordinates of points numbered 1 2 3 4 5 6 see figures below tempdeux systime 1 For key_performance 2 if coinmont 0 NE 1 OR coindesc 0 NE 1 then BEGIN if keyword_set indicezoom then BEGIN if we use key_stide the t u v and f points are no more related to the same cell because glamf and gphif has be recomputed to be in the middle of two t points IF total key_stride EQ 3 AND finite glamv 0 gphiv 0 NE 0 THEN BEGIN long1 glamv indicezoom lati1 gphiv indicezoom ENDIF ELSE BEGIN long1 glamt indicezoom lati1 gphif indicezoom ENDELSE IF total key_stride EQ 3 AND finite glamu 0 gphiu 0 NE 0 THEN BEGIN long2 glamu indicezoom lati2 gphiu indicezoom ENDIF ELSE BEGIN long2 glamf indicezoom lati2 gphit indicezoom ENDELSE long3 glamf indicezoom lati3 gphif indicezoom ENDIF ELSE BEGIN IF total key_stride EQ 3 AND finite glamv 0 gphiv 0 NE 0 THEN BEGIN long1 glamv lati1 gphiv ENDIF ELSE BEGIN long1 glamt lati1 gphif ENDELSE IF total key_stride EQ 3 AND finite glamu 0 gphiu 0 NE 0 THEN BEGIN long2 glamu lati2 gphiu ENDIF ELSE BEGIN long2 glamf lati2 gphit ENDELSE long3 glamf lati3 gphif ENDELSE nx size long1 dimensions 0 ny size long1 dimensions 1 seuil 5 min nx ny 2 seuil min p position 2 p position 0 seuil p position 3 p position 1 seuil ENDIF IF testvar var key_performance EQ 2 THEN print temps completecointerre: positions des points systime 1 tempdeux Case land corner in ascent: 2 land points in diagonal ascending with 2 ocean points on the descendant diagonal 4 t i nx 1 u i nx t i nx 1 0 1 3 5 v i f i v i 1 t i 0 2 u i t i 1 1 if coinmont 0 NE 1 then BEGIN tempdeux systime 1 For key_performance 2 for id 0 n_elements coinmont 1 do BEGIN i coinmont id ii i MOD nx ij i nx bottom triangle lons long1 i long2 i long3 i lats lati1 i lati2 i lati3 i draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex upper triangle IF ii NE nx 1 AND ij NE ny 1 THEN BEGIN lons long3 i long1 i 1 long2 i nx lats lati3 i lati1 i 1 lati2 i nx draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex ENDIF ENDFOR IF testvar var key_performance EQ 2 THEN print temps completecointerre: trace de cointerremonte systime 1 tempdeux ENDIF Case land corner in descent: 2 land points in diagonal descending with 2 ocean points on the ascendant diagonal 4 t i nx 1 u i nx t i nx 1 0 3 5 v i f i v i 1 1 t i 0 2 u i t i 1 1 if coindesc 0 NE 1 then begin tempdeux systime 1 For key_performance 2 for id 0 n_elements coindesc 1 do BEGIN i coindesc id ii i MOD nx ij i nx IF ii NE nx 1 AND ij NE ny 1 THEN BEGIN left triangle lons long1 i long3 i long2 i nx lats lati1 i lati3 i lati2 i nx draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex right triangle lons long3 i long2 i long1 i 1 lats lati3 i lati2 i lati1 i 1 draw_corner_triangle lons lats seuil CONT_COLOR cont_color _extra ex ENDIF ENDFOR IF testvar var key_performance EQ 2 THEN print temps completecointerre: trace de cointerredescend systime 1 tempdeux ENDIF IF keyword_set key_performance THEN print temps completecointerre systime 1 tempsun return end"); 320 a[318] = new Array("./ToBeReviewed/TRIANGULATION/definetri.html", "definetri.pro", "", " file_comments efine a triangulation array like TRIANGULATE But in a VERY SIMPLE CASE: the points are regulary gridded on nx ny array Find a Delaunay triangulation for this set of points is easy: Points define nx 1 ny 1 rectangles which we can cut in 2 triangles cf figure above ny 1 ny 2 1 0 0 1 2 nx 3 nx 2 nx 1 You have 2 ways to cut a rectangle: 1 the upward diagonal 2 the downward diagonal categories utilities param NX in required The x dimension array param NY in required The y dimension array param DOWNWARD in optional When downward is undefine all rectangles are cut in using the upward diagonal Downward is a vector which contains the rectangles numbers which are cut in using the downward diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle returns triangles is a 2d array and is dimensions are 3 and 2 nx 1 ny 1 triangles is define like in the TRIANGULATE procedure examples triangles definetri 3 3 1 3 triangles will be a this kind of triangulation: history sebastien Masson smlod ipsl jussieu fr 4 3 1999 version Id: definetri pro 150 2006 08 09 10:12:54Z navarro FUNCTION definetri nx ny downward compile_opt idl2 strictarrsubs nx long nx ny long ny if n_elements downward NE 0 THEN BEGIN if n_elements downward GT nx 1 ny 1 then begin print downward a trop d elements par rapport a nx et ny return 1 endif downward long downward ENDIF we define triangles triangles lonarr 3 2 nx 1 ny 1 we cut the rectangles with the upward diagonal if n_elements downward NE nx 1 ny 1 then BEGIN there is some rectangle to cut we define upward: upward is a vector which contains the rectangles numbers which are cut in using the upward diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle upward bytarr nx ny 1 upward ny 1 0 upward nx 1 0 if n_elements downward NE 0 then upward downward 0 upward where upward EQ 1 n1 n_elements upward 4 corners indexes of a rectangle number i are i nx i nx 1 i i 1 trinumber 2 upward upward nx we define the right triangles triangles 0 trinumber upward triangles 1 trinumber upward 1 triangles 2 trinumber upward 1 nx we define the left triangles triangles 0 trinumber 1 upward 1 nx triangles 1 trinumber 1 upward nx triangles 2 trinumber 1 upward ENDIF ELSE n1 0 we cut the rectangles with the downward diagonal if n_elements downward NE 0 then BEGIN n2 n_elements downward trinumber 2 downward downward nx we define the right triangles triangles 0 trinumber downward 1 triangles 1 trinumber downward nx 1 triangles 2 trinumber downward nx we define the left triangles triangles 0 trinumber 1 downward nx triangles 1 trinumber 1 downward triangles 2 trinumber 1 downward 1 endif return triangles end"); 321 a[319] = new Array("./ToBeReviewed/TRIANGULATION/definetri_e.html", "definetri_e.pro", "", "function numtri index nx ny compile_opt idl2 strictarrsubs y index nx x index y nx numtri y NE 0 nx 1 2 y 1 1 2 y EQ ny 1 OR y EQ ny 1 x return numtri end file_comments Define a triangulation array like TRIANGULATE but for a E grid type categories Make contours with E grid type param NX in required The x dimension array param NY in required The y dimension array param SINGULAR in optional When singular is undefined all rectangles are cut in using the vertical diagonal Singular is a vector which contains the rectangles numbers which are cut in using the horizontal diagonal The rectangle number is define by the index in a nx ny vector of the lower left corner of the rectangle keyword SHIFTED returns Triangles is a 2d array and is dimensions are 3 and nx 1 ny 1 Triangles is defined like in the TRIANGULATE procedure history Sebastien Masson smlod ipsl jussieu fr June 2001 version Id: definetri_e pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter SHIFTED FUNCTION definetri_e nx ny singular SHIFTED shifted compile_opt idl2 strictarrsubs nx long nx ny long ny triangles lonarr 3 2 nx 1 ny 1 build the base triangulation with the diamond cut in two triangles by the vertical diagonal first line index lindgen nx 1 trinumber index triangles 0 trinumber index triangles 1 trinumber index 1 triangles 2 trinumber index nx 1 shifted last line index ny 1 nx lindgen nx 1 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx index nx 1 shifted MOD 2 triangles 2 trinumber index 1 other lines if ny GT 2 then begin index lindgen nx ny index index 0:nx 2 1:ny 2 index index oddeven index nx 1 shifted MOD 2 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx oddeven triangles 2 trinumber index nx oddeven triangles 0 trinumber 1 index nx oddeven triangles 1 trinumber 1 index nx oddeven triangles 2 trinumber 1 index 1 endif cut the diamond specified by singular in two triangles by the horizontal diagonal IF keyword_set singular then BEGIN yindex singular nx otherline where yindex NE 0 AND yindex NE ny 1 if otherline 0 NE 1 then begin index singular otherline oddeven index nx 1 shifted MOD 2 trinumber numtri index nx ny triangles 0 trinumber index triangles 1 trinumber index nx oddeven triangles 2 trinumber index 1 triangles 0 trinumber 1 index triangles 1 trinumber 1 index 1 triangles 2 trinumber 1 index nx oddeven endif endif return triangles end "); 322 a[320] = new Array("./ToBeReviewed/TRIANGULATION/dessinetri.html", "dessinetri.pro", "", " file_comments Draw the triangulation categories utilities param TRI in optional Array which define the triangulation provided by triangule pro or triangulate param X in optional The x position of points to which the trangulation refer to see the x array provided in triangulate param Y in optional The y position of points to which the trangulation refer to see the y array provided in triangulate keyword WAIT x to call wait x second between each triangle draw keyword ONEBYONE To draw the triangles one by one keyword FILL To fill the triangles using polyfill instead of plotting them keyword CHANGECOLOR n To change the color of each traingle n colors will be used and repeted if necessary uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: dessinetri pro 150 2006 08 09 10:12:54Z navarro PRO dessinetri tri x y WAIT wait ONEBYONE onebyone FILL fill CHANGECOLOR changecolor _extra ex compile_opt idl2 strictarrsubs common tempsun systime 1 For key_performance a if n_params EQ 3 then BEGIN CASE size x n_dimensions size y n_dimensions OF 2:BEGIN nx n_elements x ny n_elements y glam x replicate 1 ny gphi replicate 1 nx y END 4:BEGIN glam x gphi y END ELSE:BEGIN dummy report x and y inputs of dessinetri must have the same number of dimensions 1 or 2 return END ENDCASE ENDIF ELSE BEGIN grille mask glam gphi tri tri undefine mask tri ciseauxtri tri glam gphi ENDELSE IF keyword_set changecolor THEN BEGIN oldname d name if d name EQ PS OR d name EQ Z then BEGIN thisos strupcase strmid version os_family 0 3 CASE thisOS of MAC : set_plot thisOS WIN : set_plot thisOS ELSE: set_plot X ENDCASE ncolors d n_colors 1 255 set_plot oldname ENDIF ELSE ncolors d n_colors 1 255 color 1 indgen changecolor ncolors changecolor 1 ENDIF ELSE color 0 color color replicate 1 n_elements tri 3 n_elements color 1 tempdeux systime 1 For key_performance 2 for i 0L n_elements tri 3 1 do begin t tri i tri 0 i IF keyword_set fill THEN polyfill glam t gphi t color color i _extra ex ELSE plots glam t gphi t color color i _extra ex IF keyword_set wait THEN wait wait IF keyword_set onebyone THEN read a prompt press a key ENDFOR IF testvar var key_performance EQ 2 THEN print temps dessinetri: trace des triangles systime 1 tempdeux if keyword_set key_performance THEN print temps dessinetri systime 1 tempsun return end"); 323 a[321] = new Array("./ToBeReviewed/TRIANGULATION/drawcoast_c.html", "drawcoast_c.pro", "", " file_comments categories param MASK param XF param YF param NX param NY keyword COAST_COLOR The color of the coastline defaut value is 0 black keyword COAST_THICK The thick of the trait to trace continents By default it is 1 keyword XSEUIL To eliminate segments of coasts which are to big which link points which can be close on the sphere but distant on the drawing We delete all segments whose the size surpass the size of the window following X XSEUIL By default XSEUIL 5 But it can be to big if we do a big zoom or a little one for some projections We specify it the keyword thanks to this keyword keyword YSEUIL See XSEUIL keyword _EXTRA Used to pass our keywords returns uses restrictions examples history version todo Seb: remplir le header PRO drawcoast_c mask xf yf nx ny COAST_COLOR coast_color COAST_THICK coast_thick YSEUIL yseuil XSEUIL xseuil _extra ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 For key_performance We trace vertical segments: if NOT keyword_set yseuil then yseuil 5 min nx ny 2 distanceseuil p position 3 p position 1 yseuil list: list of points i for which we will trace a segment between the point i j 1 and i j tempdeux systime 1 For key_performance 2 liste where mask shift mask 1 0 EQ 1 AND xf shift xf 0 1 2 yf shift yf 0 1 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN We recuperate lx an dly which are indexes in a 2d array of points given by list ly liste nx lx temporary liste nx ly indice where ly NE 0 We do not take points concerning if indice 0 NE 1 then begin the first line because in this case the point j 1 is undefined lx lx indice ly ly temporary indice Loop on concerned points and drawing of the segment Comment: we use plots instead of plot because plots goes faster IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner liste des points concernes par un trait vertical systime 1 tempdeux tempdeux systime 1 For key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i j 1 xf i j yf i j 1 yf i j color coast_color thick coast_thick normal _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracecote: trace des traits verticaux systime 1 tempdeux endif ENDIF For the drawing of horizontal segments it is the same thing but we have to be careful if it is periodic If it is periodic we duplicate the first column and we put it at the end This is made not for the shift which is periodic by default but for the plots tempdeux systime 1 For key_performance 2 if keyword_set key_periodic AND nx EQ jpi then begin mask mask mask 0 xf xf xf 0 yf yf yf 0 nx nx 1 ENDIF if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste where mask shift mask 0 1 EQ 1 AND xf shift xf 1 0 2 yf shift yf 1 0 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN ly liste nx lx temporary liste nx ly indice where ly NE ny 1 AND lx NE 0 if indice 0 NE 1 then begin We do not take points of the first column and of the last line because we added artificially lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner liste des points concernes par un trait horizontal systime 1 tempdeux tempdeux systime 1 For key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i 1 j xf i j yf i 1 j yf i j color coast_color thick coast_thick normal _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracecote: trace des traits horizontaux systime 1 tempdeux endif endif if keyword_set key_performance THEN print temps drawcoast_c systime 1 tempsun return end"); 324 a[322] = new Array("./ToBeReviewed/TRIANGULATION/drawcoast_e.html", "drawcoast_e.pro", "", " file_comments categories param MASK param XF param YF param NX param NY keyword COAST_COLOR The color of the coastline defaut value is 0 black keyword COAST_THICK The thick of the trait to trace continents By default it is 1 keyword XSEUIL To eliminate segments of coasts which are to big which link points which can be close on the sphere but distant on the drawing We delete all segments whose the size surpass the size of the window following X XSEUIL By default XSEUIL 5 But it can be to big if we do a big zoom or a little one for some projections We specify it the keyword thanks to this keyword keyword YSEUIL See XSEUIL keyword _EXTRA Used to pass our keywords returns uses restrictions examples history version todo Seb: remplir le header PRO drawcoast_e mask xf yf nx ny COAST_COLOR coast_color COAST_THICK coast_thick YSEUIL yseuil XSEUIL xseuil onemore onemore _extra ex compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 pour key_performance if keyword_set key_periodic AND nx EQ jpi then begin mask mask mask 0 xf xf xf 0 yf yf yf 0 nx nx 1 ENDIF we plot the borders of the diamond in this sense : if NOT keyword_set onemore then onemore 0 if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste: liste des points i pourlesquels on va tracer un segment index lindgen nx ny index index 0:nx 2 1:ny 1 indexbis index nx index nx onemore MOD 2 liste where mask index 1 mask indexbis EQ 1 AND xf index xf indexbis 2 yf index yf indexbis 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN index index liste indexbis indexbis liste for pt 0 n_elements index 1 do begin plots xf index pt xf indexbis pt yf index pt yf indexbis pt color coast_color thick coast_thick normal _extra ex endfor ENDIF we plot the borders of the diamond in this sense : if NOT keyword_set xseuil then xseuil 5 min nx ny 2 distanceseuil p position 2 p position 0 xseuil liste: liste des points i pourlesquels on va tracer un segment index lindgen nx ny 1 index index 0:nx 2 indexbis index nx index nx onemore MOD 2 liste where mask index 1 mask indexbis EQ 1 AND xf index xf indexbis 2 yf index yf indexbis 2 LE distanceseuil 2 IF liste 0 NE 1 THEN BEGIN index index liste indexbis indexbis liste for pt 0 n_elements index 1 do begin plots xf index pt xf indexbis pt yf index pt yf indexbis pt color coast_color thick coast_thick normal _extra ex endfor ENDIF if keyword_set key_performance THEN print temps drawcoast_e systime 1 tempsun return end"); 325 a[323] = new Array("./ToBeReviewed/TRIANGULATION/drawsectionbottom.html", "drawsectionbottom.pro", "", " file_comments Fill and draw the bottom continents for a real section categories param MASKIN in requierd param XXAXISIN in requierd param DEPTHSIN in requierd keyword COAST_COLOR The color of the coastline defaut value is 0 black keyword COAST_THICK The thickness of the coastline defaut value is 1 keyword CONT_COLOR The color of the continent defaut value is d n_colors 1 white uses common pro restrictions Simple way to fill continents for a section using the fact that continents are wider at the bottom than at the top history Sebastien Masson smasson lodyc jussieu fr June 14 2002 version Id: drawsectionbottom pro 150 2006 08 09 10:12:54Z navarro todo Seb: definir params PRO drawsectionbottom maskin xxaxisin depthsin COAST_COLOR coast_color COAST_THICK coast_thick CONT_COLOR cont_color CONT_NOFILL cont_nofill OVERPLOT overplot _extra ex compile_opt idl2 strictarrsubs cm_general IF NOT keyword_set key_forgetold THEN BEGIN updatekwd ENDIF if keyword_set overplot then return mask is from bottom to top boundaries conditions: nx size maskin 1 nz size maskin 2 1 IF size xxaxisin n_dimensions EQ 1 THEN xxaxisin temporary xxaxisin replicate 1 nz IF size depthsin n_dimensions EQ 1 THEN depthsin replicate 1 nx temporary depthsin for the mask : we add ocean at the top then it is always possible to find one ocean point on each water column mask maskin replicate 1 nx for x axis we also add one level xxaxis xxaxisin xxaxisin 0 x axis must cover nx 1 points because we will draw the edge of the mask if it was mot possible in decoupeterre pro to extend the xxaxis we do it now by hand xxaxis xxaxisin 0 if size xxaxis 1 EQ nx then begin if n_elements xxaxis EQ nx then begin deltax abs x range 1 x range 0 10 xxaxis xxaxis 0 deltax xxaxis x0 xxaxis 0 deltax xxaxis replicate x0 1 nz xxaxis ENDIF for the depth usepartial total depthsin 2 usepartial total usepartial NE usepartial 0 GE 1 depths depthsin 0:nx 1 we add one level according to the ocean level we had to the mask deltaz abs y range 1 y range 0 10 zmax max depthsin deltaz depths depths replicate zmax nx 1 depths depths replicate zmax nx if min depths gt 1 then we must add one line at the bottom this appens when the bottom limit is defined between T k and W k points IF min depthsin GT 1 OR max total mask 2 EQ nz THEN BEGIN zmin min y range deltaz depths replicate zmin nx depths mask replicate 0 nx mask nz nz 1 ENDIF xleft xxaxis 0:nx 1 xright xxaxis 1:nx looking for the position of the bottom of the ocean pos nz 1 total mask 2 depths depths lindgen nx nx pos xx transpose xleft xright xx x range 0 xx zz max y range xx float xx zz float zz filling of the continents IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 if NOT keyword_set cont_nofill then polyfill min xx max maxx xx maxx min zz max mazz zz mazz color cont_color if NOT keyword_set cont_nofill then polyfill min xx max maxx xx maxx y range 0 zz y range 0 color cont_color drawing of the coast bottom line we could have plot directly xx and yy but if countout ne 0 doing this will draw an non existing bottom line along y range values which is not so good we thus do this ugly for if loops to make sure that we don t draw these lines but we keep all vertical lines IF countout NE 0 THEN BEGIN FOR i 0 countout 1 DO BEGIN CASE 1 OF out i EQ 0:BEGIN if we start with a out point xxx values f_nan zzz values f_nan END i EQ 0:BEGIN i eq 0 but out i ne 0 xxx xx 0:out i values f_nan zzz zz 0:out i values f_nan END ELSE:BEGIN two consecutive out values at the same depth: we just keep values f_nan values until the next change of depth IF out i 1 EQ out i 1 AND zz out i 1 EQ zz out i THEN BEGIN xxx xxx values f_nan zzz zzz values f_nan ENDIF ELSE BEGIN we keep everything inbetween the out values including themselves for the vertical lines but we had values f_nan to remove the horizontal lines xxx xxx xx out i 1 :out i values f_nan zzz zzz zz out i 1 :out i values f_nan ENDELSE END ENDCASE IF i EQ countout 1 AND out i NE n_elements xx 1 THEN BEGIN xxx xxx xx out i : zzz zzz zz out i : ENDIF ENDFOR plots xxx zzz color coast_color thick coast_thick _extra ex ENDIF ELSE plots xx zz color coast_color thick coast_thick _extra ex return end "); 326 a[324] = new Array("./ToBeReviewed/TRIANGULATION/fillcornermask.html", "fillcornermask.pro", "", " file_comments To color cleanly continents categories graphic keyword _EXTRA Used to pass your keywords keyword CONT_COLOR The color of the continent defaut value is d n_colors 1 white uses common pro history Sebastien Masson smasson lodyc jussieu fr 8 8 2002 version Id: fillcornermask pro 150 2006 08 09 10:12:54Z navarro PRO fillcornermask xin yin COINMONTE coinmonte COINDESCEND coindescend CONT_COLOR cont_color INDICEZOOM indicezoom _extra ex compile_opt idl2 strictarrsubs common if NOT keyword_set coinmonte AND NOT keyword_set coindescend then return tempsun systime 1 For key_performance IF NOT keyword_set cont_color THEN cont_color d n_colors 1 255 definition of coordinates of points numbered 1 2 3 4 5 6 see figures below x1 reform xin y1 reform yin IF size x1 0 EQ 2 THEN x1 x1 0 IF size y1 0 EQ 2 THEN y1 y1 0 x2 5 x1 shift x1 1 y2 5 y1 shift y1 1 nx n_elements x1 ny n_elements y1 Case land corner in ascent: 2 land points in diagonal ascending with 2 ocean points on the descendant diagonal 3 t i nx 1 u i nx t i nx 1 0 1 4 v i f i v i 1 t i 0 2 u i t i 1 1 if keyword_set coinmonte then BEGIN if coinmonte 0 NE 1 then BEGIN iup coinmonte MOD nx jup coinmonte nx for id 0 n_elements coinmonte 1 do BEGIN i iup id j jup id IF i NE nx 1 AND j NE ny 1 THEN BEGIN polyfill x1 i x2 i x2 i x1 i 1 x1 i y2 j y1 j y1 j 1 y2 j y2 j color cont_color _extra ex ENDIF endfor endif endif Case land corner in descent: 2 land points in diagonal descending with 2 ocean points on the ascendant diagonal 4 t i nx 1 u i nx t i nx 1 0 3 5 v i f i v i 1 1 t i 0 2 u i t i 1 1 if keyword_set coindescend then BEGIN if coindescend 0 NE 1 then begin idw coindescend MOD nx jdw coindescend nx for id 0 n_elements coindescend 1 do BEGIN i idw id j jdw id IF i NE nx 1 AND j NE ny 1 THEN BEGIN polyfill x1 i x2 i x2 i x1 i 1 x1 i y2 j y1 j 1 y1 j y2 j y2 j color cont_color _extra ex ENDIF endfor endif endif IF keyword_set key_performance THEN print temps fillcornermask systime 1 tempsun return end"); 327 a[325] = new Array("./ToBeReviewed/TRIANGULATION/section.html", "section.pro", "", " file_comments categories param FIELD param RES param GLAMAXE param GPHIAXE keyword ENDPOINTS keyword BOXZOOM keyword TYPE keyword WDEPTH keyword DIREC keyword SHOWBUILD keyword ONLYBOX keyword _EXTRA Used to pass your keywords returns uses common pro restrictions examples history Sebastien Masson smasson lodyc jussieu fr version PRO section field res glamaxe gphiaxe ENDPOINTS endpoints BOXZOOM boxzoom TYPE type WDEPTH wdepth DIREC direc SHOWBUILD showbuild ONLYBOX onlybox _extra ex include common compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF definition of boxzoom in function of endpoints then redefinition of the domain boxzoom2d min endpoints 0 endpoints 2 max ma02 ma02 min endpoints 1 endpoints 3 max ma13 ma13 minprof 0 profdefault 200 if n_elements type EQ 0 then type nothing Case N_Elements Boxzoom OF 0:localbox boxzoom2d minprof profdefault 1:localbox boxzoom2d minprof boxzoom 0 2:localbox boxzoom2d boxzoom 0 4:if strpos type z NE 1 THEN localbox boxzoom2d minprof profdefault ELSE localbox boxzoom2d 5:localbox boxzoom2d minprof boxzoom 4 6:localbox boxzoom2d boxzoom 4:5 Else:BEGIN print report Bad definition of the box stop END ENDCASE nelbox n_elements localbox if keyword_set wdepth then grillechoice vargrid W ELSE grillechoice vargrid domdef localbox GRIDTYPE grillechoice findalways _extra ex grille 1 1 1 1 nx ny if less than 10 points where found we apply domdef over the whole domain problem why 10 points as a test value how can we find a good test value IF nx ny LE 10 THEN domdef GRIDTYPE grillechoice _extra ex We redefine lon1 in case findalways has been used in domdef lon1 min endpoints 0 endpoints 2 max lon2 lat1 min endpoints 1 endpoints 3 max lat2 we extend the box along the z axis i that way the plot will be drawn until its bottom part if strpos type z NE 1 THEN BEGIN We keep yranges axis z before changing the boxzoom y range localbox nelbox 1 localbox nelbox 2 if vargrid EQ W OR keyword_set wdepth then BEGIN firstzw 0 firstzw 1 lastzw lastzw 1 firstzt 1 lastzt lastzt 1 firstx 1 lastx lastx 1 firsty 1 lasty lasty 1 jpj 1 domdef firstx lastx firsty lasty firstz lastz index gridtype vargrid IF keyword_set onlybox THEN return grille mask glam gphi gdep nx ny nz firstx firsty firstz lastx lasty lastz We define the triangulation which will allows us to determinate the section We recalculate it because it must be defined on the Earth and on oceans Following the direction of the section rather longitude or rather latitude we define the way to triangulate if strpos type x NE 1 then BEGIN downward lindgen nx ny 0:nx 2 0:ny 2 tri definetri nx ny downward ENDIF ELSE tri definetri nx ny If we have an irregular grid that is periodic then it is possible that some of the triangle have a very large size neighborg points on the sphere but far away when doing the projection and should not be taken into account IF keyword_set key_irregular AND keyword_set key_periodic THEN BEGIN glamtri glam tri glamtri abs glamtri shift glamtri 1 0 good temporary glamtri LT 10 max glam nx good where total temporary good 1 EQ 3 tri temporary tri temporary good ENDIF Equation of the line on which we do the section abc linearequation endpoints 0:1 endpoints 2:3 glamtri glam tri gphitri gphi tri Which points of the triangulation are above and below the line if abc 1 NE 0 THEN test temporary gphitri GE abc 0 abc 1 temporary glamtri abc 2 abc 1 ELSE test temporary glamtri GE abc 1 abc 0 temporary gphitri abc 2 abc 0 zero123 total test 1 to keep: triangles of the triangulation which are over the line tokeep1 where zero123 EQ 1 tokeep2 where temporary zero123 EQ 2 tokeep tokeep1 tokeep2 test test tokeep tri tri tokeep Which summit of the triangle is alone in a side of the line single1 where test 0:n_elements tokeep1 1 EQ 1 single1 single1 single1 3 3 single2 where test n_elements tokeep1 :n_elements tokeep 1 EQ 0 single2 single2 single2 3 3 undefine tokeep undefine tokeep1 undefine tokeep2 undefine test single temporary single1 temporary single2 points1 the point of the triangle alone in a side of the line point2 the other point of the triangle in the other side of the line point1 single single point2 single EQ 0 1 single LE 1 undefine single ntri size tri 2 index lindgen ntri lindgen ntri points1 tri point1 index points2 tri point2 temporary index points : complex containing couples of points in a side and the other side of the line We have to delete duplicates points dcomplex points1 points2 points points uniq points sort points symetrique dcomplex imaginary points double points points points where points shift temporary symetrique 1 NE 0 points1 coordinates of the point of the triangle which is alone in a side of the line point2 coordinates of the other point of the triangle in the other side of the line points1 complex glam double points gphi double points points2 complex glam imaginary points gphi imaginary points droites equations of line whose we look for the intersection wit the section droites linearequation points1 points2 inter lineintersection droites abc replicate 1 n_elements points1 Geographic coordinates of points we look for on the section glamaxe float inter gphiaxe imaginary inter We arrange them in the growing order between boundaries of the section if strpos type x NE 1 then BEGIN sort sort glamaxe glamaxe glamaxe sort inbox where glamaxe GE lon1 AND glamaxe LE lon2 glamaxe glamaxe inbox sort sort inbox gphiaxe gphiaxe sort ENDIF ELSE BEGIN sort sort gphiaxe gphiaxe gphiaxe sort inbox where gphiaxe GE lat1 AND gphiaxe LE lat2 gphiaxe gphiaxe inbox sort sort inbox glamaxe glamaxe sort ENDELSE points points sort points1 points1 sort points2 points2 sort inter inter sort poids abs points2 inter abs points2 points1 array litchamp field array fitintobox array if array 0 EQ 1 THEN BEGIN res 1 return ENDIF if n_elements valmask EQ 0 THEN valmask 1e20 taille size array if jpt GT 1 AND taille 0 GE 3 AND strpos type t EQ 1 then BEGIN direc t array grossemoyenne array t taille size array jpt 1 ENDIF case 1 of xy taille 0 EQ 2:BEGIN value1 array double points terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan value2 array imaginary points terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan res poids value1 1 poids value2 END xyz taille 0 EQ 3 AND jpt EQ 1:BEGIN npoints n_elements points index double points replicate 1 nz replicate nx ny npoints lindgen nz value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 nz replicate nx ny npoints lindgen nz value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 nz res poids value1 1 poids value2 average following z if strpos type z EQ 1 then begin nan where finite res EQ 0 if vargrid EQ W then e3 e3w firstzw:lastzw ELSE e3 e3t firstzt:lastzt weight replicate 1 npoints e3 if nan 0 NE 1 then weight nan values f_nan totalweight total weight 2 nan zero where totalweight EQ 0 if zero 0 NE 1 then totalweight zero values f_nan res total res weight 2 nan totalweight direc z string byte testvar var toto endif END xyt taille 0 EQ 3 AND jpt NE 1:BEGIN npoints n_elements points index double points replicate 1 jpt replicate nx ny npoints lindgen jpt value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 jpt replicate nx ny npoints lindgen jpt value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 jpt res poids value1 1 poids value2 END xyzt taille 0 EQ 4:BEGIN npoints n_elements points index double points replicate 1 nz jpt replicate nx ny npoints lindgen nz jpt index reform index npoints nz jpt over value1 array index terre where value1 GT valmask 10 if terre 0 NE 1 then value1 terre values f_nan index imaginary points replicate 1 nz jpt replicate nx ny npoints lindgen nz jpt index reform index npoints nz jpt over value2 array index terre where value2 GT valmask 10 if terre 0 NE 1 then value2 terre values f_nan poids poids replicate 1 nz jpt poids reform poids npoints nz jpt over res poids value1 1 poids value2 average following z if strpos type z EQ 1 then begin nan where finite res EQ 0 if vargrid EQ W then e3 e3w firstzw:lastzw ELSE e3 e3t firstzt:lastzt weight replicate 1 npoints e3 weight weight replicate 1 jpt weight reform weight npoints nz jpt over if nan 0 NE 1 then weight nan values f_nan totalweight total weight 2 nan zero where totalweight EQ 0 if zero 0 NE 1 then totalweight zero values f_nan res total res weight 2 nan totalweight direc z string byte testvar var toto endif END endcase terre where finite res EQ 0 if terre 0 NE 1 then res terre valmask if n_elements showbuild then BEGIN winsave window psave p xsave x ysave y plt findgen nx ny nodata nofill rempli title subtitle coast_thick 2 window showbuild p title p subtitle plots endpoints 0 endpoints 2 endpoints 1 endpoints 3 color 50 plots endpoints 0 endpoints 2 endpoints 1 endpoints 3 color 50 psym 2 thick 2 FOR i 0 n_elements points1 1 DO plots float points1 i float points2 i imaginary points1 i imaginary points2 i color 150 plots float points1 imaginary points1 color 150 psym 1 plots float points2 imaginary points2 color 150 psym 1 plots float inter imaginary inter color 250 psym 1 bug IF terre 0 NE 1 THEN plots float terre inter imaginary terre inter color 0 psym 1 dummy read dummy prompt press return to continue IF d name EQ PS THEN erase ELSE wset winsave p psave x xsave y ysave ENDIF restoreboxparam boxparam4section dat return end"); 328 a[326] = new Array("./ToBeReviewed/TRIANGULATION/tracecote.html", "tracecote.pro", "", " file_comments Draw coasts in plt categories graphic INPUTS:mask le tableau mask sur la zone consideree pour le dessin keyword SURFACE_COASTLINE To draw the surface coast line instead of the coast line at level firstz tw Usefull only for deep plots keyword _EXTRA used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr 30 9 1999 version Id: tracecote pro 150 2006 08 09 10:12:54Z navarro PRO tracecote SURFACE_COASTLINE surface_coastline _EXTRA ex include commons compile_opt idl2 strictarrsubs cm_4data cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF tempsun systime 1 For key_performance if n_elements key_gridtype EQ 0 then key_gridtype c We enlarge a bit the frame defined by firsts lasts in order to recuperate edges of the coast which are in the edging of the domain tempdeux systime 1 For key_performance 2 firstx 0 min firstxt firstxf 1 lastx max lastxt lastxf 1 min firstyt firstyf 1 lasty max lastyt lastyf 1 jpj 1 nx lastx firstx 1 ny lasty firsty 1 Which vertical level choose IF keyword_set surface_coastline THEN firstz 0 ELSE IF strupcase vargrid eq W THEN firstz firstzw ELSE firstz firstzt Attribution of the mask and of coordinates delimiting limits of the land coordinates f mask tmask firstx:lastx firsty:lasty firstz xf glamf firstx:lastx firsty:lasty yf gphif firstx:lastx firsty:lasty IF testvar var key_performance EQ 2 THEN print temps tracecote: determiner mask xf yf systime 1 tempdeux if key_gridtype EQ e then onemore xf 0 0 gT xf 0 1 We pass in normalized coordinates to be able to become independant from the projection s type choosen and from the support on which we do the drawing screen or postscript z convert_coord xf yf data to_normal xf reform z 0 nx ny yf reform z 1 nx ny tempvar SIZE TEMPORARY z Beware following the projection some points x or y can become NaN see point behind the earth in an orthographic projection We put points to be eliminated at a very big value so that they will not pass the test with distanceseuil see further if map projection LE 7 AND map projection NE 0 OR map projection EQ 14 OR map projection EQ 15 OR map projection EQ 18 then begin ind where finite xf yf EQ 0 IF ind 0 NE 1 THEN BEGIN xf ind 1e5 yf ind 1e5 ENDIF ENDIF ind where xf LT p position 0 OR xf GT p position 2 IF ind 0 NE 1 THEN xf ind 1e5 ind where yf LT p position 1 OR yf GT p position 3 IF ind 0 NE 1 THEN yf ind 1e5 tempvar SIZE TEMPORARY ind we delete ind if n_elements key_gridtype EQ 0 then key_gridtype c case key_gridtype of c :drawcoast_c mask xf yf nx ny _extra ex e :drawcoast_e mask xf yf nx ny onemore onemore _extra ex endcase if keyword_set key_performance THEN print temps tracecote systime 1 tempsun return end"); 329 a[327] = new Array("./ToBeReviewed/TRIANGULATION/tracemask.html", "tracemask.pro", "", " file_comments Draw contours of a mask categories utilities param MASKENTREE in required 2d array specifing the mask param XIN in required 2d array specifing longitude coordinates param YIN in required 2d array specifing latitude coordinates keyword COAST_COLOR The color of the coastline defaut value is 0 black keyword COAST_THICK The thick of the trait to trace continents It is 1 by default keyword OVERPLOT To do a plot over an other one keyword _EXTRA used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: tracemask pro 150 2006 08 09 10:12:54Z navarro PRO tracemask maskentree xin yin COAST_COLOR coast_color COAST_THICK coast_thick OVERPLOT overplot _extra ex compile_opt idl2 strictarrsubs if keyword_set overplot then return cm_general IF NOT keyword_set key_forgetold THEN BEGIN updatekwd ENDIF tempsun systime 1 For key_performance We avoid edging problems: tempdeux systime 1 For key_performance 2 tailleentree size maskentree nx tailleentree 1 1 ny tailleentree 2 1 we check the input axis IF n_elements xin EQ 0 THEN xentree findgen nx 1 ELSE xentree xin IF size xentree 0 EQ 1 THEN xentree xentree replicate 1 ny 1 IF n_elements yin EQ 0 THEN yentree findgen ny 1 ELSE yentree yin IF size yentree 0 EQ 1 THEN yentree replicate 1 nx 1 yentree We enlarge the mask by 1 column to the left an d1 line to the bottom mask intarr tailleentree 1 1 tailleentree 2 1 mask 1:tailleentree 1 1:tailleentree 2 maskentree The 2 first columns are identical mask 0 1:tailleentree 2 maskentree 0 The 2 first lines are identical mask 1:tailleentree 1 0 maskentree 0 We calculate the position following x of points which will serve to trace the mask They are situated between each points of the mask exept for the last column we can not calculate and so we put at max x range xrange x range sort x range if REVERSE_X is used xentree 5 xentree shift xentree 1 0 IF not keyword_set overplot THEN xentree nx 2 xrange 1 ELSE xentree nx 2 xentree nx 3 we sill xentree xrange 0 xentree yentree yrange 1 yf fltarr nx ny yf 1:nx 1 1:ny 1 yentree yf 0 1:ny 1 yentree 0 IF not keyword_set overplot THEN BEGIN if yinverse then yf 0 yrange 1 ELSE yf 0 yrange 0 ENDIF ELSE yentree 0 yentree 1 IF testvar var key_performance EQ 2 THEN print temps tracemask: determination du mask et des ses coordonnes systime 1 tempdeux We trace vertical segments: tempdeux systime 1 For key_performance 2 liste where mask shift mask 1 0 EQ 1 IF liste 0 NE 1 THEN BEGIN We recuperate lx and ly which are indexes in a 2d array of points given by list ly liste nx lx temporary liste nx ly indice where ly NE 0 We do not take points concernining the first line because in this case the point j 1 is not defined if indice 0 NE 1 then begin lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracemask: liste traits verticaux systime 1 tempdeux tempdeux systime 1 For key_performance 2 loop on concerned points and drawing of the segment comments: we use plots instead of plot because plots is faster for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i j 1 xf i j yf i j 1 yf i j color coast_color thick coast_thick _extra ex if pt LT 5 then begin endif endfor IF testvar var key_performance EQ 2 THEN print temps tracemask: trace traits verticaux systime 1 tempdeux endif ENDIF We trace horizontal segments: tempdeux systime 1 For key_performance 2 liste where mask shift mask 0 1 EQ 1 IF liste 0 NE 1 THEN BEGIN ly liste nx lx temporary liste nx ly indice where lx NE 0 We do not take point sof the first column if indice 0 EQ 1 then return lx lx indice ly ly temporary indice IF testvar var key_performance EQ 2 THEN print temps tracemask: liste traits horizontaux systime 1 tempdeux tempdeux systime 1 For key_performance 2 for pt 0L n_elements lx 1 do BEGIN i lx pt j ly pt plots xf i 1 j xf i j yf i 1 j yf i j color coast_color thick coast_thick _extra ex endfor IF testvar var key_performance EQ 2 THEN print temps tracemask: trace traits horizontaux systime 1 tempdeux endif if keyword_set key_performance THEN print temps tracemask systime 1 tempsun return end "); 330 a[328] = new Array("./ToBeReviewed/TRIANGULATION/triangule.html", "triangule.pro", "", " todo seb FUNCTION triangule maskentree BASIC basic COINMONTE coinmonte COINDESCEND coindescend _extra ex compile_opt idl2 strictarrsubs common szmsk size maskentree IF szmsk 0 EQ 0 THEN BEGIN nx jpi ny jpj ENDIF ELSE BEGIN nx szmsk 1 ny szmsk 2 ENDELSE IF nx EQ 1 OR ny EQ 1 THEN return 1 IF arg_present coinmonte THEN coinmonte 1 IF arg_present coindescend THEN coindescend 1 if keyword_set basic then return triangule_c maskentree BASIC COINMONTE coinmonte COINDESCEND coindescend _extra ex if n_elements key_gridtype EQ 0 then key_gridtype c if n_elements maskentree EQ 0 then maskentree tmask 0 case key_gridtype of e :res triangule_e maskentree _extra ex c :res triangule_c maskentree COINMONTE coinmonte COINDESCEND coindescend _extra ex endcase return res end"); 331 a[329] = new Array("./ToBeReviewed/TRIANGULATION/triangule_c.html", "triangule_c.pro", "", " file_comments Construct the triangulation array The idea is: construct a list of triangle which link points between them This is automatically done by the function TRIANGULATE Here: we consider the fact that points are disposed on a grid regular or not but not unstructured that is to say that points are written following a rectangular matrix A easy way to do triangles between all points is then: for each point i j of the matrix exept those of the last line and of the last column we call rectangle i j the rectangle made of the four points i j i 1 j i j 1 i 1 j 1 To trace all triangle we just have to trace the 2 triangles contained in rectangles i j We notice that each rectangle i j have 2 diagonals it is true Make a drawing to make sure so there are two possible choice for each rectangle we want to cut in 2 triangles It is thanks to this choice that we will be able to trace coast with right angles At each angle of coast remarkable by the existence of an unique land point or of an unique ocean point on one of the four summit of a rectangle i j we have to cut the rectangle following the diagonal passing by this point categories graphic param MASKENTREE in optional It is a 2d array which will serve to mask the field we will trace after with CONTOUR TRIANGULATION triangule mask If this argument is not specified the function use tmask keyword BASIC Specify that the mask is on a basic grid use the triangulation for vertical cuts and hovmoellers keyword KEEP_CONT To keep the triangulation even on the continents keyword COINMONTE It is an array To obtain the array of ascending land corner to be treated with completecointerre pro in the variable array instead of make it pass by the global variable twin_corners_up keyword COINDESCEND It is an array See COINMONTE returns res: tableau 2d 3 nbre de triangles Each line of res represent indexes of points constituing summits of a triangle See how we trace triangles in definetri pro uses common pro different pro definetri pro restrictions Datas whose we want to do the contour must be disposed in a matrix On the other hand in the matrix the points s arrangement can not be irregular If it is use TRIANGULE history Sebastien Masson smasson lodyc jussieu fr 26 4 1999 version Id: triangule_c pro 150 2006 08 09 10:12:54Z navarro todo seb L 267 268 je ne pense pas que ce soit ce que tu voulais dire mais c est la traduction de ce qu il y avait crit Correction si besoin FUNCTION triangule_c maskentree COINMONTE coinmonte COINDESCEND coindescend BASIC basic KEEP_CONT keep_cont compile_opt idl2 strictarrsubs tempsun systime 1 For key_performance cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF Is the mask given or do we have to take tmask msk maskentree taille size msk nx taille 1 ny taille 2 IF n_elements keep_cont EQ 0 THEN keep_cont 1 key_irregular if keyword_set key_periodic nx EQ jpi AND NOT keyword_set basic then BEGIN msk msk msk 0 nx nx 1 ENDIF We will find the list of rectangles i j located by their left bottom corner we have to cut folowing a descendant diagonal We will call this list : pts_downward pts_downward 0 We construct the test which allow to find this triangle : shift msk 0 1 shift msk 1 1 msk shift msk 1 0 sum1 msk shift msk 1 0 shift msk 1 1 points which surround the left top point sum2 msk shift msk 0 1 shift msk 1 1 points which surround the right bottom point tempdeux systime 1 For key_performance 2 The left top land point surrounded by ocean points liste where 4 sum1 1 shift msk 0 1 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste The left top ocean point surrounded by land points liste where 1 sum1 shift msk 0 1 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste The right bottom land point surrounded by ocean points liste where 4 sum2 1 shift msk 1 0 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste The right bottom ocean point surrounded by land points liste where 1 sum2 shift msk 1 0 EQ 1 if liste 0 NE 1 THEN pts_downward pts_downward liste undefine liste IF testvar var key_performance EQ 2 THEN print temps triangule: trouver pts_downward systime 1 tempdeux if NOT keyword_set basic OR keyword_set coinmonte OR keyword_set coindescend then begin tempdeux systime 1 For key_performance 2 2 land points in ascendant diagonal with 2 ocean points in descendant diagonal coinmont where 1 msk 1 shift msk 1 1 shift msk 0 1 shift msk 1 0 EQ 1 if coinmont 0 NE 1 THEN pts_downward pts_downward coinmont IF testvar var key_performance EQ 2 THEN print temps triangule: trouver coinmont systime 1 tempdeux tempdeux systime 1 pour key_performance 2 coindesc where 1 shift msk 0 1 1 shift msk 1 0 msk shift msk 1 1 EQ 1 2 land points in descendant diagonal with 2 ocean points in ascendant diagonal IF testvar var key_performance EQ 2 THEN print temps triangule: trouver coindesc systime 1 tempdeux ENDIF if n_elements pts_downward EQ 1 then BEGIN tempdeux systime 1 For key_performance 2 triang definetri nx ny IF testvar var key_performance EQ 2 THEN print temps triangule: definetri systime 1 tempdeux coinmont 1 coindesc 1 ENDIF ELSE BEGIN tempdeux systime 1 For key_performance 2 pts_downward pts_downward 1:n_elements pts_downward 1 pts_downward pts_downward uniq pts_downward sort pts_downward None rectangle can have an element of the last column or of the last line as left bottom corner so we have to remove these points if they has been selected in pts_downward derniere_colonne lindgen ny 1 nx 1 derniere_ligne lindgen nx ny 1 nx pts_downward different pts_downward derniere_colonne pts_downward different pts_downward derniere_ligne if NOT keyword_set basic OR keyword_set coinmonte OR keyword_set coindescend then begin if coinmont 0 NE 1 then begin coinmont different coinmont derniere_colonne coinmont different coinmont derniere_ligne endif if coindesc 0 NE 1 then begin coindesc different coindesc derniere_colonne coindesc different coindesc derniere_ligne endif ENDIF ELSE BEGIN coinmont 1 coindesc 1 ENDELSE IF testvar var key_performance EQ 2 THEN print temps triangule: menage ds pts_downward coinmont et coindesc systime 1 tempdeux tempdeux systime 1 For key_performance 2 if pts_downward 0 EQ 1 then triang definetri nx ny ELSE triang definetri nx ny pts_downward IF testvar var key_performance EQ 2 THEN print temps triangule: definetri systime 1 tempdeux ENDELSE We delete land points which only contain land points if NOT keyword_set basic AND NOT keyword_set keep_cont then begin tempdeux systime 1 For key_performance 2 We delete rectangles which are entirely in the land recdsterre where 1 msk 1 shift msk 1 0 1 shift msk 0 1 1 shift msk 1 1 EQ 1 IF testvar var key_performance EQ 2 THEN print temps triangule: tous les recdsterre systime 1 tempdeux We do an other sort : We have to do not remove rectangles which only have one common summit t1 systime 1 indice intarr nx ny trimask intarr nx ny trimask 0:nx 2 0:ny 2 1 IF recdsterre 0 NE 1 then BEGIN tempdeux systime 1 For key_performance 2 indice recdsterre 1 if NOT keyword_set basic then begin vire1 0 vire2 0 while vire1 0 NE 1 OR vire2 0 NE 1 ne 0 do begin Delete rectangles we have to remove from recsterre in fact those we have to keep although they ar eentirely in the land vire1 where indice shift indice 1 1 1 shift indice 0 1 1 shift indice 1 0 trimask EQ 1 if vire1 0 NE 1 THEN BEGIN indice vire1 0 indice vire1 nx 1 0 endif vire2 where 1 indice 1 shift indice 1 1 shift indice 0 1 shift indice 1 0 trimask EQ 1 if vire2 0 NE 1 THEN BEGIN indice vire2 1 0 indice vire2 nx 0 endif endwhile IF testvar var key_performance EQ 2 THEN print temps triangule: trier les recdsterre systime 1 tempdeux endif indice ny 1 1 The last column and the last line indice nx 1 1 can not define any rectangle tempdeux systime 1 For key_performance 2 recgarde where indice EQ 0 We recuperate numbers of triangles we will keep trigarde 2 recgarde recgarde nx trigarde transpose temporary trigarde trigarde trigarde trigarde 1 triang triang temporary trigarde IF testvar var key_performance EQ 2 THEN print temps triangule: virer les triangle de la liste systime 1 tempdeux endif endif print temps tri triangles systime 1 t1 When key_periodic equal 1 triang is a list of indexes s array which have a surplus column We have to put it back to the initial matrix by putting indexes of the last column equal to these of the last column tempdeux systime 1 For key_performance 2 if keyword_set key_periodic nx 1 EQ jpi AND NOT keyword_set basic then BEGIN indicey triang nx indicex triang indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 then indicex liste 0 triang indicex nx indicey nx nx 1 if coinmont 0 NE 1 then begin indicey coinmont nx indicex coinmont indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coinmont indicex nx indicey nx nx 1 endif if coindesc 0 NE 1 then begin indicey coindesc nx indicex coindesc indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coindesc indicex nx indicey nx nx 1 endif endif IF testvar var key_performance EQ 2 THEN print temps triangule: finitions systime 1 tempdeux if keyword_set coinmonte THEN coinmonte coinmont ELSE twin_corners_up coinmont if keyword_set coindescend THEN coindescend coindesc ELSE twin_corners_dn coindesc IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF IF keyword_set key_performance THEN print temps triangule systime 1 tempsun return triang END "); 332 a[330] = new Array("./ToBeReviewed/TRIANGULATION/triangule_e.html", "triangule_e.pro", "", " file_comments Buid the triangulation for a E grid type categories graphic param MASKENTREE in optional It is a 2d array which will serve to mask the field we will trace after with CONTOUR TRIANGULATION triangule mask If this argument is not specified the function use tmask keyword BASIC Specify that the mask is on a basic grid use the triangulation for vertical cuts and hovmoellers keyword COINMONTE It is an array To obtain the array of ascending land corner to be treated with completecointerre pro in the variable array instead of make it pass by the global variable twin_corners_up keyword COINDESCEND It is an array See COINMONTE keyword SHIFTED uses common pro history Sebastien Masson smasson lodyc jussieu fr june 2001 version Id: triangule_e pro 150 2006 08 09 10:12:54Z navarro todo seb L 152 153 je ne pense pas que ce soit ce que tu voulais dire mais c est la traduction de ce qu il y avait crit Correction si besoin FUNCTION triangule_e maskentree COINMONTE coinmonte COINDESCEND coindescend SHIFTED shifted BASIC basic compile_opt idl2 strictarrsubs cm_4mesh IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF tempsun systime 1 For key_performance Is the mask given or do we have to take tmask msk maskentree sizem size msk nx sizem 1 ny sizem 2 if keyword_set key_periodic nx EQ jpi AND NOT keyword_set basic then BEGIN msk msk msk 0 nx nx 1 ENDIF we will find the diamond that must be cut in two triangle using the horizontal diagonal index lindgen nx ny index index 0:nx 2 1:ny 2 if n_elements shifted EQ 0 then shifted 1 oddeven index nx 1 shifted MOD 2 msk1 msk index msk2 msk index 1 sum msk index nx oddeven msk index nx oddeven sum1 msk2 sum sum2 msk1 sum horizontal singularpoint where msk1 EQ 0 AND sum1 EQ 3 OR msk1 EQ 1 AND sum1 EQ 0 OR msk2 EQ 0 AND sum2 EQ 3 OR msk2 EQ 1 AND sum2 EQ 0 OR sum EQ 0 AND msk1 msk2 EQ 2 if singularpoint 0 NE 1 then begin horizontal index singularpoint triang definetri_e nx ny horizontal SHIFTED shifted ENDIF ELSE triang definetri_e nx ny SHIFTED shifted coinmont index where sum EQ 2 AND msk1 msk2 EQ 0 coindesc index where sum EQ 0 AND msk1 msk2 EQ 2 we keep only the triangles which are outside the land but for some reasons we will in fact delete the land diamond allrecinland where sum1 msk1 EQ 0 indexallinland index allrecinland otherrec lindgen nx ny 0:nx 2 1:ny 2 otherrec different otherrec indexallinland index lindgen nx ny index index 0:nx 3 2:ny 3 out inter index indexallinland IF out 0 NE 1 THEN begin out inter out 1 indexallinland IF out 0 NE 1 THEN begin out out 1 oddeven out nx 1 shifted MOD 2 out inter out nx oddeven otherrec IF out 0 NE 1 THEN begin out inter out 2 nx otherrec IF out 0 NE 1 THEN begin out out nx out nx shifted MOD 2 endif endif endif ENDIF help out index lindgen nx ny index index 0:nx 3 2:ny 3 out inter index otherrec IF out 0 NE 1 THEN begin out inter out 1 otherrec IF out 0 NE 1 THEN begin out out 1 oddeven out nx 1 shifted MOD 2 out inter out nx oddeven indexallinland IF out 0 NE 1 THEN begin out inter out 2 nx indexallinland IF out 0 NE 1 THEN begin out out nx out nx shifted MOD 2 endif endif endif endif help out IF out 0 EQ 1 THEN out different indexallinland out ELSE out indexallinland triout numtri out nx ny triout triout triout 1 goodtri lindgen 2 nx 1 ny 1 goodtri different goodtri triout triang triang temporary goodtri When key_periodic equal 1 triang is a list of indexes s array which have a surplus column We have to put it back to the initial matrix by putting indexes of the last column equal to these of the last column tempdeux systime 1 For key_performance 2 if keyword_set key_periodic nx 1 EQ jpi AND NOT keyword_set basic then BEGIN indicey triang nx indicex triang indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 then indicex liste 0 triang indicex nx indicey nx nx 1 if coinmont 0 NE 1 then begin indicey coinmont nx indicex coinmont indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coinmont indicex nx indicey nx nx 1 endif if coindesc 0 NE 1 then begin indicey coindesc nx indicex coindesc indicey nx nx nx 1 liste where indicex EQ nx if liste 0 NE 1 THEN indicex liste 0 coindesc indicex nx indicey nx nx 1 endif endif IF testvar var key_performance EQ 2 THEN print temps triangule: finitions systime 1 tempdeux if arg_present coinmonte THEN coinmonte coinmont ELSE twin_corners_up coinmont if arg_present coindescend THEN coindescend coindesc ELSE twin_corners_dn coindesc IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF IF keyword_set key_performance THEN print temps triangule systime 1 tempsun return triang END "); 333 a[331] = new Array("./ToBeReviewed/UTILITAIRE/get_extra.html", "get_extra.pro", "", " todo seb elle fait quoi elle permet : soit de creer une variable extra contenant les mots clefs que tu desires soit de completer une variable extra avec des mots clefs que tu rajoutes imagine : tu es dans une routine et tu veux passer un mot clef en extra car la routine que tu appelles ne le connait pas mais la routine suivante oui tu fais extra get_extra ok year 1999 age_capitaine 35 et tu obtiens la bonne variable extra fait un help extra struc ou alors tu completes un extra existant : extra get_extra _extra extra name Guillaume FUNCTION get_extra _extra extra compile_opt idl2 strictarrsubs return extra END "); 334 334 a[332] = new Array("./ToBeReviewed/UTILITAIRE/oups.html", "oups.pro", "", ""); 335 335 a[333] = new Array("./ToBeReviewed/UTILITAIRE/vzoom.html", "vzoom.pro", "", ""); 336 a[334] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.html", "buildcmd.pro", "", " NAME:buildcmd PURPOSE:cette fonction reourne un string qui contient la commande de lecture et les parametres du trace CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr FUNCTION buildcmd base BOXZOOM boxzoom FORCETYPE forcetype we get back the ids of the widget parts compile_opt idl2 strictarrsubs txtcmdid widget_info base find_by_uname txtcmd domainid widget_info base find_by_uname domain actionid widget_info base find_by_uname action optionid widget_info base find_by_uname option widget_control base get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait strtrim optionsflag where options EQ Portrait Landscape 0 1 0 on determine quelle procedure on va etre appele pour faire le dessin et le type IF keyword_set forcetype THEN type forcetype ELSE type widget_info actionid combobox_gettext case type of plt :procedure plt pltz :procedure pltz pltz diag up :procedure pltz pltz diag dn :procedure pltz pltt :procedure pltt pltt diag up :procedure pltt pltt diag dn :procedure pltt xy :procedure plt xz :procedure pltz yz :procedure pltz xt :procedure pltt yt :procedure pltt zt :procedure pltt x :procedure plt1d y :procedure plt1d z :procedure plt1d t :procedure pltt endcase recherche des options options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag flags optionsflag numdessinin xindex flags where options EQ Longitude x index 0 yindex flags where options EQ Latitude y index 0 drawvecteur flags where options EQ Vecteur 0 procedure eq plt drawover flags where options EQ Overlay 0 alreadyread extractatt top_uvalue alreadyread alreadyvector extractatt top_uvalue alreadyvector alreadyover extractatt top_uvalue alreadyoer que devons nous lire case 1 of alreadyover NE 1:BEGIN toread alreadyover 1 readswitch over END alreadyvector NE 1 AND alreadyvector NE pi:BEGIN toread alreadyvector 1 readswitch vector END alreadyread NE 1 AND alreadyread NE pi AND alreadyread NE 2 pi:BEGIN toread alreadyread 1 readswitch classic END else:BEGIN case 1 of alreadyvector eq pi:BEGIN toread alreadyover 1 readswitch over END alreadyread EQ pi:BEGIN toread alreadyvector 1 readswitch vector END alreadyread EQ 2 pi:BEGIN toread alreadyover 1 readswitch over END ELSE:BEGIN toread alreadyread 1 readswitch classic END endcase END ENDCASE widget_control txtcmdid get_value widcmd widcmd strtrim widcmd 2 IF widcmd 0 EQ THEN widcmd zzz cutcmd widcmd 0 toread numberofread prefix nameexp ending readcmd buildreadcmd base nameexp procedure type BOXZOOM boxzoom complete readswitch EQ classic AND alreadyread EQ 1 we look for the line containing funclec_name currentfile extractatt top_uvalue currentfile readparameters extractatt top_uvalue readparameters currentfile i 0 while strpos readcmd i readparameters funclec_name EQ 1 do i i 1 case readswitch of classic :BEGIN if alreadyread 1 EQ 0 then BEGIN we start the reading command readcmd beginning of reading the field to draw readcmd readcmd i 1 field prefix readcmd i 1 ENDIF ELSE BEGIN we complet the reading command oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE exit if we have to read other fields if alreadyread 1 NE numberofread 1 THEN BEGIN top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyread alreadyread 1 top_uvalue 1 findline top_uvalue noticebase xnotice Select the field number strtrim alreadyread 3 1 return ENDIF we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd field create_struct arr:temporary field grid:vargrid unit:varunit experiment:varexp name:varname end of reading the field to draw we get back _EXTRA: extra extractatt top_uvalue extra if xindex NE 0 then extra create_struct extra xindex xindex if yindex NE 0 then extra create_struct extra yindex yindex exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd temporary readcmd extra sextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd case 1 of drawvecteur:BEGIN we have to read the vectors top_uvalue 1 findline top_uvalue alreadyread pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the zonal component of vector return END drawover:BEGIN we have to read the field to overlay top_uvalue 1 findline top_uvalue alreadyread 2 pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the field to overlay return END finished we draw the plot ELSE: top_uvalue 1 findline top_uvalue alreadyread 1 endcase END vector :BEGIN for the vectors there is 2 components we read u when alreadyvector is a interger and v when alreadyvector is a interger 0 5 if floor alreadyvector 1 EQ 0 then begin if floor alreadyvector EQ alreadyvector then begin readcmd beginning of reading the zonal component of vector readcmd readcmd i 1 fieldu prefix readcmd i 1 ENDIF ELSE BEGIN readcmd beginning of reading the meridional component of vector readcmd readcmd i 1 fieldv prefix readcmd i 1 ENDELSE readcmd extractatt top_uvalue currentreadcmd temporary readcmd ENDIF ELSE BEGIN oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE case alreadyvector 1 of numberofread 1:BEGIN we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd fieldu create_struct arr:temporary fieldu grid:vargrid unit:varunit experiment:varexp name:varname end of reading the zonal component of vector top_uvalue 1 findline top_uvalue currentreadcmd readcmd we finished zonal component reading we know switch to meridional component top_uvalue 1 findline top_uvalue alreadyvector 5 top_uvalue 1 findline top_uvalue noticebase xnotice Select the meridional component of vector return END numberofread 0 5:BEGIN we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd fieldv create_struct arr:temporary fieldv grid:vargrid unit:varunit experiment:varexp name:varname end of reading the meridional component of vector we finished meridional component reading we get back _EXTRA of the vector and we complet extra already build extra extractatt top_uvalue extra exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd readcmd vectorextra sextra extra mixstru extra vectorextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd if drawover then BEGIN shall we do an overlay top_uvalue 1 findline top_uvalue alreadyvector pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the field to overlay return ENDIF ELSE BEGIN it is done know top_uvalue 1 findline top_uvalue alreadyread 1 top_uvalue 1 findline top_uvalue alreadyvector 1 ENDELSE END ELSE:BEGIN we still need to read some vector components top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyvector alreadyvector 1 if floor alreadyvector EQ alreadyvector then text zonal ELSE text meridional top_uvalue 1 findline top_uvalue noticebase xnotice Select the strtrim floor alreadyread 3 1 text component of vector return END endcase END over :BEGIN if alreadyover 1 EQ 0 then begin we start the reading readcmd beginning of reading the field to overdraw readcmd readcmd i 1 fieldover prefix readcmd i 1 readcmd extractatt top_uvalue currentreadcmd temporary readcmd ENDIF ELSE BEGIN oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE if alreadyover 1 NE numberofread 1 THEN BEGIN we still need to read some files top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyover alreadyover 1 top_uvalue 1 findline top_uvalue noticebase xnotice Select the field number strtrim alreadyover 3 1 to overlay return ENDIF we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF on finalise la commande de lecture readcmd readcmd fieldover create_struct arr:temporary fieldover grid:vargrid unit:varunit experiment:varexp name:varname end of reading the field to overdraw we get back _EXTRA of over and we complet extra already build extra extractatt top_uvalue extra exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd readcmd overextra sextra extra mixstru extra overextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd we reinitialize top_uvalue 1 findline top_uvalue alreadyread 1 top_uvalue 1 findline top_uvalue alreadyvector 1 top_uvalue 1 findline top_uvalue alreadyover 1 END endcase determination du nom de la boxzoom if NOT keyword_set boxzoom then widget_control domainid get_value boxzoom ecriture de celle ci sous forme d un string box strtrim boxzoom 0 1 for i 1 n_elements boxzoom 1 3 2 strpos type z EQ 1 do box box strtrim boxzoom i 1 pour les plots en z box doit avoir par defaut 0 profmax if strpos type z NE 1 then BEGIN si de 1 niveau est selectionne: widget_control widget_info base find_by_uname dthlv1 get_value niv1 niv1 niv1 combobox_index widget_control widget_info base find_by_uname dthlv2 get_value niv2 niv2 niv2 combobox_index if niv1 NE niv2 then begin box box strtrim boxzoom 4 1 strtrim boxzoom 5 1 ENDIF ELSE BEGIN if chkstru exextra profmax then pmax exextra profmax ELSE pmax 200 box box 0 strtrim pmax 1 ENDELSE endif box box IF strpos type diag up NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 2 1 strtrim boxzoom 1 1 strtrim boxzoom 3 1 ENDIF IF strpos type diag dn NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 3 1 strtrim boxzoom 1 1 strtrim boxzoom 2 1 ENDIF on determine typein IF strpos type diag NE 1 THEN typein strmid type 0 4 ELSE typein type determination de small ssmall tostr smallout on va definir le string qui contiendra la commande a executer par widgetdessine pro Cmd readCmd procedure field boxzoom box findalways typein typein small ssmall IF drawvecteur then Cmd Cmd vecteur u: fieldu v: fieldv IF drawover then Cmd Cmd contour fieldover IF n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints Cmd Cmd _extra mixstru ex extra portrait portrait NOERASE noerase print for i 0 n_elements Cmd 1 do print Cmd i print on complete et ou actualise lastructure top_uvalue top_uvalue 1 findline top_uvalue nameprocedures numdessinout procedure top_uvalue 1 findline top_uvalue types numdessinout type top_uvalue 1 findline top_uvalue domaines numdessinout boxzoom top_uvalue 1 findline top_uvalue txtcmd numdessinout widcmd top_uvalue 1 findline top_uvalue optionsflag numdessinout flags top_uvalue 1 findline top_uvalue exextra numdessinout extra return Cmd end ");337 a[335] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcmd.html", "buildreadcmd.pro", "", " NAME:buildreadcmd PURPOSE: CATEGORY: CALLING SEQUENCE: INPUTS: KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr FUNCTION buildreadcmd base snameexp procedure type BOXZOOM boxzoom COMPLETE complete NAMEFIELD namefield compile_opt idl2 strictarrsubs cm_4cal for key_caltype get back widgets IDs vlstid widget_info base find_by_uname varlist date1id widget_info base find_by_uname calendar1 date2id widget_info base find_by_uname calendar2 domainid widget_info base find_by_uname domain optionid widget_info base find_by_uname option widget_control base get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 numdessinout extractatt top_uvalue smallout 2 1 name of the file currentfile extractatt top_uvalue currentfile filelist extractatt top_uvalue filelist filename filelist currentfile sfilename filename name of the variable if keyword_set namefield then namevar namefield ELSE namevar widget_info vlstid combobox_gettext snamevar namevar get the options options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags numdessinin xindex flags where options EQ Longitude x index 0 yindex flags where options EQ Latitude y index 0 extra extractatt top_uvalue extra if xindex NE 0 then extra create_struct extra xindex xindex if yindex NE 0 then extra create_struct extra yindex yindex exextra cw_specifie_get_value base exextra extractstru exextra min max inter lct if size exextra type EQ 8 then extra mixstru exextra extra sextra struct2string extra find date1 and date2 key_caltype extractatt top_uvalue fileparameters currentfile caltype widget_control date1id get_value date1 widget_control date2id get_value date2 if procedure EQ pltt AND date1 EQ date2 then BEGIN we redefine the dates to the begining and end of the calendar calendar extractatt top_uvalue fileparameters currentfile time_counter date1 jul2date calendar 0 date2 jul2date calendar n_elements calendar 1 widget_control date1id set_value date1 widget_control date2id set_value date2 endif fakecal extractatt top_uvalue fileparameters currentfile fakecal IF keyword_set fakecal THEN BEGIN date1 date2jul date1 fakecal date2 date2jul date2 fakecal ENDIF sdate1 strtrim date1 1 sdate2 strtrim date2 1 find boxzoom if NOT keyword_set boxzoom then widget_control domainid get_value boxzoom put boxzoom into a string box strtrim boxzoom 0 1 for i 1 n_elements boxzoom 1 3 2 strpos type z EQ 1 do box box strtrim boxzoom i 1 if strpos type z NE 1 then BEGIN common min min gdept gdepw max max box box strtrim floor min 1 strtrim ceil max 1 endif box box IF strpos type diag up NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 2 1 strtrim boxzoom 1 1 strtrim boxzoom 3 1 ENDIF IF strpos type diag dn NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 3 1 strtrim boxzoom 1 1 strtrim boxzoom 2 1 ENDIF find funclec_name readparameters meshparameters readparameters extractatt top_uvalue readparameters currentfile funclec_name readparameters funclec_name if keyword_set complete then begin sreadparameters struct2string readparameters meshparameters extractatt top_uvalue meshparameters currentfile smeshparameters struct2string meshparameters on va definir le string qui contiendra la commande a executer pour la lecture Cmd Definition of extra structure: extra sextra Definition of readparameters structure: readparameters sreadparameters Do we change of reading : dummy changeread readparameters Definition of meshparameters structure: meshparameters smeshparameters Do we change the grid : dummy changegrid meshparameters Read the data if n_elements date1in ne 0 then date1 date1in else date1 sdate1 if n_elements date2in ne 0 then date2 date2in else date2 sdate2 funclec_name snamevar date1 date2 snameexp timestep strtrim keyword_set fakecal 1 parent strtrim base 2 boxzoom box findalways filename sfilename if n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints type type Cmd Cmd _extra mixstru ex extra nostruct top_uvalue 1 findline top_uvalue varinfo numdessinout filename namevar top_uvalue 1 findline top_uvalue dates numdessinout date1 date2 ENDIF ELSE BEGIN Cmd funclec_name snamevar date1 date2 snameexp parent strtrim base 1 boxzoom boxfilename sfilename if n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints type type Cmd Cmd _extra mixstru ex extra nostruct ENDELSE print :::::::::::::::::::::: for i 0 n_elements Cmd 1 do print Cmd i print :::::::::::::::::::::: return cmd end");338 a[336] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.html", "changefield.pro", "", " PRO changefield base newfieldname BOXZOOM boxzoom compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue Change exextra : exextra definedefaultextra newfieldname specifieid widget_info base find_by_uname specifie widget_control specifieid set_value exextra Change the variable Do we need to change the vertical axis according to the tye of points T or W dthlv1id widget_info base find_by_uname dthlv1 widget_control dthlv1id get_uvalue dthlv1_uval oldzgridt dthlv1_uval grid_t get the type of point currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar for i 0 n_elements listvar 1 do print listvar i listgrid i indexvar where listvar EQ newfieldname indexvar 0 indexvar 0 zgridt strupcase listgrid indexvar NE W if we change the type of point if zgridt NE oldzgridt then BEGIN update dthlv1_uval grid_t dthlv1_uval grid_t zgridt widget_control dthlv1id set_uvalue dthlv1_uval update cw_domain if NOT keyword_set boxzoom THEN widget_control widget_info base find_by_uname domain get_value boxzoom widget_control widget_info base find_by_uname domain set_value boxzoom endif return end");339 a[337] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefile.html", "changefile.pro", "", " PRO changefile base newfilename BOXZOOM boxzoom DATE1 date1 DATE2 date2 FIELDNAME fieldname compile_opt idl2 strictarrsubs widget_control base hourglass widget_control base get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF size newfilename type EQ 7 THEN newfile where filelist EQ newfilename 0 ELSE newfile newfilename it is already the index of the new file if newfile EQ 1 then begin nothing report invalid filename return endif oldfile extractatt top_uvalue currentfile oldfilename filelist oldfile did we really change the file if oldfile EQ newfile AND NOT keyword_set BOXZOOM OR keyword_set DATE1 OR keyword_set DATE2 OR keyword_set FIELDNAME then return widget_control base update 0 we update currentfile element of the top_uvalue top_uvalue 1 findline top_uvalue currentfile newfile Calendar oldcalendar extractatt top_uvalue fileparameters oldfile time_counter newcalendar extractatt top_uvalue fileparameters newfile time_counter Did we change the calendar if array_equal oldcalendar newcalendar NE 1 then begin cm_4cal for key_caltype key_caltype extractatt top_uvalue fileparameters newfile caltype fake or real calendar fakecal extractatt top_uvalue fileparameters newfile fakecal Which dates were selected date1id widget_info base find_by_uname calendar1 if NOT keyword_set date1 then widget_control date1id get_value date1 jdate1 date2jul date1 if where newcalendar EQ jdate1 0 EQ 1 then jdate1 newcalendar 0 date2id widget_info base find_by_uname calendar2 if NOT keyword_set date2 then widget_control date2id get_value date2 jdate2 date2jul date2 if where newcalendar EQ jdate2 0 EQ 1 then jdate2 date1 if jdate2 LT jdate1 THEN jdate2 jdate1 widget_control date1id destroy widget_control date2id destroy basecal widget_info base find_by_uname basecal rien cw_calendar basecal newcalendar jdate1 uname calendar1 FAKECAL fakecal uvalue name: calendar1 frame rien cw_calendar basecal newcalendar jdate2 uname calendar2 FAKECAL fakecal uvalue name: calendar2 frame ENDIF ELSE BEGIN if keyword_set date1 then begin date1id widget_info base find_by_uname calendar1 widget_control date1id set_value date1 endif if keyword_set date2 then begin date2id widget_info base find_by_uname calendar2 widget_control date2id set_value date2 endif ENDELSE Grid parameters and domain newgrid extractatt top_uvalue meshparameters newfile change changegrid newgrid if change OR keyword_set boxzoom then BEGIN if NOT keyword_set boxzoom then boxzoom 1 domainid widget_info base find_by_uname domain widget_control domainid set_value boxzoom endif file name IF oldfile NE newfile THEN BEGIN flstid widget_info base find_by_uname filelist widget_control flstid set_combobox_select newfile ENDIF Variables name vlstid widget_info base find_by_uname varlist oldfieldname widget_info vlstid combobox_gettext did we really change the liste of variables oldlistvar extractatt top_uvalue fileparameters oldfile listvar newlistvar extractatt top_uvalue fileparameters newfile listvar if array_equal oldlistvar newlistvar NE 1 THEN widget_control vlstid set_value newlistvar set the liste of variables to the new variable name if keyword_set fieldname then newfieldname fieldname ELSE newfieldname oldfieldname indexvar where newlistvar EQ newfieldname indexvar 0 indexvar 0 widget_control vlstid set_combobox_select indexvar newfieldname newlistvar indexvar did we change the name of the variable if newfieldname NE oldfieldname then BEGIN changefield base newfieldname BOXZOOM boxzoom ENDIF widget_control base update 1 return end");340 a[338] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/createhistory.html", "createhistory.pro", "", " PRO createhistory base small we save globalcommand in globaloldcommand compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue globalcommand extractatt top_uvalue globalcommand top_uvalue 1 findline top_uvalue globaloldcommand globalcommand portrait or landscape options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait optionsflag where options EQ Portrait Landscape 0 0 composition du text contennu ds history pro texte common if keyword_set postscript then begin noerase 1 openps infowidget infowidget portrait strtrim portrait 2 endif beginning of 1 end of 1 if small 0 small 1 GT 1 then begin for draw 1 small 0 small 1 1 do begin texte texte beginning of strtrim draw 1 2 noerase 1 end of strtrim draw 1 2 endfor ENDIF texte texte if keyword_set postscript then begin closeps infowidget infowidget printps endif the new globalcommand top_uvalue 1 findline top_uvalue globalcommand texte for i 0 n_elements texte 1 do print texte i return end");341 a[339] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/cutcmd.html", "cutcmd.pro", "", " PRO cutcmd widcmd toread numberofread prefix nameexp ending compile_opt idl2 strictarrsubs dummy where byte widcmd EQ byte 0 nbdblquote CASE 1 OF nbdblquote MOD 2: stop odd numbers are impossibles nbdblquote GT 0: nbdblquote EQ 0:BEGIN widcmd is an expression of type: numb1 a numb2 b numb we will change into the form numb1 a numb2 b numb in order to suits the new method of cutcmd widcmd strtrim widcmd 2 we force to start with a or case 1 of strpos widcmd EQ 0: strpos widcmd EQ 0: ELSE:widcmd widcmd ENDCASE separator strsplit widcmd extract regex other strsplit widcmd extract IF n_elements separator NE n_elements other THEN stop widcmd FOR i 0 n_elements other 1 DO BEGIN IF isnumber other i LT 1 THEN other i other i widcmd widcmd separator i other i ENDFOR print widcmd END ENDCASE cutted strsplit widcmd extract IF strpos widcmd EQ 0 THEN start 0 ELSE start 1 nameexp cutted start: :2 numberofread n_elements nameexp IF toread GE numberofread then begin dummy report toread cannot be larger than numberofread stop ENDIF other cutted 1 start: :2 make sure that we have a prefix for each nameexp IF start EQ 0 THEN other other nameexp nameexp toread prefix other toread IF n_elements other EQ numberofread 1 THEN ending other numberofread ELSE ending help prefix nameexp ending return end");342 a[340] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/definedefaultextra.html", "definedefaultextra.pro", "", " FUNCTION definedefaultextra nomvariable compile_opt idl2 strictarrsubs case strlowcase nomvariable of sn :BEGIN return get_extra min 31 max 37 inter 2 lct 33 nocontout END tn :BEGIN return get_extra min 20 max 31 inter 5 lct 39 END un :BEGIN return get_extra min 1 max 1 inter 1 lct 64 END vn :BEGIN return get_extra min 1 max 1 inter 1 lct 64 END ELSE: ENDCASE return get_extra min max inter lct 39 end");343 a[341] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.html", "doubleclickaction.pro", "", " PRO doubleclickaction event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue on active la bonne fenetre widget_control event id get_value win wset win quel est le dessin selectionne smallin extractatt top_uvalue smallin smallout extractatt top_uvalue smallout x convert_coord uval x 0 uval y 0 device to_normal 0 y convert_coord uval x 0 uval y 0 device to_normal 1 numcolonne n_elements where findgen smallin 0 smallin 0 lt x 1 numligne n_elements where findgen smallin 1 smallin 1 lt 1 y 1 numdessin numcolonne numligne smallin 0 1 choix du type d action case uval press of 1:BEGIN if top_uvalue smallin 2 NE numdessin then begin tracecadre smallin erase if total smallin EQ smallout EQ 3 then tracecadre smallout out smallin smallin 0:1 numdessin top_uvalue 1 findline top_uvalue smallin smallin tracecadre smallin p extractatt top_uvalue penvs numdessin 1 x extractatt top_uvalue xenvs numdessin 1 y extractatt top_uvalue yenvs numdessin 1 END 2:BEGIN if top_uvalue smallout 2 NE numdessin then begin tracecadre smallout erase if total smallin EQ smallout EQ 3 then tracecadre smallin smallout smallin 0:1 numdessin top_uvalue 1 findline top_uvalue smallout smallout tracecadre smallout out endif END 4:BEGIN tracecadre smallin 0:1 numdessin fill inserthistory event top beginning of strtrim numdessin 2 end of strtrim numdessin 2 remise a 0 des attributs de la uvalue concernant ce dessin:numdessin numdessin 1 top_uvalue 1 findline top_uvalue varinfo numdessin top_uvalue 1 findline top_uvalue dates numdessin 0l 0l top_uvalue 1 findline top_uvalue nameprocedures numdessin top_uvalue 1 findline top_uvalue types numdessin top_uvalue 1 findline top_uvalue domaines numdessin fltarr 6 top_uvalue 1 findline top_uvalue txtcmd numdessin if numdessin EQ smallin 2 then tracecadre smallin if numdessin EQ smallout 2 then tracecadre smallout out END ELSE: endcase updatewidget event top return end");344 a[342] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/extractatt.html", "extractatt.pro", "", " FUNCTION extractatt top_uvalue name compile_opt idl2 strictarrsubs taille size top_uvalue j 1 repeat BEGIN j j 1 if j EQ size top_uvalue 2 then return 1 endrep until top_uvalue 0 j EQ name return top_uvalue 1 j end");345 a[343] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/findline.html", "findline.pro", "", " FUNCTION findline top_uvalue name compile_opt idl2 strictarrsubs taille size top_uvalue j 1 repeat BEGIN j j 1 if j EQ size top_uvalue 2 then return 1 endrep until top_uvalue 0 j EQ name return j end");346 a[344] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.html", "identifyclick.pro", "", " FUNCTION identifyclick event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval no_copy thisEvent TAG_NAMES event Structure if thisEvent EQ WIDGET_TIMER then press 0 ELSE press event press d 0 1 t 1 0 d 2 0 long click d 1 0 t 2 0 click normal d 2 1 d 3 0 t 0 0 double click t 3 0 d 0 0 double click type inutile case 1 OF d 0 0 1er remonte thisEvent EQ WIDGET_DRAW AND uval click EQ 0 AND press EQ 0: d 0 1 1er appuie de la serie thisEvent EQ WIDGET_DRAW AND uval click EQ 0 AND press ge 1:BEGIN uval x event x 0 uval y event y 0 uval press press uval click 1 widget_control event id timer 3 END d 1 0 1er remonte thisEvent EQ WIDGET_DRAW AND uval click EQ 1 AND press EQ 0:uval click 2 d 2 0 fin long click thisEvent EQ WIDGET_DRAW AND uval click EQ 2 AND press EQ 0:BEGIN type long uval x uval x 0 event x uval x uval x sort uval x uval y uval y 0 event y uval y uval y sort uval y uval click 0 uval press event release END d 2 1 thisEvent EQ WIDGET_DRAW AND uval click EQ 2 AND press ge 1:BEGIN type double uval press press uval click 3 END d 3 0 remonte et fin de double click thisEvent EQ WIDGET_DRAW AND uval click EQ 3 AND press EQ 0:uval click 0 t 0 0 fin de double click thisEvent EQ WIDGET_TIMER AND uval click EQ 0 AND press EQ 0: t 1 0 long click thisEvent EQ WIDGET_TIMER AND uval click EQ 1 AND press EQ 0:uval click 2 t 2 0 click normal thisEvent EQ WIDGET_TIMER AND uval click EQ 2 AND press EQ 0:BEGIN type single press uval press uval click 0 END t 3 0 fin de double click thisEvent EQ WIDGET_TIMER AND uval click EQ 3 AND press EQ 0:uval click 0 cas normalement impossible: ELSE:BEGIN print thisEvent uval click press print Probleme cas normalement impossible END endcase widget_control event id set_uvalue uval no_copy return type:type end");347 a[345] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/inserthistory.html", "inserthistory.pro", "", " PRO inserthistory base text line1 line2compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue globalcommand extractatt top_uvalue globalcommand top_uvalue 1 findline top_uvalue globaloldcommand globalcommand for i 0 n_elements globalcommand 1 do print globalcommand i we insert text between line1 and line2 index1 where globalcommand EQ line1 index1 index1 0 1 if index1 EQ 1 then begin rien report line1 n est pas trouve ds globalcommand return endif index2 where globalcommand EQ line2 index2 index2 0 if index2 EQ 1 then begin rien report line2 n est pas trouve ds globalcommand return ENDIF the new text: globalcommand globalcommand 0:index1 text globalcommand index2:n_elements globalcommand 1 the new globalcommand top_uvalue 1 findline top_uvalue globalcommand globalcommand return end");348 a[346] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.html", "letsdraw.pro", "", " NAME:widgetdessine PURPOSE: c est la procedure qui lance le dessin Si on ne le lui donne pas de commande elle appelle construitcommande pour savoir quoi tracer CATEGORY: CALLING SEQUENCE:widgetdessine base INPUTS:base: l id du widget ou appliquer le dessin KEYWORD PARAMETERS: COMMANDE: un string du style: read_data sst OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO letsdraw base COMMANDE commande _extra ex compile_opt idl2 strictarrsubs common on recupere la uvalue de base widget_control base get_uvalue top_uvalue print help top_uvalue struct help top_uvalue exextra struct if NOT keyword_set commande then commande buildcmd base _extra ex if commande 0 EQ then return on recupere la uvalue de base widget_control base hourglass widget_control base get_uvalue top_uvalue print help top_uvalue struct print help top_uvalue exextra struct help top_uvalue extra struct print print commande help mixstru top_uvalue exextra top_uvalue extra struct on recuperel id de la fenetre graphique associee au widget d id base graphid extractatt top_uvalue graphid widget_control graphid get_value win on la selectionne c est a elle que sera passe toutes les commandes concernant une fenetre wset win erase 255 on netoie la fenetre on s assure que si on travaille avec un ecran codant les couleurs sur 24 bits la couleur de fond specifiee p background est bien appliqueeif d n_colors gt 256 then begin device decomposed 1 p background ffffff x plot 0 0 device decomposed 0 ENDIF smallout long extractatt top_uvalue smallout numdessinout smallout 2 1 tracecadre smallout fill options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait strtrim optionsflag where options EQ Portrait Landscape 0 1 0 createpro common noerase 1 key_portrait portrait Commande filename myuniquetmpdir xxx_oneplot pro inserthistory base Commande beginning of strtrim smallout 2 1 end of strtrim smallout 2 1 top_uvalue 1 findline top_uvalue penvs numdessinout p top_uvalue 1 findline top_uvalue xenvs numdessinout x top_uvalue 1 findline top_uvalue yenvs numdessinout y return end");349 a[347] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html", "loadgrid.pro", "", " PRO loadgrid meshfilein _extra ex compile_opt idl2 strictarrsubs cm_4mesh ccmeshparameters filename meshfilein split the name according to delimiter meshfile strsplit meshfilein extract meshfile strtrim meshfile 2 try to find a pro file with this name filepro find meshfile 0 firstfound onlypro 0 if this is an idl batch file or a procedure if filepro NE NOT FOUND THEN BEGIN CASE protype filepro OF this is a procedure proc :listing file_basename filepro pro this is a function this case is not coded func :stop this is an IDL batch file batch :listing file_basename filepro pro ENDCASE ENDIF ELSE BEGIN filenc find meshfile 0 firstfound onlync 0 if filenc EQ NOT FOUND THEN stop listing initncdf filenc ENDELSE add the arguments and keywords if necessary IF n_elements meshfile GT 1 AND strmid listing 0 1 NE THEN BEGIN FOR i 1 filepro NE NOT FOUND n_elements meshfile 1 DO listing listing meshfile i ENDIF IF strmid listing 0 1 NE THEN listing listing strcalling meshfilein _extra ex createpro listing filename myuniquetmpdir for_createpro pro _extra ex return END ");350 a[348] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.html", "longclickaction.pro", "", " PRO longclickaction event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue quel est le dessin selectionne smallout extractatt top_uvalue smallout smallin extractatt top_uvalue smallin small smallin x convert_coord uval x 0 uval y 0 device to_normal 0 y convert_coord uval x 0 uval y 0 device to_normal 1 numcolonne n_elements where findgen small 0 small 0 lt x 1 numligne n_elements where findgen small 1 small 1 lt 1 y 1 numdessin numcolonne numligne small 0 we put on numdessin as the leader plot tracecadre smallin erase if total smallin EQ smallout EQ 3 then tracecadre smallout out smallin smallin 0:1 numdessin 1 top_uvalue 1 findline top_uvalue smallin smallin tracecadre smallin p extractatt top_uvalue penvs numdessin x extractatt top_uvalue xenvs numdessin y extractatt top_uvalue yenvs numdessin Change the domain box: coor convert_coord uval x uval y device to_data x coor 0 0 coor 0 1 y coor 1 0 coor 1 1 domainid widget_info event top find_by_uname domain boxzoom x y faut il passer la boxzoom en indexes currentplot extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags currentplot changex flags where options EQ Longitude x index 0 EQ 1 changey flags where options EQ Latitude y index 0 EQ 1 if changex OR changey then begin on veut retrouver le type de grille qui est utiliseecurrentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar domdef boxzoom gridtype vargrid grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz if changex then boxzoom 0:1 firstx lastx if changey then boxzoom 2:3 firsty lasty endif widget_control domainid set_value boxzoom actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext case uval press of 1:BEGIN nodates type EQ xt OR type EQ yt OR type EQ zt OR type EQ t updatewidget event top noboxzoom nodates nodates notype type NE plt letsdraw event top END 2:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltz forcetype pltz ENDIF updatewidget event top noboxzoom letsdraw event top END 4:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltt forcetype pltt ENDIF updatewidget event top noboxzoom nodates letsdraw event top forcetype forcetype END endcase return end");351 a[349] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.html", "read_vermair.pro", "", " FUNCTION read_vermair name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex compile_opt idl2 strictarrsubs common if name EQ un then name vozocrtx if name EQ vn then name vomecrty if debut EQ fin then begin res lec name debut nomexp BOXZOOM boxzoom _EXTRA ex ENDIF ELSE res lect name debut fin nomexp BOXZOOM boxzoom _EXTRA ex return tab:res grille:vargrid unite: experience:varexp nom:varname end");352 a[350] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.html", "scanfile.pro", "", " liste des presupposes: 1 le fichier a lire est un fichier netcdf 2 le nom de ce fichier finit par U nc V nc W nc T nc ou F nc la lettre avant le nc designant la grille a laquelle se rapporte la champ Si tel n est pas la cas le fichier est attribue a la grille T 3 ce fichier contient une dimension infinie qui doit etre celle qui se rapporte au temps et au mois 2 autres dimensions dont les noms sont x lon xi_ et y lat ou eta_ ou bien en majuscule 4 il doit exiter ds ce fichier une unique variable n ayant qu une dimension et etant la dimension temporelle cette variable sera prise comme axe des temps Rq: si plusieurs variables verifient ces criteres on considere la premiere variable 5 Cette variable axe des temps doit contenir l attribut units qui doit etre ecrit suivant la syntaxe: seconds since 0001 01 01 00:00:00 hours since 0001 01 01 00:00:00 days since 1979 01 01 00:59:59 months since 1979 01 01 00:59:59 years since 1979 01 01 00:59:59 je crois que c est tout GRID UTVWF to specify the type of grid Defaut is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found FUNCTION scanfile namefile GRID GRID _extra ex compile_opt idl2 strictarrsubs common res 1 filename fullname isafile filename namefile IODIRECTORY iodir _extra ex open file cdfid ncdf_open fullname What contains the file infile ncdf_inquire cdfid find vargrid IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN pattern GRID GRID_ GRID UPID_ 30ID_ gdtype T U V W F fnametest strupcase fullname FOR i 0 n_elements pattern 1 DO BEGIN FOR j 0 n_elements gdtype 1 DO BEGIN substr pattern i gdtype j pos strpos fnametest substr IF pos NE 1 THEN vargrid strmid fnametest pos strlen substr 1 1 ENDFOR ENDFOR ENDIF ENDELSE name of all dimensions namedim strarr infile ndims for dimiq 0 infile ndims 1 do begin ncdf_diminq cdfid dimiq tmpname value namedim dimiq strlowcase tmpname ENDFOR we are looking for a x dimension dimidx where namedim EQ x OR strmid namedim 0 3 EQ lon OR strmid namedim 0 3 EQ xi_ OR namedim EQ xt_i7_156 dimidx dimidx 0 if dimidx EQ 1 then begin print one of the dimensions must have the name: x or lon or xi_ or xt_i7_156 stop endif we are looking for a y dimension dimidy where namedim EQ y OR strmid namedim 0 3 EQ lat OR strmid namedim 4 EQ eta_ OR namedim EQ yt_j6_75 dimidy dimidy 0 if dimidy EQ 1 then begin print one of the dimensions must have the name: y or lat or eta_ or yt_j6_75 stop endif name of all variables we keep only the variables containing at least x y and time dimension if existing namevar strarr infile nvars for varid 0 infile nvars 1 do begin invar ncdf_varinq cdfid varid what contains the variable if where invar dim EQ dimidx 0 NE 1 AND where invar dim EQ dimidy 0 NE 1 AND where invar dim EQ infile recdim 0 NE 1 OR infile recdim EQ 1 THEN namevar varid invar name ENDFOR namevar namevar where namevar NE listgrid replicate vargrid n_elements namevar time axis date0fk date2jul 19000101 IF infile recdim EQ 1 THEN BEGIN jpt 1 time date0fk fakecal 1 ENDIF ELSE BEGIN ncdf_diminq cdfid infile recdim timedimname jpt we look for the variable containing the time axis we look for the first variable having for only dimension infile recdim varid 0 repeat BEGIN invar ncdf_varinq cdfid varid varid varid 1 endrep until n_elements invar dim EQ 1 AND invar dim 0 EQ infile recdim varid varid 1 CASE 1 OF varid EQ 1:BEGIN dummy report the file fullname has no time axis C we create a fake calendar fakecal 1 time date0fk lindgen jpt END invar natts EQ 0:BEGIN dummy report the variable invar name has no attribut C we create a fake calendar fakecal 1 time date0fk lindgen jpt END ELSE:BEGIN we want to know which attributes are attached to the time variable attnames strarr invar natts for attiq 0 invar natts 1 do attnames attiq ncdf_attname cdfid varid attiq if where attnames EQ units 0 EQ 1 then BEGIN dummy report Attribut units not found for the variable varid name C we create a fake calendar fakecal 1 time date0fk lindgen jpt ENDIF ELSE BEGIN on lit l axe des temps ncdf_varget cdfid varid time time double time ncdf_attget cdfid varid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 value strtrim strcompress string value 2 mots str_sep value unite mots 0 debut str_sep mots 2 now we try to find the attribut called calendar the the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid varid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE ATTENTION il faut recuperer l attribut calendar et ajuster time en consequense on passe time en jour julien d idlunite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 case unite of second :time julday debut 1 debut 2 debut 0 time 86400 d hour :time julday debut 1 debut 2 debut 0 time 24 d day :time julday debut 1 debut 2 debut 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday debut 1 debut 2 debut 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday debut 1 time t debut 2 debut 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday debut 1 debut 2 debut 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday debut 1 debut 2 debut 0 time t END ENDCASE high frequency calendar: more than one element per day IF max histogram long time time 0 GT 1 THEN fakecal 1 ELSE fakecal 0 date0fk date2jul 19000101 IF keyword_set fakecal THEN time date0fk lindgen jpt ELSE time long time ENDELSE END ENDCASE ENDELSE ncdf_close cdfid return filename:fullname time_counter:time listvar:namevar listgrid:strupcase listgrid caltype:key_caltype fakecal:date0fk fakecal end");353 a[351] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html", "selectfile.pro", "", " PRO selectfile_event event compile_opt idl2 strictarrsubs common widget_control event id get_uvalue eventuvalue default definition of messenger when selectfile_event is called directly without calling xmanager widget_control event handler get_uvalue messenger messenger 1 IF chkstru eventuvalue name EQ 0 THEN return case eventuvalue name of cancel button Global Cancel :BEGIN widget_control event handler get_uvalue messenger messenger 1 widget_control event handler destroy END data file informations datafilename :BEGIN widget_control event id get_value filename filename isafile filename filename 0 iodir iodir onlync title data file name if size filename type NE 7 then BEGIN widget_control event id set_value return ENDIF widget_control event id set_value filename END browse datafilename :BEGIN filename isafile iodir iodir onlync title data file name if size filename type NE 7 then return widget_control widget_info event handler find_by_uname datafilename set_value filename END switch automatic by and mesh definition buttons gridload :BEGIN IF event select EQ 1 THEN BEGIN widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control widget_info event handler find_by_uname kwd base sensitive 1 CASE event value OF via initnetcdf :BEGIN widget_control widget_info event handler find_by_uname meshload set_value initncdf editable 0 widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value initncdf keywords: END via perso :BEGIN widget_control widget_info event handler find_by_uname meshload set_value editable 1 widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value keywords of IDL procedure: END ENDCASE ENDIF END name of the procedure or batch file meshload :BEGIN widget_control event id get_value filename filename find filename 0 onlypro firstfound 0 if filename EQ NOT FOUND then begin widget_control event id set_value return endif CASE protype filename OF this is a procedure proc :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwd base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value file_basename filename pro keywords: END this is a function this case is not accepted func :BEGIN widget_control event id set_value return END this is an IDL batch file batch :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwd base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value no keywords: END ENDCASE widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control event id set_value file_basename filename pro END browse meshload :BEGIN filename isafile iodir homedir onlypro title to load the grid file if size filename type NE 7 then return meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id set_value filename selectfile_event ID:meshload_id TOP:event top HANDLER:event handler END Lets Go button Lets Go :BEGIN widget_control widget_info event handler find_by_uname datafilename get_value datafilename datafilename datafilename 0 IF datafilename EQ THEN return datafilename isafile filename datafilename iodir iodir onlync title data file name if size datafilename type NE 7 then BEGIN widget_control widget_info event handler find_by_uname datafilename set_value return ENDIF widget_control widget_info event handler find_by_uname gridload get_value gridload widget_control widget_info event handler find_by_uname argtxt get_value argtxt argtxt strtrim argtxt 0 2 IF strpos argtxt EQ 0 THEN argtxt strmid argtxt 1 widget_control widget_info event handler find_by_uname kwdtxt get_value kwdtxt kwdtxt strtrim kwdtxt 0 2 IF strpos kwdtxt EQ 0 THEN kwdtxt strmid kwdtxt 1 CASE gridload 0 OF via perso :BEGIN meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id get_value meshload meshload meshload 0 IF meshload EQ THEN return meshload find meshload 0 onlypro firstfound 0 if meshload EQ NOT FOUND then begin widget_control meshload_id set_value return endif END via initnetcdf :meshload datafilename ENDCASE IF strlen argtxt NE 0 THEN meshload meshload argtxt IF strlen kwdtxt NE 0 THEN meshload meshload kwdtxt widget_control event handler get_uvalue messenger messenger create_struct datafilename datafilename meshload meshload widget_control event handler destroy END endcase return end FUNCTION selectfile datafilename idlfile argspro _extra ex compile_opt idl2 strictarrsubs common pour recuperer les reponses possees lors de l utilisation de ce widget on cree un pointeur que l on place dans la uvalue Comme ca une fois que le widget est detruit dans la procedure event pro la variable surlaquelle pointait le pointeur contenue ds la uvalue du widget n est pas detruite est on peut recuperer le resultat messenger ptr_new allocate_heap base widget_base column title selectfile align_center uvalue messenger _EXTRA ex cancel button dummyid widget_button base value Cancel uvalue name: Global Cancel data file informations basea widget_base base row align_center dummyid widget_label basea value Data file name: database widget_text basea value uvalue name: datafilename uname datafilename xsize 45 EDITABLE dummyid widget_button basea value Browse uvalue name: browse datafilename switch automatic by and mesh definition buttons baseb widget_base base row align_center gdldid cw_bgroup baseb automatic grid construction with initncdf pro grid construction with other IDL batch or procedure exclusive set_value 0 uvalue name: gridload uname gridload button_uvalue via initnetcdf via perso name of the procedure or batch file basec widget_base base row align_center uname pro base dummyid widget_label basec value IDL batch file of procedure basemeshload widget_text basec value initncdf uvalue name: meshload uname meshload xsize 45 editable 0 dummyid widget_button basec value Browse uvalue name: browse meshload arguments informations based widget_base base row align_center uname arg base sensitive 0 dummyid widget_label based value procedure arguments agrbase widget_text based value uvalue name: argtxt uname argtxt xsize 45 EDITABLE keyword informations basee widget_base base row align_center uname kwd base dummyid widget_label basee uname kwdlab value keywords of initncdf: dummyid widget_text basee value uvalue name: kwdtxt uname kwdtxt xsize 45 EDITABLE Lets Go button basego widget_button base value Lets Go uvalue name: Lets Go IF n_elements datafilename NE 0 THEN BEGIN widget_control database set_value datafilename selectfile_event ID:database TOP:base HANDLER:base ENDIF IF n_elements idlfile NE 0 THEN BEGIN widget_control basemeshload set_value idlfile selectfile_event ID:basemeshload TOP:base HANDLER:base widget_control basemeshload get_value idlfile2 IF idlfile2 0 NE THEN widget_control gdldid set_value 1 ENDIF IF n_elements argspro NE 0 THEN widget_control argbase set_value argspro IF n_elements datafilename EQ 0 THEN BEGIN widget_control base realize xmanager selectfile base event_handler selectfile_event no_block 0 ENDIF ELSE selectfile_event ID:basego TOP:base HANDLER:base get back the information from selectfile_event res messenger ptr_free messenger if size res type NE 8 then return 1 loadgrid res meshload _extra ex ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta res3 scanfile res datafilename iodir iodir _extra ex if size res3 type NE 8 then return 1 return fileparameters:res3 readparameters:ccreadparameters meshparameters:ccmeshparameters end");354 a[352] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/singleclickaction.html", "singleclickaction.pro", "", " PRO singleclickaction event compile_opt idl2 strictarrsubs cm_4mesh cm_4data return widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext IF type NE plt THEN return on active la bonne fenetre widget_control event id get_value win wset win choix du type daction case uval press of 1:BEGIN coor convert_coord uval x 0 uval y 0 device to_data x coor 0 y coor 1 help x y oldgrid vargrid CASE strupcase vargrid OF T :vargrid F W :vargrid F U :vargrid V V :vargrid U F :vargrid T ENDCASE grille 1 glam gphi 1 nx ny nz firstx firsty firstz lastx lasty lastz vargrid oldgrid define the corner of the cells in the clockwise direction IF keyword_set key_periodic AND nx EQ jpi THEN BEGIN x1 glam 0:ny 2 y1 gphi 0:ny 2 x2 glam 1:ny 1 y2 gphi 1:ny 1 x3 shift glam 1:ny 1 1 0 y3 shift gphi 1:ny 1 1 0 x4 shift glam 0:ny 2 1 0 y4 shift gphi 0:ny 2 1 0 ENDIF ELSE BEGIN x1 glam 0:nx 2 0:ny 2 y1 gphi 0:nx 2 0:ny 2 x2 glam 0:nx 2 1:ny 1 y2 gphi 0:nx 2 1:ny 1 x3 glam 1:nx 1 1:ny 1 y3 gphi 1:nx 1 1:ny 1 x4 glam 1:nx 1 0:ny 2 y4 gphi 1:nx 1 0:ny 2 ENDELSE glam 1 free memory gphi 1 free memory What is the longitude WHILE x GT x range 1 DO x x 360 WHILE x LT x range 0 DO x x 360 IF x GT x range 1 THEN RETURN IF y GT y range 1 THEN RETURN IF y LT y range 0 THEN RETURN cell inquad x y x1 y1 x2 y2 x3 y3 x4 y4 onsphere key_onearth x1 1 free memory y1 1 free memory x2 1 free memory y2 1 free memory x3 1 free memory y3 1 free memory x4 1 free memory y4 1 free memory IF cell 0 EQ 1 OR n_elements cell GT 1 THEN RETURN yy cell 0 nx 1 key_periodic nx EQ jpi xx cell 0 MOD nx 1 key_periodic nx EQ jpi CASE strupcase vargrid OF T :BEGIN xx xx firstx 1 yy yy firsty 1 END W :BEGIN xx xx firstx 1 yy yy firsty 1 END U :BEGIN xx xx firstx yy yy firsty 1 END V :BEGIN xx xx firstx 1 yy yy firsty END F :BEGIN xx xx firstx yy yy firsty END ENDCASE bad where xx GE jpi IF bad 0 NE 1 THEN BEGIN xx bad xx bad jpi yy bad yy bad 1 ENDIF bad where yy GE jpj IF bad 0 NE 1 THEN stop print glamt xx yy gphit xx yy cmd buildcmd event top boxzoom boxzoom END ELSE: endcase RETURN end");355 a[353] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/tracecadre.html", "tracecadre.pro", "", " PRO tracecadre small out out erase erase fill fill determination de la colonne et de la ligne correspondant au small en entree compile_opt idl2 strictarrsubs numdessin small 2 1 numligne numdessin small 0 numcolonne numdessin numligne small 0 determination deposcadre largeurcolonne 1 small 0 largeurligne 1 small 1 cadre numcolonne largeurcolonne 1 numligne 1 largeurligne numcolonne 1 largeurcolonne 1 numligne largeurligne decale 0 001 cadre cadre decale decale decale decale reinitplt p position 0 0 1 1 IF keyword_set fill then begin polyfill cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 color 255 normal ENDIF ELSE BEGIN plot cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 xrange 0 1 yrange 0 1 linestyle 2 keyword_set out noerase normal thick 2 color 0 255 keyword_set erase ENDELSE return end");356 a[354] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/updatewidget.html", "updatewidget.pro", "", " PRO updatewidget base NOBOXZOOM noboxzoom NODATES nodates NOTYPE notype compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 widget_control base update 0 date1 et date2 if keyword_set nodates then begin date1 0 date2 0 ENDIF ELSE BEGIN dates extractatt top_uvalue dates numdessinin date1 dates 0 date2 dates 1 ENDELSE domain boxzoom extractatt top_uvalue domaines numdessinin if total boxzoom EQ 0 then boxzoom 1 if keyword_set noboxzoom then boxzoom 0 varinfo: filename namevar varinfo extractatt top_uvalue varinfo numdessinin filename varinfo 0 nomvar varinfo 1 if filename NE OR nomvar NE THEN BEGIN changefile base filename fieldname nomvar BOXZOOM boxzoom DATE1 date1 DATE2 date2 ENDIF ELSE BEGIN if date1 NE 0 then begin date1id widget_info base find_by_uname calendar1 widget_control date1id set_value date1 endif if date2 NE 0 then begin date2id widget_info base find_by_uname calendar2 widget_control date2id set_value date2 endif if keyword_set boxzoom then BEGIN domainid widget_info base find_by_uname domain widget_control domainid set_value boxzoom endif ENDELSE exextra if n_elements extractatt top_uvalue exextra numdessinin NE 0 then begin exextra extractatt top_uvalue exextra numdessinin specifieid widget_info base find_by_uname specifie widget_control specifieid set_value exextra endif text command txtcmd extractatt top_uvalue txtcmd numdessinin if txtcmd NE then begin txtcmdid widget_info base find_by_uname txtcmd widget_control txtcmdid set_value txtcmd endif graphtype if NOT keyword_set notype then BEGIN graphtype extractatt top_uvalue types numdessinin if graphtype NE then begin actionid widget_info base find_by_uname action widget_control actionid get_value action_value widget_control actionid set_combobox_select where action_value EQ graphtype 0 endif endif widget_control base update 1 return end");357 a[355] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.html", "xcreateanim.pro", "", " pro xcreateanim_event event compile_opt idl2 strictarrsubs common on recupere les aguments contenus ds le widget if tag_names event structure_name NE WIDGET_BUTTON then return widget_control event id get_uvalue uval if n_elements uval EQ 0 then return if uval EQ cancel then begin widget_control event top destroy return ENDIF on va ecrire l animation widget_control event top get_uvalue local_uvalue widget_control local_uvalue parent get_uvalue top_uvalue calendar extractatt top_uvalue fileparameters local_uvalue indexfile time_counter key_caltype extractatt top_uvalue fileparameters local_uvalue indexfile caltype fakecal extractatt top_uvalue fileparameters local_uvalue indexfile fakecal widget_control widget_info event top find_by_uname Filename get_value nomfic nomfic nomfic 0 widget_control widget_info event top find_by_uname directorie get_value animdir animdir animdir 0 widget_control widget_info event top find_by_uname debut get_value vdate1 index1 where calendar eq date2jul vdate1 index1 index1 0 if index1 EQ 1 then return widget_control widget_info event handler find_by_uname fin get_value vdate2 index2 where calendar eq date2jul vdate2 index2 index2 0 if index2 EQ 1 OR index2 LE index1 then return on detruit le widget avant de creer le fichier ps widget_control event top destroy creation de la routine qui nous serviera pour faire le dessin on recupere la liste des instructions globalcommand extractatt top_uvalue globalcommand on complete par le premiere et les dernieres lignes du programme createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript DATE1IN date1in DATE2IN date2in creation du fichier recupere le nombre d octets surlequel on code la palette device get_visual_depth depth taille de l image en nombre de pixel: xsize d x_size ysize d y_size on verifie que le nom du fichier termine bien par gif if strpos nomfic gif EQ 1 then nomfic nomfic gif current_window d window window free pixmap xsize xsize ysize ysize indication du numero de l image que l on est en train de creer base widget_base sliderid widget_slider base minimum 1 maximum index2 index1 1 value 1 title image number: widget_control base realize commencement du fichier gif ecriture d une image vide IF keyword_set fakecal THEN date index1 ELSE date jul2date calendar index1 xxx2ps noerase date1in date date2in date image tvrd true depth GT 8 If an 8 bit image was read reduce the number of colors if depth le 8 then begin tvlct red green blue get reduce_colors image index red red index green green index blue blue index endif if depth gt 8 then Convert 24 bit image to 8 bit image color_quan image 1 red green blue colors 256 get_translation translation map_all write_gif animdir nomfic image red green blue multiple wdelete d window boucle de creation et d ecriture ds le fichier IF index2 GT index1 THEN BEGIN FOR ind index1 1 index2 do BEGIN widget_control sliderid set_value ind index1 1 on bouge le slider window free pixmap xsize xsize ysize ysize IF keyword_set fakecal THEN date ind ELSE date jul2date calendar ind xxx2ps noerase date1 date date2 date image tvrd true depth GT 8 if depth gt 8 then image color_quan image 1 aaa bbb ccc colors 256 translation translation write_gif animdir nomfic image red green blue multiple wdelete d window ENDFOR ENDIF on met une derniere image blanche window free pixmap xsize xsize ysize ysize reinitplt plot 0 0 nodata image tvrd true depth GT 8 if depth gt 8 then image color_quan image 1 aaa bbb ccc colors 256 translation translation write_gif animdir nomfic image red green blue multiple wdelete d window fermeture du fichier write_gif animdir nomfic close widget_control base destroy rebascule en mode normal thisOS strupcase strmid version os_family 0 3 wset current_window si on est sous x on essaie de lancer xanim if thisOS NE MAC AND thisOS NE WIN then begin spawn which xanim result if strpos result 0 xanim EQ strlen result 0 5 then spawn xanim animdir nomfic endif return end PRO xcreateanim parent compile_opt idl2 strictarrsubs common widget_control parent get_uvalue top_uvalue on va s assurer que toutes les procedures de sont pas pltt procedures extractatt top_uvalue nameprocedures if total procedures EQ pltt NE 0 then begin nothing report Certains des plots ont un axe se rapportant au temps C Animation impossible error return ENDIF on va s assurer que toutes les figures ont le meme calendrier filelist extractatt top_uvalue filelist filenames extractatt top_uvalue varinfo 0 filenames reform filenames filenames filenames uniq filenames sort filenames if strtrim filenames 0 1 EQ then filenames filenames 1:n_elements filenames 1 indexfile where filelist EQ filenames 0 0 calendar extractatt top_uvalue fileparameters indexfile time_counter key_caltype extractatt top_uvalue fileparameters indexfile caltype fakecal extractatt top_uvalue fileparameters indexfile fakecal if n_elements filenames GT 1 then begin for i 1 n_elements filenames 1 do begin indexfilebis where filelist EQ filenames i 0 calendarbis extractatt top_uvalue fileparameters indexfilebis time_counter if n_elements calendarbis NE n_elements calendar then begin nothing report Les diffrents plots n utilisent pas le meme calendrier C Animation impossible error return ENDIF if total calendar NE calendarbis NE 0 then begin nothing report Les diffrents plots n utilisent pas le meme calendrier C Animation impossible error return endif endfor endif c est possible de faire une animationbase widget_base column title animation creation uvalue parent:parent indexfile:indexfile rien widget_label base value animation name rien widget_text base value anim_idl gif uname Filename editable rien widget_label base value animation directory if n_elements animdir EQ 0 then cd current animdir rien widget_text base value animdir uname directorie editable rien widget_label base value starting date rien cw_calendar base calendar calendar 0 FAKECAL fakecal uname debut uvalue name: calendar frame rien widget_label base value ending date rien cw_calendar base calendar calendar n_elements calendar 1 FAKECAL fakecal uname fin uvalue name: calendar frame rien widget_button base value OK uvalue ok rien widget_button base value Cancel uvalue cancel widget_control base realize xmanager xcreateanim base no_block return end");358 a[356] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar_event.html", "xxxmenubar_event.pro", "", " PRO xxxmenubar_event event compile_opt idl2 strictarrsubs common case event value of Open :begin oldmeshparams ccmeshparameters newfile selectfile if size newfile type NE 8 then return widget_control event top hourglass widget_control event top update 0 widget_control event top get_uvalue top_uvalue on s occupe de filelist filelist extractatt top_uvalue filelist filelist filelist newfile fileparameters filename currentfile n_elements filelist 1 on update le widget filelistid widget_info event top find_by_uname filelist widget_control filelistid combobox_additem file_basename newfile fileparameters filename widget_control filelistid set_combobox_select currentfile on update les elements filelist et currentfile de la top_uvalue top_uvalue 1 findline top_uvalue filelist filelist oldfile top_uvalue 1 findline top_uvalue currentfile top_uvalue 1 findline top_uvalue currentfile currentfile on s occupe du nom de la variable vlstid widget_info event top find_by_uname varlist quel etait le champ selectionne on le reselectionne fieldname widget_info vlstid combobox_gettext index where newfile fileparameters listvar EQ fieldname widget_control vlstid set_value newfile fileparameters listvar widget_control vlstid set_combobox_select 0 index 0 on s occupe du calendrier key_caltype newfile fileparameters caltype date1id widget_info event top find_by_uname calendar1 widget_control date1id get_value date1 widget_control date1id destroy jdate1 jul2date date1 if where newfile fileparameters time_counter EQ jdate1 0 EQ 1 then jdate1 newfile fileparameters time_counter 0 date2id widget_info event top find_by_uname calendar2 widget_control date2id get_value date2 widget_control date2id destroy jdate2 jul2date date2 if where newfile fileparameters time_counter EQ jdate2 0 EQ 1 then jdate2 jdate1 basecal widget_info event top find_by_uname basecal fakecal newfile fileparameters fakecal rien cw_calendar basecal newfile fileparameters time_counter jdate1 uname calendar1 FAKECAL fakecal uvalue name: calendar1 frame rien cw_calendar basecal newfile fileparameters time_counter jdate2 uname calendar2 FAKECAL fakecal uvalue name: calendar2 frame on update les elements fileparameters readparameters et meshparameters de la top_uvalue newfileparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newfileparameters i extractatt top_uvalue fileparameters i newfileparameters currentfile newfile fileparameters ptr_free extractatt top_uvalue fileparameters top_uvalue 1 findline top_uvalue fileparameters newfileparameters newreadparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newreadparameters i extractatt top_uvalue readparameters i newreadparameters currentfile newfile readparameters ptr_free extractatt top_uvalue readparameters top_uvalue 1 findline top_uvalue readparameters newreadparameters newmeshparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newmeshparameters i extractatt top_uvalue meshparameters i newmeshparameters currentfile newfile meshparameters ptr_free extractatt top_uvalue meshparameters top_uvalue 1 findline top_uvalue meshparameters newmeshparameters on actualise le widget if cmpgrid oldmeshparams then BEGIN domainid widget_info event top find_by_uname domain widget_control domainid set_value 1 endif widget_control event top update 1 end New xxx :BEGIN widget_control event top get_uvalue top_uvalue extra extractatt top_uvalue extra xxx CALLERWIDID event top _extra extra end Quit :begin widget_control event top get_uvalue top_uvalue ptr_free extractatt top_uvalue exextra ptr_free extractatt top_uvalue fileparameters ptr_free extractatt top_uvalue readparameters ptr_free extractatt top_uvalue meshparameters ptr_free top_uvalue widget_control event top destroy on ferme le widget end PostScript :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as postscript in demo mode return ENDIF widget_control event top get_uvalue top_uvalue on recupere la liste des instructions globalcommand extractatt top_uvalue globalcommand for i 0 n_elements globalcommand 1 do print globalcommand i on complete par le premiere et les dernieres lignes du programme createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape DATE1IN date1in DATE2IN date2in POSTSCRIPT END Animated gif :begin IF float strmid version release 0 3 GE 6 2 THEN xcreateanim event top end Gif :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as an image in demo mode return ENDIF widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 tracecadre smallin erase tracecadre smallout erase filename xquestion dans quelle fichier gif voulez vous sauver C l ecran de xxx xxx_image gif if rstrpos filename gif NE strlen filename 4 then filename filename gif filename isafile file filename io imagedir new saveimage filename quiet end IDL procedure :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as a idl program file in demo mode return ENDIF on recupere le nom du fichier filename xquestion dans quelle procedure IDL voulez vous sauver C la realisation de ce graph xxx_figure pro on le complete par un pro if rstrpos filename pro NE strlen filename 4 then filename filename pro filename isafile file filename io homedir new widget_control event top get_uvalue top_uvalue portrait ou landscape options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait optionsflag where options EQ Portrait Landscape 0 0 on lit les commandes pour faire un plot globalcommand extractatt top_uvalue globalcommand on complete par le premiere et les dernieres lignes du programme thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :sep : WIN :sep ELSE:sep ENDCASE poslastsep rstrpos filename sep proname strmid filename poslastsep 1 strlen filename poslastsep 1 4 globalcommand pro proname NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape DATE1IN date1in DATE2IN date2in _extra ex globalcommand return end on les ecrit dans un programme putfile filename globalcommand END RESTORE kwd of xxx :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save the widget in demo mode return ENDIF on recupere le nom du fichier filename xquestion dans quel fichier bianire voulez vous sauver le widget xxx_widget dat on le complete par un dat if rstrpos filename dat NE strlen filename 4 then filename filename dat filename isafile file filename io homedir new widget_control event top get_uvalue uvalue widget_control extractatt uvalue graphid get_value win wshow win wset win image tvrd true save uvalue image filename filename END Print to prompt :BEGIN commande getfile myuniquetmpdir xxx_oneplot pro for i 0 n_elements commande 1 do print commande i end Portrait Landscape :begin widget_control event top get_uvalue top_uvalue options extractatt top_uvalue options index where options EQ Portrait Landscape index index 0 optionsflag extractatt top_uvalue optionsflag key_portrait 1 optionsflag index 0 top_uvalue 1 findline top_uvalue optionsflag index key_portrait fenetre separee ou fenetre collee au widget if widget_info event top find_by_uname graph EQ 0 then BEGIN on tue la fenetre graphid extractatt top_uvalue graphid widget_control widget_info graphid parent destroy on la recree basegraph widget_base title xxx window group_leader event top uvalue event top uname basegraph windsize givewindowsize graphid widget_draw basegraph uname graph uvalue name: graph press:0 click:0 x: 0 0 y: 0 0 button_events retain 2 xsize windsize 0 ysize windsize 1 widget_control basegraph realize xmanager xxx basegraph no_block on redessine ce qu il y avait dedans on recupere la liste des instructions globalcommand extractatt top_uvalue globalcommand on complete par le premiere et les dernieres lignes du programme createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape KWDUSED noerase PORTRAIT portrait on reattribue l element graphid de la top_uvalue top_uvalue 1 findline top_uvalue graphid graphid ENDIF ELSE BEGIN extra extractatt top_uvalue extra xxx CALLERWIDID event top redraw _extra extra widget_control event top destroy on ferme le widget ENDELSE end Overlay :begin widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Overlay on change le flag sur Longitude x index flag 1 flags index numdessinin flag flag 0 on le reeatribue top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag end Vecteur :BEGIN widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Vecteur on change le flag sur Longitude x index flag 1 flags index numdessinin flag flag 0 on le reeatribue top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag end Longitude x index :BEGIN widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Longitude x index on change le flag sur Longitude x index flag 1 flags index numdessinin flag flag 0 on le reeatribue top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag maintenant on va changer les sliders definissant la boxzoom domainid widget_info event top find_by_uname domain boxzoom extractatt top_uvalue domaines numdessinin on veut retrouver le type de grille qui est utilisee currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar if flag EQ 0 then BEGIN longitudes on fait un domdef pour retrouver le lon1 lon2 correspondant a la boxzoom definie sur le widget domdef boxzoom gridtype vargrid xindex yindex flags where options EQ Latitude y index numdessinin 0 widget_control domainid set_value lon1 lon2 boxzoom 2:3 ENDIF ELSE BEGIN xindex maintenant ion veut retrouver firstx lastx correspondant a la boxzoom definie sur le widget domdef boxzoom gridtype vargrid yindex flags where options EQ Latitude y index numdessinin 0 grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz widget_control domainid set_value firstx lastx boxzoom 2:3 ENDELSE on met a jour la top_uvalue widget_control domainid get_value boxzoom top_uvalue 1 findline top_uvalue domaines numdessinin boxzoom end Latitude y index :begin widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Latitude y index on change le flag sur Latitude y index flag 1 flags index numdessinin flag flag 0 on le reeatribue top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag maintenant on va changer les sliders definissant la boxzoom domainid widget_info event top find_by_uname domain boxzoom extractatt top_uvalue domaines numdessinin on veut retrouver le type de grille qui est utilisee currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar if flag EQ 0 then BEGIN latitudes on fait un domdef pour retrouver le lat1 lat2 correspondant a la boxzoom definie sur le widget domdef boxzoom gridtype vargrid yindex xindex flags where options EQ Longitude x index numdessinin 0 widget_control domainid set_value boxzoom 0:1 lat1 lat2 ENDIF ELSE BEGIN yindex maintenant ion veut retrouver firsty lasty correspondant a la boxzoom definie sur le widget domdef boxzoom gridtype vargrid xindex flags where options EQ Longitude x index numdessinin 0 grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz widget_control domainid set_value boxzoom 0:1 firsty lasty ENDELSE on met a jour latop_uvalue widget_control domainid get_value boxzoom top_uvalue 1 findline top_uvalue domaines numdessinin boxzoom END endcase return end");359 a[357] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.html", "cw_bgroup.pro", "", " Id: cw_bgroup pro 134 2006 07 07 10:19:08Z navarro Copyright c 1992 2005 Research Systems Inc All rights reserved Unauthorized reproduction prohibited NAME: CW_BGROUP PURPOSE: CW_BGROUP is a compound widget that simplifies creating a base of buttons It handles the details of creating the proper base standard exclusive or non exclusive and filling in the desired buttons Events for the individual buttons are handled transparently and a CW_BGROUP event returned This event can return any one of the following: The Index of the button within the base The widget ID of the button The name of the button An arbitrary value taken from an array of User values CATEGORY: Compound widgets CALLING SEQUENCE: Widget CW_BGROUP Parent Names To get or set the value of a CW_BGROUP use the GET_VALUE and SET_VALUE keywords to WIDGET_CONTROL The value of a CW_BGROUP is: Type Value normal None exclusive Index of currently set button non exclusive Vector indicating the position of each button 1 set 0 unset INPUTS: Parent: The ID of the parent widget Names: A string array containing one string per button giving the name of each button KEYWORD PARAMETERS: BUTTON_UVALUE: An array of user values to be associated with each button and returned in the event structure COLUMN: Buttons will be arranged in the number of columns specified by this keyword EVENT_FUNCT: The name of an optional user supplied event function for buttons This function is called with the return value structure whenever a button is pressed and follows the conventions for user written event functions EXCLUSIVE: Buttons will be placed in an exclusive base with only one button allowed to be selected at a time FONT: The name of the font to be used for the button titles If this keyword is not specified the default font is used FRAME: Specifies the width of the frame to be drawn around the base IDS: A named variable into which the button IDs will be stored as a longword vector LABEL_LEFT: Creates a text label to the left of the buttons LABEL_TOP: Creates a text label above the buttons MAP: If set the base will be mapped when the widget is realized the default NONEXCLUSIVE: Buttons will be placed in an non exclusive base The buttons will be independent NO_RELEASE: If set button release events will not be returned RETURN_ID: If set the VALUE field of returned events will be the widget ID of the button RETURN_INDEX: If set the VALUE field of returned events will be the zero based index of the button within the base THIS IS THE DEFAULT RETURN_NAME: If set the VALUE field of returned events will be the name of the button within the base ROW: Buttons will be arranged in the number of rows specified by this keyword SCROLL: If set the base will include scroll bars to allow viewing a large base through a smaller viewport SET_VALUE: The initial value of the buttons This is equivalent to the later statement: WIDGET_CONTROL widget set_value value SPACE: The space in pixels to be left around the edges of a row or column major base This keyword is ignored if EXCLUSIVE or NONEXCLUSIVE are specified UVALUE: The user value to be associated with the widget UNAME: The user name to be associated with the widget XOFFSET: The X offset of the widget relative to its parent XPAD: The horizontal space in pixels between children of a row or column major base Ignored if EXCLUSIVE or NONEXCLUSIVE are specified XSIZE: The width of the base X_SCROLL_SIZE: The width of the viewport if SCROLL is specified YOFFSET: The Y offset of the widget relative to its parent YPAD: The vertical space in pixels between children of a row or column major base Ignored if EXCLUSIVE or NONEXCLUSIVE are specified YSIZE: The height of the base Y_SCROLL_SIZE: The height of the viewport if SCROLL is specified OUTPUTS: The ID of the created widget is returned SIDE EFFECTS: This widget generates event structures with the following definition: event ID:0L TOP:0L HANDLER:0L SELECT:0 VALUE:0 The SELECT field is passed through from the button event VALUE is either the INDEX ID NAME or BUTTON_UVALUE of the button depending on how the widget was created RESTRICTIONS: Only buttons with textual names are handled by this widget Bitmaps are not understood MODIFICATION HISTORY: 15 June 1992 AB 7 April 1993 AB Removed state caching 6 Oct 1994 KDB Font keyword is not applied to the label 10 FEB 1995 DJC fixed bad bug in event procedure getting id of stash widget 11 April 1995 AB Removed Motif special cases pro CW_BGROUP_SETV id value compile_opt hidden idl2 strictarrsubs ON_ERROR 2 return to caller stash WIDGET_INFO id CHILD WIDGET_CONTROL stash GET_UVALUE state NO_COPY case state type of 0: message unable to set plain button group value 1: begin WIDGET_CONTROL SET_BUTTON 0 state ids state excl_pos state excl_pos value WIDGET_CONTROL SET_BUTTON state ids value end 2: begin n n_elements value 1 for i 0 n do begin state nonexcl_curpos i value i WIDGET_CONTROL state ids i SET_BUTTON value i endfor end endcase WIDGET_CONTROL stash SET_UVALUE state NO_COPY end function CW_BGROUP_GETV id value compile_opt hidden idl2 strictarrsubs ON_ERROR 2 return to caller stash WIDGET_INFO id CHILD WIDGET_CONTROL stash GET_UVALUE state NO_COPY case state type of 0: message unable to get plain button group value 1: ret state excl_pos 1: ret state ret_arr state excl_pos 2: ret state nonexcl_curpos 2: BEGIN index where state nonexcl_curpos NE 0 if index 0 EQ 1 then begin if size state ret_arr type EQ 7 then ret ELSE ret 1 ENDIF ELSE ret state ret_arr index END endcase WIDGET_CONTROL stash SET_UVALUE state NO_COPY return ret end function CW_BGROUP_EVENT ev compile_opt hidden idl2 strictarrsubs WIDGET_CONTROL ev handler GET_UVALUE stash WIDGET_CONTROL stash GET_UVALUE state NO_COPY WIDGET_CONTROL ev id get_uvalue uvalue ret 1 Assume we return a struct case state type of 0: 1: if ev select eq 1 then begin state excl_pos uvalue ENDIF else begin if state no_release ne 0 then ret 0 ENDELSE 2: begin Keep track of the current state state nonexcl_curpos uvalue ev select if state no_release ne 0 and ev select eq 0 then ret 0 end endcase if ret then begin Return a struct ret ID:state base TOP:ev top HANDLER:0L SELECT:ev select VALUE:state ret_arr uvalue efun state efun WIDGET_CONTROL stash SET_UVALUE state NO_COPY if efun ne then return CALL_FUNCTION efun ret else return ret endif else begin Trash the event WIDGET_CONTROL stash SET_UVALUE state NO_COPY return 0 endelse endfunction CW_BGROUP parent names BUTTON_UVALUE button_uvalue COLUMN column EVENT_FUNCT efun EXCLUSIVE excl FONT font FRAME frame IDS ids LABEL_TOP label_top LABEL_LEFT label_left MAP map NONEXCLUSIVE nonexcl NO_RELEASE no_release RETURN_ID return_id RETURN_INDEX return_index RETURN_NAME return_name ROW row SCROLL scroll SET_VALUE sval SPACE space TAB_MODE tab_mode UVALUE uvalue XOFFSET xoffset XPAD xpad XSIZE xsize X_SCROLL_SIZE x_scroll_size YOFFSET yoffset YPAD ypad YSIZE ysize Y_SCROLL_SIZE y_scroll_size UNAME uname IF N_PARAMS ne 2 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller Set default values for the keywords version WIDGET_INFO version if version toolkit eq OLIT then def_space_pad 4 else def_space_pad 3 IF N_ELEMENTS column eq 0 then column 0 IF N_ELEMENTS excl eq 0 then excl 0 IF N_ELEMENTS frame eq 0 then frame 0 IF N_ELEMENTS map eq 0 then map 1 IF N_ELEMENTS nonexcl eq 0 then nonexcl 0 IF N_ELEMENTS no_release eq 0 then no_release 0 IF N_ELEMENTS row eq 0 then row 0 IF N_ELEMENTS scroll eq 0 then scroll 0 IF N_ELEMENTS space eq 0 then space def_space_pad IF N_ELEMENTS uname eq 0 then uname CW_BGROUP_UNAME IF N_ELEMENTS uvalue eq 0 then uvalue 0 IF N_ELEMENTS xoffset eq 0 then xoffset 0 IF N_ELEMENTS xpad eq 0 then xpad def_space_pad IF N_ELEMENTS xsize eq 0 then xsize 0 IF N_ELEMENTS x_scroll_size eq 0 then x_scroll_size 0 IF N_ELEMENTS yoffset eq 0 then yoffset 0 IF N_ELEMENTS ypad eq 0 then ypad def_space_pad IF N_ELEMENTS ysize eq 0 then ysize 0 IF N_ELEMENTS y_scroll_size eq 0 then y_scroll_size 0 top_base 0L if n_elements label_top ne 0 then begin next_base WIDGET_BASE parent XOFFSET xoffset YOFFSET yoffset COLUMN if keyword_set font then junk WIDGET_LABEL next_base value label_top font font else junk WIDGET_LABEL next_base value label_top top_base next_base endif else next_base parent if n_elements label_left ne 0 then begin next_base WIDGET_BASE next_base XOFFSET xoffset YOFFSET yoffset ROW if keyword_set font then junk WIDGET_LABEL next_base value label_left font font else junk WIDGET_LABEL next_base value label_left if top_base eq 0L then top_base next_base endif We need some kind of outer base to hold the users UVALUE if top_base eq 0L then begin top_base WIDGET_BASE parent XOFFSET xoffset YOFFSET yoffset next_base top_base endif If top_base EQ next_base THEN next_base WIDGET_BASE top_base Xpad 1 Ypad 1 Space 1 Set top level base attributes WIDGET_CONTROL top_base MAP map FUNC_GET_VALUE CW_BGROUP_GETV PRO_SET_VALUE CW_BGROUP_SETV SET_UVALUE uvalue SET_UNAME uname Tabbing if n_elements tab_mode ne 0 then begin WIDGET_CONTROL top_base TAB_MODE tab_mode WIDGET_CONTROL next_base TAB_MODE tab_mode end The actual button holding base base WIDGET_BASE next_base COLUMN column EXCLUSIVE excl FRAME frame NONEXCLUSIVE nonexcl ROW row SCROLL scroll SPACE space XPAD xpad XSIZE xsize X_SCROLL_SIZE x_scroll_size YPAD ypad YSIZE ysize Y_SCROLL_SIZE y_scroll_size EVENT_FUNC CW_BGROUP_EVENT UVALUE WIDGET_INFO top_base child n n_elements names ids lonarr n for i 0 n 1 do begin if n_elements font eq 0 then begin ids i WIDGET_BUTTON base value names i UVALUE i UNAME uname _BUTTON STRTRIM i 2 endif else begin ids i WIDGET_BUTTON base value names i FONT font UVALUE i UNAME uname _BUTTON STRTRIM i 2 endelse endfor Keep the state info in the real inner base UVALUE Pick an event value type: 0 Return ID 1 Return INDEX 2 Return NAME ret_type 1 if KEYWORD_SET RETURN_ID then ret_type 0 if KEYWORD_SET RETURN_NAME then ret_type 2 if KEYWORD_SET BUTTON_UVALUE then ret_type 3 case ret_type of 0: ret_arr ids 1: ret_arr indgen n 2: ret_arr names 3: ret_arr button_uvalue endcase type 0 if excl ne 0 then type 1 if nonexcl ne 0 then type 2 if n_elements efun le 0 then efun state type:type 0 Standard 1 Exclusive 2 Non exclusive base: top_base cw_bgroup base ret_arr:ret_arr Vector of event values efun : efun Name of event fcn nonexcl_curpos:intarr n If non exclus tracks state excl_pos:0 If exclusive current button ids:ids Ids of buttons no_release:no_release WIDGET_CONTROL WIDGET_INFO top_base CHILD SET_UVALUE state NO_COPY if n_elements sval ne 0 then CW_BGROUP_SETV top_base sval return top_base END");360 a[358] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.html", "cw_calendar.pro", "", " IDL testwid julday 1 1 1980 lindgen 100 5 PRO testwid_event event ComboboxId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy set :BEGIN widget_control event id get_value value widget_control ComboboxId set_value value END get :BEGIN widget_control ComboboxId get_value value help value struct END ELSE: endcase return end PRO testwid calendar date0 _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_calendar base calendar date0 _extra ex uname c est lui uvalue c est lui print cw_calendar ID nothing nothing widget_label base value end of the test nothing widget_text base value string calendar 0 uvalue set editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return END PRO cw_calendar_set_value id value compile_opt strictarr strictarrsubs cm_4cal get back the calendar and its related informations winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid key_caltype infowid caltype high freqeuncy calendar IF keyword_set infowid fakecal THEN BEGIN value2 date2jul long value infowid fakecal IF value2 LT n_elements infowid calendar AND value2 GE 0 THEN BEGIN stepid widget_info id find_by_uname step widget_control stepid set_value combobox_select:value2 infowid date jul2date value2 infowid fakecal widget_control winfo_id set_uvalue infowid ENDIF ENDIF ELSE BEGIN value long value 0 define year month day year value 10000l month value MOD 10000L 100L day value MOD 100L make sure the values correspond to real dates if year EQ 0 then year 1 if month EQ 0 then month 6 if day EQ 0 then day 15 check that the date exists in the calendar if where infowid calendar EQ julday month day year 0 EQ 1 then return update the value of infocal infowid date value widget_control winfo_id set_uvalue infowid update the combobox if needed possiblecase day month year for name 2 0 1 do BEGIN call set_cal_combobox with out 2 to specify that the call is coming from cw_calendar_set_value if widget_info id find_by_uname possiblecase name NE 0 then set_cal_combobox handler:id out:2 possiblecase name value ENDFOR ENDELSE return end FUNCTION cw_calendar_get_value id compile_opt strictarr strictarrsubs winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid return infowid date END FUNCTION get_cal_value id winfoid compile_opt strictarr strictarrsubs winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid oldate infowid date day wid_id widget_info id find_by_uname day if wid_id NE 0 then BEGIN widget_control wid_id get_value wid_value date long wid_value combobox_gettext ENDIF ELSE date oldate MOD 100L month wid_id widget_info id find_by_uname month if wid_id NE 0 then BEGIN widget_control wid_id get_value wid_value allmonths string format C CMoA 31 indgen 12 month where allmonths EQ wid_value combobox_gettext 0 1 date date 100L long month ENDIF ELSE date date oldate MOD 10000L 100L 100L year wid_id widget_info id find_by_uname year widget_control wid_id get_value wid_value date date 10000L long wid_value combobox_gettext IF arg_present winfoid NE 0 THEN BEGIN winfoid winfo_id infowid date date return infowid ENDIF ELSE return date end redefine the value and index position of the combobox PRO set_cal_combobox event casename date0 compile_opt strictarr strictarrsubs casename: Which widget shall we move: day month or year wid_id widget_info event handler find_by_uname casename we get back the calendar winfo_id widget_info event handler find_by_uname infocal widget_control winfo_id get_uvalue infowid caldat infowid calendar monthcal daycal yearcal and the current date IF n_elements date0 EQ 0 then date0 get_cal_value event handler year0 date0 10000L month0 date0 MOD 10000L 100L day0 date0 MOD 100L index of days months years according to date0 case casename of day :BEGIN list of days corresponding to month0 and year0 index where monthcal EQ month0 AND yearcal EQ year0 current daycal index END month :BEGIN list of months corresponding to year0 index where yearcal EQ year0 current monthcal index keep only the uniq values indexbis uniq current index index indexbis current current indexbis END year :BEGIN keep only the uniq years index uniq yearcal current yearcal index END ENDCASE we update the uvalue of the widget widget_control wid_id set_uvalue name:casename for event out 0 we store the previous position of the combobox to use it as the default position IF event out EQ 0 THEN widget_control wid_id get_value oldselect we redefine the new list if casename EQ month then begin widget_control wid_id set_value string format C CMoA 31 current 1 ENDIF ELSE BEGIN widget_control wid_id set_value strtrim current 1 ENDELSE specify the index position within the new list of values widget_control wid_id get_value combobox CASE event out OF 1: we put to the biggest position 1:selected combobox combobox_number 1 0: same as the previous position is the best choice 0:selected oldselect combobox_index combobox combobox_number 1 1: we put to the smallest position 1:selected 0 2: a new date has been specified 2:BEGIN case casename of day :selected where current EQ day0 0 month :selected where current EQ month0 0 year :selected where current EQ year0 0 ENDCASE END ENDCASE widget_control wid_id set_value combobox_select:selected update the date infowid date get_cal_value event handler widget_control winfo_id set_uvalue infowid return end move cyclicly the calendar to the value 0 if event out 1 or combobox_number 1 if event out 1 PRO move event casename compile_opt strictarr strictarrsubs possiblecase day month year impossiblecase id widget_info event handler find_by_uname casename widget_control id get_value wvalue we try to move but we are already at the beginning end of the combobox wvalue combobox_index EQ wvalue combobox_number 1 and event out EQ 1 wvalue combobox_index EQ 0 and event out EQ 1 move is not called when out eq 0 whichcase where possiblecase EQ casename 0 if wvalue combobox_index EQ wvalue combobox_number 1 event out EQ 1 THEN BEGIN if widget_info event handler find_by_uname possiblecase whichcase 1 EQ 0 then begin it is impossible to move the next combobox widget_control id get_value widvalue we set to widvalue combobox_number 1 when event out EQ 1 and to 0 when event out EQ 1 selected widvalue combobox_number 1 event out EQ 1 widget_control id set_value combobox_select:selected we call move for the next combobox ENDIF ELSE move event possiblecase whichcase 1 it is possible to move from 1 ENDIF ELSE widget_control id set_value combobox_select:wvalue combobox_index event out set_cal_combobox event possiblecase whichcase 1 return end FUNCTION cw_calendar_event event cm_4cal compile_opt strictarr strictarrsubs winfo_id widget_info event handler find_by_uname infocal widget_control winfo_id get_uvalue infowid key_caltype infowid caltype widget_control event id get_uvalue uval high frequency calendar IF uval name EQ step THEN BEGIN infowid date jul2date event index infowid fakecal ENDIF ELSE BEGIN possiblecase day month year impossiblecase whichcase where possiblecase EQ uval name 0 if event out NE 0 then BEGIN we use the button and we want to go out of the combobox: to index 1 event out 1 or to index combobox_number event out 1 we try to move the combobox just right with name: possiblecase whichcase 1 if widget_info event handler find_by_uname possiblecase whichcase 1 EQ 0 then BEGIN this widget do not exist we set cyclicly the current widget to the value 0 if event out 1 or combobox_number 1 if event out 1 widget_control event id get_value widvalue selected widvalue combobox_number 1 event out EQ 1 widget_control event id set_value combobox_select:selected ENDIF ELSE move event possiblecase whichcase 1 ENDIF if we changed month year we need to update the day and month list if uval name NE day then begin event out 0 for name whichcase 1 0 1 do BEGIN if widget_info event handler find_by_uname possiblecase name NE 0 then set_cal_combobox event possiblecase name endfor ENDIF we update the date infowid get_cal_value event handler winfo_id ENDELSE widget_control winfo_id set_uvalue infowid return CW_CALENDAR ID:event handler TOP:event top HANDLER:0L VALUE:infowid date FAKECAL: infowid fakecal endFUNCTION cw_calendar parent calendar jdate0 CALTYPE CALTYPE FAKECAL fakecal UVALUE uvalue UNAME uname _extra ex cm_4cal compile_opt strictarr strictarrsubs if keyword_set caltype then key_caltype caltype months days years found in the calendar caldat calendar monthcal daycal yearcal hourcal mincal scdcal starting date if n_elements jdate0 EQ 0 then jdate0 calendar 0 if where calendar EQ jdate0 0 EQ 1 then jdate0 calendar 0 caldat jdate0 month0 day0 year0 test the type of calendar if n_elements calendar GT 1 then BEGIN each day have the same value if n_elements uniq daycal sort daycal EQ 1 then monthly 1 each month and each day have the same value if keyword_set monthly AND n_elements uniq monthcal sort monthcal EQ 1 then yearly 1 endif if NOT keyword_set uvalue then uvalue dummy: if NOT keyword_set uname then uname base0 widget_base parent ROW EVENT_FUNC cw_calendar_event FUNC_GET_VALUE cw_calendar_get_value PRO_SET_VALUE cw_calendar_set_value UVALUE uvalue UNAME uname space 0 _extra ex if n_elements fakecal eq 0 then fakecal 0 base widget_base base0 space 0 uname infocal uvalue calendar:calendar date:jul2date jdate0 fakecal:fakecal caltype: key_caltype IF keyword_set fakecal THEN BEGIN cmbbid cw_combobox_pm base UVALUE name: step UNAME step value strtrim indgen n_elements calendar 1 widget_control cmbbid set_value combobox_select: where calendar EQ jdate0 0 ENDIF ELSE BEGIN vallen widget_info base string_size m day if NOT keyword_set monthly then begin dayindex where monthcal EQ month0 AND yearcal EQ year0 currentday daycal dayindex currentday strtrim currentday 1 cmbbid cw_combobox_pm base UVALUE name: day UNAME day value currentday widget_control cmbbid set_value combobox_select: where long currentday EQ day0 0 endif month if NOT keyword_set yearly then BEGIN monthindex where yearcal EQ year0 currentmonth long monthcal monthindex we suppress the repeted months monthindexbis uniq currentmonth sort currentmonth monthindex monthindex monthindexbis currentmonth currentmonth monthindexbis xoff 34 2 vallen 0 1 keyword_set monthly cmbbid cw_combobox_pm base UVALUE name: month UNAME month value string format C CMoA 31 currentmonth 1 xoffset xoff widget_control cmbbid set_value combobox_select: where long currentmonth EQ month0 0 endif year yearindex uniq yearcal sort yearcal currentyear strtrim yearcal yearindex 1 xoff 34 2 vallen 0 1 keyword_set monthly 33 3 vallen 0 1 keyword_set yearly cmbbid cw_combobox_pm base UVALUE name: year UNAME year value currentyear xoffset xoff widget_control cmbbid set_value combobox_select: where long currentyear EQ year0 0 ENDELSE return base end");361 a[359] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.html", "cw_combobox_pm.pro", "", " NAME: cw_combobox_pm PURPOSE: widget equivalent a WIDGET_COMBOBOX sauf qu en plus on dispose de 2 bouttons et pour deplacer le widget de 1 CATEGORY: compound widget aide a l ecriture des widgets CALLING SEQUENCE: id cw_combobox_pm parent INPUTS: Parent: The widget ID of the parent widget KEYWORD PARAMETERS:tous ceux de WIDGET_COMBOBOX OUTPUTS: The returned value of this function is the widget ID of the newly created animation widget COMMON BLOCKS: none SIDE EFFECTS: Widget Events Returned by Combobox Widgets Pressing the mouse button while the mouse cursor is over an element of a combobox widget causes the widget to change the label on the combobox button and to generate an event The appearance of any previously selected element is restored to normal at the same time The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_COMBOBOX_PM ID:0L TOP:0L HANDLER:0L INDEX:0L OUT:0 The first three fields are the standard fields found in every widget event INDEX returns the index of the selected item This can be used to index the array of names originally used to set the widget s value OUT:c est un entier qui peut prendre 3 valeurs: 1 : si on appuie sur alors que l index est deja aux max rq: ds ce cas l index reste au max 1: si on appuie sur alors que l index est deja aux min rq: ds ce cas l index reste au min 0 : ds les autres cas Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat retourne ds la variable resultat une structure de 3 elements dont les noms sont inspires des mots cles que l on peut passer a widget_control qd on utilise WIDGET_COMBOBOX: COMBOBOX_NUMBER: the number of elements currently contained in the specified combobox widget COMBOBOX_SELECT: the zero based number of the currently selected element i e the currently displayed element in the specified combobox widget DYNAMIC_RESIZE: a True value 1 if the widget specified by Widget_ID is a button combobox or label widget that has had its DYNAMIC_RESIZE attribute set Otherwise False 0 is returned 2 SET_VALUE widget_control wid_id set_value impose permet de modifier l etat de la combobox comme on peut le faire pour WIDGET_COMBOBOX Impose peut etre: a The contents of the list widget string or string array b une structure qui peut avoir comme elements de 1 a 3 : DYNAMIC_RESIZE:Set this keyword to activate if set to 1 or deactivate if set to 0 dynamic resizing of the specified CW_COMBOBOX_PM widget see the documentation for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX procedure for more information about dynamic widget resizing COMBOBOX_SELECT:Set this keyword to return the zero based number of the currently selected element i e the currently displayed element in the specified combobox widget VALUE: The contents of the list widget string or string array RESTRICTIONS: EXAMPLE: cf utiliser le programme founit i dessous: testwid et la procedure associee testwid_event MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 6 9 1999 testwid value strtrim indgen 10 2 PRO testwid_event event help event STRUCT ComboboxId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy dynamic_resize :BEGIN widget_control event id get_value value widget_control ComboboxId set_value dynamic_resize:value END combobox_select :BEGIN widget_control event id get_value value widget_control ComboboxId set_value combobox_select:value END value :BEGIN widget_control event id get_value value widget_control ComboboxId set_value value END get :BEGIN widget_control ComboboxId get_value value help value struct END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_combobox_pm base _extra ex uname c est lui uvalue c est lui print cw_combobox_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue dynamic_resize editable nothing widget_text base value 10 uvalue combobox_select editable nothing widget_text base value 5 uvalue value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end PRO cw_combobox_pm_set_value id value compile_opt idl2 strictarrsubs ComboboxId widget_info id find_by_uname Combobox if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of dynamic_resize :widget_control ComboboxId dynamic_resize value dynamic_resize for compatibility droplist_select :widget_control ComboboxId set_combobox_select value droplist_select combobox_select :widget_control ComboboxId set_combobox_select value combobox_select value :widget_control ComboboxId set_value value value ELSE:ras report wrong tag name in argument value of cw_combobox_pm_set_value endcase endfor ENDIF ELSE widget_control ComboboxId set_value value return end FUNCTION cw_combobox_pm_get_value id compile_opt idl2 strictarrsubs ComboboxId widget_info id find_by_uname Combobox widget_control ComboboxId get_value cmbbval cmbbtxt widget_info ComboboxId combobox_gettext cmbbnumb widget_info ComboboxId combobox_number index where cmbbval EQ cmbbtxt 0 return combobox_number:cmbbnumb combobox_gettext:cmbbtxt combobox_index:index combobox_value:cmbbval dynamic_resize:widget_info ComboboxId dynamic_resize end FUNCTION cw_combobox_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval if uval EQ Combobox then return CW_COMBOBOX_PM ID:event handler TOP:event top HANDLER:0L INDEX:event index STR:event str OUT:0 ComboboxId widget_info event handler find_by_uname Combobox widget_control ComboboxId get_value cmbbval cmbbtxt widget_info ComboboxId combobox_gettext cmbbnumb widget_info ComboboxId combobox_number index where cmbbval EQ cmbbtxt 0 out 0 case uval OF plus :BEGIN if index LT cmbbnumb 1 then BEGIN index index 1 widget_control ComboboxId set_combobox_select index ENDIF ELSE out 1 END minus :BEGIN if index GT 0 then BEGIN index index 1 widget_control ComboboxId set_combobox_select index ENDIF ELSE out 1 END endcase return CW_COMBOBOX_PM ID:event handler TOP:event top HANDLER:0L INDEX:index STR:cmbbtxt OUT:out endFUNCTION cw_combobox_pm parent VALUE value UVALUE uvalue UNAME uname ROW row COLUMN column _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller cheking for row and column keywords row keyword_set row 1 keyword_set column column keyword_set column 1 keyword_set row keyword_set column EQ row if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 0 EVENT_FUNC cw_combobox_pm_event FUNC_GET_VALUE cw_combobox_pm_get_value PRO_SET_VALUE cw_combobox_pm_set_value UVALUE uvalue UNAME uname _extra ex vallen widget_info base string_size m vallen 35 vallen 0 1 max strlen value if keyword_set row THEN BEGIN nothing widget_button base value uvalue minus xoffset 0 yoffset 5 xsize 15 ysize 15 nothing widget_combobox base VALUE value UVALUE Combobox UNAME Combobox xoffset 13 yoffset 0 xsize vallen nothing widget_button base value uvalue plus xoffset vallen 11 yoffset 5 xsize 15 ysize 15 ENDIF ELSE BEGIN nothing widget_combobox base VALUE value UVALUE Combobox UNAME Combobox xoffset 0 yoffset 0 xsize vallen nothing widget_button base value uvalue minus xoffset vallen 2 15 yoffset 24 xsize 15 ysize 15 nothing widget_button base value uvalue plus xoffset vallen 2 yoffset 24 xsize 15 ysize 15 ENDELSE widget_control base realize return base end");362 a[360] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.html", "cw_domain.pro", "", " IDL testwid PRO testwid_event event help event struct Id widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy set :BEGIN widget_control event id get_value value value value 0 nothing execute boxzoom value widget_control Id set_value boxzoom END get :BEGIN widget_control Id get_value value print value END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_domain base _extra ex uname c est lui uvalue c est lui print cw_domain ID nothing nothing widget_label base value end of the test nothing widget_text base value 40 100 10 10 uvalue set editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end pro cw_domain_set_value id value compile_opt idl2 strictarrsubs cm_4mesh topid findtopid id widget_control topid get_uvalue top_uvalue make sure that we have the good grid stored in the cm_4mesh common parameters currentfile extractatt top_uvalue currentfile currentgrid extractatt top_uvalue meshparameters currentfile change changegrid currentgrid quel est le type de boxzoom currentplot extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags currentplot IF flags where options EQ Longitude x index 0 EQ 0 THEN xtype geographic ELSE xtype index IF flags where options EQ Latitude y index 0 EQ 0 THEN ytype geographic ELSE ytype index comment completer la boxzoom IF xtype EQ geographic then begin lonn1 lon1 lonn2 lon2 xtitle lon ENDIF ELSE BEGIN lonn1 firstxt lonn2 lastxt xtitle x ind ENDELSE IF ytype EQ geographic then begin latt1 lat1 latt2 lat2 ytitle lat ENDIF ELSE BEGIN latt1 firstyt latt2 lastyt ytitle y ind ENDELSE vertf1 floor min gdepw 0 gdept 0 vertf2 ceil max gdepw 0 gdept 0 Case N_Elements Value OF 0:boxzoom lonn1 lonn2 latt1 latt2 vertf1 vertf2 1:BEGIN if value EQ 1 then boxzoom lonn1 lonn2 latt1 latt2 vertf1 vertf2 ELSE boxzoom lonn1 lonn2 latt1 latt2 0 value 0 END 2:boxzoom lonn1 lonn2 latt1 latt2 value 0 value 1 4:boxzoom Value 5:boxzoom Value 0:3 0 Value 4 6:boxzoom Value Else:BEGIN rien report Wrong Definition of Boxzoom END ENDCASE boxzoom 0 floor boxzoom 0 boxzoom 1 ceil boxzoom 1 boxzoom 2 floor boxzoom 2 boxzoom 3 ceil boxzoom 3 if n_elements boxzoom GE 5 then begin boxzoom 4 floor boxzoom 4 boxzoom 5 ceil boxzoom 5 endif widget_control widget_info id find_by_uname lon1 get_uvalue uvalue strict uvalue strict les longitudes min et max possible if xtype EQ geographic then BEGIN min floor min glamt glamf max max max ceil max ENDIF ELSE BEGIN min 0 max jpi 1 ENDELSE les id des widgets lon1id widget_info id find_by_uname lon1 lon2id widget_info id find_by_uname lon2 doit on changer de type d axe x: longitude index lonbase widget_info id find_by_uname lonbase widget_control lonbase get_uvalue lonbase_uvalue if lonbase_uvalue name NE xtype then BEGIN widget_control lonbase update 0 on casse tout widget_control lon1id destroy widget_control lon2id destroy on reconstruit lon1id cw_slider_pm lonbase value min boxzoom 0 boxzoom 0 keyword_set strict boxzoom 1 boxzoom 0 keyword_set strict widget_control lonbase set_uvalue name:xtype widget_control lonbase update 1 ENDIF ELSE BEGIN la nouvelle valeur qu ils vont avoir cursorvalue1 min boxzoom 0 boxzoom 0 strict boxzoom 1 boxzoom 2 boxzoom 2 keyword_set strict boxzoom 3 boxzoom 2 keyword_set strict widget_control latbase set_uvalue name:ytype widget_control latbase update 1 ENDIF ELSE BEGIN cursorvalue1 min boxzoom 2 boxzoom 2 strict boxzoom 3 indice2 1 if indice1 EQ indice2 then BEGIN if where gdep1 GE boxzoom 4 AND gdep2 LE boxzoom 5 0 EQ 1 then begin indice1 0 indice1 dthlv1_uval grid_t EQ 1 indice2 indice1 endif boxzoom 4 gdep1 indice1 boxzoom 5 boxzoom 4 1 endif maintenant que les values et les indexes sont definis proprement on peut les appliquer widget_control dthlv1id set_value combobox_select:indice1 widget_control dthlv2id set_value combobox_select:indice2 controler les min et les max des sliders if indice1 EQ 0 then min1 0 ELSE min1 gdep2 indice1 1 max1 min1 1 gdep1 indice2 widget_control depth1id set_value slider_min:min1 slider_max:max1 value:boxzoom 4 min2 gdep2 indice1 if indice2 EQ jpk 1 then BEGIN max2 max gdept gdepw max2 strtrim string max2 format e8 0 1 max2 float 1 strmid max2 1 float max2 ENDIF ELSE max2 gdep1 indice2 1 widget_control depth2id set_value slider_min:min2 slider_max:max2 value:boxzoom 5 return end FUNCTION cw_domain_get_value id compile_opt idl2 strictarrsubs box lonarr 6 possiblecase lon1 lon2 lat1 lat2 depth1 depth2 for i 0 5 do begin widget_control widget_info id find_by_uname possiblecase i get_value value box i value value endfor return box end FUNCTION cw_domain_event event compile_opt idl2 strictarrsubs common help struct event if where tag_names event EQ OUT 0 NE 1 then if event out NE 0 then return 1 widget_control event id get_uvalue uval case uval name of lon1 :widget_control widget_info event handler find_by_uname lon2 set_value slider_min:event value uval strict lon2 :widget_control widget_info event handler find_by_uname lon1 set_value slider_max:event value uval strict lat1 :widget_control widget_info event handler find_by_uname lat2 set_value slider_min:event value uval strict lat2 :widget_control widget_info event handler find_by_uname lat1 set_value slider_max:event value uval strict unzoom :BEGIN id widget_info event handler find_by_uname lon1 widget_control id get_value value widget_control id set_value slider_min:value slider_min_max 0 widget_control id set_value value slider_min_max 0 id widget_info event handler find_by_uname lat1 widget_control id get_value value widget_control id set_value slider_min:value slider_min_max 0 widget_control id set_value value slider_min_max 0 id widget_info event handler find_by_uname lon2 widget_control id get_value value widget_control id set_value slider_max:value slider_min_max 1 widget_control id set_value value slider_min_max 1 id widget_info event handler find_by_uname lat2 widget_control id get_value value widget_control id set_value slider_max:value slider_min_max 1 widget_control id set_value value slider_min_max 1 END dthlv1 :BEGIN ids depth1id widget_info event handler find_by_uname depth1 depth2id widget_info event handler find_by_uname depth2 dthlv2id widget_info event handler find_by_uname dthlv2 faut il changer dthlv2 widget_control event id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value widget_control dthlv2id get_value dthlv2_value gdep2 fix dthlv2_value combobox_value if dthlv2_value combobox_index LT event index then BEGIN on redefinie la valeur de dthlv2id widget_control dthlv2id set_value combobox_select:event index donc on redefinit la valeur et le max du slider 2 if event index EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 event index 1 1 widget_control depth2id set_value slider_max:max value:gdep2 event index du coup on redefinie donc le max du slider 1 widget_control depth1id set_value slider_max:gdep1 event index END on redefinie la valeur et le min du slider depth 1 if event index EQ 0 then min 0 ELSE min gdep1 event index 1 1 widget_control depth1id set_value slider_min:min value:gdep1 event index du coup on change aussi la valeur du min du slider depth 2 widget_control depth2id set_value slider_min:gdep1 event index 1 END dthlv2 :BEGIN ids depth1id widget_info event handler find_by_uname depth1 depth2id widget_info event handler find_by_uname depth2 dthlv1id widget_info event handler find_by_uname dthlv1 faut il changer dthlv1 widget_control dthlv1id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value widget_control event id get_value dthlv2_value gdep2 fix dthlv2_value combobox_value if dthlv1_value combobox_index GT event index then BEGIN on redefinie la valeur de dthlv1id widget_control dthlv1id set_value combobox_select:event index donc on redefinit la valeur et le min du slider 1 if event index EQ 0 then min 0 ELSE min gdep2 event index 1 widget_control depth1id set_value slider_min:min value:gdep1 event index du coup on redefinie donc le min du slider 2 widget_control depth2id set_value slider_min:gdep2 event index END on redefinie la valeur et le max du slider depth 2 if event index EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 event index 1 1 widget_control depth2id set_value slider_max:max value:gdep2 event index du coup on change aussi la valeur du max du slider depth 1 widget_control depth1id set_value slider_max:gdep2 event index 1 END depth1 :BEGIN ids depth2id widget_info event handler find_by_uname depth2 dthlv1id widget_info event handler find_by_uname dthlv1 doit on changer dthlv1 widget_control dthlv1id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value rien where gdep1 LT event value indice indice indice indice 1 if indice NE dthlv2_value combobox_index then begin on change le max de depth1 widget_control depth1id set_value slider_max:gdep2 indice 1 on redefinie la valeur de dthlv2id widget_control dthlv2id set_value combobox_select:indice donc on redefinit le max du slider 2 if indice EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 indice 1 1 widget_control event id set_value slider_max:max endif END ELSE: ENDCASE slidesliceid widget_info event top find_by_uname slide_slice if slidesliceid NE 0 then widget_control slidesliceid set_value 1 return ID:event handler TOP:event top HANDLER:0L BOX:cw_domain_get_value event handler end FUNCTION cw_domain parent BOXZOOM boxzoom STRICT strict UVALUE uvalue UNAME uname UNZOOM unzoom _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data def de laboxzoom Case N_Elements Boxzoom OF 0:boxzoom lon1 lon2 lat1 lat2 min gdepw 0 gdept 0 max gdepw 0 gdept 0 1:boxzoom lon1 lon2 lat1 lat2 0 boxzoom 0 2:boxzoom lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4:boxzoom Boxzoom vert1 vert2 5:boxzoom Boxzoom 0:3 0 Boxzoom 4 6: Else: return report Mauvaise Definition de Boxzoom ENDCASE IF total Boxzoom EQ 0 THEN boxzoom lon1 lon2 lat1 lat2 min gdepw 0 gdept 0 max gdepw 0 gdept 0 boxzoom 0 floor boxzoom 0 boxzoom 1 ceil boxzoom 1 boxzoom 2 floor boxzoom 2 boxzoom 3 ceil boxzoom 3 boxzoom 4 floor boxzoom 4 boxzoom 5 ceil boxzoom 5 if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent row 2 space 0 EVENT_FUNC cw_domain_event FUNC_GET_VALUE cw_domain_get_value PRO_SET_VALUE cw_domain_set_value UVALUE uvalue UNAME uname _extra ex baseh widget_base base column 1 keyword_set unzoom space 0 baseh1 widget_base baseh row 2 space 0 longitude min floor min glamt glamf max max max ceil max IF max min GT 360 AND keyword_set key_periodic THEN max min 360 lonbase widget_base baseh1 column 2 space 0 uname lonbase uvalue name: geographic lon1id cw_slider_pm lonbase value min boxzoom 0 boxzoom 0 keyword_set strict boxzoom 1 boxzoom 0 keyword_set strict latitude min floor min gphit gphif max max max ceil max latbase widget_base baseh1 column 2 space 0 uname latbase uvalue name: geographic lat1id cw_slider_pm latbase value min boxzoom 2 boxzoom 2 keyword_set strict boxzoom 3 boxzoom 2 keyword_set strict unzoom if keyword_set unzoom then rien widget_button baseh value unzoom uvalue name: unzoom xsize 60 ysize 110 depth basez widget_base base column 3 space 0 base_align_center basezdrp widget_base basez row 2 space 0 if strupcase vargrid EQ W then gdep gdepw ELSE gdep gdept gdep1 floor gdep gdep2 ceil gdep same where gdep2 gdep1 EQ 0 if same 0 NE 1 then gdep2 same gdep2 same 1 sgdep1 strtrim gdep1 1 sgdep2 strtrim gdep2 1 dephtid cw_combobox_pm basezdrp value sgdep1 uvalue name: dthlv1 grid_t:strupcase vargrid NE W uname dthlv1 rien where gdep1 LT boxzoom 4 indice1 indice1 indice1 indice2 1 widget_control dephtid set_value combobox_select:indice2 basedepthslid widget_base base column 2 space 0 strminlen max strlen strtrim round gdept gdepw 1 if indice1 EQ 0 then min1 0 ELSE min1 gdep2 indice1 1 max1 min1 1 gdep1 indice2 rien cw_slider_pm basez value min1 boxzoom 4 boxzoom 4 boxzoom 5 max2 uvalue name: depth2 minimum min2 maximum max2 uname depth2 title z2 strminlen strminlen return base end");363 a[361] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.html", "cw_droplist_pm.pro", "", " NAME: cw_droplist_pm PURPOSE: widget equivalent a WIDGET_DROPLIST sauf qu en plus on dispose de 2 bouttons et pour deplacer le widget de 1 CATEGORY: compound widget aide a l ecriture des widgets CALLING SEQUENCE: id cw_droplist_pm parent INPUTS: Parent: The widget ID of the parent widget KEYWORD PARAMETERS:tous ceux de WIDGET_DROPLIST OUTPUTS: The returned value of this function is the widget ID of the newly created animation widget COMMON BLOCKS: none SIDE EFFECTS: Widget Events Returned by Droplist Widgets Pressing the mouse button while the mouse cursor is over an element of a droplist widget causes the widget to change the label on the droplist button and to generate an event The appearance of any previously selected element is restored to normal at the same time The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_DROPLIST_PM ID:0L TOP:0L HANDLER:0L INDEX:0L OUT:0 The first three fields are the standard fields found in every widget event INDEX returns the index of the selected item This can be used to index the array of names originally used to set the widget s value OUT:c est un entier qui peut prendre 3 valeurs: 1 : si on appuie sur alors que l index est deja aux max rq: ds ce cas l index reste au max 1: si on appuie sur alors que l index est deja aux min rq: ds ce cas l index reste au min 0 : ds les autres cas Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat retourne ds la variable resultat une structure de 3 elements dont les noms sont inspires des mots cles que l on peut passer a widget_control qd on utilise WIDGET_DROPLIST: DROPLIST_NUMBER: the number of elements currently contained in the specified droplist widget DROPLIST_SELECT: the zero based number of the currently selected element i e the currently displayed element in the specified droplist widget DYNAMIC_RESIZE: a True value 1 if the widget specified by Widget_ID is a button droplist or label widget that has had its DYNAMIC_RESIZE attribute set Otherwise False 0 is returned 2 SET_VALUE widget_control wid_id set_value impose permet de modifier l etat de la droplist comme on peut le faire pour WIDGET_DROPLIST Impose peut etre: a The contents of the list widget string or string array b une structure qui peut avoir comme elements de 1 a 3 : DYNAMIC_RESIZE:Set this keyword to activate if set to 1 or deactivate if set to 0 dynamic resizing of the specified CW_DROPLIST_PM widget see the documentation for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST procedure for more information about dynamic widget resizing DROPLIST_SELECT:Set this keyword to return the zero based number of the currently selected element i e the currently displayed element in the specified droplist widget VALUE: The contents of the list widget string or string array RESTRICTIONS: EXAMPLE: cf utiliser le programme founit i dessous: testwid et la procedure associee testwid_event MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 6 9 1999 PRO testwid_event event help event STRUCT DroplistId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy dynamic_resize :BEGIN widget_control event id get_value value widget_control DroplistId set_value dynamic_resize:value END droplist_select :BEGIN widget_control event id get_value value widget_control DroplistId set_value droplist_select:value END value :BEGIN widget_control event id get_value value widget_control DroplistId set_value value END get :BEGIN widget_control DroplistId get_value value help value struct END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_droplist_pm base _extra ex uname c est lui uvalue c est lui print cw_droplist_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue dynamic_resize editable nothing widget_text base value 10 uvalue droplist_select editable nothing widget_text base value 5 uvalue value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end PRO cw_droplist_pm_set_value id value compile_opt idl2 strictarrsubs DroplistId widget_info id find_by_uname Droplist if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of dynamic_resize :widget_control DroplistId dynamic_resize value dynamic_resize droplist_select :widget_control DroplistId set_droplist_select value droplist_select value :widget_control DroplistId set_value value value ELSE:ras report mauvais nom de l argument de la structure ds cw_droplist_pm_set_value endcase endfor ENDIF ELSE widget_control DroplistId set_value value return end FUNCTION cw_droplist_pm_get_value id compile_opt idl2 strictarrsubs DroplistId widget_info id find_by_uname Droplist return droplist_number:widget_info DroplistId droplist_number droplist_select:widget_info DroplistId droplist_select dynamic_resize:widget_info DroplistId dynamic_resize end FUNCTION cw_droplist_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval if uval EQ Droplist then return CW_DROPLIST_PM ID:event handler TOP:event top HANDLER:0L INDEX:event index OUT:0 DroplistId widget_info event handler find_by_uname Droplist index widget_info DroplistId droplist_select case uval OF plus :BEGIN indexmax widget_info DroplistId droplist_number 1 if index NE indexmax then widget_control DroplistId set_droplist_select index 1 return CW_DROPLIST_PM ID:event handler TOP:event top HANDLER:0L INDEX: index 1 index 1 OUT: long index EQ 0 END endcase endFUNCTION cw_droplist_pm parent UVALUE uvalue UNAME uname ROW row COLUMN column _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller cheking for row and column keywords row keyword_set row 1 keyword_set column column keyword_set column 1 keyword_set row keyword_set column EQ row if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 1 xpad 1 ypad 1 ROW row COLUMN column EVENT_FUNC cw_droplist_pm_event FUNC_GET_VALUE cw_droplist_pm_get_value PRO_SET_VALUE cw_droplist_pm_set_value UVALUE uvalue UNAME uname _extra ex if keyword_set row THEN nothing widget_button base value uvalue minus nothing widget_droplist base UVALUE Droplist UNAME Droplist _extra ex if keyword_set column then begin base1 widget_base base row align_center space 1 xpad 1 ypad 1 nothing widget_button base1 value uvalue minus xsize 20 ysize 20 nothing widget_button base1 value uvalue plus xsize 20 ysize 20 ENDIF ELSE nothing widget_button base value uvalue plus widget_control base realize return base end");364 a[362] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.html", "cw_pagelayout.pro", "", " FUNCTION cw_pagelayout_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout if uval name EQ undo then begin return ID:event handler TOP:event top HANDLER:0L ENDIF ELSE BEGIN common si on ne change pas le nombre de colonnes on sort if uval name EQ column then if event index 1 EQ smallin 0 THEN return ID:event handler TOP:event top HANDLER:0L si on ne change pas le nombre de lignes on sort if uval name EQ row then if event index 1 EQ smallin 1 THEN return ID:event handler TOP:event top HANDLER:0L on efface la page graphid widget_info event top find_by_uname graph graphid extractatt top_uvalue graphid widget_control graphid get_value win wset win erase 255 case uval name of clear : column :BEGIN smallin event index 1 smallin 1 1 smallout event index 1 smallout 1 1 END row :BEGIN smallin smallin 0 event index 1 1 smallout smallout 0 event index 1 1 END endcase nbredessin smallin 0 smallin 1 on remet tout a 0 en ce qui concerne les postscripts createhistory event top smallin options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flag flags numdessinin update and reset all values of the top_uvalue top_uvalue 1 findline top_uvalue smallin smallin top_uvalue 1 findline top_uvalue smallout smallout top_uvalue 1 findline top_uvalue penvs replicate p nbredessin top_uvalue 1 findline top_uvalue xenvs replicate x nbredessin top_uvalue 1 findline top_uvalue yenvs replicate y nbredessin top_uvalue 1 findline top_uvalue nameprocedures strarr nbredessin top_uvalue 1 findline top_uvalue types strarr nbredessin top_uvalue 1 findline top_uvalue varinfo strarr 2 nbredessin top_uvalue 1 findline top_uvalue domaines fltarr 6 nbredessin top_uvalue 1 findline top_uvalue dates lonarr 2 nbredessin top_uvalue 1 findline top_uvalue txtcmd strarr nbredessin top_uvalue 1 findline top_uvalue optionsflag flag replicate 1 nbredessin ptr_free extractatt top_uvalue exextra top_uvalue 1 findline top_uvalue exextra ptrarr nbredessin allocate_heap top_uvalue 1 findline top_uvalue ENDELSE return ID:event handler TOP:event top HANDLER:0L endFUNCTION cw_pagelayout parent small UVALUE uvalue UNAME uname UNZOOM unzoom COLUMN column ROW row _extra ex compile_opt idl2 strictarrsubs row keyword_set row 1 keyword_set column if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent EVENT_FUNC cw_pagelayout_event FUNC_GET_VALUE cw_pagelayout_get_value PRO_SET_VALUE cw_pagelayout_set_value UVALUE uvalue UNAME uname space 0 _extra ex IF n_elements small eq 0 then small 1 1 1 dummy widget_label base value cln yoffset 3 id widget_combobox base value strtrim indgen 9 1 1 uvalue name: column uname column xoffset 20 xsize 40 widget_control id set_combobox_select small 0 1 IF keyword_set row THEN BEGIN xoff 60 yoff 0 ENDIF ELSE BEGIN xoff 0 yoff 20 ENDELSE dummy widget_label base value row xoffset xoff yoffset yoff 3 id widget_combobox base value strtrim indgen 9 1 1 uvalue name: row uname row xoffset xoff 20 xsize 40 yoffset yoff widget_control id set_combobox_select small 1 1 return base end ");336 a[334] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.html", "buildcmd.pro", "", " file_comments This function send back a string which contain the reading command and drawing s parameters param BASE in required keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword FORCETYPE history Sebastien Masson smasson lodyc jussieu fr version Id: buildcmd pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter le param BASE et le keyword FORCETYPE FUNCTION buildcmd base BOXZOOM boxzoom FORCETYPE forcetype we get back the ids of the widget parts compile_opt idl2 strictarrsubs txtcmdid widget_info base find_by_uname txtcmd domainid widget_info base find_by_uname domain actionid widget_info base find_by_uname action optionid widget_info base find_by_uname option widget_control base get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait strtrim optionsflag where options EQ Portrait Landscape 0 1 0 We determinate which procedure we will call to do the drawing and the type IF keyword_set forcetype THEN type forcetype ELSE type widget_info actionid combobox_gettext case type of plt :procedure plt pltz :procedure pltz pltz diag up :procedure pltz pltz diag dn :procedure pltz pltt :procedure pltt pltt diag up :procedure pltt pltt diag dn :procedure pltt xy :procedure plt xz :procedure pltz yz :procedure pltz xt :procedure pltt yt :procedure pltt zt :procedure pltt x :procedure plt1d y :procedure plt1d z :procedure plt1d t :procedure pltt endcase Search of options options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag flags optionsflag numdessinin xindex flags where options EQ Longitude x index 0 yindex flags where options EQ Latitude y index 0 drawvecteur flags where options EQ Vecteur 0 procedure eq plt drawover flags where options EQ Overlay 0 alreadyread extractatt top_uvalue alreadyread alreadyvector extractatt top_uvalue alreadyvector alreadyover extractatt top_uvalue alreadyoer What must we read case 1 of alreadyover NE 1:BEGIN toread alreadyover 1 readswitch over END alreadyvector NE 1 AND alreadyvector NE pi:BEGIN toread alreadyvector 1 readswitch vector END alreadyread NE 1 AND alreadyread NE pi AND alreadyread NE 2 pi:BEGIN toread alreadyread 1 readswitch classic END else:BEGIN case 1 of alreadyvector eq pi:BEGIN toread alreadyover 1 readswitch over END alreadyread EQ pi:BEGIN toread alreadyvector 1 readswitch vector END alreadyread EQ 2 pi:BEGIN toread alreadyover 1 readswitch over END ELSE:BEGIN toread alreadyread 1 readswitch classic END endcase END ENDCASE widget_control txtcmdid get_value widcmd widcmd strtrim widcmd 2 IF widcmd 0 EQ THEN widcmd zzz cutcmd widcmd 0 toread numberofread prefix nameexp ending readcmd buildreadcmd base nameexp procedure type BOXZOOM boxzoom complete readswitch EQ classic AND alreadyread EQ 1 we look for the line containing funclec_name currentfile extractatt top_uvalue currentfile readparameters extractatt top_uvalue readparameters currentfile i 0 while strpos readcmd i readparameters funclec_name EQ 1 do i i 1 case readswitch of classic :BEGIN if alreadyread 1 EQ 0 then BEGIN we start the reading command readcmd beginning of reading the field to draw readcmd readcmd i 1 field prefix readcmd i 1 ENDIF ELSE BEGIN we complet the reading command oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE exit if we have to read other fields if alreadyread 1 NE numberofread 1 THEN BEGIN top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyread alreadyread 1 top_uvalue 1 findline top_uvalue noticebase xnotice Select the field number strtrim alreadyread 3 1 return ENDIF we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd field create_struct arr:temporary field grid:vargrid unit:varunit experiment:varexp name:varname end of reading the field to draw we get back _EXTRA: extra extractatt top_uvalue extra if xindex NE 0 then extra create_struct extra xindex xindex if yindex NE 0 then extra create_struct extra yindex yindex exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd temporary readcmd extra sextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd case 1 of drawvecteur:BEGIN we have to read the vectors top_uvalue 1 findline top_uvalue alreadyread pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the zonal component of vector return END drawover:BEGIN we have to read the field to overlay top_uvalue 1 findline top_uvalue alreadyread 2 pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the field to overlay return END finished we draw the plot ELSE: top_uvalue 1 findline top_uvalue alreadyread 1 endcase END vector :BEGIN for the vectors there is 2 components we read u when alreadyvector is a interger and v when alreadyvector is a interger 0 5 if floor alreadyvector 1 EQ 0 then begin if floor alreadyvector EQ alreadyvector then begin readcmd beginning of reading the zonal component of vector readcmd readcmd i 1 fieldu prefix readcmd i 1 ENDIF ELSE BEGIN readcmd beginning of reading the meridional component of vector readcmd readcmd i 1 fieldv prefix readcmd i 1 ENDELSE readcmd extractatt top_uvalue currentreadcmd temporary readcmd ENDIF ELSE BEGIN oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE case alreadyvector 1 of numberofread 1:BEGIN we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd fieldu create_struct arr:temporary fieldu grid:vargrid unit:varunit experiment:varexp name:varname end of reading the zonal component of vector top_uvalue 1 findline top_uvalue currentreadcmd readcmd we finished zonal component reading we know switch to meridional component top_uvalue 1 findline top_uvalue alreadyvector 5 top_uvalue 1 findline top_uvalue noticebase xnotice Select the meridional component of vector return END numberofread 0 5:BEGIN we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF readcmd temporary readcmd fieldv create_struct arr:temporary fieldv grid:vargrid unit:varunit experiment:varexp name:varname end of reading the meridional component of vector we finished meridional component reading we get back _EXTRA of the vector and we complet extra already build extra extractatt top_uvalue extra exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd readcmd vectorextra sextra extra mixstru extra vectorextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd if drawover then BEGIN shall we do an overlay top_uvalue 1 findline top_uvalue alreadyvector pi top_uvalue 1 findline top_uvalue noticebase xnotice Select the field to overlay return ENDIF ELSE BEGIN it is done know top_uvalue 1 findline top_uvalue alreadyread 1 top_uvalue 1 findline top_uvalue alreadyvector 1 ENDELSE END ELSE:BEGIN we still need to read some vector components top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyvector alreadyvector 1 if floor alreadyvector EQ alreadyvector then text zonal ELSE text meridional top_uvalue 1 findline top_uvalue noticebase xnotice Select the strtrim floor alreadyread 3 1 text component of vector return END endcase END over :BEGIN if alreadyover 1 EQ 0 then begin we start the reading readcmd beginning of reading the field to overdraw readcmd readcmd i 1 fieldover prefix readcmd i 1 readcmd extractatt top_uvalue currentreadcmd temporary readcmd ENDIF ELSE BEGIN oldrdcmd extractatt top_uvalue currentreadcmd nl n_elements oldrdcmd oldrdcmd nl 1 oldrdcmd nl 1 readcmd i prefix readcmd i readcmd temporary oldrdcmd temporary readcmd ENDELSE if alreadyover 1 NE numberofread 1 THEN BEGIN we still need to read some files top_uvalue 1 findline top_uvalue currentreadcmd readcmd top_uvalue 1 findline top_uvalue alreadyover alreadyover 1 top_uvalue 1 findline top_uvalue noticebase xnotice Select the field number strtrim alreadyover 3 1 to overlay return ENDIF we finalize the reading command IF ending NE THEN BEGIN nl n_elements readcmd readcmd nl 1 readcmd nl 1 readcmd temporary readcmd ending ENDIF on finalise la commande de lecture readcmd readcmd fieldover create_struct arr:temporary fieldover grid:vargrid unit:varunit experiment:varexp name:varname end of reading the field to overdraw we get back _EXTRA of over and we complet extra already build extra extractatt top_uvalue extra exextra cw_specifie_get_value base extra mixstru exextra extra sextra struct2string extra readcmd readcmd overextra sextra extra mixstru extra overextra top_uvalue 1 findline top_uvalue currentreadcmd readcmd we reinitialize top_uvalue 1 findline top_uvalue alreadyread 1 top_uvalue 1 findline top_uvalue alreadyvector 1 top_uvalue 1 findline top_uvalue alreadyover 1 END endcase determination of the boxzoom s name if NOT keyword_set boxzoom then widget_control domainid get_value boxzoom Writting of this one as a string box strtrim boxzoom 0 1 for i 1 n_elements boxzoom 1 3 2 strpos type z EQ 1 do box box strtrim boxzoom i 1 For plots in z box must have by default 0 profmax if strpos type z NE 1 then BEGIN If more than 1 level is selected: widget_control widget_info base find_by_uname dthlv1 get_value niv1 niv1 niv1 combobox_index widget_control widget_info base find_by_uname dthlv2 get_value niv2 niv2 niv2 combobox_index if niv1 NE niv2 then begin box box strtrim boxzoom 4 1 strtrim boxzoom 5 1 ENDIF ELSE BEGIN if chkstru exextra profmax then pmax exextra profmax ELSE pmax 200 box box 0 strtrim pmax 1 ENDELSE endif box box IF strpos type diag up NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 2 1 strtrim boxzoom 1 1 strtrim boxzoom 3 1 ENDIF IF strpos type diag dn NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 3 1 strtrim boxzoom 1 1 strtrim boxzoom 2 1 ENDIF We determinate typein IF strpos type diag NE 1 THEN typein strmid type 0 4 ELSE typein type determination of small ssmall tostr smallout We will define the string which will contain the command to be executed by widgetdessine pro Cmd readCmd procedure field boxzoom box findalways typein typein small ssmall IF drawvecteur then Cmd Cmd vecteur u: fieldu v: fieldv IF drawover then Cmd Cmd contour fieldover IF n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints Cmd Cmd _extra mixstru ex extra portrait portrait NOERASE noerase print for i 0 n_elements Cmd 1 do print Cmd i print We complete and or update the structure top_uvalue top_uvalue 1 findline top_uvalue nameprocedures numdessinout procedure top_uvalue 1 findline top_uvalue types numdessinout type top_uvalue 1 findline top_uvalue domaines numdessinout boxzoom top_uvalue 1 findline top_uvalue txtcmd numdessinout widcmd top_uvalue 1 findline top_uvalue optionsflag numdessinout flags top_uvalue 1 findline top_uvalue exextra numdessinout extra return Cmd end "); 337 a[335] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcmd.html", "buildreadcmd.pro", "", " param BASE in required The id of the widget where apply the drawing param SNAMEEXP in required param PROCEDURE in required param TYPE in required keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword COMPLETE keyword NAMEFIELD uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: buildreadcmd pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter les param et les keyword qui ne le sont pas FUNCTION buildreadcmd base snameexp procedure type BOXZOOM boxzoom COMPLETE complete NAMEFIELD namefield compile_opt idl2 strictarrsubs cm_4cal for key_caltype get back widgets IDs vlstid widget_info base find_by_uname varlist date1id widget_info base find_by_uname calendar1 date2id widget_info base find_by_uname calendar2 domainid widget_info base find_by_uname domain optionid widget_info base find_by_uname option widget_control base get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 numdessinout extractatt top_uvalue smallout 2 1 name of the file currentfile extractatt top_uvalue currentfile filelist extractatt top_uvalue filelist filename filelist currentfile sfilename filename name of the variable if keyword_set namefield then namevar namefield ELSE namevar widget_info vlstid combobox_gettext snamevar namevar get the options options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags numdessinin xindex flags where options EQ Longitude x index 0 yindex flags where options EQ Latitude y index 0 extra extractatt top_uvalue extra if xindex NE 0 then extra create_struct extra xindex xindex if yindex NE 0 then extra create_struct extra yindex yindex exextra cw_specifie_get_value base exextra extractstru exextra min max inter lct if size exextra type EQ 8 then extra mixstru exextra extra sextra struct2string extra find date1 and date2 key_caltype extractatt top_uvalue fileparameters currentfile caltype widget_control date1id get_value date1 widget_control date2id get_value date2 if procedure EQ pltt AND date1 EQ date2 then BEGIN we redefine the dates to the begining and end of the calendar calendar extractatt top_uvalue fileparameters currentfile time_counter date1 jul2date calendar 0 date2 jul2date calendar n_elements calendar 1 widget_control date1id set_value date1 widget_control date2id set_value date2 endif fakecal extractatt top_uvalue fileparameters currentfile fakecal IF keyword_set fakecal THEN BEGIN date1 date2jul date1 fakecal date2 date2jul date2 fakecal ENDIF sdate1 strtrim date1 1 sdate2 strtrim date2 1 find boxzoom if NOT keyword_set boxzoom then widget_control domainid get_value boxzoom put boxzoom into a string box strtrim boxzoom 0 1 for i 1 n_elements boxzoom 1 3 2 strpos type z EQ 1 do box box strtrim boxzoom i 1 if strpos type z NE 1 then BEGIN common min min gdept gdepw max max box box strtrim floor min 1 strtrim ceil max 1 endif box box IF strpos type diag up NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 2 1 strtrim boxzoom 1 1 strtrim boxzoom 3 1 ENDIF IF strpos type diag dn NE 1 THEN BEGIN sendpoints strtrim boxzoom 0 1 strtrim boxzoom 3 1 strtrim boxzoom 1 1 strtrim boxzoom 2 1 ENDIF find funclec_name readparameters meshparameters readparameters extractatt top_uvalue readparameters currentfile funclec_name readparameters funclec_name if keyword_set complete then begin sreadparameters struct2string readparameters meshparameters extractatt top_uvalue meshparameters currentfile smeshparameters struct2string meshparameters We will define the string which will contain the command to be executed for the reading Cmd Definition of extra structure: extra sextra Definition of readparameters structure: readparameters sreadparameters Do we change of reading : dummy changeread readparameters Definition of meshparameters structure: meshparameters smeshparameters Do we change the grid : dummy changegrid meshparameters Read the data if n_elements date1in ne 0 then date1 date1in else date1 sdate1 if n_elements date2in ne 0 then date2 date2in else date2 sdate2 funclec_name snamevar date1 date2 snameexp timestep strtrim keyword_set fakecal 1 parent strtrim base 2 boxzoom box findalways filename sfilename if n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints type type Cmd Cmd _extra mixstru ex extra nostruct top_uvalue 1 findline top_uvalue varinfo numdessinout filename namevar top_uvalue 1 findline top_uvalue dates numdessinout date1 date2 ENDIF ELSE BEGIN Cmd funclec_name snamevar sdate1 sdate2 snameexp timestep strtrim keyword_set fakecal 1 parent strtrim base 1 boxzoom box findalways filename sfilename if n_elements sendpoints NE 0 then Cmd Cmd endpoints sendpoints type type Cmd Cmd _extra mixstru ex extra nostruct ENDELSE print :::::::::::::::::::::: for i 0 n_elements Cmd 1 do print Cmd i print :::::::::::::::::::::: return cmd end"); 338 a[336] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.html", "changefield.pro", "", " file_comments categories param BASE in required The id of the widget where apply the drawing param NEWFIELDNAME keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef returns uses restrictions examples history version Id: changefield pro 150 2006 08 09 10:12:54Z navarro todo seb PRO changefield base newfieldname BOXZOOM boxzoom compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue Change exextra : exextra definedefaultextra newfieldname specifieid widget_info base find_by_uname specifie widget_control specifieid set_value exextra Change the variable Do we need to change the vertical axis according to the tye of points T or W dthlv1id widget_info base find_by_uname dthlv1 widget_control dthlv1id get_uvalue dthlv1_uval oldzgridt dthlv1_uval grid_t get the type of point currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar for i 0 n_elements listvar 1 do print listvar i listgrid i indexvar where listvar EQ newfieldname indexvar 0 indexvar 0 zgridt strupcase listgrid indexvar NE W if we change the type of point if zgridt NE oldzgridt then BEGIN update dthlv1_uval grid_t dthlv1_uval grid_t zgridt widget_control dthlv1id set_uvalue dthlv1_uval update cw_domain if NOT keyword_set boxzoom THEN widget_control widget_info base find_by_uname domain get_value boxzoom widget_control widget_info base find_by_uname domain set_value boxzoom endif return end"); 339 a[337] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefile.html", "changefile.pro", "", " file_comments categories param BASE in required The id of the widget where apply the drawing param NEWFILENAME keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword DATE1 keyword DATE2 keyword FIELDNAME returns uses restrictions examples history version Id: changefile pro 150 2006 08 09 10:12:54Z navarro todo seb PRO changefile base newfilename BOXZOOM boxzoom DATE1 date1 DATE2 date2 FIELDNAME fieldname compile_opt idl2 strictarrsubs widget_control base hourglass widget_control base get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF size newfilename type EQ 7 THEN newfile where filelist EQ newfilename 0 ELSE newfile newfilename it is already the index of the new file if newfile EQ 1 then begin nothing report invalid filename return endif oldfile extractatt top_uvalue currentfile oldfilename filelist oldfile did we really change the file if oldfile EQ newfile AND NOT keyword_set BOXZOOM OR keyword_set DATE1 OR keyword_set DATE2 OR keyword_set FIELDNAME then return widget_control base update 0 we update currentfile element of the top_uvalue top_uvalue 1 findline top_uvalue currentfile newfile Calendar oldcalendar extractatt top_uvalue fileparameters oldfile time_counter newcalendar extractatt top_uvalue fileparameters newfile time_counter Did we change the calendar if array_equal oldcalendar newcalendar NE 1 then begin cm_4cal for key_caltype key_caltype extractatt top_uvalue fileparameters newfile caltype fake or real calendar fakecal extractatt top_uvalue fileparameters newfile fakecal Which dates were selected date1id widget_info base find_by_uname calendar1 if NOT keyword_set date1 then widget_control date1id get_value date1 jdate1 date2jul date1 if where newcalendar EQ jdate1 0 EQ 1 then jdate1 newcalendar 0 date2id widget_info base find_by_uname calendar2 if NOT keyword_set date2 then widget_control date2id get_value date2 jdate2 date2jul date2 if where newcalendar EQ jdate2 0 EQ 1 then jdate2 date1 if jdate2 LT jdate1 THEN jdate2 jdate1 widget_control date1id destroy widget_control date2id destroy basecal widget_info base find_by_uname basecal rien cw_calendar basecal newcalendar jdate1 uname calendar1 FAKECAL fakecal uvalue name: calendar1 frame rien cw_calendar basecal newcalendar jdate2 uname calendar2 FAKECAL fakecal uvalue name: calendar2 frame ENDIF ELSE BEGIN if keyword_set date1 then begin date1id widget_info base find_by_uname calendar1 widget_control date1id set_value date1 endif if keyword_set date2 then begin date2id widget_info base find_by_uname calendar2 widget_control date2id set_value date2 endif ENDELSE Grid parameters and domain newgrid extractatt top_uvalue meshparameters newfile change changegrid newgrid if change OR keyword_set boxzoom then BEGIN if NOT keyword_set boxzoom then boxzoom 1 domainid widget_info base find_by_uname domain widget_control domainid set_value boxzoom endif file name IF oldfile NE newfile THEN BEGIN flstid widget_info base find_by_uname filelist widget_control flstid set_combobox_select newfile ENDIF Variables name vlstid widget_info base find_by_uname varlist oldfieldname widget_info vlstid combobox_gettext did we really change the liste of variables oldlistvar extractatt top_uvalue fileparameters oldfile listvar newlistvar extractatt top_uvalue fileparameters newfile listvar if array_equal oldlistvar newlistvar NE 1 THEN widget_control vlstid set_value newlistvar set the liste of variables to the new variable name if keyword_set fieldname then newfieldname fieldname ELSE newfieldname oldfieldname indexvar where newlistvar EQ newfieldname indexvar 0 indexvar 0 widget_control vlstid set_combobox_select indexvar newfieldname newlistvar indexvar did we change the name of the variable if newfieldname NE oldfieldname then BEGIN changefield base newfieldname BOXZOOM boxzoom ENDIF widget_control base update 1 return end"); 340 a[338] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/createhistory.html", "createhistory.pro", "", " file_comments categories param BASE in required The id of the widget where apply the drawing param SMALL Vector composed of 3 or 4 elements applyed to make a drawing on a small portion of a page or screen It delimit the zone where the drawing will be done If there is 4 elements: then is constituated of coordinates expressed in cm located from the up and left corner of the page or the window in portrait like in lanscape of the bottom and left corner and of the up and right corner of the drawing zone If there is 3 elements: in this case we divide the page or the screen in small 0 columns and in small 1 lines the drawing made in the box numbered small 2 The numerotation starting up and left by the number 1 and then following the writing direction By default we make the largest drawing we can do conserving the aspect rapport exept when REMPLI is activated returns uses restrictions examples history version Id: createhistory pro 150 2006 08 09 10:12:54Z navarro todo seb: je ne suis pas sur pour les param documenter le reste PRO createhistory base small we save globalcommand in globaloldcommand compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue globalcommand extractatt top_uvalue globalcommand top_uvalue 1 findline top_uvalue globaloldcommand globalcommand portrait or landscape options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait optionsflag where options EQ Portrait Landscape 0 0 composition du text contennu ds history pro texte common if keyword_set postscript then begin noerase 1 openps infowidget infowidget portrait strtrim portrait 2 endif beginning of 1 end of 1 if small 0 small 1 GT 1 then begin for draw 1 small 0 small 1 1 do begin texte texte beginning of strtrim draw 1 2 noerase 1 end of strtrim draw 1 2 endfor ENDIF texte texte if keyword_set postscript then begin closeps infowidget infowidget printps endif the new globalcommand top_uvalue 1 findline top_uvalue globalcommand texte for i 0 n_elements texte 1 do print texte i return end"); 341 a[339] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/cutcmd.html", "cutcmd.pro", "", " file_comments categories param WIDCMD param TOREAD param NUMBEROFREAD param PREFIX param NAMEEXP param ENDING returns uses restrictions examples history version Id: cutcmd pro 150 2006 08 09 10:12:54Z navarro todo seb PRO cutcmd widcmd toread numberofread prefix nameexp ending compile_opt idl2 strictarrsubs dummy where byte widcmd EQ byte 0 nbdblquote CASE 1 OF nbdblquote MOD 2: stop odd numbers are impossibles nbdblquote GT 0: nbdblquote EQ 0:BEGIN widcmd is an expression of type: numb1 a numb2 b numb we will change into the form numb1 a numb2 b numb in order to suits the new method of cutcmd widcmd strtrim widcmd 2 we force to start with a or case 1 of strpos widcmd EQ 0: strpos widcmd EQ 0: ELSE:widcmd widcmd ENDCASE separator strsplit widcmd extract regex other strsplit widcmd extract IF n_elements separator NE n_elements other THEN stop widcmd FOR i 0 n_elements other 1 DO BEGIN IF isnumber other i LT 1 THEN other i other i widcmd widcmd separator i other i ENDFOR print widcmd END ENDCASE cutted strsplit widcmd extract IF strpos widcmd EQ 0 THEN start 0 ELSE start 1 nameexp cutted start: :2 numberofread n_elements nameexp IF toread GE numberofread then begin dummy report toread cannot be larger than numberofread stop ENDIF other cutted 1 start: :2 make sure that we have a prefix for each nameexp IF start EQ 0 THEN other other nameexp nameexp toread prefix other toread IF n_elements other EQ numberofread 1 THEN ending other numberofread ELSE ending help prefix nameexp ending return end"); 342 a[340] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/definedefaultextra.html", "definedefaultextra.pro", "", " file_comments categories param NOMVARIABLE returns uses restrictions examples history version Id: definedefaultextra pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION definedefaultextra nomvariable compile_opt idl2 strictarrsubs case strlowcase nomvariable of sn :BEGIN return get_extra min 31 max 37 inter 2 lct 33 nocontout END tn :BEGIN return get_extra min 20 max 31 inter 5 lct 39 END un :BEGIN return get_extra min 1 max 1 inter 1 lct 64 END vn :BEGIN return get_extra min 1 max 1 inter 1 lct 64 END ELSE: ENDCASE return get_extra min max inter lct 39 end"); 343 a[341] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.html", "doubleclickaction.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: doubleclickaction pro 150 2006 08 09 10:12:54Z navarro todo seb PRO doubleclickaction event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue We activate the right window widget_control event id get_value win wset win What is the selected drawing smallin extractatt top_uvalue smallin smallout extractatt top_uvalue smallout x convert_coord uval x 0 uval y 0 device to_normal 0 y convert_coord uval x 0 uval y 0 device to_normal 1 numcolonne n_elements where findgen smallin 0 smallin 0 lt x 1 numligne n_elements where findgen smallin 1 smallin 1 lt 1 y 1 numdessin numcolonne numligne smallin 0 1 Choice of the type of action case uval press of 1:BEGIN if top_uvalue smallin 2 NE numdessin then begin tracecadre smallin erase if total smallin EQ smallout EQ 3 then tracecadre smallout out smallin smallin 0:1 numdessin top_uvalue 1 findline top_uvalue smallin smallin tracecadre smallin p extractatt top_uvalue penvs numdessin 1 x extractatt top_uvalue xenvs numdessin 1 y extractatt top_uvalue yenvs numdessin 1 END 2:BEGIN if top_uvalue smallout 2 NE numdessin then begin tracecadre smallout erase if total smallin EQ smallout EQ 3 then tracecadre smallin smallout smallin 0:1 numdessin top_uvalue 1 findline top_uvalue smallout smallout tracecadre smallout out endif END 4:BEGIN tracecadre smallin 0:1 numdessin fill inserthistory event top beginning of strtrim numdessin 2 end of strtrim numdessin 2 Putting at 0 of attributes of the value concerning the drawing: numdessin numdessin 1 top_uvalue 1 findline top_uvalue varinfo numdessin top_uvalue 1 findline top_uvalue dates numdessin 0l 0l top_uvalue 1 findline top_uvalue nameprocedures numdessin top_uvalue 1 findline top_uvalue types numdessin top_uvalue 1 findline top_uvalue domaines numdessin fltarr 6 top_uvalue 1 findline top_uvalue txtcmd numdessin if numdessin EQ smallin 2 then tracecadre smallin if numdessin EQ smallout 2 then tracecadre smallout out END ELSE: endcase updatewidget event top return end"); 344 a[342] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/extractatt.html", "extractatt.pro", "", " file_comments categories param TOP_UVALUE param NAME returns uses restrictions examples history version Id: extractatt pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION extractatt top_uvalue name compile_opt idl2 strictarrsubs taille size top_uvalue j 1 repeat BEGIN j j 1 if j EQ size top_uvalue 2 then return 1 endrep until top_uvalue 0 j EQ name return top_uvalue 1 j end"); 345 a[343] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/findline.html", "findline.pro", "", " file_comments categories param TOP_UVALUE param NAME returns uses restrictions examples history version Id: findline pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION findline top_uvalue name compile_opt idl2 strictarrsubs taille size top_uvalue j 1 repeat BEGIN j j 1 if j EQ size top_uvalue 2 then return 1 endrep until top_uvalue 0 j EQ name return j end"); 346 a[344] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.html", "identifyclick.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: identifyclick pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION identifyclick event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval no_copy thisEvent TAG_NAMES event Structure if thisEvent EQ WIDGET_TIMER then press 0 ELSE press event press d 0 1 t 1 0 d 2 0 long click d 1 0 t 2 0 normal click d 2 1 d 3 0 t 0 0 double click t 3 0 d 0 0 double click type inutile case 1 OF d 0 0 1er reascending thisEvent EQ WIDGET_DRAW AND uval click EQ 0 AND press EQ 0: d 0 1 1er click of the series thisEvent EQ WIDGET_DRAW AND uval click EQ 0 AND press ge 1:BEGIN uval x event x 0 uval y event y 0 uval press press uval click 1 widget_control event id timer 3 END d 1 0 1er reascending thisEvent EQ WIDGET_DRAW AND uval click EQ 1 AND press EQ 0:uval click 2 d 2 0 End of the long click thisEvent EQ WIDGET_DRAW AND uval click EQ 2 AND press EQ 0:BEGIN type long uval x uval x 0 event x uval x uval x sort uval x uval y uval y 0 event y uval y uval y sort uval y uval click 0 uval press event release END d 2 1 thisEvent EQ WIDGET_DRAW AND uval click EQ 2 AND press ge 1:BEGIN type double uval press press uval click 3 END d 3 0 reascending and end of the double click thisEvent EQ WIDGET_DRAW AND uval click EQ 3 AND press EQ 0:uval click 0 t 0 0 End of the double click thisEvent EQ WIDGET_TIMER AND uval click EQ 0 AND press EQ 0: t 1 0 long click thisEvent EQ WIDGET_TIMER AND uval click EQ 1 AND press EQ 0:uval click 2 t 2 0 normal click thisEvent EQ WIDGET_TIMER AND uval click EQ 2 AND press EQ 0:BEGIN type single press uval press uval click 0 END t 3 0 End of the double click thisEvent EQ WIDGET_TIMER AND uval click EQ 3 AND press EQ 0:uval click 0 Imposible case in theory: ELSE:BEGIN print thisEvent uval click press print Probleme cas normalement impossible END endcase widget_control event id set_uvalue uval no_copy return type:type end"); 347 a[345] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/inserthistory.html", "inserthistory.pro", "", " file_comments categories param BASE param TEXT param LINE1 param LINE2 returns uses restrictions examples history version Id: inserthistory pro 150 2006 08 09 10:12:54Z navarro todo seb PRO inserthistory base text line1 line2 compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue globalcommand extractatt top_uvalue globalcommand top_uvalue 1 findline top_uvalue globaloldcommand globalcommand for i 0 n_elements globalcommand 1 do print globalcommand i we insert text between line1 and line2 index1 where globalcommand EQ line1 index1 index1 0 1 if index1 EQ 1 then begin rien report line1 n est pas trouve ds globalcommand return endif index2 where globalcommand EQ line2 index2 index2 0 if index2 EQ 1 then begin rien report line2 n est pas trouve ds globalcommand return ENDIF the new text: globalcommand globalcommand 0:index1 text globalcommand index2:n_elements globalcommand 1 the new globalcommand top_uvalue 1 findline top_uvalue globalcommand globalcommand return end"); 348 a[346] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.html", "letsdraw.pro", "", " file_comments It si the procedure lauching the drawing If we do not give the command to it it call construitcommande to know what to trace categories param BASE in required The id of the widget where apply the drawing keyword COMMANDE A string of the style: read_data sst keyword _EXTRA Used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: letsdraw pro 150 2006 08 09 10:12:54Z navarro PRO letsdraw base COMMANDE commande _extra ex compile_opt idl2 strictarrsubs common we recuperate the uvalue of base widget_control base get_uvalue top_uvalue print help top_uvalue struct help top_uvalue exextra struct if NOT keyword_set commande then commande buildcmd base _extra ex if commande 0 EQ then return on recupere la uvalue de base widget_control base hourglass widget_control base get_uvalue top_uvalue print help top_uvalue struct print help top_uvalue exextra struct help top_uvalue extra struct print print commande help mixstru top_uvalue exextra top_uvalue extra struct we recuperate the id of the graphic associated to the widget of id base graphid extractatt top_uvalue graphid widget_control graphid get_value win We select it we will pass to it all commands concerning the window wset win erase 255 we clean the window We make sure that if we work with a screen coding colors on 24 bits the specified background color p background is the one applied if d n_colors gt 256 then begin device decomposed 1 p background ffffff x plot 0 0 device decomposed 0 ENDIF smallout long extractatt top_uvalue smallout numdessinout smallout 2 1 tracecadre smallout fill options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait strtrim optionsflag where options EQ Portrait Landscape 0 1 0 createpro common noerase 1 key_portrait portrait Commande filename myuniquetmpdir xxx_oneplot pro inserthistory base Commande beginning of strtrim smallout 2 1 end of strtrim smallout 2 1 top_uvalue 1 findline top_uvalue penvs numdessinout p top_uvalue 1 findline top_uvalue xenvs numdessinout x top_uvalue 1 findline top_uvalue yenvs numdessinout y return end"); 349 a[347] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html", "loadgrid.pro", "", " file_comments categories param MESHFILEIN keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: loadgrid pro 150 2006 08 09 10:12:54Z navarro todo seb PRO loadgrid meshfilein _extra ex compile_opt idl2 strictarrsubs cm_4mesh ccmeshparameters filename meshfilein split the name according to delimiter meshfile strsplit meshfilein extract meshfile strtrim meshfile 2 try to find a pro file with this name filepro find meshfile 0 firstfound onlypro 0 if this is an idl batch file or a procedure if filepro NE NOT FOUND THEN BEGIN CASE protype filepro OF this is a procedure proc :listing file_basename filepro pro this is a function this case is not coded func :stop this is an IDL batch file batch :listing file_basename filepro pro ENDCASE ENDIF ELSE BEGIN filenc find meshfile 0 firstfound onlync 0 if filenc EQ NOT FOUND THEN stop listing initncdf filenc ENDELSE add the arguments and keywords if necessary IF n_elements meshfile GT 1 AND strmid listing 0 1 NE THEN BEGIN FOR i 1 filepro NE NOT FOUND n_elements meshfile 1 DO listing listing meshfile i ENDIF IF strmid listing 0 1 NE THEN listing listing strcalling meshfilein _extra ex createpro listing filename myuniquetmpdir for_createpro pro _extra ex return END "); 350 a[348] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.html", "longclickaction.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: longclickaction pro 150 2006 08 09 10:12:54Z navarro todo seb PRO longclickaction event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue What is the selected drawing smallout extractatt top_uvalue smallout smallin extractatt top_uvalue smallin small smallin x convert_coord uval x 0 uval y 0 device to_normal 0 y convert_coord uval x 0 uval y 0 device to_normal 1 numcolonne n_elements where findgen small 0 small 0 lt x 1 numligne n_elements where findgen small 1 small 1 lt 1 y 1 numdessin numcolonne numligne small 0 we put on numdessin as the leader plot tracecadre smallin erase if total smallin EQ smallout EQ 3 then tracecadre smallout out smallin smallin 0:1 numdessin 1 top_uvalue 1 findline top_uvalue smallin smallin tracecadre smallin p extractatt top_uvalue penvs numdessin x extractatt top_uvalue xenvs numdessin y extractatt top_uvalue yenvs numdessin Change the domain box: coor convert_coord uval x uval y device to_data x coor 0 0 coor 0 1 y coor 1 0 coor 1 1 domainid widget_info event top find_by_uname domain boxzoom x y Do we have to pass the boxzoom in indexes currentplot extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags currentplot changex flags where options EQ Longitude x index 0 EQ 1 changey flags where options EQ Latitude y index 0 EQ 1 if changex OR changey then begin We want to find the type of grid which is used currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar domdef boxzoom gridtype vargrid grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz if changex then boxzoom 0:1 firstx lastx if changey then boxzoom 2:3 firsty lasty endif widget_control domainid set_value boxzoom actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext case uval press of 1:BEGIN nodates type EQ xt OR type EQ yt OR type EQ zt OR type EQ t updatewidget event top noboxzoom nodates nodates notype type NE plt letsdraw event top END 2:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltz forcetype pltz ENDIF updatewidget event top noboxzoom letsdraw event top END 4:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltt forcetype pltt ENDIF updatewidget event top noboxzoom nodates letsdraw event top forcetype forcetype END endcase return end"); 351 a[349] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.html", "read_vermair.pro", "", " file_comments categories param NAME param DEBUT param FIN param NOMEXP keyword PARENT same as DIALOG_PARENT de dialog_message pro keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: read_vermair pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION read_vermair name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex compile_opt idl2 strictarrsubs common if name EQ un then name vozocrtx if name EQ vn then name vomecrty if debut EQ fin then begin res lec name debut nomexp BOXZOOM boxzoom _EXTRA ex ENDIF ELSE res lect name debut fin nomexp BOXZOOM boxzoom _EXTRA ex return tab:res grille:vargrid unite: experience:varexp nom:varname end"); 352 a[350] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.html", "scanfile.pro", "", " file_comments categories param NAMEFILE keyword GRID keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: scanfile pro 150 2006 08 09 10:12:54Z navarro todo seb : I don t know what to do with that liste des presupposes: 1 le fichier a lire est un fichier netcdf 2 le nom de ce fichier finit par U nc V nc W nc T nc ou F nc la lettre avant le nc designant la grille a laquelle se rapporte la champ Si tel n est pas la cas le fichier est attribue a la grille T 3 ce fichier contient une dimension infinie qui doit etre celle qui se rapporte au temps et au mois 2 autres dimensions dont les noms sont x lon xi_ et y lat ou eta_ ou bien en majuscule 4 il doit exiter ds ce fichier une unique variable n ayant qu une dimension et etant la dimension temporelle cette variable sera prise comme axe des temps Rq: si plusieurs variables verifient ces criteres on considere la premiere variable 5 Cette variable axe des temps doit contenir l attribut units qui doit etre ecrit suivant la syntaxe: seconds since 0001 01 01 00:00:00 hours since 0001 01 01 00:00:00 days since 1979 01 01 00:59:59 months since 1979 01 01 00:59:59 years since 1979 01 01 00:59:59 je crois que c est tout GRID UTVWF to specify the type of grid Defaut is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found FUNCTION scanfile namefile GRID GRID _extra ex compile_opt idl2 strictarrsubs common res 1 filename fullname isafile filename namefile IODIRECTORY iodir _extra ex open file cdfid ncdf_open fullname What contains the file infile ncdf_inquire cdfid find vargrid IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN pattern GRID GRID_ GRID UPID_ 30ID_ gdtype T U V W F fnametest strupcase fullname FOR i 0 n_elements pattern 1 DO BEGIN FOR j 0 n_elements gdtype 1 DO BEGIN substr pattern i gdtype j pos strpos fnametest substr IF pos NE 1 THEN vargrid strmid fnametest pos strlen substr 1 1 ENDFOR ENDFOR ENDIF ENDELSE name of all dimensions namedim strarr infile ndims for dimiq 0 infile ndims 1 do begin ncdf_diminq cdfid dimiq tmpname value namedim dimiq strlowcase tmpname ENDFOR we are looking for a x dimension dimidx where namedim EQ x OR strmid namedim 0 3 EQ lon OR strmid namedim 0 3 EQ xi_ OR namedim EQ xt_i7_156 dimidx dimidx 0 if dimidx EQ 1 then begin print one of the dimensions must have the name: x or lon or xi_ or xt_i7_156 stop endif we are looking for a y dimension dimidy where namedim EQ y OR strmid namedim 0 3 EQ lat OR strmid namedim 4 EQ eta_ OR namedim EQ yt_j6_75 dimidy dimidy 0 if dimidy EQ 1 then begin print one of the dimensions must have the name: y or lat or eta_ or yt_j6_75 stop endif name of all variables we keep only the variables containing at least x y and time dimension if existing namevar strarr infile nvars for varid 0 infile nvars 1 do begin invar ncdf_varinq cdfid varid what contains the variable if where invar dim EQ dimidx 0 NE 1 AND where invar dim EQ dimidy 0 NE 1 AND where invar dim EQ infile recdim 0 NE 1 OR infile recdim EQ 1 THEN namevar varid invar name ENDFOR namevar namevar where namevar NE listgrid replicate vargrid n_elements namevar time axis date0fk date2jul 19000101 IF infile recdim EQ 1 THEN BEGIN jpt 1 time date0fk fakecal 1 ENDIF ELSE BEGIN ncdf_diminq cdfid infile recdim timedimname jpt we look for the variable containing the time axis we look for the first variable having for only dimension infile recdim varid 0 repeat BEGIN invar ncdf_varinq cdfid varid varid varid 1 endrep until n_elements invar dim EQ 1 AND invar dim 0 EQ infile recdim varid varid 1 CASE 1 OF varid EQ 1:BEGIN dummy report the file fullname has no time axis C we create a fake calendar fakecal 1 time date0fk lindgen jpt END invar natts EQ 0:BEGIN dummy report the variable invar name has no attribut C we create a fake calendar fakecal 1 time date0fk lindgen jpt END ELSE:BEGIN we want to know which attributes are attached to the time variable attnames strarr invar natts for attiq 0 invar natts 1 do attnames attiq ncdf_attname cdfid varid attiq if where attnames EQ units 0 EQ 1 then BEGIN dummy report Attribut units not found for the variable varid name C we create a fake calendar fakecal 1 time date0fk lindgen jpt ENDIF ELSE BEGIN we read the time axis ncdf_varget cdfid varid time time double time ncdf_attget cdfid varid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 value strtrim strcompress string value 2 mots str_sep value unite mots 0 debut str_sep mots 2 now we try to find the attribut called calendar the the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid varid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE BEWARE we have to recuperate the calendar attribute and ajust TIME by consequence We pass TIME in IDL julian days unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 case unite of second :time julday debut 1 debut 2 debut 0 time 86400 d hour :time julday debut 1 debut 2 debut 0 time 24 d day :time julday debut 1 debut 2 debut 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday debut 1 debut 2 debut 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday debut 1 time t debut 2 debut 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday debut 1 debut 2 debut 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday debut 1 debut 2 debut 0 time t END ENDCASE high frequency calendar: more than one element per day IF max histogram long time time 0 GT 1 THEN fakecal 1 ELSE fakecal 0 date0fk date2jul 19000101 IF keyword_set fakecal THEN time date0fk lindgen jpt ELSE time long time ENDELSE END ENDCASE ENDELSE ncdf_close cdfid return filename:fullname time_counter:time listvar:namevar listgrid:strupcase listgrid caltype:key_caltype fakecal:date0fk fakecal end"); 353 a[351] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html", "selectfile.pro", "", " PRO selectfile_event event compile_opt idl2 strictarrsubs common widget_control event id get_uvalue eventuvalue default definition of messenger when selectfile_event is called directly without calling xmanager widget_control event handler get_uvalue messenger messenger 1 IF chkstru eventuvalue name EQ 0 THEN return case eventuvalue name of cancel button Global Cancel :BEGIN widget_control event handler get_uvalue messenger messenger 1 widget_control event handler destroy END data file informations datafilename :BEGIN widget_control event id get_value filename filename isafile filename filename 0 iodir iodir onlync title data file name if size filename type NE 7 then BEGIN widget_control event id set_value return ENDIF widget_control event id set_value filename END browse datafilename :BEGIN filename isafile iodir iodir onlync title data file name if size filename type NE 7 then return widget_control widget_info event handler find_by_uname datafilename set_value filename END switch automatic by and mesh definition buttons gridload :BEGIN IF event select EQ 1 THEN BEGIN widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control widget_info event handler find_by_uname kwd base sensitive 1 CASE event value OF via initnetcdf :BEGIN widget_control widget_info event handler find_by_uname meshload set_value initncdf editable 0 widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value initncdf keywords: END via perso :BEGIN widget_control widget_info event handler find_by_uname meshload set_value editable 1 widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value keywords of IDL procedure: END ENDCASE ENDIF END name of the procedure or batch file meshload :BEGIN widget_control event id get_value filename filename find filename 0 onlypro firstfound 0 if filename EQ NOT FOUND then begin widget_control event id set_value return endif CASE protype filename OF this is a procedure proc :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwd base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value file_basename filename pro keywords: END this is a function this case is not accepted func :BEGIN widget_control event id set_value return END this is an IDL batch file batch :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwd base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value no keywords: END ENDCASE widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control event id set_value file_basename filename pro END browse meshload :BEGIN filename isafile iodir homedir onlypro title to load the grid file if size filename type NE 7 then return meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id set_value filename selectfile_event ID:meshload_id TOP:event top HANDLER:event handler END Lets Go button Lets Go :BEGIN widget_control widget_info event handler find_by_uname datafilename get_value datafilename datafilename datafilename 0 IF datafilename EQ THEN return datafilename isafile filename datafilename iodir iodir onlync title data file name if size datafilename type NE 7 then BEGIN widget_control widget_info event handler find_by_uname datafilename set_value return ENDIF widget_control widget_info event handler find_by_uname gridload get_value gridload widget_control widget_info event handler find_by_uname argtxt get_value argtxt argtxt strtrim argtxt 0 2 IF strpos argtxt EQ 0 THEN argtxt strmid argtxt 1 widget_control widget_info event handler find_by_uname kwdtxt get_value kwdtxt kwdtxt strtrim kwdtxt 0 2 IF strpos kwdtxt EQ 0 THEN kwdtxt strmid kwdtxt 1 CASE gridload 0 OF via perso :BEGIN meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id get_value meshload meshload meshload 0 IF meshload EQ THEN return meshload find meshload 0 onlypro firstfound 0 if meshload EQ NOT FOUND then begin widget_control meshload_id set_value return endif END via initnetcdf :meshload datafilename ENDCASE IF strlen argtxt NE 0 THEN meshload meshload argtxt IF strlen kwdtxt NE 0 THEN meshload meshload kwdtxt widget_control event handler get_uvalue messenger messenger create_struct datafilename datafilename meshload meshload widget_control event handler destroy END endcase return end file_comments categories param DATAFILENAME param IDLFILE param ARGSPRO keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: selectfile pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter les params FUNCTION selectfile datafilename idlfile argspro _extra ex compile_opt idl2 strictarrsubs common We create a pointer in the uvalue to recuperate answers at setted questions atthe time of the use of this widget So when the widget is deleted in the procedure event pro the variable on which the pointer pointed contained in the uvalue of the widget is not deleted and we can recuperate the result messenger ptr_new allocate_heap base widget_base column title selectfile align_center uvalue messenger _EXTRA ex cancel button dummyid widget_button base value Cancel uvalue name: Global Cancel data file informations basea widget_base base row align_center dummyid widget_label basea value Data file name: database widget_text basea value uvalue name: datafilename uname datafilename xsize 45 EDITABLE dummyid widget_button basea value Browse uvalue name: browse datafilename switch automatic by and mesh definition buttons baseb widget_base base row align_center gdldid cw_bgroup baseb automatic grid construction with initncdf pro grid construction with other IDL batch or procedure exclusive set_value 0 uvalue name: gridload uname gridload button_uvalue via initnetcdf via perso name of the procedure or batch file basec widget_base base row align_center uname pro base dummyid widget_label basec value IDL batch file of procedure basemeshload widget_text basec value initncdf uvalue name: meshload uname meshload xsize 45 editable 0 dummyid widget_button basec value Browse uvalue name: browse meshload arguments informations based widget_base base row align_center uname arg base sensitive 0 dummyid widget_label based value procedure arguments agrbase widget_text based value uvalue name: argtxt uname argtxt xsize 45 EDITABLE keyword informations basee widget_base base row align_center uname kwd base dummyid widget_label basee uname kwdlab value keywords of initncdf: dummyid widget_text basee value uvalue name: kwdtxt uname kwdtxt xsize 45 EDITABLE Lets Go button basego widget_button base value Lets Go uvalue name: Lets Go IF n_elements datafilename NE 0 THEN BEGIN widget_control database set_value datafilename selectfile_event ID:database TOP:base HANDLER:base ENDIF IF n_elements idlfile NE 0 THEN BEGIN widget_control basemeshload set_value idlfile selectfile_event ID:basemeshload TOP:base HANDLER:base widget_control basemeshload get_value idlfile2 IF idlfile2 0 NE THEN widget_control gdldid set_value 1 ENDIF IF n_elements argspro NE 0 THEN widget_control argbase set_value argspro IF n_elements datafilename EQ 0 THEN BEGIN widget_control base realize xmanager selectfile base event_handler selectfile_event no_block 0 ENDIF ELSE selectfile_event ID:basego TOP:base HANDLER:base get back the information from selectfile_event res messenger ptr_free messenger if size res type NE 8 then return 1 loadgrid res meshload _extra ex ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta res3 scanfile res datafilename iodir iodir _extra ex if size res3 type NE 8 then return 1 return fileparameters:res3 readparameters:ccreadparameters meshparameters:ccmeshparameters end"); 354 a[352] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/singleclickaction.html", "singleclickaction.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: singleclickaction pro 150 2006 08 09 10:12:54Z navarro todo seb PRO singleclickaction event compile_opt idl2 strictarrsubs cm_4mesh cm_4data return widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext IF type NE plt THEN return We activate the right window widget_control event id get_value win wset win choice of the type of action case uval press of 1:BEGIN coor convert_coord uval x 0 uval y 0 device to_data x coor 0 y coor 1 help x y oldgrid vargrid CASE strupcase vargrid OF T :vargrid F W :vargrid F U :vargrid V V :vargrid U F :vargrid T ENDCASE grille 1 glam gphi 1 nx ny nz firstx firsty firstz lastx lasty lastz vargrid oldgrid define the corner of the cells in the clockwise direction IF keyword_set key_periodic AND nx EQ jpi THEN BEGIN x1 glam 0:ny 2 y1 gphi 0:ny 2 x2 glam 1:ny 1 y2 gphi 1:ny 1 x3 shift glam 1:ny 1 1 0 y3 shift gphi 1:ny 1 1 0 x4 shift glam 0:ny 2 1 0 y4 shift gphi 0:ny 2 1 0 ENDIF ELSE BEGIN x1 glam 0:nx 2 0:ny 2 y1 gphi 0:nx 2 0:ny 2 x2 glam 0:nx 2 1:ny 1 y2 gphi 0:nx 2 1:ny 1 x3 glam 1:nx 1 1:ny 1 y3 gphi 1:nx 1 1:ny 1 x4 glam 1:nx 1 0:ny 2 y4 gphi 1:nx 1 0:ny 2 ENDELSE glam 1 free memory gphi 1 free memory What is the longitude WHILE x GT x range 1 DO x x 360 WHILE x LT x range 0 DO x x 360 IF x GT x range 1 THEN RETURN IF y GT y range 1 THEN RETURN IF y LT y range 0 THEN RETURN cell inquad x y x1 y1 x2 y2 x3 y3 x4 y4 onsphere key_onearth x1 1 free memory y1 1 free memory x2 1 free memory y2 1 free memory x3 1 free memory y3 1 free memory x4 1 free memory y4 1 free memory IF cell 0 EQ 1 OR n_elements cell GT 1 THEN RETURN yy cell 0 nx 1 key_periodic nx EQ jpi xx cell 0 MOD nx 1 key_periodic nx EQ jpi CASE strupcase vargrid OF T :BEGIN xx xx firstx 1 yy yy firsty 1 END W :BEGIN xx xx firstx 1 yy yy firsty 1 END U :BEGIN xx xx firstx yy yy firsty 1 END V :BEGIN xx xx firstx 1 yy yy firsty END F :BEGIN xx xx firstx yy yy firsty END ENDCASE bad where xx GE jpi IF bad 0 NE 1 THEN BEGIN xx bad xx bad jpi yy bad yy bad 1 ENDIF bad where yy GE jpj IF bad 0 NE 1 THEN stop print glamt xx yy gphit xx yy cmd buildcmd event top boxzoom boxzoom END ELSE: endcase RETURN end"); 355 a[353] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/tracecadre.html", "tracecadre.pro", "", " file_comments categories param SMALL keyword OUT keyword ERASE keyword FILL returns uses restrictions examples history version Id: tracecadre pro 150 2006 08 09 10:12:54Z navarro todo seb PRO tracecadre small out out erase erase fill fill determination of the column and of the line corresponding in input to small compile_opt idl2 strictarrsubs numdessin small 2 1 numligne numdessin small 0 numcolonne numdessin numligne small 0 determination of poscadre largeurcolonne 1 small 0 largeurligne 1 small 1 cadre numcolonne largeurcolonne 1 numligne 1 largeurligne numcolonne 1 largeurcolonne 1 numligne largeurligne decale 0 001 cadre cadre decale decale decale decale reinitplt p position 0 0 1 1 IF keyword_set fill then begin polyfill cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 color 255 normal ENDIF ELSE BEGIN plot cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 xrange 0 1 yrange 0 1 linestyle 2 keyword_set out noerase normal thick 2 color 0 255 keyword_set erase ENDELSE return end"); 356 a[354] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/updatewidget.html", "updatewidget.pro", "", " file_comments categories param BASE in required The id of the widget where apply the drawing keyword NOBOXZOOM keyword NODATES keyword NOTYPE returns uses restrictions examples history version Id: updatewidget pro 150 2006 08 09 10:12:54Z navarro todo seb PRO updatewidget base NOBOXZOOM noboxzoom NODATES nodates NOTYPE notype compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 widget_control base update 0 date1 et date2 if keyword_set nodates then begin date1 0 date2 0 ENDIF ELSE BEGIN dates extractatt top_uvalue dates numdessinin date1 dates 0 date2 dates 1 ENDELSE domain boxzoom extractatt top_uvalue domaines numdessinin if total boxzoom EQ 0 then boxzoom 1 if keyword_set noboxzoom then boxzoom 0 varinfo: filename namevar varinfo extractatt top_uvalue varinfo numdessinin filename varinfo 0 nomvar varinfo 1 if filename NE OR nomvar NE THEN BEGIN changefile base filename fieldname nomvar BOXZOOM boxzoom DATE1 date1 DATE2 date2 ENDIF ELSE BEGIN if date1 NE 0 then begin date1id widget_info base find_by_uname calendar1 widget_control date1id set_value date1 endif if date2 NE 0 then begin date2id widget_info base find_by_uname calendar2 widget_control date2id set_value date2 endif if keyword_set boxzoom then BEGIN domainid widget_info base find_by_uname domain widget_control domainid set_value boxzoom endif ENDELSE exextra if n_elements extractatt top_uvalue exextra numdessinin NE 0 then begin exextra extractatt top_uvalue exextra numdessinin specifieid widget_info base find_by_uname specifie widget_control specifieid set_value exextra endif text command txtcmd extractatt top_uvalue txtcmd numdessinin if txtcmd NE then begin txtcmdid widget_info base find_by_uname txtcmd widget_control txtcmdid set_value txtcmd endif graphtype if NOT keyword_set notype then BEGIN graphtype extractatt top_uvalue types numdessinin if graphtype NE then begin actionid widget_info base find_by_uname action widget_control actionid get_value action_value widget_control actionid set_combobox_select where action_value EQ graphtype 0 endif endif widget_control base update 1 return end"); 357 a[355] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.html", "xcreateanim.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: xcreateanim pro 150 2006 08 09 10:12:54Z navarro todo seb pro xcreateanim_event event compile_opt idl2 strictarrsubs common We recuperate arguments contained in the widget if tag_names event structure_name NE WIDGET_BUTTON then return widget_control event id get_uvalue uval if n_elements uval EQ 0 then return if uval EQ cancel then begin widget_control event top destroy return ENDIF We will write the animation widget_control event top get_uvalue local_uvalue widget_control local_uvalue parent get_uvalue top_uvalue calendar extractatt top_uvalue fileparameters local_uvalue indexfile time_counter key_caltype extractatt top_uvalue fileparameters local_uvalue indexfile caltype fakecal extractatt top_uvalue fileparameters local_uvalue indexfile fakecal widget_control widget_info event top find_by_uname Filename get_value nomfic nomfic nomfic 0 widget_control widget_info event top find_by_uname directorie get_value animdir animdir animdir 0 widget_control widget_info event top find_by_uname debut get_value vdate1 index1 where calendar eq date2jul vdate1 index1 index1 0 if index1 EQ 1 then return widget_control widget_info event handler find_by_uname fin get_value vdate2 index2 where calendar eq date2jul vdate2 index2 index2 0 if index2 EQ 1 OR index2 LE index1 then return We delete the widget before create the file ps widget_control event top destroy creation of the routine which will serve us to do the drawing We recuperate the list of instructions globalcommand extractatt top_uvalue globalcommand We complete by first and last lines of the program createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript DATE1IN date1in DATE2IN date2in creation of the file we recuperate the number of octets on which we code the palette device get_visual_depth depth Picture s size in number of pixels : xsize d x_size ysize d y_size We check that the file s name end by gif if strpos nomfic gif EQ 1 then nomfic nomfic gif current_window d window window free pixmap xsize xsize ysize ysize indication of the number of the picture we are creating base widget_base sliderid widget_slider base minimum 1 maximum index2 index1 1 value 1 title image number: widget_control base realize Beginning of the gif file Writting of an empty picture IF keyword_set fakecal THEN date index1 ELSE date jul2date calendar index1 xxx2ps noerase date1in date date2in date image tvrd true depth GT 8 If an 8 bit image was read reduce the number of colors if depth le 8 then begin tvlct red green blue get reduce_colors image index red red index green green index blue blue index endif if depth gt 8 then Convert 24 bit image to 8 bit image color_quan image 1 red green blue colors 256 get_translation translation map_all write_gif animdir nomfic image red green blue multiple wdelete d window Creation and writting loop in the file IF index2 GT index1 THEN BEGIN FOR ind index1 1 index2 do BEGIN widget_control sliderid set_value ind index1 1 We move the slider window free pixmap xsize xsize ysize ysize IF keyword_set fakecal THEN date ind ELSE date jul2date calendar ind xxx2ps noerase date1 date date2 date image tvrd true depth GT 8 if depth gt 8 then image color_quan image 1 aaa bbb ccc colors 256 translation translation write_gif animdir nomfic image red green blue multiple wdelete d window ENDFOR ENDIF We put a last white picture window free pixmap xsize xsize ysize ysize reinitplt plot 0 0 nodata image tvrd true depth GT 8 if depth gt 8 then image color_quan image 1 aaa bbb ccc colors 256 translation translation write_gif animdir nomfic image red green blue multiple wdelete d window File s closing write_gif animdir nomfic close widget_control base destroy Rerock in normal mode thisOS strupcase strmid version os_family 0 3 wset current_window If we are under x we try to lauch xanim if thisOS NE MAC AND thisOS NE WIN then begin spawn which xanim result if strpos result 0 xanim EQ strlen result 0 5 then spawn xanim animdir nomfic endif return end file_comments categories param PARENT returns uses restrictions examples history version Id: xcreateanim pro 150 2006 08 09 10:12:54Z navarro todo seb PRO xcreateanim parent compile_opt idl2 strictarrsubs common widget_control parent get_uvalue top_uvalue We will make sure that all procedure are not in pltt procedures extractatt top_uvalue nameprocedures if total procedures EQ pltt NE 0 then begin nothing report Certains des plots ont un axe se rapportant au temps C Animation impossible error return ENDIF We will make sure that all figure have the same calendar filelist extractatt top_uvalue filelist filenames extractatt top_uvalue varinfo 0 filenames reform filenames filenames filenames uniq filenames sort filenames if strtrim filenames 0 1 EQ then filenames filenames 1:n_elements filenames 1 indexfile where filelist EQ filenames 0 0 calendar extractatt top_uvalue fileparameters indexfile time_counter key_caltype extractatt top_uvalue fileparameters indexfile caltype fakecal extractatt top_uvalue fileparameters indexfile fakecal if n_elements filenames GT 1 then begin for i 1 n_elements filenames 1 do begin indexfilebis where filelist EQ filenames i 0 calendarbis extractatt top_uvalue fileparameters indexfilebis time_counter if n_elements calendarbis NE n_elements calendar then begin nothing report Les diffrents plots n utilisent pas le meme calendrier C Animation impossible error return ENDIF if total calendar NE calendarbis NE 0 then begin nothing report Les diffrents plots n utilisent pas le meme calendrier C Animation impossible error return endif endfor endif It is possible to do an animation base widget_base column title animation creation uvalue parent:parent indexfile:indexfile rien widget_label base value animation name rien widget_text base value anim_idl gif uname Filename editable rien widget_label base value animation directory if n_elements animdir EQ 0 then cd current animdir rien widget_text base value animdir uname directorie editable rien widget_label base value starting date rien cw_calendar base calendar calendar 0 FAKECAL fakecal uname debut uvalue name: calendar frame rien widget_label base value ending date rien cw_calendar base calendar calendar n_elements calendar 1 FAKECAL fakecal uname fin uvalue name: calendar frame rien widget_button base value OK uvalue ok rien widget_button base value Cancel uvalue cancel widget_control base realize xmanager xcreateanim base no_block return end"); 358 a[356] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar_event.html", "xxxmenubar_event.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: xxxmenubar_event pro 150 2006 08 09 10:12:54Z navarro todo seb PRO xxxmenubar_event event compile_opt idl2 strictarrsubs common case event value of Open :begin oldmeshparams ccmeshparameters newfile selectfile if size newfile type NE 8 then return widget_control event top hourglass widget_control event top update 0 widget_control event top get_uvalue top_uvalue We take care of filelist filelist extractatt top_uvalue filelist filelist filelist newfile fileparameters filename currentfile n_elements filelist 1 We update the widget filelistid widget_info event top find_by_uname filelist widget_control filelistid combobox_additem file_basename newfile fileparameters filename widget_control filelistid set_combobox_select currentfile We update filelist and currentfile s elements of the top_value top_uvalue 1 findline top_uvalue filelist filelist oldfile top_uvalue 1 findline top_uvalue currentfile top_uvalue 1 findline top_uvalue currentfile currentfile We take care of the name of the variable vlstid widget_info event top find_by_uname varlist What is the selected field Do we reselect it fieldname widget_info vlstid combobox_gettext index where newfile fileparameters listvar EQ fieldname widget_control vlstid set_value newfile fileparameters listvar widget_control vlstid set_combobox_select 0 index 0 We take care of the calendar key_caltype newfile fileparameters caltype date1id widget_info event top find_by_uname calendar1 widget_control date1id get_value date1 widget_control date1id destroy jdate1 jul2date date1 if where newfile fileparameters time_counter EQ jdate1 0 EQ 1 then jdate1 newfile fileparameters time_counter 0 date2id widget_info event top find_by_uname calendar2 widget_control date2id get_value date2 widget_control date2id destroy jdate2 jul2date date2 if where newfile fileparameters time_counter EQ jdate2 0 EQ 1 then jdate2 jdate1 basecal widget_info event top find_by_uname basecal fakecal newfile fileparameters fakecal rien cw_calendar basecal newfile fileparameters time_counter jdate1 uname calendar1 FAKECAL fakecal uvalue name: calendar1 frame rien cw_calendar basecal newfile fileparameters time_counter jdate2 uname calendar2 FAKECAL fakecal uvalue name: calendar2 frame We update fileparameters readparameters et meshparameters elements of the top_value newfileparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newfileparameters i extractatt top_uvalue fileparameters i newfileparameters currentfile newfile fileparameters ptr_free extractatt top_uvalue fileparameters top_uvalue 1 findline top_uvalue fileparameters newfileparameters newreadparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newreadparameters i extractatt top_uvalue readparameters i newreadparameters currentfile newfile readparameters ptr_free extractatt top_uvalue readparameters top_uvalue 1 findline top_uvalue readparameters newreadparameters newmeshparameters ptrarr currentfile 1 allocate_heap FOR i 0 currentfile 1 DO newmeshparameters i extractatt top_uvalue meshparameters i newmeshparameters currentfile newfile meshparameters ptr_free extractatt top_uvalue meshparameters top_uvalue 1 findline top_uvalue meshparameters newmeshparameters We update the widget if cmpgrid oldmeshparams then BEGIN domainid widget_info event top find_by_uname domain widget_control domainid set_value 1 endif widget_control event top update 1 end New xxx :BEGIN widget_control event top get_uvalue top_uvalue extra extractatt top_uvalue extra xxx CALLERWIDID event top _extra extra end Quit :begin widget_control event top get_uvalue top_uvalue ptr_free extractatt top_uvalue exextra ptr_free extractatt top_uvalue fileparameters ptr_free extractatt top_uvalue readparameters ptr_free extractatt top_uvalue meshparameters ptr_free top_uvalue widget_control event top destroy We shut the widget end PostScript :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as postscript in demo mode return ENDIF widget_control event top get_uvalue top_uvalue We recuperate the list of instructions globalcommand extractatt top_uvalue globalcommand for i 0 n_elements globalcommand 1 do print globalcommand i We complete by first and last lines of the program createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape DATE1IN date1in DATE2IN date2in POSTSCRIPT END Animated gif :begin IF float strmid version release 0 3 GE 6 2 THEN xcreateanim event top end Gif :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as an image in demo mode return ENDIF widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 tracecadre smallin erase tracecadre smallout erase filename xquestion dans quelle fichier gif voulez vous sauver C l ecran de xxx xxx_image gif if rstrpos filename gif NE strlen filename 4 then filename filename gif filename isafile file filename io imagedir new saveimage filename quiet end IDL procedure :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save as a idl program file in demo mode return ENDIF We recuperate the name of the file filename xquestion dans quelle procedure IDL voulez vous sauver C la realisation de ce graph xxx_figure pro We complete it by a pro if rstrpos filename pro NE strlen filename 4 then filename filename pro filename isafile file filename io homedir new widget_control event top get_uvalue top_uvalue portrait or landscape options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait optionsflag where options EQ Portrait Landscape 0 0 We read commands to do a plot globalcommand extractatt top_uvalue globalcommand We complete by first and last lines of the program thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :sep : WIN :sep ELSE:sep ENDCASE poslastsep rstrpos filename sep proname strmid filename poslastsep 1 strlen filename poslastsep 1 4 globalcommand pro proname NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape DATE1IN date1in DATE2IN date2in _extra ex globalcommand return end We write it in a program putfile filename globalcommand END RESTORE kwd of xxx :BEGIN IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to save the widget in demo mode return ENDIF We recuperate the name of the file filename xquestion dans quel fichier bianire voulez vous sauver le widget xxx_widget dat We complete it by a dat if rstrpos filename dat NE strlen filename 4 then filename filename dat filename isafile file filename io homedir new widget_control event top get_uvalue uvalue widget_control extractatt uvalue graphid get_value win wshow win wset win image tvrd true save uvalue image filename filename END Print to prompt :BEGIN commande getfile myuniquetmpdir xxx_oneplot pro for i 0 n_elements commande 1 do print commande i end Portrait Landscape :begin widget_control event top get_uvalue top_uvalue options extractatt top_uvalue options index where options EQ Portrait Landscape index index 0 optionsflag extractatt top_uvalue optionsflag key_portrait 1 optionsflag index 0 top_uvalue 1 findline top_uvalue optionsflag index key_portrait Separated windows or windows stuck to the widget if widget_info event top find_by_uname graph EQ 0 then BEGIN We delete the window graphid extractatt top_uvalue graphid widget_control widget_info graphid parent destroy We recreate it basegraph widget_base title xxx window group_leader event top uvalue event top uname basegraph windsize givewindowsize graphid widget_draw basegraph uname graph uvalue name: graph press:0 click:0 x: 0 0 y: 0 0 button_events retain 2 xsize windsize 0 ysize windsize 1 widget_control basegraph realize xmanager xxx basegraph no_block We redraw what their were into it We recuperate the list of instructions globalcommand extractatt top_uvalue globalcommand We complete by first and last lines of the program createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape KWDUSED noerase PORTRAIT portrait We reattribute the graphic element of the top_value top_uvalue 1 findline top_uvalue graphid graphid ENDIF ELSE BEGIN extra extractatt top_uvalue extra xxx CALLERWIDID event top redraw _extra extra widget_control event top destroy We shut the widget ENDELSE end Overlay :begin widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Overlay We change the flag on Longitude x index flag 1 flags index numdessinin flag flag 0 We reattribute it top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag end Vecteur :BEGIN widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Vecteur We change the flag on Longitude x index flag 1 flags index numdessinin flag flag 0 We reattribute it top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag end Longitude x index :BEGIN widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Longitude x index We change the flag on Longitude x index flag 1 flags index numdessinin flag flag 0 We reattribute it top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag Now we will change sliders defining the boxzoom domainid widget_info event top find_by_uname domain boxzoom extractatt top_uvalue domaines numdessinin We want to find the type of grid which is used currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar if flag EQ 0 then BEGIN longitudes We do a domdef to find the lon1 lon2 corresponding to the boxzoom defined on the widget domdef boxzoom gridtype vargrid xindex yindex flags where options EQ Latitude y index numdessinin 0 widget_control domainid set_value lon1 lon2 boxzoom 2:3 ENDIF ELSE BEGIN xindex now we want to find firstx lastx corresponding to the boxzoom defined on the widget domdef boxzoom gridtype vargrid yindex flags where options EQ Latitude y index numdessinin 0 grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz widget_control domainid set_value firstx lastx boxzoom 2:3 ENDELSE We update the top_uvalue widget_control domainid get_value boxzoom top_uvalue 1 findline top_uvalue domaines numdessinin boxzoom end Latitude y index :begin widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag index where options EQ Latitude y index We change the flag on Latitude y index flag 1 flags index numdessinin flag flag 0 We reattribute it top_uvalue 1 findline top_uvalue optionsflag index numdessinin flag Now we will change sliders defining the boxzoom domainid widget_info event top find_by_uname domain boxzoom extractatt top_uvalue domaines numdessinin We want to find the type of grid which is used currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar if flag EQ 0 then BEGIN latitudes We do a domdef to find the lat1 lat2 corresponding to the boxzoom defined on the widget domdef boxzoom gridtype vargrid yindex xindex flags where options EQ Longitude x index numdessinin 0 widget_control domainid set_value boxzoom 0:1 lat1 lat2 ENDIF ELSE BEGIN yindex now we want to find firsty lasty corresponding to the boxzoom defined on the widget domdef boxzoom gridtype vargrid xindex flags where options EQ Longitude x index numdessinin 0 grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz widget_control domainid set_value boxzoom 0:1 firsty lasty ENDELSE We update the top_uvalue widget_control domainid get_value boxzoom top_uvalue 1 findline top_uvalue domaines numdessinin boxzoom END endcase return end"); 359 a[357] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.html", "cw_bgroup.pro", "", "pro CW_BGROUP_SETV id value compile_opt hidden idl2 strictarrsubs ON_ERROR 2 return to caller stash WIDGET_INFO id CHILD WIDGET_CONTROL stash GET_UVALUE state NO_COPY case state type of 0: message unable to set plain button group value 1: begin WIDGET_CONTROL SET_BUTTON 0 state ids state excl_pos state excl_pos value WIDGET_CONTROL SET_BUTTON state ids value end 2: begin n n_elements value 1 for i 0 n do begin state nonexcl_curpos i value i WIDGET_CONTROL state ids i SET_BUTTON value i endfor end endcase WIDGET_CONTROL stash SET_UVALUE state NO_COPY end function CW_BGROUP_GETV id value compile_opt hidden idl2 strictarrsubs ON_ERROR 2 return to caller stash WIDGET_INFO id CHILD WIDGET_CONTROL stash GET_UVALUE state NO_COPY case state type of 0: message unable to get plain button group value 1: ret state excl_pos 1: ret state ret_arr state excl_pos 2: ret state nonexcl_curpos 2: BEGIN index where state nonexcl_curpos NE 0 if index 0 EQ 1 then begin if size state ret_arr type EQ 7 then ret ELSE ret 1 ENDIF ELSE ret state ret_arr index END endcase WIDGET_CONTROL stash SET_UVALUE state NO_COPY return ret end function CW_BGROUP_EVENT ev compile_opt hidden idl2 strictarrsubs WIDGET_CONTROL ev handler GET_UVALUE stash WIDGET_CONTROL stash GET_UVALUE state NO_COPY WIDGET_CONTROL ev id get_uvalue uvalue ret 1 Assume we return a struct case state type of 0: 1: if ev select eq 1 then begin state excl_pos uvalue ENDIF else begin if state no_release ne 0 then ret 0 ENDELSE 2: begin Keep track of the current state state nonexcl_curpos uvalue ev select if state no_release ne 0 and ev select eq 0 then ret 0 end endcase if ret then begin Return a struct ret ID:state base TOP:ev top HANDLER:0L SELECT:ev select VALUE:state ret_arr uvalue efun state efun WIDGET_CONTROL stash SET_UVALUE state NO_COPY if efun ne then return CALL_FUNCTION efun ret else return ret endif else begin Trash the event WIDGET_CONTROL stash SET_UVALUE state NO_COPY return 0 endelse end file_comments CW_BGROUP is a compound widget that simplifies creating a base of buttons It handles the details of creating the proper base standard exclusive or non exclusive and filling in the desired buttons Events for the individual buttons are handled transparently and a CW_BGROUP event returned This event can return any one of the following: The Index of the button within the base The widget ID of the button The name of the button An arbitrary value taken from an array of User values categories Compound widgets param PARENT in required The ID of the parent widget param NAMES A string array containing one string per button giving the name of each button keyword BUTTON_UVALUE An array of user values to be associated with each button and returned in the event structure keyword COLUMN Buttons will be arranged in the number of columns specified by this keyword keyword EVENT_FUNCT The name of an optional user supplied event function for buttons This function is called with the return value structure whenever a button is pressed and follows the conventions for user written event functions keyword EXCLUSIVE Buttons will be placed in an exclusive base with only one button allowed to be selected at a time keyword FONT The name of the font to be used for the button titles If this keyword is not specified the default font is used keyword FRAME Specifies the width of the frame to be drawn around the base keyword IDS A named variable into which the button IDs will be stored as a longword vector keyword LABEL_LEFT Creates a text label to the left of the buttons keyword LABEL_TOP Creates a text label above the buttons keyword MAP If set the base will be mapped when the widget is realized the default keyword NONEXCLUSIVE Buttons will be placed in an non exclusive base The buttons will be independent keyword NO_RELEASE If set button release events will not be returned keyword RETURN_ID If set the VALUE field of returned events will be the widget ID of the button keyword RETURN_INDEX If set the VALUE field of returned events will be the zero based index of the button within the base THIS IS THE DEFAULT keyword RETURN_NAME If set the VALUE field of returned events will be the name of the button within the base keyword ROW Buttons will be arranged in the number of rows specified by this keyword keyword SCROLL If set the base will include scroll bars to allow viewing a large base through a smaller viewport keyword SET_VALUE The initial value of the buttons This is equivalent to the later statement: WIDGET_CONTROL widget set_value value keyword SPACE The space in pixels to be left around the edges of a row or column major base This keyword is ignored if EXCLUSIVE or NONEXCLUSIVE are specified keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword XOFFSET The X offset of the widget relative to its parent keyword XPAD The horizontal space in pixels between children of a row or column major base Ignored if EXCLUSIVE or NONEXCLUSIVE are specified keyword XSIZE The width of the base keyword X_SCROLL_SIZE The width of the viewport if SCROLL is specified keyword YOFFSET The Y offset of the widget relative to its parent keyword YPAD The vertical space in pixels between children of a row or column major base Ignored if EXCLUSIVE or NONEXCLUSIVE are specified keyword YSIZE The height of the base keyword Y_SCROLL_SIZE The height of the viewport if SCROLL is specified returns The ID of the created widget is returned restrictions This widget generates event structures with the following definition: event ID:0L TOP:0L HANDLER:0L SELECT:0 VALUE:0 The SELECT field is passed through from the button event VALUE is either the INDEX ID NAME or BUTTON_UVALUE of the button depending on how the widget was created restrictions Only buttons with textual names are handled by this widget Bitmaps are not understood history 15 June 1992 AB 7 April 1993 AB Removed state caching 6 Oct 1994 KDB Font keyword is not applied to the label 10 FEB 1995 DJC fixed bad bug in event procedure getting id of stash widget 11 April 1995 AB Removed Motif special cases Copyright c 1992 2005 Research Systems Inc All rights reserved Unauthorized reproduction prohibited version Id: cw_bgroup pro 150 2006 08 09 10:12:54Z navarro function CW_BGROUP parent names BUTTON_UVALUE button_uvalue COLUMN column EVENT_FUNCT efun EXCLUSIVE excl FONT font FRAME frame IDS ids LABEL_TOP label_top LABEL_LEFT label_left MAP map NONEXCLUSIVE nonexcl NO_RELEASE no_release RETURN_ID return_id RETURN_INDEX return_index RETURN_NAME return_name ROW row SCROLL scroll SET_VALUE sval SPACE space TAB_MODE tab_mode UVALUE uvalue XOFFSET xoffset XPAD xpad XSIZE xsize X_SCROLL_SIZE x_scroll_size YOFFSET yoffset YPAD ypad YSIZE ysize Y_SCROLL_SIZE y_scroll_size UNAME uname IF N_PARAMS ne 2 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller Set default values for the keywords version WIDGET_INFO version if version toolkit eq OLIT then def_space_pad 4 else def_space_pad 3 IF N_ELEMENTS column eq 0 then column 0 IF N_ELEMENTS excl eq 0 then excl 0 IF N_ELEMENTS frame eq 0 then frame 0 IF N_ELEMENTS map eq 0 then map 1 IF N_ELEMENTS nonexcl eq 0 then nonexcl 0 IF N_ELEMENTS no_release eq 0 then no_release 0 IF N_ELEMENTS row eq 0 then row 0 IF N_ELEMENTS scroll eq 0 then scroll 0 IF N_ELEMENTS space eq 0 then space def_space_pad IF N_ELEMENTS uname eq 0 then uname CW_BGROUP_UNAME IF N_ELEMENTS uvalue eq 0 then uvalue 0 IF N_ELEMENTS xoffset eq 0 then xoffset 0 IF N_ELEMENTS xpad eq 0 then xpad def_space_pad IF N_ELEMENTS xsize eq 0 then xsize 0 IF N_ELEMENTS x_scroll_size eq 0 then x_scroll_size 0 IF N_ELEMENTS yoffset eq 0 then yoffset 0 IF N_ELEMENTS ypad eq 0 then ypad def_space_pad IF N_ELEMENTS ysize eq 0 then ysize 0 IF N_ELEMENTS y_scroll_size eq 0 then y_scroll_size 0 top_base 0L if n_elements label_top ne 0 then begin next_base WIDGET_BASE parent XOFFSET xoffset YOFFSET yoffset COLUMN if keyword_set font then junk WIDGET_LABEL next_base value label_top font font else junk WIDGET_LABEL next_base value label_top top_base next_base endif else next_base parent if n_elements label_left ne 0 then begin next_base WIDGET_BASE next_base XOFFSET xoffset YOFFSET yoffset ROW if keyword_set font then junk WIDGET_LABEL next_base value label_left font font else junk WIDGET_LABEL next_base value label_left if top_base eq 0L then top_base next_base endif We need some kind of outer base to hold the users UVALUE if top_base eq 0L then begin top_base WIDGET_BASE parent XOFFSET xoffset YOFFSET yoffset next_base top_base endif If top_base EQ next_base THEN next_base WIDGET_BASE top_base Xpad 1 Ypad 1 Space 1 Set top level base attributes WIDGET_CONTROL top_base MAP map FUNC_GET_VALUE CW_BGROUP_GETV PRO_SET_VALUE CW_BGROUP_SETV SET_UVALUE uvalue SET_UNAME uname Tabbing if n_elements tab_mode ne 0 then begin WIDGET_CONTROL top_base TAB_MODE tab_mode WIDGET_CONTROL next_base TAB_MODE tab_mode end The actual button holding base base WIDGET_BASE next_base COLUMN column EXCLUSIVE excl FRAME frame NONEXCLUSIVE nonexcl ROW row SCROLL scroll SPACE space XPAD xpad XSIZE xsize X_SCROLL_SIZE x_scroll_size YPAD ypad YSIZE ysize Y_SCROLL_SIZE y_scroll_size EVENT_FUNC CW_BGROUP_EVENT UVALUE WIDGET_INFO top_base child n n_elements names ids lonarr n for i 0 n 1 do begin if n_elements font eq 0 then begin ids i WIDGET_BUTTON base value names i UVALUE i UNAME uname _BUTTON STRTRIM i 2 endif else begin ids i WIDGET_BUTTON base value names i FONT font UVALUE i UNAME uname _BUTTON STRTRIM i 2 endelse endfor Keep the state info in the real inner base UVALUE Pick an event value type: 0 Return ID 1 Return INDEX 2 Return NAME ret_type 1 if KEYWORD_SET RETURN_ID then ret_type 0 if KEYWORD_SET RETURN_NAME then ret_type 2 if KEYWORD_SET BUTTON_UVALUE then ret_type 3 case ret_type of 0: ret_arr ids 1: ret_arr indgen n 2: ret_arr names 3: ret_arr button_uvalue endcase type 0 if excl ne 0 then type 1 if nonexcl ne 0 then type 2 if n_elements efun le 0 then efun state type:type 0 Standard 1 Exclusive 2 Non exclusive base: top_base cw_bgroup base ret_arr:ret_arr Vector of event values efun : efun Name of event fcn nonexcl_curpos:intarr n If non exclus tracks state excl_pos:0 If exclusive current button ids:ids Ids of buttons no_release:no_release WIDGET_CONTROL WIDGET_INFO top_base CHILD SET_UVALUE state NO_COPY if n_elements sval ne 0 then CW_BGROUP_SETV top_base sval return top_base END"); 360 a[358] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.html", "cw_calendar.pro", "", " IDL testwid julday 1 1 1980 lindgen 100 5 PRO testwid_event event ComboboxId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy set :BEGIN widget_control event id get_value value widget_control ComboboxId set_value value END get :BEGIN widget_control ComboboxId get_value value help value struct END ELSE: endcase return end PRO testwid calendar date0 _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_calendar base calendar date0 _extra ex uname c est lui uvalue c est lui print cw_calendar ID nothing nothing widget_label base value end of the test nothing widget_text base value string calendar 0 uvalue set editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return END PRO cw_calendar_set_value id value compile_opt strictarr strictarrsubs cm_4cal get back the calendar and its related informations winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid key_caltype infowid caltype high freqeuncy calendar IF keyword_set infowid fakecal THEN BEGIN value2 date2jul long value infowid fakecal IF value2 LT n_elements infowid calendar AND value2 GE 0 THEN BEGIN stepid widget_info id find_by_uname step widget_control stepid set_value combobox_select:value2 infowid date jul2date value2 infowid fakecal widget_control winfo_id set_uvalue infowid ENDIF ENDIF ELSE BEGIN value long value 0 make sure the value correspond value jul2date date2jul value define year month day year value 10000l month value MOD 10000L 100L day value MOD 100L check that the date exists in the calendar if where infowid calendar EQ julday month day year 0 EQ 1 then return update the value of infocal infowid date value widget_control winfo_id set_uvalue infowid update the combobox if needed possiblecase day month year for name 2 0 1 do BEGIN call set_cal_combobox with out 2 to specify that the call is coming from cw_calendar_set_value if widget_info id find_by_uname possiblecase name NE 0 then set_cal_combobox handler:id out:2 possiblecase name value ENDFOR ENDELSE return end FUNCTION cw_calendar_get_value id compile_opt strictarr strictarrsubs winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid return infowid date END FUNCTION get_cal_value id winfoid compile_opt strictarr strictarrsubs winfo_id widget_info id find_by_uname infocal widget_control winfo_id get_uvalue infowid oldate infowid date day wid_id widget_info id find_by_uname day if wid_id NE 0 then BEGIN widget_control wid_id get_value wid_value date long wid_value combobox_gettext ENDIF ELSE date oldate MOD 100L month wid_id widget_info id find_by_uname month if wid_id NE 0 then BEGIN widget_control wid_id get_value wid_value allmonths string format C CMoA 31 indgen 12 month where allmonths EQ wid_value combobox_gettext 0 1 date date 100L long month ENDIF ELSE date date oldate MOD 10000L 100L 100L year wid_id widget_info id find_by_uname year widget_control wid_id get_value wid_value date date 10000L long wid_value combobox_gettext IF arg_present winfoid NE 0 THEN BEGIN winfoid winfo_id infowid date date return infowid ENDIF ELSE return date end redefine the value and index position of the combobox PRO set_cal_combobox event casename date0 compile_opt strictarr strictarrsubs casename: Which widget shall we move: day month or year wid_id widget_info event handler find_by_uname casename we get back the calendar winfo_id widget_info event handler find_by_uname infocal widget_control winfo_id get_uvalue infowid caldat infowid calendar monthcal daycal yearcal and the current date IF n_elements date0 EQ 0 then date0 get_cal_value event handler year0 date0 10000L month0 date0 MOD 10000L 100L day0 date0 MOD 100L index of days months years according to date0 case casename of day :BEGIN list of days corresponding to month0 and year0 index where monthcal EQ month0 AND yearcal EQ year0 current daycal index END month :BEGIN list of months corresponding to year0 index where yearcal EQ year0 current monthcal index keep only the uniq values indexbis uniq current index index indexbis current current indexbis END year :BEGIN keep only the uniq years index uniq yearcal current yearcal index END ENDCASE we update the uvalue of the widget widget_control wid_id set_uvalue name:casename for event out 0 we store the previous position of the combobox to use it as the default position IF event out EQ 0 THEN widget_control wid_id get_value oldselect we redefine the new list if casename EQ month then begin widget_control wid_id set_value string format C CMoA 31 current 1 ENDIF ELSE BEGIN widget_control wid_id set_value strtrim current 1 ENDELSE specify the index position within the new list of values widget_control wid_id get_value combobox CASE event out OF 1: we put to the biggest position 1:selected combobox combobox_number 1 0: same as the previous position is the best choice 0:selected oldselect combobox_index combobox combobox_number 1 1: we put to the smallest position 1:selected 0 2: a new date has been specified 2:BEGIN case casename of day :selected where current EQ day0 0 month :selected where current EQ month0 0 year :selected where current EQ year0 0 ENDCASE END ENDCASE widget_control wid_id set_value combobox_select:selected update the date infowid date get_cal_value event handler widget_control winfo_id set_uvalue infowid return end move cyclicly the calendar to the value 0 if event out 1 or combobox_number 1 if event out 1 PRO move event casename compile_opt strictarr strictarrsubs possiblecase day month year impossiblecase id widget_info event handler find_by_uname casename widget_control id get_value wvalue we try to move but we are already at the beginning end of the combobox wvalue combobox_index EQ wvalue combobox_number 1 and event out EQ 1 wvalue combobox_index EQ 0 and event out EQ 1 move is not called when out eq 0 whichcase where possiblecase EQ casename 0 if wvalue combobox_index EQ wvalue combobox_number 1 event out EQ 1 THEN BEGIN if widget_info event handler find_by_uname possiblecase whichcase 1 EQ 0 then begin it is impossible to move the next combobox widget_control id get_value widvalue we set to widvalue combobox_number 1 when event out EQ 1 and to 0 when event out EQ 1 selected widvalue combobox_number 1 event out EQ 1 widget_control id set_value combobox_select:selected we call move for the next combobox ENDIF ELSE move event possiblecase whichcase 1 it is possible to move from 1 ENDIF ELSE widget_control id set_value combobox_select:wvalue combobox_index event out set_cal_combobox event possiblecase whichcase 1 return end FUNCTION cw_calendar_event event cm_4cal compile_opt strictarr strictarrsubs winfo_id widget_info event handler find_by_uname infocal widget_control winfo_id get_uvalue infowid key_caltype infowid caltype widget_control event id get_uvalue uval high frequency calendar IF uval name EQ step THEN BEGIN infowid date jul2date event index infowid fakecal ENDIF ELSE BEGIN possiblecase day month year impossiblecase whichcase where possiblecase EQ uval name 0 if event out NE 0 then BEGIN we use the button and we want to go out of the combobox: to index 1 event out 1 or to index combobox_number event out 1 we try to move the combobox just right with name: possiblecase whichcase 1 if widget_info event handler find_by_uname possiblecase whichcase 1 EQ 0 then BEGIN this widget do not exist we set cyclicly the current widget to the value 0 if event out 1 or combobox_number 1 if event out 1 widget_control event id get_value widvalue selected widvalue combobox_number 1 event out EQ 1 widget_control event id set_value combobox_select:selected ENDIF ELSE move event possiblecase whichcase 1 ENDIF if we changed month year we need to update the day and month list if uval name NE day then begin event out 0 for name whichcase 1 0 1 do BEGIN if widget_info event handler find_by_uname possiblecase name NE 0 then set_cal_combobox event possiblecase name endfor ENDIF we update the date infowid get_cal_value event handler winfo_id ENDELSE widget_control winfo_id set_uvalue infowid return CW_CALENDAR ID:event handler TOP:event top HANDLER:0L VALUE:infowid date FAKECAL: infowid fakecal end file_comments categories param PARENT in required The widget ID of the parent widget param CALENDAR param JDATE0 keyword CALTYPE keyword FAKECAL keyword UVALUE keyword UNAME keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: cw_calendar pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION cw_calendar parent calendar jdate0 CALTYPE CALTYPE FAKECAL fakecal UVALUE uvalue UNAME uname _extra ex cm_4cal compile_opt strictarr strictarrsubs if keyword_set caltype then key_caltype caltype months days years found in the calendar caldat calendar monthcal daycal yearcal hourcal mincal scdcal starting date if n_elements jdate0 EQ 0 then jdate0 calendar 0 if where calendar EQ jdate0 0 EQ 1 then jdate0 calendar 0 caldat jdate0 month0 day0 year0 test the type of calendar if n_elements calendar GT 1 then BEGIN each day have the same value if n_elements uniq daycal sort daycal EQ 1 then monthly 1 each month and each day have the same value if keyword_set monthly AND n_elements uniq monthcal sort monthcal EQ 1 then yearly 1 endif if NOT keyword_set uvalue then uvalue dummy: if NOT keyword_set uname then uname base0 widget_base parent ROW EVENT_FUNC cw_calendar_event FUNC_GET_VALUE cw_calendar_get_value PRO_SET_VALUE cw_calendar_set_value UVALUE uvalue UNAME uname space 0 _extra ex if n_elements fakecal eq 0 then fakecal 0 base widget_base base0 space 0 uname infocal uvalue calendar:calendar date:jul2date jdate0 fakecal:fakecal caltype: key_caltype IF keyword_set fakecal THEN BEGIN cmbbid cw_combobox_pm base UVALUE name: step UNAME step value strtrim indgen n_elements calendar 1 widget_control cmbbid set_value combobox_select: where calendar EQ jdate0 0 ENDIF ELSE BEGIN vallen widget_info base string_size m day if NOT keyword_set monthly then begin dayindex where monthcal EQ month0 AND yearcal EQ year0 currentday daycal dayindex currentday strtrim currentday 1 cmbbid cw_combobox_pm base UVALUE name: day UNAME day value currentday widget_control cmbbid set_value combobox_select: where long currentday EQ day0 0 endif month if NOT keyword_set yearly then BEGIN monthindex where yearcal EQ year0 currentmonth long monthcal monthindex we suppress the repeted months monthindexbis uniq currentmonth sort currentmonth monthindex monthindex monthindexbis currentmonth currentmonth monthindexbis xoff 34 2 vallen 0 1 keyword_set monthly cmbbid cw_combobox_pm base UVALUE name: month UNAME month value string format C CMoA 31 currentmonth 1 xoffset xoff widget_control cmbbid set_value combobox_select: where long currentmonth EQ month0 0 endif year yearindex uniq yearcal sort yearcal currentyear strtrim yearcal yearindex 1 xoff 34 2 vallen 0 1 keyword_set monthly 33 3 vallen 0 1 keyword_set yearly cmbbid cw_combobox_pm base UVALUE name: year UNAME year value currentyear xoffset xoff widget_control cmbbid set_value combobox_select: where long currentyear EQ year0 0 ENDELSE return base end"); 361 a[359] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.html", "cw_combobox_pm.pro", "", " testwid value strtrim indgen 10 2 PRO testwid_event event help event STRUCT ComboboxId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy dynamic_resize :BEGIN widget_control event id get_value value widget_control ComboboxId set_value dynamic_resize:value END combobox_select :BEGIN widget_control event id get_value value widget_control ComboboxId set_value combobox_select:value END value :BEGIN widget_control event id get_value value widget_control ComboboxId set_value value END get :BEGIN widget_control ComboboxId get_value value help value struct END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_combobox_pm base _extra ex uname c est lui uvalue c est lui print cw_combobox_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue dynamic_resize editable nothing widget_text base value 10 uvalue combobox_select editable nothing widget_text base value 5 uvalue value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end PRO cw_combobox_pm_set_value id value compile_opt idl2 strictarrsubs ComboboxId widget_info id find_by_uname Combobox if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of dynamic_resize :widget_control ComboboxId dynamic_resize value dynamic_resize for compatibility droplist_select :widget_control ComboboxId set_combobox_select value droplist_select combobox_select :widget_control ComboboxId set_combobox_select value combobox_select value :widget_control ComboboxId set_value value value ELSE:ras report wrong tag name in argument value of cw_combobox_pm_set_value endcase endfor ENDIF ELSE widget_control ComboboxId set_value value return end FUNCTION cw_combobox_pm_get_value id compile_opt idl2 strictarrsubs ComboboxId widget_info id find_by_uname Combobox widget_control ComboboxId get_value cmbbval cmbbtxt widget_info ComboboxId combobox_gettext cmbbnumb widget_info ComboboxId combobox_number index where cmbbval EQ cmbbtxt 0 return combobox_number:cmbbnumb combobox_gettext:cmbbtxt combobox_index:index combobox_value:cmbbval dynamic_resize:widget_info ComboboxId dynamic_resize end FUNCTION cw_combobox_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval if uval EQ Combobox then return CW_COMBOBOX_PM ID:event handler TOP:event top HANDLER:0L INDEX:event index STR:event str OUT:0 ComboboxId widget_info event handler find_by_uname Combobox widget_control ComboboxId get_value cmbbval cmbbtxt widget_info ComboboxId combobox_gettext cmbbnumb widget_info ComboboxId combobox_number index where cmbbval EQ cmbbtxt 0 out 0 case uval OF plus :BEGIN if index LT cmbbnumb 1 then BEGIN index index 1 widget_control ComboboxId set_combobox_select index ENDIF ELSE out 1 END minus :BEGIN if index GT 0 then BEGIN index index 1 widget_control ComboboxId set_combobox_select index ENDIF ELSE out 1 END endcase return CW_COMBOBOX_PM ID:event handler TOP:event top HANDLER:0L INDEX:index STR:cmbbtxt OUT:out end file_comments Like WIDGET_COMBOBOX but here their are 2 buttons and to move the widget from 1 categories compound widget param PARENT in required The widget ID of the parent widget keyword COLUMN Buttons will be arranged in the number of columns specified by this keyword keyword ROW Buttons will be arranged in the number of rows specified by this keyword keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword VALUE keyword _EXTRA Used to pass your keywords returns The returned value of this function is the widget ID of the newly created animation widget restrictions Widget Events Returned by Combobox Widgets Pressing the mouse button while the mouse cursor is over an element of a combobox widget causes the widget to change the label on the combobox button and to generate an event The appearance of any previously selected element is restored to normal at the same time The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_COMBOBOX_PM ID:0L TOP:0L HANDLER:0L INDEX:0L OUT:0 The first three fields are the standard fields found in every widget event INDEX returns the index of the selected item This can be used to index the array of names originally used to set the widget s value OUT:It is an integer which can take 3 values: 1 : If we press when the index is already at the max Comment: In this case the index stay at the max 1: If we press when the index is already at the min Comment: In this case the index stay at the min 0 : In other cases Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat Send back in the result variable a structure of 3 elements whose names are inspired by keywords we can pass at widget_control when we use WIDGET_COMBOBOX: COMBOBOX_NUMBER: the number of elements currently contained in the specified combobox widget COMBOBOX_SELECT: the zero based number of the currently selected element i e the currently displayed element in the specified combobox widget DYNAMIC_RESIZE: a True value 1 if the widget specified by Widget_ID is a button combobox or label widget that has had its DYNAMIC_RESIZE attribute set Otherwise False 0 is returned 2 SET_VALUE widget_control wid_id set_value impose Allows to modify the state of the combobox like we can do it for WIDGET_COMBOBOX May impose: a The contents of the list widget string or string array b A structure which can have for elements from 1 to 3 : DYNAMIC_RESIZE:Set this keyword to activate if set to 1 or deactivate if set to 0 dynamic resizing of the specified CW_COMBOBOX_PM widget see the documentation for the DYNAMIC_RESIZE keyword to WIDGET_COMBOBOX procedure for more information about dynamic widget resizing COMBOBOX_SELECT:Set this keyword to return the zero based number of the currently selected element i e the currently displayed element in the specified combobox widget VALUE: The contents of the list widget string or string array examples See the program provided above testwid and the associated procedure testwid_event history Sebastien Masson smasson lodyc jussieu fr 6 9 1999 version Id: cw_combobox_pm pro 150 2006 08 09 10:12:54Z navarro FUNCTION cw_combobox_pm parent VALUE value UVALUE uvalue UNAME uname ROW row COLUMN column _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller cheking for row and column keywords row keyword_set row 1 keyword_set column column keyword_set column 1 keyword_set row keyword_set column EQ row if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 0 EVENT_FUNC cw_combobox_pm_event FUNC_GET_VALUE cw_combobox_pm_get_value PRO_SET_VALUE cw_combobox_pm_set_value UVALUE uvalue UNAME uname _extra ex vallen widget_info base string_size m vallen 35 vallen 0 1 max strlen value if keyword_set row THEN BEGIN nothing widget_button base value uvalue minus xoffset 0 yoffset 5 xsize 15 ysize 15 nothing widget_combobox base VALUE value UVALUE Combobox UNAME Combobox xoffset 13 yoffset 0 xsize vallen nothing widget_button base value uvalue plus xoffset vallen 11 yoffset 5 xsize 15 ysize 15 ENDIF ELSE BEGIN nothing widget_combobox base VALUE value UVALUE Combobox UNAME Combobox xoffset 0 yoffset 0 xsize vallen nothing widget_button base value uvalue minus xoffset vallen 2 15 yoffset 24 xsize 15 ysize 15 nothing widget_button base value uvalue plus xoffset vallen 2 yoffset 24 xsize 15 ysize 15 ENDELSE widget_control base realize return base end"); 362 a[360] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.html", "cw_domain.pro", "", " IDL testwid PRO testwid_event event help event struct Id widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy set :BEGIN widget_control event id get_value value value value 0 nothing execute boxzoom value widget_control Id set_value boxzoom END get :BEGIN widget_control Id get_value value print value END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_domain base _extra ex uname c est lui uvalue c est lui print cw_domain ID nothing nothing widget_label base value end of the test nothing widget_text base value 40 100 10 10 uvalue set editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end pro cw_domain_set_value id value compile_opt idl2 strictarrsubs cm_4mesh topid findtopid id widget_control topid get_uvalue top_uvalue make sure that we have the good grid stored in the cm_4mesh common parameters currentfile extractatt top_uvalue currentfile currentgrid extractatt top_uvalue meshparameters currentfile change changegrid currentgrid What is the type of boxzoom currentplot extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags currentplot IF flags where options EQ Longitude x index 0 EQ 0 THEN xtype geographic ELSE xtype index IF flags where options EQ Latitude y index 0 EQ 0 THEN ytype geographic ELSE ytype index How to complete the boxzoom IF xtype EQ geographic then begin lonn1 lon1 lonn2 lon2 xtitle lon ENDIF ELSE BEGIN lonn1 firstxt lonn2 lastxt xtitle x ind ENDELSE IF ytype EQ geographic then begin latt1 lat1 latt2 lat2 ytitle lat ENDIF ELSE BEGIN latt1 firstyt latt2 lastyt ytitle y ind ENDELSE vertf1 floor min gdepw 0 gdept 0 vertf2 ceil max gdepw 0 gdept 0 Case N_Elements Value OF 0:boxzoom lonn1 lonn2 latt1 latt2 vertf1 vertf2 1:BEGIN if value EQ 1 then boxzoom lonn1 lonn2 latt1 latt2 vertf1 vertf2 ELSE boxzoom lonn1 lonn2 latt1 latt2 0 value 0 END 2:boxzoom lonn1 lonn2 latt1 latt2 value 0 value 1 4:boxzoom Value 5:boxzoom Value 0:3 0 Value 4 6:boxzoom Value Else:BEGIN rien report Wrong Definition of Boxzoom END ENDCASE boxzoom 0 floor boxzoom 0 boxzoom 1 ceil boxzoom 1 boxzoom 2 floor boxzoom 2 boxzoom 3 ceil boxzoom 3 if n_elements boxzoom GE 5 then begin boxzoom 4 floor boxzoom 4 boxzoom 5 ceil boxzoom 5 endif widget_control widget_info id find_by_uname lon1 get_uvalue uvalue strict uvalue strict Longitudes Possible min and max if xtype EQ geographic then BEGIN min floor min glamt glamf max max max ceil max ENDIF ELSE BEGIN min 0 max jpi 1 ENDELSE widgets s id lon1id widget_info id find_by_uname lon1 lon2id widget_info id find_by_uname lon2 Do we have to change the type of x axis: longitude index lonbase widget_info id find_by_uname lonbase widget_control lonbase get_uvalue lonbase_uvalue if lonbase_uvalue name NE xtype then BEGIN widget_control lonbase update 0 We break everything widget_control lon1id destroy widget_control lon2id destroy We reconstruct lon1id cw_slider_pm lonbase value min boxzoom 0 boxzoom 0 keyword_set strict boxzoom 1 boxzoom 0 keyword_set strict widget_control lonbase set_uvalue name:xtype widget_control lonbase update 1 ENDIF ELSE BEGIN The new value they will have cursorvalue1 min boxzoom 0 boxzoom 0 strict boxzoom 1 boxzoom 2 boxzoom 2 keyword_set strict boxzoom 3 boxzoom 2 keyword_set strict widget_control latbase set_uvalue name:ytype widget_control latbase update 1 ENDIF ELSE BEGIN cursorvalue1 min boxzoom 2 boxzoom 2 strict boxzoom 3 indice2 1 if indice1 EQ indice2 then BEGIN if where gdep1 GE boxzoom 4 AND gdep2 LE boxzoom 5 0 EQ 1 then begin indice1 0 indice1 dthlv1_uval grid_t EQ 1 indice2 indice1 endif boxzoom 4 gdep1 indice1 boxzoom 5 boxzoom 4 1 endif Now values and indexes are proprely defined So we can apply them widget_control dthlv1id set_value combobox_select:indice1 widget_control dthlv2id set_value combobox_select:indice2 control mins and maxs of sliders if indice1 EQ 0 then min1 0 ELSE min1 gdep2 indice1 1 max1 min1 1 gdep1 indice2 widget_control depth1id set_value slider_min:min1 slider_max:max1 value:boxzoom 4 min2 gdep2 indice1 if indice2 EQ jpk 1 then BEGIN max2 max gdept gdepw max2 strtrim string max2 format e8 0 1 max2 float 1 strmid max2 1 float max2 ENDIF ELSE max2 gdep1 indice2 1 widget_control depth2id set_value slider_min:min2 slider_max:max2 value:boxzoom 5 return end FUNCTION cw_domain_get_value id compile_opt idl2 strictarrsubs box lonarr 6 possiblecase lon1 lon2 lat1 lat2 depth1 depth2 for i 0 5 do begin widget_control widget_info id find_by_uname possiblecase i get_value value box i value value endfor return box end FUNCTION cw_domain_event event compile_opt idl2 strictarrsubs common help struct event if where tag_names event EQ OUT 0 NE 1 then if event out NE 0 then return 1 widget_control event id get_uvalue uval case uval name of lon1 :widget_control widget_info event handler find_by_uname lon2 set_value slider_min:event value uval strict lon2 :widget_control widget_info event handler find_by_uname lon1 set_value slider_max:event value uval strict lat1 :widget_control widget_info event handler find_by_uname lat2 set_value slider_min:event value uval strict lat2 :widget_control widget_info event handler find_by_uname lat1 set_value slider_max:event value uval strict unzoom :BEGIN id widget_info event handler find_by_uname lon1 widget_control id get_value value widget_control id set_value slider_min:value slider_min_max 0 widget_control id set_value value slider_min_max 0 id widget_info event handler find_by_uname lat1 widget_control id get_value value widget_control id set_value slider_min:value slider_min_max 0 widget_control id set_value value slider_min_max 0 id widget_info event handler find_by_uname lon2 widget_control id get_value value widget_control id set_value slider_max:value slider_min_max 1 widget_control id set_value value slider_min_max 1 id widget_info event handler find_by_uname lat2 widget_control id get_value value widget_control id set_value slider_max:value slider_min_max 1 widget_control id set_value value slider_min_max 1 END dthlv1 :BEGIN ids depth1id widget_info event handler find_by_uname depth1 depth2id widget_info event handler find_by_uname depth2 dthlv2id widget_info event handler find_by_uname dthlv2 Do we have to change dthlv2 widget_control event id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value widget_control dthlv2id get_value dthlv2_value gdep2 fix dthlv2_value combobox_value if dthlv2_value combobox_index LT event index then BEGIN We redefine the dthlv2id s value widget_control dthlv2id set_value combobox_select:event index So we redefine the value and the max of the slider 2 if event index EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 event index 1 1 widget_control depth2id set_value slider_max:max value:gdep2 event index So we redefine the max of the slider 1 widget_control depth1id set_value slider_max:gdep1 event index END We redefine the value and the min of the slider depth1 if event index EQ 0 then min 0 ELSE min gdep1 event index 1 1 widget_control depth1id set_value slider_min:min value:gdep1 event index S we change the value of the min of the slider depth 2 widget_control depth2id set_value slider_min:gdep1 event index 1 END dthlv2 :BEGIN ids depth1id widget_info event handler find_by_uname depth1 depth2id widget_info event handler find_by_uname depth2 dthlv1id widget_info event handler find_by_uname dthlv1 Do we have to change dthlv1 widget_control dthlv1id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value widget_control event id get_value dthlv2_value gdep2 fix dthlv2_value combobox_value if dthlv1_value combobox_index GT event index then BEGIN We redfine the value of dthlv1id widget_control dthlv1id set_value combobox_select:event index So we redefine the value and the min of the slider 1 if event index EQ 0 then min 0 ELSE min gdep2 event index 1 widget_control depth1id set_value slider_min:min value:gdep1 event index Se we redefine the min of the slider 2 widget_control depth2id set_value slider_min:gdep2 event index END We redefine the value and the max of the slider depth 2 if event index EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 event index 1 1 widget_control depth2id set_value slider_max:max value:gdep2 event index So we change the value of the max of the slider depth 1 widget_control depth1id set_value slider_max:gdep2 event index 1 END depth1 :BEGIN ids depth2id widget_info event handler find_by_uname depth2 dthlv1id widget_info event handler find_by_uname dthlv1 Do we have to change dthlv1 widget_control dthlv1id get_value dthlv1_value gdep1 fix dthlv1_value combobox_value rien where gdep1 LT event value indice indice indice indice 1 if indice NE dthlv2_value combobox_index then begin We change the min of depth1 widget_control depth1id set_value slider_max:gdep2 indice 1 We redefine the value of dthlv2id widget_control dthlv2id set_value combobox_select:indice So we redefine the min of the slider 2 if indice EQ jpk 1 then BEGIN max max gdept gdepw max strtrim string max format e8 0 1 max float 1 strmid max 1 float max ENDIF ELSE max gdep2 indice 1 1 widget_control event id set_value slider_max:max endif END ELSE: ENDCASE slidesliceid widget_info event top find_by_uname slide_slice if slidesliceid NE 0 then widget_control slidesliceid set_value 1 return ID:event handler TOP:event top HANDLER:0L BOX:cw_domain_get_value event handler end file_comments categories param PARENT in required The widget ID of the parent widget keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword STRICT keyword UNZOOM keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: cw_domain pro 150 2006 08 09 10:12:54Z navarro todo seb: Documenter FUNCTION cw_domain parent BOXZOOM boxzoom STRICT strict UVALUE uvalue UNAME uname UNZOOM unzoom _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data Definition of the boxzoom Case N_Elements Boxzoom OF 0:boxzoom lon1 lon2 lat1 lat2 min gdepw 0 gdept 0 max gdepw 0 gdept 0 1:boxzoom lon1 lon2 lat1 lat2 0 boxzoom 0 2:boxzoom lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4:boxzoom Boxzoom vert1 vert2 5:boxzoom Boxzoom 0:3 0 Boxzoom 4 6: Else: return report Mauvaise Definition de Boxzoom ENDCASE IF total Boxzoom EQ 0 THEN boxzoom lon1 lon2 lat1 lat2 min gdepw 0 gdept 0 max gdepw 0 gdept 0 boxzoom 0 floor boxzoom 0 boxzoom 1 ceil boxzoom 1 boxzoom 2 floor boxzoom 2 boxzoom 3 ceil boxzoom 3 boxzoom 4 floor boxzoom 4 boxzoom 5 ceil boxzoom 5 if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent row 2 space 0 EVENT_FUNC cw_domain_event FUNC_GET_VALUE cw_domain_get_value PRO_SET_VALUE cw_domain_set_value UVALUE uvalue UNAME uname _extra ex baseh widget_base base column 1 keyword_set unzoom space 0 baseh1 widget_base baseh row 2 space 0 longitude min floor min glamt glamf max max max ceil max IF max min GT 360 AND keyword_set key_periodic THEN max min 360 lonbase widget_base baseh1 column 2 space 0 uname lonbase uvalue name: geographic lon1id cw_slider_pm lonbase value min boxzoom 0 boxzoom 0 keyword_set strict boxzoom 1 boxzoom 0 keyword_set strict latitude min floor min gphit gphif max max max ceil max latbase widget_base baseh1 column 2 space 0 uname latbase uvalue name: geographic lat1id cw_slider_pm latbase value min boxzoom 2 boxzoom 2 keyword_set strict boxzoom 3 boxzoom 2 keyword_set strict unzoom if keyword_set unzoom then rien widget_button baseh value unzoom uvalue name: unzoom xsize 60 ysize 110 depth basez widget_base base column 3 space 0 base_align_center basezdrp widget_base basez row 2 space 0 if strupcase vargrid EQ W then gdep gdepw ELSE gdep gdept gdep1 floor gdep gdep2 ceil gdep same where gdep2 gdep1 EQ 0 if same 0 NE 1 then gdep2 same gdep2 same 1 sgdep1 strtrim gdep1 1 sgdep2 strtrim gdep2 1 dephtid cw_combobox_pm basezdrp value sgdep1 uvalue name: dthlv1 grid_t:strupcase vargrid NE W uname dthlv1 rien where gdep1 LT boxzoom 4 indice1 indice1 indice1 indice2 1 widget_control dephtid set_value combobox_select:indice2 basedepthslid widget_base base column 2 space 0 strminlen max strlen strtrim round gdept gdepw 1 if indice1 EQ 0 then min1 0 ELSE min1 gdep2 indice1 1 max1 min1 1 gdep1 indice2 rien cw_slider_pm basez value min1 boxzoom 4 boxzoom 4 boxzoom 5 max2 uvalue name: depth2 minimum min2 maximum max2 uname depth2 title z2 strminlen strminlen return base end"); 363 a[361] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.html", "cw_droplist_pm.pro", "", " PRO testwid_event event help event STRUCT DroplistId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy dynamic_resize :BEGIN widget_control event id get_value value widget_control DroplistId set_value dynamic_resize:value END droplist_select :BEGIN widget_control event id get_value value widget_control DroplistId set_value droplist_select:value END value :BEGIN widget_control event id get_value value widget_control DroplistId set_value value END get :BEGIN widget_control DroplistId get_value value help value struct END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_droplist_pm base _extra ex uname c est lui uvalue c est lui print cw_droplist_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue dynamic_resize editable nothing widget_text base value 10 uvalue droplist_select editable nothing widget_text base value 5 uvalue value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end PRO cw_droplist_pm_set_value id value compile_opt idl2 strictarrsubs DroplistId widget_info id find_by_uname Droplist if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of dynamic_resize :widget_control DroplistId dynamic_resize value dynamic_resize droplist_select :widget_control DroplistId set_droplist_select value droplist_select value :widget_control DroplistId set_value value value ELSE:ras report mauvais nom de l argument de la structure ds cw_droplist_pm_set_value endcase endfor ENDIF ELSE widget_control DroplistId set_value value return end FUNCTION cw_droplist_pm_get_value id compile_opt idl2 strictarrsubs DroplistId widget_info id find_by_uname Droplist return droplist_number:widget_info DroplistId droplist_number droplist_select:widget_info DroplistId droplist_select dynamic_resize:widget_info DroplistId dynamic_resize end FUNCTION cw_droplist_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval if uval EQ Droplist then return CW_DROPLIST_PM ID:event handler TOP:event top HANDLER:0L INDEX:event index OUT:0 DroplistId widget_info event handler find_by_uname Droplist index widget_info DroplistId droplist_select case uval OF plus :BEGIN indexmax widget_info DroplistId droplist_number 1 if index NE indexmax then widget_control DroplistId set_droplist_select index 1 return CW_DROPLIST_PM ID:event handler TOP:event top HANDLER:0L INDEX: index 1 index 1 OUT: long index EQ 0 END endcase end file_comments Like WIDGET_DROPLIST but here their are 2 buttons and to move the widget from 1 categories compound widget param PARENT in required The widget ID of the parent widget keyword COLUMN Buttons will be arranged in the number of columns specified by this keyword keyword ROW Buttons will be arranged in the number of rows specified by this keyword keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword _EXTRA Used to pass your keywords returns The returned value of this function is the widget ID of the newly created animation widget restrictions Widget Events Returned by Droplist Widgets Pressing the mouse button while the mouse cursor is over an element of a droplist widget causes the widget to change the label on the droplist button and to generate an event The appearance of any previously selected element is restored to normal at the same time The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_DROPLIST_PM ID:0L TOP:0L HANDLER:0L INDEX:0L OUT:0 The first three fields are the standard fields found in every widget event INDEX returns the index of the selected item This can be used to index the array of names originally used to set the widget s value OUT:It is an integer which can take 3 values: 1 : If we press when the index is already at the max Comment: In this case the index stay at the max 1: If we press when the index is already at the min Comment: In this case the index stay at the min 0 : In other cases Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat Send back in the result variable a structure of 3 elements whose names are inspired by keywords we can pass at widget_control when we use WIDGET_COMBOBOX: DROPLIST_NUMBER: the number of elements currently contained in the specified droplist widget DROPLIST_SELECT: the zero based number of the currently selected element i e the currently displayed element in the specified droplist widget DYNAMIC_RESIZE: a True value 1 if the widget specified by Widget_ID is a button droplist or label widget that has had its DYNAMIC_RESIZE attribute set Otherwise False 0 is returned 2 SET_VALUE widget_control wid_id set_value impose permet de modifier l etat de la droplist comme on peut le faire pour WIDGET_DROPLIST Impose peut etre: a The contents of the list widget string or string array b A structure which can have for elements from 1 to 3 : DYNAMIC_RESIZE:Set this keyword to activate if set to 1 or deactivate if set to 0 dynamic resizing of the specified CW_DROPLIST_PM widget see the documentation for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST procedure for more information about dynamic widget resizing DROPLIST_SELECT:Set this keyword to return the zero based number of the currently selected element i e the currently displayed element in the specified droplist widget VALUE: The contents of the list widget string or string array examples See the program provided above testwid and the associated procedure testwid_event history Sebastien Masson smasson lodyc jussieu fr 6 9 1999 version Id: cw_droplist_pm pro 150 2006 08 09 10:12:54Z navarro FUNCTION cw_droplist_pm parent UVALUE uvalue UNAME uname ROW row COLUMN column _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller cheking for row and column keywords row keyword_set row 1 keyword_set column column keyword_set column 1 keyword_set row keyword_set column EQ row if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 1 xpad 1 ypad 1 ROW row COLUMN column EVENT_FUNC cw_droplist_pm_event FUNC_GET_VALUE cw_droplist_pm_get_value PRO_SET_VALUE cw_droplist_pm_set_value UVALUE uvalue UNAME uname _extra ex if keyword_set row THEN nothing widget_button base value uvalue minus nothing widget_droplist base UVALUE Droplist UNAME Droplist _extra ex if keyword_set column then begin base1 widget_base base row align_center space 1 xpad 1 ypad 1 nothing widget_button base1 value uvalue minus xsize 20 ysize 20 nothing widget_button base1 value uvalue plus xsize 20 ysize 20 ENDIF ELSE nothing widget_button base value uvalue plus widget_control base realize return base end"); 364 a[362] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.html", "cw_pagelayout.pro", "", " FUNCTION cw_pagelayout_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout if uval name EQ undo then begin return ID:event handler TOP:event top HANDLER:0L ENDIF ELSE BEGIN common If we do not change the number of columns we send if uval name EQ column then if event index 1 EQ smallin 0 THEN return ID:event handler TOP:event top HANDLER:0L If we do not change the number of lines we send if uval name EQ row then if event index 1 EQ smallin 1 THEN return ID:event handler TOP:event top HANDLER:0L We erase the page graphid widget_info event top find_by_uname graph graphid extractatt top_uvalue graphid widget_control graphid get_value win wset win erase 255 case uval name of clear : column :BEGIN smallin event index 1 smallin 1 1 smallout event index 1 smallout 1 1 END row :BEGIN smallin smallin 0 event index 1 1 smallout smallout 0 event index 1 1 END endcase nbredessin smallin 0 smallin 1 We put all back to 0 for postscripts createhistory event top smallin options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flag flags numdessinin update and reset all values of the top_uvalue top_uvalue 1 findline top_uvalue smallin smallin top_uvalue 1 findline top_uvalue smallout smallout top_uvalue 1 findline top_uvalue penvs replicate p nbredessin top_uvalue 1 findline top_uvalue xenvs replicate x nbredessin top_uvalue 1 findline top_uvalue yenvs replicate y nbredessin top_uvalue 1 findline top_uvalue nameprocedures strarr nbredessin top_uvalue 1 findline top_uvalue types strarr nbredessin top_uvalue 1 findline top_uvalue varinfo strarr 2 nbredessin top_uvalue 1 findline top_uvalue domaines fltarr 6 nbredessin top_uvalue 1 findline top_uvalue dates lonarr 2 nbredessin top_uvalue 1 findline top_uvalue txtcmd strarr nbredessin top_uvalue 1 findline top_uvalue optionsflag flag replicate 1 nbredessin ptr_free extractatt top_uvalue exextra top_uvalue 1 findline top_uvalue exextra ptrarr nbredessin allocate_heap top_uvalue 1 findline top_uvalue ENDELSE return ID:event handler TOP:event top HANDLER:0L end file_comments categories param PARENT in required The widget ID of the parent widget param SMALL keyword COLUMN Buttons will be arranged in the number of columns specified by this keyword keyword ROW Buttons will be arranged in the number of rows specified by this keyword keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: cw_pagelayout pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter FUNCTION cw_pagelayout parent small UVALUE uvalue UNAME uname UNZOOM unzoom COLUMN column ROW row _extra ex compile_opt idl2 strictarrsubs row keyword_set row 1 keyword_set column if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent EVENT_FUNC cw_pagelayout_event FUNC_GET_VALUE cw_pagelayout_get_value PRO_SET_VALUE cw_pagelayout_set_value UVALUE uvalue UNAME uname space 0 _extra ex IF n_elements small eq 0 then small 1 1 1 dummy widget_label base value cln yoffset 3 id widget_combobox base value strtrim indgen 9 1 1 uvalue name: column uname column xoffset 20 xsize 40 widget_control id set_combobox_select small 0 1 IF keyword_set row THEN BEGIN xoff 60 yoff 0 ENDIF ELSE BEGIN xoff 0 yoff 20 ENDELSE dummy widget_label base value row xoffset xoff yoffset yoff 3 id widget_combobox base value strtrim indgen 9 1 1 uvalue name: row uname row xoffset xoff 20 xsize 40 yoffset yoff widget_control id set_combobox_select small 1 1 return base end "); 365 365 a[363] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.html", "cw_slide_slice.pro", "", "pro cw_slide_slice_set_value id value compile_opt idl2 strictarrsubs common topid findtopid id domainid widget_info topid find_by_uname domain widget_control domainid get_value boxzoom if boxzoom 1 boxzoom 0 LT boxzoom 3 boxzoom 2 then type y ELSE type x thickid widget_info topid find_by_uname thickness widget_control thickid get_uvalue thicknessuval widget_control thickid get_value thickness thickness thicknessuval choix thickness droplist_select sliderid widget_info topid find_by_uname slider if type EQ y then BEGIN mini floor min glamt glamf max maxi maxi ceil maxi thickness widget_control sliderid set_value slider_min:mini slider_max:maxi value:boxzoom 0 maxi value mini boxzoom 0 maxi value mini boxzoom 2 maxi column uname slider uvalue name: slider ENDELSE index where thicknessval EQ thickness index index 0 if index EQ 1 then BEGIN index 20 thicknessval 20 strtrim thickness 1 widget_control droplistid set_value thicknessval widget_control droplistid set_uvalue name: thickness choix:thicknessval endif widget_control droplistid set_value droplist_select:index if type EQ xt then begin mini floor min glamt glamf max maxi maxi ceil maxi ENDIF ELSE BEGIN mini floor min gphit gphif max maxi maxi ceil maxi ENDELSE return base end"); 366 a[364] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.html", "cw_slider_pm.pro", "", " NAME: cw_slider_pm PURPOSE: widget equivalent a WIDGET_SLIDER sauf qu en plus on dispose de 2 bouttons et pour deplacer le widget de 1 CATEGORY: compound widget aide a l ecriture des widgets CALLING SEQUENCE: id cw_slider_pm parent INPUTS: Parent: The widget ID of the parent widget KEYWORD PARAMETERS:tous ceux de WIDGET_SLIDER OUTPUTS: The returned value of this function is the widget ID of the newly created animation widget COMMON BLOCKS: none SIDE EFFECTS: Widget Events Returned by the CW_SLIDER_PM Widget Slider widgets generate events when the mouse is used to change their value The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_SLIDER_PM ID:0L TOP:0L HANDLER:0L VALUE:0L DRAG:0 OUT:0 ID is the widget ID of the button generating the event TOP is the widget ID of the top level widget containing ID HANDLER contains the widget ID of the widget associated with the handler routine VALUE returns the new value of the slider DRAG returns integer 1 if the slider event was generated as part of a drag operation or zero if the event was generated when the user had finished positioning the slider Note that the slider widget only generates events during the drag operation if the DRAG keyword is set and if the application is running under Motif When the DRAG keyword is set the DRAG field can be used to avoid computationally expensive operations until the user releases the slider OUT:c est un entier qui peut prendre 3 valeurs: 1 : si on appuie sur alors que le slider est deja aux max rq: ds ce cas le slider reste au max 1: si on appuie sur alors que le slider est deja aux min rq: ds ce cas le slider reste au min 0 : ds les autres cas Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat retourne ds la variable resultat une structure de 2 elements dont les noms sont inspires des mots cles que l on peut passer a widget_control qd on utilise WIDGET_SLIDER: VALUE:the value setting of the widget SLIDER_MIN_MAX: a 2 elements array: The minimum and the maximum value of the range encompassed by the slider 2 SET_VALUE widget_control wid_id set_value impose permet de modifier l etat de la slider bar comme on peut le faire pour WIDGET_SLIDER Impose peut etre: a un entier: donne la nouvelle position of the slider b une structure qui peut avoir comme elements de 1 a 3 : VALUE:un entier qui donne la nouvelle position of the slider SLIDER_MIN:Set to a new minimum value for the specified slider widget SLIDER_MAX:Set to a new minimum value for the specified slider widget RESTRICTIONS: EXAMPLE: cf utiliser le programme founit i dessous: testwid et la procedure associee testwid_event MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 5 9 1999 PRO testwid_event event help event STRUCT SliderBarId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy slider_min :BEGIN widget_control event id get_value value widget_control SliderBarId set_value slider_min:value END slider_max :BEGIN widget_control event id get_value value widget_control SliderBarId set_value slider_max:value END slider_value :BEGIN widget_control event id get_value value widget_control SliderBarId set_value value END get :BEGIN widget_control SliderBarId get_value value help value struct print value slider_min_max END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_slider_pm base _extra ex uname c est lui uvalue c est lui print cw_slider_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue slider_min editable nothing widget_text base value 10 uvalue slider_max editable nothing widget_text base value 5 uvalue slider_value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end FUNCTION decvalue value compile_opt idl2 strictarrsubs a float value 0 return strtrim string floor a 0 1 indgen 10 format f15 1 2 end FUNCTION decind value compile_opt idl2 strictarrsubs a float value 0 return round 10 a floor a computation accuracy end PRO cw_slider_pm_set_value id value compile_opt idl2 strictarrsubs sbid widget_info id find_by_uname SliderBar dcid widget_info id find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of slider_min :BEGIN IF float value slider_min 0 LT minmax 1 THEN BEGIN minmax 0 value slider_min 0 widget_control sbid set_slider_min floor float value slider_min 0 valuedc float widget_info dcid combobox_gettext IF valuedc LT value slider_min THEN BEGIN widget_control sbid set_value floor float value slider_min 0 widget_control dcid set_value decvalue value slider_min widget_control dcid set_combobox_select decind value slider_min ENDIF ENDIF end slider_max :BEGIN IF float value slider_max 0 GT minmax 0 THEN BEGIN minmax 1 value slider_max 0 widget_control sbid set_slider_max ceil float value slider_max 0 valuedc float widget_info dcid combobox_gettext IF valuedc GT value slider_max THEN BEGIN widget_control sbid set_value ceil float value slider_max 0 widget_control dcid set_value decvalue value slider_max widget_control dcid set_combobox_select decind value slider_max ENDIF ENDIF end value :IF float value value 0 GE minmax 0 AND float value value 0 LE minmax 1 THEN value2 float value value 0 ELSE:ras report wrong tag name in argument value of cw_slider_pm_set_value endcase endfor ENDIF ELSE BEGIN IF float value 0 GE minmax 0 AND float value 0 LE minmax 1 THEN value2 float value 0 ENDELSE IF n_elements value2 NE 0 THEN BEGIN widget_control sbid set_value fix value2 widget_control dcid set_value decvalue value2 widget_control dcid set_combobox_select decind value2 ENDIF return end FUNCTION cw_slider_pm_get_value id compile_opt idl2 strictarrsubs sbid widget_info id find_by_uname SliderBar dcid widget_info id find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX value float widget_info dcid combobox_gettext return value:value slider_min_max:minmax end FUNCTION cw_slider_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval sbid widget_info event handler find_by_uname SliderBar dcid widget_info event handler find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX IF uval EQ decimal THEN value float event str ELSE value float widget_info dcid combobox_gettext out 0 defaut case case uval OF plus : if value 1 LE minmax 1 then value2 value 1 ELSE out 1 minus :if value 1 GE minmax 0 then value2 value 1 ELSE out 1 SliderBar :if event value value floor value LE minmax 1 THEN value2 event value value floor value decimal :BEGIN CASE 1 OF value GT minmax 1 : value2 minmax 1 value LT minmax 0 : value2 minmax 0 ELSE: ENDCASE END ELSE: ENDCASE IF n_elements value2 NE 0 THEN BEGIN value value2 widget_control sbid set_value floor value widget_control dcid set_value decvalue value widget_control dcid set_combobox_select decind value ENDIF return CW_SLIDER_PM ID:event handler TOP:event top HANDLER:0L VALUE:value OUT:OUT endFUNCTION cw_slider_pm parent MAXIMUM maximum MINIMUM minimum STRMINLEN strminlen VALUE value UVALUE uvalue UNAME uname title title _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller if n_elements minimum NE 0 then minimum floor minimum ELSE minimum 0 if n_elements maximum NE 0 then maximum ceil maximum ELSE maximum 100 if NOT keyword_set title then title cheking exclusive keywords column keyword_set column 1 keyword_set row keyword_set vertical xsize lenstr max strlen strtrim minimum maximum 1 if keyword_set strminlen then lenstr strminlen lenstr xsize 35 mlen lenstr 1 3 lenstr lt 4 xsize 35 mlen lenstr 2 dummyid widget_combobox base value decvalue minimum UVALUE decimal UNAME decimal xoffset xoff yoffset 2 xsize xsize dummyid widget_slider base MAXIMUM maximum MINIMUM minimum UVALUE SliderBar UNAME SliderBar suppress_value drag yoffset 30 xsize xoff xsize if keyword_set value then cw_slider_pm_set_value base value return base end");367 a[365] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.html", "cw_specifie.pro", "", " PRO cw_specifie_set_value id value compile_opt idl2 strictarrsubs cm_general if size value type NE 8 then return widget_control widget_info id find_by_uname min set_value strtrim value min 2 widget_control widget_info id find_by_uname max set_value strtrim value max 2 widget_control widget_info id find_by_uname int set_value strtrim value inter 2 widget_control widget_info id find_by_uname palnum set_value strtrim value lct 2 autres extractstru value min max inter lct nothing xindex yindex if size autres type EQ 8 then BEGIN autresid widget_info id find_by_uname autres widget_control widget_info id find_by_uname autres get_value autresautres autresautres autresautres 0 if strtrim autresautres 2 NE then begin autresautres createfunc get_extra autresautres filename myuniquetmpdir for_createfunc pro autres mixstru autres autresautres endif autres strkeywd autres widget_control widget_info id find_by_uname autres set_value autres endif return end FUNCTION cw_specifie_get_value id compile_opt idl2 strictarrsubs cm_general widget_control widget_info id find_by_uname min get_value min min float min 0 widget_control widget_info id find_by_uname max get_value max max float max 0 widget_control widget_info id find_by_uname int get_value int int float int 0 widget_control widget_info id find_by_uname palnum get_value palnum palnum long palnum 0 widget_control widget_info id find_by_uname autres get_value autres autres autres 0 exextra min:min max:max inter:int lct:palnum if strtrim autres 2 NE then exextra createfunc get_extra autres _extra exextra kwdlist exextra exextra exextra exextra filename myuniquetmpdir for_createfunc pro return exextra end FUNCTION cw_specifie_event event on recuper les ID des differents widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 case uval of default :BEGIN on trouve le nom de la variable: vlstid widget_info event top find_by_uname varlist fieldname widget_info vlstid combobox_gettext exextra definedefaultextra fieldname widget_control widget_info event handler find_by_uname min set_value strtrim exextra min 1 widget_control widget_info event handler find_by_uname max set_value strtrim exextra max 1 widget_control widget_info event handler find_by_uname int set_value strtrim exextra inter 1 widget_control widget_info event handler find_by_uname palnum set_value strtrim exextra lct 1 widget_control widget_info event handler find_by_uname autres set_value END palcol :BEGIN ind fix strmid event value 0 strpos event value widget_control widget_info event handler find_by_uname palnum set_value strtrim ind 1 END ELSE: endcase return ID:event handler TOP:event top HANDLER:0L OK:uval EQ ok end FUNCTION cw_specifie parent ROW row COLUMN column UVALUE uvalue UNAME uname FRAME frame FORXXX forxxx _extra ex cheking exclusive keywords compile_opt idl2 strictarrsubs column keyword_set column 1 keyword_set row row keyword_set row 1 keyword_set column keyword_set row EQ column if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 0 frame EVENT_FUNC cw_specifie_event FUNC_GET_VALUE cw_specifie_get_value PRO_SET_VALUE cw_specifie_set_value UVALUE uvalue UNAME uname _extra ex base1 base1 widget_base base rien widget_label base1 value Min xoffset 85 yoffset 15 rien widget_label base1 value Max xoffset 145 yoffset 15 rien widget_label base1 value Int xoffset 210 yoffset 15 lct get_name nomcouleur nbrligne 30 nbrlist n_elements nomcouleur nbrligne nomcouleur strtrim sindgen n_elements nomcouleur 1 nomcouleur nomcouleur 0 nomcouleur nomcouleur 1 Color nomcouleur if nbrlist GT 1 then for i 1 nbrlist do nomcouleur nomcouleur 0:nbrligne i 1 i 1 nomcouleur nbrligne i i:n_elements nomcouleur 1 rien cw_pdmenu base1 nomcouleur RETURN_NAME uvalue palcol uname palcol xoffset 250 yoffset 0 base2 base2 widget_base base column 4 keyword_set forxxx yoffset 30 if keyword_set forxxx then rien widget_button base2 value Default uvalue default frame tooltip see find definedefaultextra 0 rien widget_text base2 value editable xsize 7 uname min uvalue min rien widget_text base2 value editable xsize 7 uname max uvalue max rien widget_text base2 value editable xsize 7 uname int uvalue int if keyword_set forxxx then colvalue ELSE colvalue 39 rien widget_text base2 value colvalue editable xsize 2 uname palnum uvalue palnum widget text contennant les autres mots cles passe ds top_uvalue exextra en reste t il si oui il faut les mettres sous forme destring rien widget_text base value editable uname autres uvalue autres xsize 54 ysize 3 yoffset 65 wrap no_newline if keyword_set forxxx then cw_specifie_set_value base definedefaultextra rien_du_tout return base end ");368 a[366] = new Array("./ToBeReviewed/WIDGET/findtopid.html", "findtopid.pro", "", " NAME: findtopid PURPOSE: retrouve a partir d un Id de widget l Id du widget qui est the top level base i e it has no parent CATEGORY: aide pour les widgets CALLING SEQUENCE: res findtopid Widget_ID INPUTS: Widget_ID: this argument should be the widget ID of the widget for which information is desired KEYWORD PARAMETERS: OUTPUTS: l Id du widget qui est the top level base COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 22 9 1999 FUNCTION findtopid identite compile_opt idl2 strictarrsubs id long identiteexist widget_info id managed if exist EQ 0 then return 1 topid id topid2 id while topid2 NE 0 do begin topid topid2 topid2 widget_info topid2 parent endwhile return long topid end");369 a[367] = new Array("./ToBeReviewed/WIDGET/slec.html", "slec.pro", "", " FUNCTION slec name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex include common compile_opt idl2 strictarrsubs cm_4data IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF case n_params of 1:tab nlec name PARENT parent BOXZOOM boxzoom _EXTRA ex 2:tab nlec name debut PARENT parent BOXZOOM boxzoom _EXTRA ex 3:tab nlec name debut fin PARENT parent BOXZOOM boxzoom _EXTRA ex 4:tab nlec name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex endcase return tab:tab grille:vargrid unite:varunit experience:varexp nom:varname end");370 a[368] = new Array("./ToBeReviewed/WIDGET/xnotice.html", "xnotice.pro", "", " NAME:xnotice PURPOSE:cree un widget avec du texte au milieu de la fenetre CATEGORY:information CALLING SEQUENCE:widgetid xnotice text INPUTS:text: un string ou un vecteur de string Si c est un scalaire on cherche le separateur de ligne C pour creer un texte a plusieurs lignes KEYWORD PARAMETERS:chkwidget: oblige a verifier qu il y a des widgets actif pour creer un widget sinon imprime au prompt OUTPUTS:lidentite du widget cree COMMON BLOCKS SIDE EFFECTS:ne fait pas appelle a xmanager ne cree aucun event il faut detruire ce widget a la main: widget_control widgetid destroy RESTRICTIONS: EXAMPLE: IDL id xnotice ca marche C ou pas IDL widget_control id destroy MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 2000 3 17 FUNCTION xnotice text CHKWIDGET chkwidget on separe le text en differentes lignes separees par C si cen est pas deja fait compile_opt idl2 strictarrsubs if n_elements text EQ 1 then text str_sep text C trim if keyword_set chkwidget then makewid widget_info managed 0 ELSE makewid 1 if makewid EQ 0 then BEGIN for i 0 n_elements text 1 do print text i noticebase 0 endif noticebase widget_base column title information align_center screensize get_screen_size widget_control noticebase tlb_set_xoffset screensize 0 2 2 tlb_set_yoffset screensize 1 2 2 nothing widget_label noticebase value for i 0 n_elements text 1 do nothing widget_label noticebase value text i nothing widget_label noticebase value widget_control noticebase realize return noticebase end");371 a[369] = new Array("./ToBeReviewed/WIDGET/xquestion.html", "xquestion.pro", "", " NAME:xquestion PURPOSE: a small widget who ask a question and give an answer WARNING: For a binary question with yes no answer use DIALOG_MESSAGE CATEGORY: widget CALLING SEQUENCE: answer xquestion question proposedanswer INPUTS: question: a scalar string or a array of string If this argument is set to : an array of strings: each array element is displayed as a separate line of text a scalar string: we are looking for the separate line character C proposedanswer: a string proposing a answer KEYWORD PARAMETERS: those from WIDGET_BASE and WIDGET_TEXT CHKWIDGET: active this keyword if you whant that xquestion check if managed widget are present If not xquestion do not open a widget but print the question in the IDL window OUTPUTS: answer: a string COMMON BLOCKS: none we use a false widget SIDE EFFECTS: The function does not return to its caller until the user press Enter key in the widget RESTRICTIONS: EXAMPLE: IDL help xquestion Postscript name STRING toto ps MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 13 10 1999 pro xquestion_event event compile_opt idl2 strictarrsubs we get the answer widget_control widget_info event top find_by_uname text get_value answer answer answer 0 now we give the answer to xquestion pro by using the pointer uvalue widget_control event top get_uvalue ptranswer ptranswer answer we destroy the widget widget_control event top destroy return endFUNCTION xquestion question proposedanswer CHKWIDGET chkwidget _extra ex compile_opt idl2 strictarrsubs is separate line a scalar we must cut it into pieces if n_elements question EQ 1 then question str_sep question C trim is a widget necessary if keyword_set chkwidget then BEGIN if widget_info managed 0 EQ 0 then BEGIN if n_elements proposedanswer EQ 0 then BEGIN proposedanswer answer complete ENDIF ELSE BEGIN answer proposedanswer complete default answer is proposedanswer ENDELSE if n_elements question GT 1 THEN for i 0 n_elements question 2 do print question i read question n_elements question 1 complete answer if keyword_set answer EQ 0 then answer proposedanswer return answer endif endif definition of the widget BaseId widget_base column title Question _extra ex screensize get_screen_size widget_control BaseId tlb_set_xoffset screensize 0 2 2 tlb_set_yoffset screensize 1 2 2 for i 0 n_elements question 1 DO trash widget_label BaseId value question i align_left if n_elements proposedanswer EQ 0 then answer ELSE answer proposedanswer trash widget_text BaseId value answer editable _extra ex uname text trash widget_button BaseId value ok ptranswer ptr_new allocate_heap widget_control BaseId set_uvalue ptranswer we realize the widget and wait for an answer widget_control BaseId realize xmanager xquestion BaseId we get the answer answer ptranswer we freeing the pointer ptr_free ptranswer return answer end");372 a[370] = new Array("./ToBeReviewed/WIDGET/xx.html", "xx.pro", "", " PRO xx JOUR jour MESHFILENAME meshfilename LISTVAR listvar LISTGRID listgrid FUNCLEC_NAME funclec_name CALENDAR calendar _extra ex compile_opt idl2 strictarrsubs common partie a changer nom de la fonction de lecture: if NOT keyword_set funclec_name then funclec_name slec varexp INF liste des variables if NOT keyword_set listvar then listvar tn sn un vn taux tauy hdep20 hdep28 hdep15 hturb hpycn htoth emp qn qs smltot11 smltot12 smltot13 smltot14 smltot15 smltot16 tmltot11 tmltot12 tmltot13 tmltot14 tmltot15 tmltot16 liste des grilles auxquelles elles se rapportent les variables if NOT keyword_set listgrid then BEGIN listgrid replicate T n_elements listvar listgrid 2 4 U listgrid 3 5 V ENDIF calendrier a utiliser en jours juliens d IDL if NOT keyword_set calendar then BEGIN if keyword_set jour then calendar calendriertotem julian_day ELSE calendar calendriertotem julian_day mensuel ENDIF nom du fichier se rapportant au masque if NOT keyword_set meshfilename then meshfilename usr1 com smasson IDL INIT inittotem pro meshparameters whichgrid meshfilename parameteres specifiant comment doit etre lu le champ readparameters funclec_name: funclec_name jpidta: jpidta jpjdta: jpjdta jpkdta: jpkdta ixmindta: ixmindta ixmaxdta: ixmaxdta iymindta: iymindta iymaxdta: iymaxdta izmindta: izmindta izmaxdta: izmaxdta fin de la partie a changerfileparameters filename: many time_counter: calendar listvar: listvar listgrid: strupcase listgrid multistructure fileparameters: temporary fileparameters readparameters: temporary readparameters meshparameters: temporary meshparameters xxx multistructure temporary multistructure _extra ex return end");373 a[371] = new Array("./ToBeReviewed/WIDGET/xxx.html", "xxx.pro", "", " NAME:xxx PURPOSE:un maximum de possibilites avec un minimum de clics CATEGORY:super widget CALLING SEQUENCE:xxx INPUTS:none KEYWORD PARAMETERS: SEPARATE: pour separer la partie boutons de la partie dessin en 2 fenetres Utile pour les petits ecrans mais attention peut saturer la memoire video de certains Tx un peu vetustes RESTORE toto dat ou toto dat est un fichier cree lors d une precedente utilisation de xxx grace a la commande Widget du menu save as OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO xxx_event event compile_opt idl2 strictarrsubs common widget_info event top find_by_uname quel est le type d evenement if event id EQ 622 then help event struct widget_control event id get_uvalue uval if tag_names event structure_name 0 EQ WIDGET_TRACKING then uval name: ActiverFenetre if keyword_set uval EQ 0 then return help event struct help uval struct case sur le type d evenement widget_control event top get_uvalue top_uvalue si on a active le mot cles separate a l appelle de xxx if size top_uvalue type EQ 3 then begin event top top_uvalue widget_control event top get_uvalue top_uvalue endif on tue le petit widget cree par notice pro si il existe noticebase extractatt top_uvalue noticebase if noticebase NE 0 then BEGIN widget_control noticebase destroy top_uvalue 1 findline top_uvalue noticebase 0l endif options extractatt top_uvalue options case uval name OF menubar :xxxmenubar_event event ok :nouveaudessin 1 specifie : action : calendar1 :BEGIN date2id widget_info event top find_by_uname calendar2 widget_control date2id get_value date2 if event value GT date2 then widget_control date2id set_value event value END calendar2 :BEGIN date1id widget_info event top find_by_uname calendar1 widget_control date1id get_value date1 if event value LT date1 then widget_control date1id set_value event value END domain : varlist :BEGIN currentfile extractatt top_uvalue currentfile listvar extractatt top_uvalue fileparameters currentfile listvar name listvar event index changefield event top name END txtcmd : filelist :BEGIN changefile event top event index END ActiverFenetre :BEGIN if event enter EQ 1 AND d name NE PS then BEGIN graphid widget_info event top find_by_uname graph graphid extractatt top_uvalue graphid widget_control graphid get_value win wset win widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 p extractatt top_uvalue penvs numdessinin x extractatt top_uvalue xenvs numdessinin y extractatt top_uvalue yenvs numdessinin endif END graph :BEGIN quelclick identifyclick event case quelclick type of inutile :return long :longclickaction event single :singleclickaction event double :doubleclickaction event endcase END endcase if keyword_set nouveaudessin then letsdraw event top return end PRO xxx datafilename idlfile argspro CALLERWIDID CallerWidId REDRAW redraw SEPARATE separate UVALUE uvalue RESTORE restore _EXTRA ex compile_opt idl2 strictarrsubs all_cm reinitialize the p x y z variables reinitplt we get back the uvalue of the widget that called xxx to create a new widget if keyword_set restore then BEGIN restore isafile filename restore iodir homedir _extra ex if size restore type NE 7 then restore 0 ELSE BEGIN restore isafile file restore iodir homedir _extra ex newgrid extractatt uvalue meshparameters 0 change changegrid newgrid ENDELSE endif if n_elements CallerWidId NE 0 THEN widget_control CallerWidId get_uvalue uvalue ELSE CallerWidId 0 liste des fichiers que l on veut regarder if keyword_set uvalue then BEGIN currentfile extractatt uvalue currentfile filelist extractatt uvalue filelist fileparameters extractatt uvalue fileparameters readparameters extractatt uvalue readparameters meshparameters extractatt uvalue meshparameters ENDIF ELSE BEGIN newfile selectfile datafilename idlfile argspro _extra ex if size newfile type NE 8 then return fileparameters ptrarr 1 allocate_heap fileparameters 0 newfile fileparameters readparameters ptrarr 1 allocate_heap readparameters 0 newfile readparameters meshparameters ptrarr 1 allocate_heap meshparameters 0 newfile meshparameters currentfile 0 filelist newfile fileparameters filename ENDELSE if keyword_set uvalue THEN BEGIN smallin extractatt uvalue smallin smallout extractatt uvalue smallout ENDIF ELSE BEGIN smallin 1 1 1 smallout 1 1 1 ENDELSE nbredessin smallin 0 smallin 1 numdessinin smallin 2 1 warning flg definition must be consistent with cw_pdmenu argument see also flag definition in cw_pagelayout if keyword_set uvalue then BEGIN flag extractatt uvalue optionsflag key_portrait flag 0 numdessinin ENDIF ELSE flag key_portrait 0 0 0 0 replicate 1 nbredessin We start the widget definition widget and screen size scrsize get_screen_size 0 95 windsize givewindowsize xxxsize windsize 0 1 keyword_set separate 350 windsize 1 The top base IF xxxsize 0 LE scrsize 0 AND xxxsize 1 LE scrsize 1 THEN BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 ENDIF ELSE BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 xsize xxxsize 0 ysize xxxsize 1 x_scroll_size xxxsize 0 selectact ENDIF ELSE selectfile 0 menu options xoff xoff 110 if keyword_set uvalue then begin options extractatt uvalue options ENDIF ELSE options Portrait Landscape Overlay Vecteur Longitude x index Latitude y index desc 1 File 0 Open 0 New xxx 2 Quit 1 Save as 0 PostScript 0 Animated gif 0 Gif 0 IDL procedure 0 RESTORE kwd of xxx 2 Print to prompt 1 Flag options descsuite options if n_elements descsuite GE 2 then descsuite 0:n_elements descsuite 2 0 descsuite 0:n_elements descsuite 2 descsuite n_elements descsuite 1 2 descsuite n_elements descsuite 1 desc desc descsuite menu cw_pdmenu base desc RETURN_NAME uname menubar uvalue name: menubar xoffset xoff yoffset yoff Ok button yoff yoff 37 xoff 5 boutton OK baseok widget_button base value OK uvalue name: ok uname ok button frame xoffset xoff yoffset yoff Page Layout page layout xoff xoff 65 dummyid cw_pagelayout base smallin row frame xoffset xoff yoffset yoff List of Variables xoff xoff 140 currentlistvar fileparameters currentfile listvar vlstid widget_combobox base value currentlistvar uvalue name: varlist uname varlist xoffset xoff yoffset yoff 1 if keyword_set uvalue then BEGIN selectvar extractatt uvalue varinfo 1 numdessinin selectvar where currentlistvar EQ selectvar 0 widget_control vlstid set_combobox_select 0 selectvar ENDIF ELSE selectvar 0 List of files yoff yoff 35 flstid widget_combobox base value file_basename filelist uname filelist xsize 345 yoffset yoff uvalue name: filelist if keyword_set uvalue then BEGIN selectfile extractatt uvalue varinfo 0 numdessinin selectfile where file_basename filelist EQ selectfile 0 widget_control flstid set_combobox_select 0 selectfile ENDIF ELSE selectfile 0 Text for computation yoff yoff 32 computation done on the files if keyword_set uvalue then txtvalue extractatt uvalue txtcmd numdessinin ELSE txtvalue varexp dummyid widget_text base value txtvalue uvalue name: txtcmd uname txtcmd editable yoffset yoff xsize 54 frame Calendar yoff yoff 40 currentcalendar fileparameters currentfile time_counter key_caltype fileparameters currentfile caltype fakecal fileparameters currentfile fakecal if keyword_set uvalue then begin dates extractatt uvalue dates numdessinin date1 date2jul dates 0 date2 date2jul dates 1 ENDIF basecalid widget_base base column 2 space 0 yoffset yoff uname basecal dummyid cw_calendar basecalid currentcalendar date1 FAKECAL fakecal uname calendar1 uvalue name: calendar1 frame dummyid cw_calendar basecalid currentcalendar date2 FAKECAL fakecal uname calendar2 uvalue name: calendar2 frame Domain yoff yoff 60 vargrid strupcase fileparameters currentfile listgrid selectvar IF vargrid EQ W then zgrid W ELSE zgrid T if keyword_set uvalue then boxzoom extractatt uvalue domaines numdessinin dummyid cw_domain base uname domain uvalue name: domain unzoom frame boxzoom boxzoom yoffset yoff xoffset 15 Plots specifications yoff yoff 230 speid cw_specifie base uname specifie uvalue name: specifie frame column forxxx yoffset yoff if keyword_set uvalue then BEGIN exextra extractatt uvalue exextra numdessinin IF n_elements exextra NE 0 THEN widget_control speid set_value exextra ENDIF drawing part if keyword_set separate then basegraph widget_base title xxx window group_leader base uvalue base ELSE basegraph base graphid widget_draw basegraph uname graph button_events retain 2 uvalue name: graph press:0 click:0 x: 0 0 y: 0 0 xoffset 350 1 keyword_set separate xsize windsize 0 ysize windsize 1 tooltip toto realize the widget widget_control base realize if keyword_set separate then begin widget_control basegraph realize xmanager xxx basegraph no_block endif if keyword_set uvalue then BEGIN on recopie le pointeur uvalue dans top_uvalue Attention il faut completement redefinir top_uvalue a partir des variables pointees par uvalue Sinon si on fait simplement top_uvalue uvalue qd on detruit par uvalue et les variables surlesquelles il pointe on detruit aussi les variables sur lesquelles pointent top_uvalue case 1 of keyword_set redraw :BEGIN top_uvalue uvalue widget_control base set_uvalue top_uvalue we find homedir homedir isadirectory io homedir title Bad definition of homedir on recupere la liste des instructions globalcommand extractatt top_uvalue globalcommand on complete par le premiere et les dernieres lignes du programme createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape noerase END keyword_set restore :begin top_uvalue uvalue widget_control base set_uvalue top_uvalue widget_control graphid get_value win wshow win wset win tv image true etat des widgets updatewidget base menage END ELSE:BEGIN top_uvalue ptrarr 2 29 allocate_heap FOR i 0 28 do top_uvalue 0 i uvalue 0 i FOR i 0 14 do top_uvalue 1 i uvalue 1 i FOR i 18 27 do top_uvalue 1 i uvalue 1 i numfile n_elements extractatt uvalue filelist top_uvalue 1 15 ptrarr numfile allocate_heap top_uvalue 1 16 ptrarr numfile allocate_heap top_uvalue 1 17 ptrarr numfile allocate_heap for i 0 numfile 1 do begin top_uvalue 1 15 i uvalue 1 15 i top_uvalue 1 16 i uvalue 1 16 i top_uvalue 1 17 i uvalue 1 17 i endfor top_uvalue 1 28 ptrarr nbredessin allocate_heap for i 0 nbredessin 1 do top_uvalue 1 28 i uvalue 1 28 i widget_control base set_uvalue top_uvalue copie l ecran du widget de uvalue dans celui de top_uvalue if keyword_set CallerWidId then begin widget_control extractatt uvalue graphid get_value win wshow win wset win image tvrd true widget_control graphid get_value win wshow win wset win tv image true ENDIF END endcase top_uvalue 1 findline top_uvalue graphid graphid ENDIF ELSE BEGIN sinon on va definit tous les elements que l on acroche au widget grace a la top_uvalue qui est un tableau de pointeurs a 2 colonnes: les noms et des variables on initialie tous ces elements variables concernant le widget ds sa generalite if NOT keyword_set ex then ex nothing:0 variables se rapportant aux differents fichiers que l on peut lire variables specifiques a chaque dessin creation du pointeur que l on va attache au widget top_uvalue ptrarr 2 29 allocate_heap variables se rapportant au widget en general top_uvalue 0 0 options top_uvalue 1 0 options top_uvalue 0 1 smallin top_uvalue 1 1 smallin top_uvalue 0 2 smallout top_uvalue 1 2 smallout top_uvalue 0 3 graphid top_uvalue 1 3 graphid top_uvalue 0 4 alreadyvector top_uvalue 1 4 1 top_uvalue 0 5 alreadyover top_uvalue 1 5 1 top_uvalue 0 6 alreadyread top_uvalue 1 6 1 top_uvalue 0 7 currentreadcmd top_uvalue 1 7 top_uvalue 0 8 globalcommand top_uvalue 1 8 top_uvalue 0 9 globaloldcommand top_uvalue 1 9 top_uvalue 0 10 no more used top_uvalue 1 10 9999 top_uvalue 0 11 noticebase top_uvalue 1 11 0l top_uvalue 0 12 extra top_uvalue 1 12 ex variables se rapportant aux differents fichiers que l on peut lire top_uvalue 0 13 currentfile top_uvalue 1 13 currentfile top_uvalue 0 14 filelist top_uvalue 1 14 filelist top_uvalue 0 15 fileparameters top_uvalue 1 15 fileparameters top_uvalue 0 16 readparameters top_uvalue 1 16 readparameters top_uvalue 0 17 meshparameters top_uvalue 1 17 meshparameters variables se rapportant aux differents dessins que l on peut fairetop_uvalue 0 18 penvs top_uvalue 1 18 replicate p nbredessin top_uvalue 0 19 xenvs top_uvalue 1 19 replicate x nbredessin top_uvalue 0 20 yenvs top_uvalue 1 20 replicate y nbredessin top_uvalue 0 21 nameprocedures top_uvalue 1 21 strarr nbredessin top_uvalue 0 22 types top_uvalue 1 22 strarr nbredessin top_uvalue 0 23 varinfo top_uvalue 1 23 strarr 2 nbredessin top_uvalue 0 24 domaines top_uvalue 1 24 fltarr 6 nbredessin top_uvalue 0 25 dates top_uvalue 1 25 lonarr 2 nbredessin top_uvalue 0 26 txtcmd top_uvalue 1 26 strarr nbredessin top_uvalue 0 27 optionsflag top_uvalue 1 27 flag top_uvalue 0 28 exextra top_uvalue 1 28 ptrarr nbredessin allocate_heap widget_control base set_uvalue top_uvalue createhistory base smallin ENDELSE xmanager xxx base no_block return end");366 a[364] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.html", "cw_slider_pm.pro", "", " PRO testwid_event event help event STRUCT SliderBarId widget_info event top find_by_uname c est lui widget_control event id get_uvalue uval if n_elements uval EQ 0 then return case uval of done :widget_control event top destroy slider_min :BEGIN widget_control event id get_value value widget_control SliderBarId set_value slider_min:value END slider_max :BEGIN widget_control event id get_value value widget_control SliderBarId set_value slider_max:value END slider_value :BEGIN widget_control event id get_value value widget_control SliderBarId set_value value END get :BEGIN widget_control SliderBarId get_value value help value struct print value slider_min_max END ELSE: endcase return end PRO testwid _extra ex base widget_base COLUMN print base base nothing widget_label base value beginning of the test nothing cw_slider_pm base _extra ex uname c est lui uvalue c est lui print cw_slider_pm ID nothing nothing widget_label base value end of the test nothing widget_text base value 0 uvalue slider_min editable nothing widget_text base value 10 uvalue slider_max editable nothing widget_text base value 5 uvalue slider_value editable nothing widget_button base value get uvalue get nothing widget_button base value done uvalue done widget_control base REALIZE xmanager testwid base return end FUNCTION decvalue value compile_opt idl2 strictarrsubs a float value 0 return strtrim string floor a 0 1 indgen 10 format f15 1 2 end FUNCTION decind value compile_opt idl2 strictarrsubs a float value 0 return round 10 a floor a computation accuracy end PRO cw_slider_pm_set_value id value compile_opt idl2 strictarrsubs sbid widget_info id find_by_uname SliderBar dcid widget_info id find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX if size value type eq 8 then BEGIN this is a structure tagnames tag_names value for tag 0 n_tags value 1 do begin case strtrim strlowcase tagnames tag 2 of slider_min :BEGIN IF float value slider_min 0 LT minmax 1 THEN BEGIN minmax 0 value slider_min 0 widget_control sbid set_slider_min floor float value slider_min 0 valuedc float widget_info dcid combobox_gettext IF valuedc LT value slider_min THEN BEGIN widget_control sbid set_value floor float value slider_min 0 widget_control dcid set_value decvalue value slider_min widget_control dcid set_combobox_select decind value slider_min ENDIF ENDIF end slider_max :BEGIN IF float value slider_max 0 GT minmax 0 THEN BEGIN minmax 1 value slider_max 0 widget_control sbid set_slider_max ceil float value slider_max 0 valuedc float widget_info dcid combobox_gettext IF valuedc GT value slider_max THEN BEGIN widget_control sbid set_value ceil float value slider_max 0 widget_control dcid set_value decvalue value slider_max widget_control dcid set_combobox_select decind value slider_max ENDIF ENDIF end value :IF float value value 0 GE minmax 0 AND float value value 0 LE minmax 1 THEN value2 float value value 0 ELSE:ras report wrong tag name in argument value of cw_slider_pm_set_value endcase endfor ENDIF ELSE BEGIN IF float value 0 GE minmax 0 AND float value 0 LE minmax 1 THEN value2 float value 0 ENDELSE IF n_elements value2 NE 0 THEN BEGIN widget_control sbid set_value fix value2 widget_control dcid set_value decvalue value2 widget_control dcid set_combobox_select decind value2 ENDIF return end FUNCTION cw_slider_pm_get_value id compile_opt idl2 strictarrsubs sbid widget_info id find_by_uname SliderBar dcid widget_info id find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX value float widget_info dcid combobox_gettext return value:value slider_min_max:minmax end FUNCTION cw_slider_pm_event event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval sbid widget_info event handler find_by_uname SliderBar dcid widget_info event handler find_by_uname decimal minmax widget_info sbid SLIDER_MIN_MAX IF uval EQ decimal THEN value float event str ELSE value float widget_info dcid combobox_gettext out 0 defaut case case uval OF plus : if value 1 LE minmax 1 then value2 value 1 ELSE out 1 minus :if value 1 GE minmax 0 then value2 value 1 ELSE out 1 SliderBar :if event value value floor value LE minmax 1 THEN value2 event value value floor value decimal :BEGIN CASE 1 OF value GT minmax 1 : value2 minmax 1 value LT minmax 0 : value2 minmax 0 ELSE: ENDCASE END ELSE: ENDCASE IF n_elements value2 NE 0 THEN BEGIN value value2 widget_control sbid set_value floor value widget_control dcid set_value decvalue value widget_control dcid set_combobox_select decind value ENDIF return CW_SLIDER_PM ID:event handler TOP:event top HANDLER:0L VALUE:value OUT:OUT end file_comments Like WIDGET_SLIDER but here their are 2 buttons and to move the widget from 1 categories compound widget param PARENT in required The widget ID of the parent widget keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword VALUE keyword MAXIMUM keyword MINIMUM keyword STRMINLEN keyword _EXTRA Used to pass your keywords returns The returned value of this function is the widget ID of the newly created animation widget restrictions Widget Events Returned by the CW_SLIDER_PM Widget Slider widgets generate events when the mouse is used to change their value The event structure returned by the WIDGET_EVENT function is defined by the following statement: CW_SLIDER_PM ID:0L TOP:0L HANDLER:0L VALUE:0L DRAG:0 OUT:0 ID is the widget ID of the button generating the event TOP is the widget ID of the top level widget containing ID HANDLER contains the widget ID of the widget associated with the handler routine VALUE returns the new value of the slider DRAG returns integer 1 if the slider event was generated as part of a drag operation or zero if the event was generated when the user had finished positioning the slider Note that the slider widget only generates events during the drag operation if the DRAG keyword is set and if the application is running under Motif When the DRAG keyword is set the DRAG field can be used to avoid computationally expensive operations until the user releases the slider OUT:It is an integer which can take 3 values: 1 : If we press when the index is already at the max Comment: In this case the index stay at the max 1: If we press when the index is already at the min Comment: In this case the index stay at the min 0 : In other cases Keywords to WIDGET_CONTROL A number of keywords to the WIDGET_CONTROL procedure affect the behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE 1 GET_VALUE widget_control wid_id get_value resultat retourne ds la variable resultat une structure de 2 elements dont les noms sont inspires des mots cles que l on peut passer a widget_control qd on utilise WIDGET_SLIDER: VALUE:the value setting of the widget SLIDER_MIN_MAX: a 2 elements array: The minimum and the maximum value of the range encompassed by the slider 2 SET_VALUE widget_control wid_id set_value impose Allows to modify the state of the combobox like we can do it for WIDGET_COMBOBOX May impose: a un entier: donne la nouvelle position of the slider b A structure which can have for elements from 1 to 3 : VALUE: an integer which give the new position of the slider SLIDER_MIN:Set to a new minimum value for the specified slider widget SLIDER_MAX:Set to a new minimum value for the specified slider widget examples See the program provided above testwid and the associated procedure testwid_event history Sebastien Masson smasson lodyc jussieu fr 5 9 1999 version Id: cw_slider_pm pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter FUNCTION cw_slider_pm parent MAXIMUM maximum MINIMUM minimum STRMINLEN strminlen VALUE value UVALUE uvalue UNAME uname title title _extra ex compile_opt idl2 strictarrsubs IF N_PARAMS NE 1 THEN MESSAGE Incorrect number of arguments ON_ERROR 2 return to caller if n_elements minimum NE 0 then minimum floor minimum ELSE minimum 0 if n_elements maximum NE 0 then maximum ceil maximum ELSE maximum 100 if NOT keyword_set title then title cheking exclusive keywords column keyword_set column 1 keyword_set row keyword_set vertical xsize lenstr max strlen strtrim minimum maximum 1 if keyword_set strminlen then lenstr strminlen lenstr xsize 35 mlen lenstr 1 3 lenstr lt 4 xsize 35 mlen lenstr 2 dummyid widget_combobox base value decvalue minimum UVALUE decimal UNAME decimal xoffset xoff yoffset 2 xsize xsize dummyid widget_slider base MAXIMUM maximum MINIMUM minimum UVALUE SliderBar UNAME SliderBar suppress_value drag yoffset 30 xsize xoff xsize if keyword_set value then cw_slider_pm_set_value base value return base end"); 367 a[365] = new Array("./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.html", "cw_specifie.pro", "", " PRO cw_specifie_set_value id value compile_opt idl2 strictarrsubs cm_general if size value type NE 8 then return widget_control widget_info id find_by_uname min set_value strtrim value min 2 widget_control widget_info id find_by_uname max set_value strtrim value max 2 widget_control widget_info id find_by_uname int set_value strtrim value inter 2 widget_control widget_info id find_by_uname palnum set_value strtrim value lct 2 autres extractstru value min max inter lct nothing xindex yindex if size autres type EQ 8 then BEGIN autresid widget_info id find_by_uname autres widget_control widget_info id find_by_uname autres get_value autresautres autresautres autresautres 0 if strtrim autresautres 2 NE then begin autresautres createfunc get_extra autresautres filename myuniquetmpdir for_createfunc pro autres mixstru autres autresautres endif autres strkeywd autres widget_control widget_info id find_by_uname autres set_value autres endif return end FUNCTION cw_specifie_get_value id compile_opt idl2 strictarrsubs cm_general widget_control widget_info id find_by_uname min get_value min min float min 0 widget_control widget_info id find_by_uname max get_value max max float max 0 widget_control widget_info id find_by_uname int get_value int int float int 0 widget_control widget_info id find_by_uname palnum get_value palnum palnum long palnum 0 widget_control widget_info id find_by_uname autres get_value autres autres autres 0 exextra min:min max:max inter:int lct:palnum if strtrim autres 2 NE then exextra createfunc get_extra autres _extra exextra kwdlist exextra exextra exextra exextra filename myuniquetmpdir for_createfunc pro return exextra end FUNCTION cw_specifie_event event on recuper les ID des differents widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue smallin extractatt top_uvalue smallin numdessinin smallin 2 1 smallout extractatt top_uvalue smallout numdessinout smallout 2 1 case uval of default :BEGIN We find the name of the variable: vlstid widget_info event top find_by_uname varlist fieldname widget_info vlstid combobox_gettext exextra definedefaultextra fieldname widget_control widget_info event handler find_by_uname min set_value strtrim exextra min 1 widget_control widget_info event handler find_by_uname max set_value strtrim exextra max 1 widget_control widget_info event handler find_by_uname int set_value strtrim exextra inter 1 widget_control widget_info event handler find_by_uname palnum set_value strtrim exextra lct 1 widget_control widget_info event handler find_by_uname autres set_value END palcol :BEGIN ind fix strmid event value 0 strpos event value widget_control widget_info event handler find_by_uname palnum set_value strtrim ind 1 END ELSE: endcase return ID:event handler TOP:event top HANDLER:0L OK:uval EQ ok end file_comments categories param PARENT in required The widget ID of the parent widget keyword COLUMN Buttons will be arranged in the number of columns specified by this keyword keyword ROW Buttons will be arranged in the number of rows specified by this keyword keyword UVALUE The user value to be associated with the widget keyword UNAME The user name to be associated with the widget keyword FRAME keyword FORXXX keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version ID todo seb: documenter FUNCTION cw_specifie parent ROW row COLUMN column UVALUE uvalue UNAME uname FRAME frame FORXXX forxxx _extra ex cheking exclusive keywords compile_opt idl2 strictarrsubs column keyword_set column 1 keyword_set row row keyword_set row 1 keyword_set column keyword_set row EQ column if NOT keyword_set uvalue then uvalue if NOT keyword_set uname then uname base widget_base parent space 0 frame EVENT_FUNC cw_specifie_event FUNC_GET_VALUE cw_specifie_get_value PRO_SET_VALUE cw_specifie_set_value UVALUE uvalue UNAME uname _extra ex base1 base1 widget_base base rien widget_label base1 value Min xoffset 85 yoffset 15 rien widget_label base1 value Max xoffset 145 yoffset 15 rien widget_label base1 value Int xoffset 210 yoffset 15 lct get_name nomcouleur nbrligne 30 nbrlist n_elements nomcouleur nbrligne nomcouleur strtrim sindgen n_elements nomcouleur 1 nomcouleur nomcouleur 0 nomcouleur nomcouleur 1 Color nomcouleur if nbrlist GT 1 then for i 1 nbrlist do nomcouleur nomcouleur 0:nbrligne i 1 i 1 nomcouleur nbrligne i i:n_elements nomcouleur 1 rien cw_pdmenu base1 nomcouleur RETURN_NAME uvalue palcol uname palcol xoffset 250 yoffset 0 base2 base2 widget_base base column 4 keyword_set forxxx yoffset 30 if keyword_set forxxx then rien widget_button base2 value Default uvalue default frame tooltip see find definedefaultextra 0 rien widget_text base2 value editable xsize 7 uname min uvalue min rien widget_text base2 value editable xsize 7 uname max uvalue max rien widget_text base2 value editable xsize 7 uname int uvalue int if keyword_set forxxx then colvalue ELSE colvalue 39 rien widget_text base2 value colvalue editable xsize 2 uname palnum uvalue palnum widget text containig other keywords pass into top_uvalue exextra Does it remain some If yes we have to put them as string rien widget_text base value editable uname autres uvalue autres xsize 54 ysize 3 yoffset 65 wrap no_newline if keyword_set forxxx then cw_specifie_set_value base definedefaultextra rien_du_tout return base end "); 368 a[366] = new Array("./ToBeReviewed/WIDGET/findtopid.html", "findtopid.pro", "", " file_comments Find from an Id of widget the Id of the widget which is the top level base i e it has no parent categories widget param WIDGET_ID This argument should be the widget ID of the widget for which information is desired returns The Id of the widget which is the top level base history Sebastien Masson smasson lodyc jussieu fr 22 9 1999 version Id: findtopid pro 150 2006 08 09 10:12:54Z navarro FUNCTION findtopid WIDGET_ID compile_opt idl2 strictarrsubs id long WIDGET_ID exist widget_info id managed if exist EQ 0 then return 1 topid id topid2 id while topid2 NE 0 do begin topid topid2 topid2 widget_info topid2 parent endwhile return long topid end"); 369 a[367] = new Array("./ToBeReviewed/WIDGET/slec.html", "slec.pro", "", " file_comments categories param NAME param DEBUT param FIN param NOMEXP keyword PARENT in required The widget ID of the parent widget keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: slec pro 150 2006 08 09 10:12:54Z navarro todo Seb: documenter FUNCTION slec name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex include common compile_opt idl2 strictarrsubs cm_4data IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF case n_params of 1:tab nlec name PARENT parent BOXZOOM boxzoom _EXTRA ex 2:tab nlec name debut PARENT parent BOXZOOM boxzoom _EXTRA ex 3:tab nlec name debut fin PARENT parent BOXZOOM boxzoom _EXTRA ex 4:tab nlec name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex endcase return tab:tab grille:vargrid unite:varunit experience:varexp nom:varname end"); 370 a[368] = new Array("./ToBeReviewed/WIDGET/xnotice.html", "xnotice.pro", "", " file_comments Create a widget with some text at the middle of the window categories Information param TEXT in required it is a string or a vector of string If it is a scalar we look for the line separator C to create a text with several lines keyword CHKWIDGET Force to verify that they are some active widget to create a widget otherwise print at the prompt returns The identity of the created widget restrictions It do not call xmanager It do not create any event We have to delete this widget manuelly: widget_control widgetid destroy examples IDL id xnotice ca marche C ou pas IDL widget_control id destroy history Sebastien Masson smasson lodyc jussieu fr 2000 3 17 version Id: xnotice pro 150 2006 08 09 10:12:54Z navarro FUNCTION xnotice text CHKWIDGET chkwidget We separate the text in different lines separated by C if it is not done yet n est pas deja fait compile_opt idl2 strictarrsubs if n_elements text EQ 1 then text str_sep text C trim if keyword_set chkwidget then makewid widget_info managed 0 ELSE makewid 1 if makewid EQ 0 then BEGIN for i 0 n_elements text 1 do print text i noticebase 0 endif noticebase widget_base column title information align_center screensize get_screen_size widget_control noticebase tlb_set_xoffset screensize 0 2 2 tlb_set_yoffset screensize 1 2 2 nothing widget_label noticebase value for i 0 n_elements text 1 do nothing widget_label noticebase value text i nothing widget_label noticebase value widget_control noticebase realize return noticebase end"); 371 a[369] = new Array("./ToBeReviewed/WIDGET/xquestion.html", "xquestion.pro", "", " pro xquestion_event event compile_opt idl2 strictarrsubs we get the answer widget_control widget_info event top find_by_uname text get_value answer answer answer 0 now we give the answer to xquestion pro by using the pointer uvalue widget_control event top get_uvalue ptranswer ptranswer answer we destroy the widget widget_control event top destroy return end file_comments A small widget who ask a question and give an answer WARNING: For a binary question with yes no answer use DIALOG_MESSAGE categories widget param QUESTION A scalar string or a array of string If this argument is set to : an array of strings: each array element is displayed as a separate line of text a scalar string: we are looking for the separate line character C param PROPOSEDANSWER A string proposing a answer keyword CHKWIDGET Active this keyword if you whant that xquestion check if managed widget are present If not xquestion do not open a widget but print the question in the IDL window keyword _EXTRA Used to pass your keywords returns answer: a string restrictions The function does not return to its caller until the user press Enter key in the widget examples IDL help xquestion Postscript name STRING toto ps history Sebastien Masson smasson lodyc jussieu fr 13 10 1999 version Id: xquestion pro 150 2006 08 09 10:12:54Z navarro FUNCTION xquestion question proposedanswer CHKWIDGET chkwidget _extra ex compile_opt idl2 strictarrsubs is separate line a scalar we must cut it into pieces if n_elements question EQ 1 then question str_sep question C trim is a widget necessary if keyword_set chkwidget then BEGIN if widget_info managed 0 EQ 0 then BEGIN if n_elements proposedanswer EQ 0 then BEGIN proposedanswer answer complete ENDIF ELSE BEGIN answer proposedanswer complete default answer is proposedanswer ENDELSE if n_elements question GT 1 THEN for i 0 n_elements question 2 do print question i read question n_elements question 1 complete answer if keyword_set answer EQ 0 then answer proposedanswer return answer endif endif definition of the widget BaseId widget_base column title Question _extra ex screensize get_screen_size widget_control BaseId tlb_set_xoffset screensize 0 2 2 tlb_set_yoffset screensize 1 2 2 for i 0 n_elements question 1 DO trash widget_label BaseId value question i align_left if n_elements proposedanswer EQ 0 then answer ELSE answer proposedanswer trash widget_text BaseId value answer editable _extra ex uname text trash widget_button BaseId value ok ptranswer ptr_new allocate_heap widget_control BaseId set_uvalue ptranswer we realize the widget and wait for an answer widget_control BaseId realize xmanager xquestion BaseId we get the answer answer ptranswer we freeing the pointer ptr_free ptranswer return answer end"); 372 a[370] = new Array("./ToBeReviewed/WIDGET/xx.html", "xx.pro", "", " file_comments categories keyword JOUR keyword MESHFILENAME keyword LISTVAR keyword LISTGRID keyword FUNCLEC_NAME keyword CALENDAR keyword _EXTRA Used to pass your keywords uses restrictions examples history version Id: xx pro 150 2006 08 09 10:12:54Z navarro todo seb documenter PRO xx JOUR jour MESHFILENAME meshfilename LISTVAR listvar LISTGRID listgrid FUNCLEC_NAME funclec_name CALENDAR calendar _extra ex compile_opt idl2 strictarrsubs common Name of the part to be changed Name of the reading function if NOT keyword_set funclec_name then funclec_name slec varexp INF list of variables if NOT keyword_set listvar then listvar tn sn un vn taux tauy hdep20 hdep28 hdep15 hturb hpycn htoth emp qn qs smltot11 smltot12 smltot13 smltot14 smltot15 smltot16 tmltot11 tmltot12 tmltot13 tmltot14 tmltot15 tmltot16 list of grids to which variables refer to if NOT keyword_set listgrid then BEGIN listgrid replicate T n_elements listvar listgrid 2 4 U listgrid 3 5 V ENDIF calendar to be used in IDL julian days if NOT keyword_set calendar then BEGIN if keyword_set jour then calendar calendriertotem julian_day ELSE calendar calendriertotem julian_day mensuel ENDIF Name of the file refering to the mask if NOT keyword_set meshfilename then meshfilename usr1 com smasson IDL INIT inittotem pro meshparameters whichgrid meshfilename parameters specifing how the field must be read readparameters funclec_name: funclec_name jpidta: jpidta jpjdta: jpjdta jpkdta: jpkdta ixmindta: ixmindta ixmaxdta: ixmaxdta iymindta: iymindta iymaxdta: iymaxdta izmindta: izmindta izmaxdta: izmaxdta End of the part to be change fileparameters filename: many time_counter: calendar listvar: listvar listgrid: strupcase listgrid multistructure fileparameters: temporary fileparameters readparameters: temporary readparameters meshparameters: temporary meshparameters xxx multistructure temporary multistructure _extra ex return end"); 373 a[371] = new Array("./ToBeReviewed/WIDGET/xxx.html", "xxx.pro", "", " PRO xxx_event event compile_opt idl2 strictarrsubs common widget_info event top find_by_uname What is the type of evenment if event id EQ 622 then help event struct widget_control event id get_uvalue uval if tag_names event structure_name 0 EQ WIDGET_TRACKING then uval name: ActiverFenetre if keyword_set uval EQ 0 then return help event struct help uval struct case on the type of evenment widget_control event top get_uvalue top_uvalue If we activate the keyword separate at the call of xxx if size top_uvalue type EQ 3 then begin event top top_uvalue widget_control event top get_uvalue top_uvalue endif we delete the small widget created by notice pro if it exists noticebase extractatt top_uvalue noticebase if noticebase NE 0 then BEGIN widget_control noticebase destroy top_uvalue 1 findline top_uvalue noticebase 0l endif options extractatt top_uvalue options case uval name OF menubar :xxxmenubar_event event ok :nouveaudessin 1 specifie : action : calendar1 :BEGIN date2id widget_info event top find_by_uname calendar2 widget_control date2id get_value date2 if event value GT date2 then widget_control date2id set_value event value END calendar2 :BEGIN date1id widget_info event top find_by_uname calendar1 widget_control date1id get_value date1 if event value LT date1 then widget_control date1id set_value event value END domain : varlist :BEGIN currentfile extractatt top_uvalue currentfile listvar extractatt top_uvalue fileparameters currentfile listvar name listvar event index changefield event top name END txtcmd : filelist :BEGIN changefile event top event index END ActiverFenetre :BEGIN if event enter EQ 1 AND d name NE PS then BEGIN graphid widget_info event top find_by_uname graph graphid extractatt top_uvalue graphid widget_control graphid get_value win wset win widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 p extractatt top_uvalue penvs numdessinin x extractatt top_uvalue xenvs numdessinin y extractatt top_uvalue yenvs numdessinin endif END graph :BEGIN quelclick identifyclick event case quelclick type of inutile :return long :longclickaction event single :singleclickaction event double :doubleclickaction event endcase END endcase if keyword_set nouveaudessin then letsdraw event top return end file_comments A maximum of possibilities with a minimum of clics categories widget param DATAFILENAME param IDLFILE param ARGSPRO keyword SEPARATE To separate the button part and the drawing part in 2 windows Useful for small screens but be careful to do not saturate the video memory of some antiquated Tx keyword RESTORE toto dat or toto dat is a file created at the time of a precedent use of xxx thanks to the command Widget of the menu save as keyword _EXTRA Used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: xxx pro 150 2006 08 09 10:12:54Z navarro todo seb: documenter le reste des keywords PRO xxx datafilename idlfile argspro CALLERWIDID CallerWidId REDRAW redraw SEPARATE separate UVALUE uvalue RESTORE restore _EXTRA ex compile_opt idl2 strictarrsubs all_cm reinitialize the p x y z variables reinitplt we get back the uvalue of the widget that called xxx to create a new widget if keyword_set restore then BEGIN restore isafile filename restore iodir homedir _extra ex if size restore type NE 7 then restore 0 ELSE BEGIN restore isafile file restore iodir homedir _extra ex newgrid extractatt uvalue meshparameters 0 change changegrid newgrid ENDELSE endif if n_elements CallerWidId NE 0 THEN widget_control CallerWidId get_uvalue uvalue ELSE CallerWidId 0 list of files we want to look at if keyword_set uvalue then BEGIN currentfile extractatt uvalue currentfile filelist extractatt uvalue filelist fileparameters extractatt uvalue fileparameters readparameters extractatt uvalue readparameters meshparameters extractatt uvalue meshparameters ENDIF ELSE BEGIN newfile selectfile datafilename idlfile argspro _extra ex if size newfile type NE 8 then return fileparameters ptrarr 1 allocate_heap fileparameters 0 newfile fileparameters readparameters ptrarr 1 allocate_heap readparameters 0 newfile readparameters meshparameters ptrarr 1 allocate_heap meshparameters 0 newfile meshparameters currentfile 0 filelist newfile fileparameters filename ENDELSE if keyword_set uvalue THEN BEGIN smallin extractatt uvalue smallin smallout extractatt uvalue smallout ENDIF ELSE BEGIN smallin 1 1 1 smallout 1 1 1 ENDELSE nbredessin smallin 0 smallin 1 numdessinin smallin 2 1 warning flg definition must be consistent with cw_pdmenu argument see also flag definition in cw_pagelayout if keyword_set uvalue then BEGIN flag extractatt uvalue optionsflag key_portrait flag 0 numdessinin ENDIF ELSE flag key_portrait 0 0 0 0 replicate 1 nbredessin We start the widget definition widget and screen size scrsize get_screen_size 0 95 windsize givewindowsize xxxsize windsize 0 1 keyword_set separate 350 windsize 1 The top base IF xxxsize 0 LE scrsize 0 AND xxxsize 1 LE scrsize 1 THEN BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 ENDIF ELSE BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 xsize xxxsize 0 ysize xxxsize 1 x_scroll_size xxxsize 0 selectact ENDIF ELSE selectfile 0 menu options xoff xoff 110 if keyword_set uvalue then begin options extractatt uvalue options ENDIF ELSE options Portrait Landscape Overlay Vecteur Longitude x index Latitude y index desc 1 File 0 Open 0 New xxx 2 Quit 1 Save as 0 PostScript 0 Animated gif 0 Gif 0 IDL procedure 0 RESTORE kwd of xxx 2 Print to prompt 1 Flag options descsuite options if n_elements descsuite GE 2 then descsuite 0:n_elements descsuite 2 0 descsuite 0:n_elements descsuite 2 descsuite n_elements descsuite 1 2 descsuite n_elements descsuite 1 desc desc descsuite menu cw_pdmenu base desc RETURN_NAME uname menubar uvalue name: menubar xoffset xoff yoffset yoff Ok button yoff yoff 37 xoff 5 boutton OK baseok widget_button base value OK uvalue name: ok uname ok button frame xoffset xoff yoffset yoff Page Layout page layout xoff xoff 65 dummyid cw_pagelayout base smallin row frame xoffset xoff yoffset yoff List of Variables xoff xoff 140 currentlistvar fileparameters currentfile listvar vlstid widget_combobox base value currentlistvar uvalue name: varlist uname varlist xoffset xoff yoffset yoff 1 if keyword_set uvalue then BEGIN selectvar extractatt uvalue varinfo 1 numdessinin selectvar where currentlistvar EQ selectvar 0 widget_control vlstid set_combobox_select 0 selectvar ENDIF ELSE selectvar 0 List of files yoff yoff 35 flstid widget_combobox base value file_basename filelist uname filelist xsize 345 yoffset yoff uvalue name: filelist if keyword_set uvalue then BEGIN selectfile extractatt uvalue varinfo 0 numdessinin selectfile where file_basename filelist EQ selectfile 0 widget_control flstid set_combobox_select 0 selectfile ENDIF ELSE selectfile 0 Text for computation yoff yoff 32 computation done on the files if keyword_set uvalue then txtvalue extractatt uvalue txtcmd numdessinin ELSE txtvalue varexp dummyid widget_text base value txtvalue uvalue name: txtcmd uname txtcmd editable yoffset yoff xsize 54 frame Calendar yoff yoff 40 currentcalendar fileparameters currentfile time_counter key_caltype fileparameters currentfile caltype fakecal fileparameters currentfile fakecal if keyword_set uvalue then begin dates extractatt uvalue dates numdessinin date1 date2jul dates 0 date2 date2jul dates 1 ENDIF basecalid widget_base base column 2 space 0 yoffset yoff uname basecal dummyid cw_calendar basecalid currentcalendar date1 FAKECAL fakecal uname calendar1 uvalue name: calendar1 frame dummyid cw_calendar basecalid currentcalendar date2 FAKECAL fakecal uname calendar2 uvalue name: calendar2 frame Domain yoff yoff 60 vargrid strupcase fileparameters currentfile listgrid selectvar IF vargrid EQ W then zgrid W ELSE zgrid T if keyword_set uvalue then boxzoom extractatt uvalue domaines numdessinin dummyid cw_domain base uname domain uvalue name: domain unzoom frame boxzoom boxzoom yoffset yoff xoffset 15 Plots specifications yoff yoff 230 speid cw_specifie base uname specifie uvalue name: specifie frame column forxxx yoffset yoff if keyword_set uvalue then BEGIN exextra extractatt uvalue exextra numdessinin IF n_elements exextra NE 0 THEN widget_control speid set_value exextra ENDIF drawing part if keyword_set separate then basegraph widget_base title xxx window group_leader base uvalue base ELSE basegraph base graphid widget_draw basegraph uname graph button_events retain 2 uvalue name: graph press:0 click:0 x: 0 0 y: 0 0 xoffset 350 1 keyword_set separate xsize windsize 0 ysize windsize 1 tooltip toto realize the widget widget_control base realize if keyword_set separate then begin widget_control basegraph realize xmanager xxx basegraph no_block endif if keyword_set uvalue then BEGIN We recopy the pointer uvalue in top_uvalue Beware we have to redefine completely top_value from variables pointed by uvalue Otherwise if we simply do top_value uvalue when we delete by uvalue and variables on which it point we also delete variables on which point top_value case 1 of keyword_set redraw :BEGIN top_uvalue uvalue widget_control base set_uvalue top_uvalue we find homedir homedir isadirectory io homedir title Bad definition of homedir We recuperae the list of instructions globalcommand extractatt top_uvalue globalcommand We complete by first and last lines of the program createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape noerase END keyword_set restore :begin top_uvalue uvalue widget_control base set_uvalue top_uvalue widget_control graphid get_value win wshow win wset win tv image true widgets s state updatewidget base END ELSE:BEGIN top_uvalue ptrarr 2 29 allocate_heap FOR i 0 28 do top_uvalue 0 i uvalue 0 i FOR i 0 14 do top_uvalue 1 i uvalue 1 i FOR i 18 27 do top_uvalue 1 i uvalue 1 i numfile n_elements extractatt uvalue filelist top_uvalue 1 15 ptrarr numfile allocate_heap top_uvalue 1 16 ptrarr numfile allocate_heap top_uvalue 1 17 ptrarr numfile allocate_heap for i 0 numfile 1 do begin top_uvalue 1 15 i uvalue 1 15 i top_uvalue 1 16 i uvalue 1 16 i top_uvalue 1 17 i uvalue 1 17 i endfor top_uvalue 1 28 ptrarr nbredessin allocate_heap for i 0 nbredessin 1 do top_uvalue 1 28 i uvalue 1 28 i widget_control base set_uvalue top_uvalue Copy the screen of the widget of uvalue in top_value s one if keyword_set CallerWidId then begin widget_control extractatt uvalue graphid get_value win wshow win wset win image tvrd true widget_control graphid get_value win wshow win wset win tv image true ENDIF END endcase top_uvalue 1 findline top_uvalue graphid graphid ENDIF ELSE BEGIN Otherwise we will define all elements we will hook at the widget thanks to the top_value which is a pointer array with 2 columns: names and variables We initialize all these elements Variables concerning the widget in its generality if NOT keyword_set ex then ex nothing:0 variables se rapportant aux differents fichiers que l on peut lire variables specifiques a chaque dessin creation of the pointer we will hook at the widget top_uvalue ptrarr 2 29 allocate_heap variables refering to the widget top_uvalue 0 0 options top_uvalue 1 0 options top_uvalue 0 1 smallin top_uvalue 1 1 smallin top_uvalue 0 2 smallout top_uvalue 1 2 smallout top_uvalue 0 3 graphid top_uvalue 1 3 graphid top_uvalue 0 4 alreadyvector top_uvalue 1 4 1 top_uvalue 0 5 alreadyover top_uvalue 1 5 1 top_uvalue 0 6 alreadyread top_uvalue 1 6 1 top_uvalue 0 7 currentreadcmd top_uvalue 1 7 top_uvalue 0 8 globalcommand top_uvalue 1 8 top_uvalue 0 9 globaloldcommand top_uvalue 1 9 top_uvalue 0 10 no more used top_uvalue 1 10 9999 top_uvalue 0 11 noticebase top_uvalue 1 11 0l top_uvalue 0 12 extra top_uvalue 1 12 ex variables refering to different files we can read top_uvalue 0 13 currentfile top_uvalue 1 13 currentfile top_uvalue 0 14 filelist top_uvalue 1 14 filelist top_uvalue 0 15 fileparameters top_uvalue 1 15 fileparameters top_uvalue 0 16 readparameters top_uvalue 1 16 readparameters top_uvalue 0 17 meshparameters top_uvalue 1 17 meshparameters variables refering to different drawing we can do top_uvalue 0 18 penvs top_uvalue 1 18 replicate p nbredessin top_uvalue 0 19 xenvs top_uvalue 1 19 replicate x nbredessin top_uvalue 0 20 yenvs top_uvalue 1 20 replicate y nbredessin top_uvalue 0 21 nameprocedures top_uvalue 1 21 strarr nbredessin top_uvalue 0 22 types top_uvalue 1 22 strarr nbredessin top_uvalue 0 23 varinfo top_uvalue 1 23 strarr 2 nbredessin top_uvalue 0 24 domaines top_uvalue 1 24 fltarr 6 nbredessin top_uvalue 0 25 dates top_uvalue 1 25 lonarr 2 nbredessin top_uvalue 0 26 txtcmd top_uvalue 1 26 strarr nbredessin top_uvalue 0 27 optionsflag top_uvalue 1 27 flag top_uvalue 0 28 exextra top_uvalue 1 28 ptrarr nbredessin allocate_heap widget_control base set_uvalue top_uvalue createhistory base smallin ENDELSE xmanager xxx base no_block return end"); 374 374 a[372] = new Array("./Utilities/createfunc.html", "createfunc.pro", "", " file_comments write an IDL function compile it and execute it useful to avoid the use of execute param command in required a scalar string defining the result to be given back by the function see examples keyword FILENAMEIN in default for_createfunc pro name of the function to be created keyword KWDLIST in a vector string to specify a list of keywords that must be included in the function definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword _EXTRA used to pass your keywords to the created function restrictions arguments can be given only through keywords ends the function name with pro if needed examples IDL print createfunc 3 2 filename test IDL print createfunc 3 two filename test IDL kwdlist two two two 2 history Sebastien Masson smasson lodyc jussieu fr May 2005 version Id: createfunc pro 136 2006 07 10 15:20:19Z pinsard FUNCTION createfunc command FILENAMEIN filenamein KWDLIST kwdlist _EXTRA ex compile_opt idl2 hidden strictarrsubs IF n_elements command NE 1 THEN stop define filename if needed if NOT keyword_set filenamein then filename for_createfunc pro ELSE filename filenamein get the name of the function not the name of the file containing the function shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return 1 filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _EXTRA ex IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist putfile filename function shortfilename kwdlist compile_opt idl2 hidden strictarrsubs res command return res end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename is_function cd old_dir execute it res call_function shortfilename _EXTRA ex return res end"); 375 375 a[373] = new Array("./Utilities/createpro.html", "createpro.pro", "", " file_comments write an idl procedure compile it and execute it param command in required a string array defining the procedure to be created each element will be a line of the created procedure keyword FILENAMEIN in default for_createpro pro name of the procedure to be created keyword KWDLIST in a vector string to specify a list of keywords that must be included in the procedure definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword KWDUSED obsolete please pass directly your keywords through _EXTRA keyword _EXTRA used to pass your keywords to the created procedure restrictions is not working with functions use createfunc instead arguments can be given only through keywords ends the procedure name with pro if needed examples IDL createpro print OK filename test IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok ok history Sebastien Masson smasson lodyc jussieu fr cleaning new keywords: October 2005 Feb 2006: supress keyword kwdused and use call_procedure instead of execute version Id: createpro pro 136 2006 07 10 15:20:19Z pinsard PRO createpro command FILENAMEIN filenamein KWDLIST kwdlist KWDUSED kwdused _EXTRA ex compile_opt idl2 hidden strictarrsubs IF keyword_set kwdused THEN BEGIN dummy report keyword KWDUSED has been suppressed please pass directly your keywords through _extra see examples in createpro header return ENDIF define filename if needed if NOT keyword_set filenamein then filename for_createpro pro ELSE filename filenamein get the name of the procedure not the name of the file containing the procedure shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _extra ex kwdlist strtrim kwdlist 2 IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist for i 0 n_elements command 1 do print command i putfile filename pro shortfilename kwdlist compile_opt idl2 hidden strictarrsubs command return end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename cd old_dir execute it call_procedure shortfilename _extra ex return end"); … … 390 390 a[388] = new Array("./Utilities/undefine.html", "undefine.pro", "", " file_comments erase a variable same thing that delvar but usable in a program and usable for one variable simultaneously categories utilities param varname in required The name of the variable we want erase examples IDL a 1 IDL undefine a Compiled module: UNDEFINE IDL help a A UNDEFINED history trouve sur la page web de D Fanning http: www dfanning com : QUESTION: How do I make an IDL variable have a type undefined ANSWER: At the main IDL level you can use the IDL procedure DELVAR to delete an IDL variable and make it undefined Inside of procedures and functions I use this little program named UNDEFINE that I got from Andrew Cool at the DSTO High Frequency Radar Division in Adelaide Australia version Id: undefine pro 136 2006 07 10 15:20:19Z pinsard PRO UNDEFINE varname compile_opt idl2 strictarrsubs tempvar SIZE TEMPORARY varname END "); 391 391 a[389] = new Array("./Utilities/xfile.html", "xfile.pro", "", " file_comments display in a widget an ASCII file It is the same thing that xdisplayfile but here we use it to display the content of a procedure or of a function even if it is not in the current directory thanks to the path categories utilities param filename in required It is the name of the procedure or of the function we want to display with or without pro at the end keyword _extra used to pass your keywords examples xfile plt history Sebastien Masson smasson lodyc jussieu fr 7 1 99 6 7 1999: compatibility mac and windows version Id: xfile pro 136 2006 07 10 15:20:19Z pinsard PRO xfile filename _extra ex compile_opt idl2 strictarrsubs pfile strlowcase filename we have to find the full name if strpos pfile pro lt 0 then pfile pfile pro thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :BEGIN sep : pathsep end WIN :BEGIN sep pathsep end ELSE: BEGIN sep pathsep : end ENDCASE cd current current if strpos pfile sep lt 0 then BEGIN if rstrpos current sep NE strlen current 1 then current current sep multipath str_sep path pathsep if rstrpos multipath 0 sep NE strlen multipath 0 1 then multipath multipath sep pfile current multipath pfile ENDIF i 0 repeat begin res findfile pfile i i i 1 endrep until res 0 NE OR i EQ n_elements pfile if res 0 NE then BEGIN we open the file in a widget xdisplayfile pfile i 1 _extra ex ENDIF ELSE ras report le fichier demande n existe pas return end"); 392 a[390] = new Array("./Utilities/xhelp.html", "xhelp.pro", "", " file_comments Display an IDL procedure header using widgets and the widget manager categories Widgets param Filename in required A scalar string that contains the filename of the file to display If FILENAME does not include a complete path specification xhelp will search for the file in the current working directory and then each of the directories listed in PATH environment variable The pro file suffix will be appended if it is not supplied keyword _extra used to pass your keywords restrictions Triggers the XMANAGER if it is not already in use examples Open a file and create a widget to display its contents history Written By Steve Richards December 1990 Graceful error recovery DMS Feb 1992 Modified to extract pro documentation headers PJR ESRG mar94 Paul Ricchiazzi jun93 Institute for Computational Earth System Science University of California Santa Barbara 7 1 99 : legeres mofification par Sebastien Masson : utilisation de xdisplayfile de findfile et de _extra 6 7 1999: compatibility mac and windows version Id: xhelp pro 1 36 2006 07 10 15:20:19Z pinsard PRO xhelp filename _extra ex compile_opt idl2 strictarrsubs Are we sure filename is a string cquoidonc size filename type if cquoidonc NE 7 then begin ras report Input parameter must be a string and not a size filename tname return endif We have to find the full name pfile FILENAME if strpos pfile pro lt 0 then pfile pfile pro thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :BEGIN sep : pathsep end WIN :BEGIN sep pathsep end ELSE: BEGIN sep pathsep : end ENDCASE cd current current if strpos pfile sep lt 0 then BEGIN if rstrpos current sep NE strlen current 1 then current current sep multipath str_sep path pathsep if rstrpos multipath 0 sep NE strlen multipath 0 1 then multipath multipath sep pfile current multipath pfile ENDIF We test each possible name to find where the file is nfile n_elements pfile n 0 repeat begin res findfile pfile n n n 1 endrep until res 0 NE OR n EQ n_elements pfile if res 0 NE then BEGIN openr unit pfile n 1 get_lun opening of the file we select the heading piece a strarr 1000 Maximum of lines xsize 0 i 0 c readon 0 while not eof unit do begin readf unit c if strpos c eq 0 then readon 0 if readon then begindum where byte c eq 9b ntab count tab characters xsize xsize strlen c 8 ntab a i strmid c 1 200 i i 1 endif if strpos c eq 0 then readon 1 endwhile if i EQ 0 then ras report le programme a etait mal ecrit il n y a pas d en tete utiliser xfile pro ELSE BEGIN a a 0:i 1 we wrote the a s content in a widget xdisplayfile toto text a title pfile n 1 _extra ex ENDELSE FREE_LUN unit free the file unit ENDIF ELSE ras report le fichier demande n existe pas return end ");392 a[390] = new Array("./Utilities/xhelp.html", "xhelp.pro", "", " file_comments Display an IDL procedure header using widgets and the widget manager categories Widgets param Filename in required A scalar string that contains the filename of the file to display If FILENAME does not include a complete path specification xhelp will search for the file in the current working directory and then each of the directories listed in PATH environment variable The pro file suffix will be appended if it is not supplied keyword _extra used to pass your keywords restrictions Triggers the XMANAGER if it is not already in use examples Open a file and create a widget to display its contents history Written By Steve Richards December 1990 Graceful error recovery DMS Feb 1992 Modified to extract pro documentation headers PJR ESRG mar94 Paul Ricchiazzi jun93 Institute for Computational Earth System Science University of California Santa Barbara 7 1 99 : legeres mofification par Sebastien Masson : utilisation de xdisplayfile de findfile et de _extra 6 7 1999: compatibility mac and windows version Id: xhelp pro 141 2006 07 21 09:17:25Z theetten PRO xhelp filename _extra ex compile_opt idl2 strictarrsubs Are we sure filename is a string cquoidonc size filename type if cquoidonc NE 7 then begin ras report Input parameter must be a string and not a size filename tname return endif We have to find the full name pfile FILENAME if strpos pfile pro lt 0 then pfile pfile pro thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :BEGIN sep : pathsep end WIN :BEGIN sep pathsep end ELSE: BEGIN sep pathsep : end ENDCASE cd current current if strpos pfile sep lt 0 then BEGIN if rstrpos current sep NE strlen current 1 then current current sep multipath str_sep path pathsep if rstrpos multipath 0 sep NE strlen multipath 0 1 then multipath multipath sep pfile current multipath pfile ENDIF We test each possible name to find where the file is nfile n_elements pfile n 0 repeat begin res findfile pfile n n n 1 endrep until res 0 NE OR n EQ n_elements pfile if res 0 NE then BEGIN openr unit pfile n 1 get_lun opening of the file we select the heading piece a strarr 1000 Maximum of lines xsize 0 i 0 c readon 0 while not eof unit do begin readf unit c if strpos c eq 0 then readon 0 if readon then BEGIN dum where byte c eq 9b ntab count tab characters xsize xsize strlen c 8 ntab a i strmid c 1 200 i i 1 endif if strpos c eq 0 then readon 1 endwhile if i EQ 0 then ras report le programme a etait mal ecrit il n y a pas d en tete utiliser xfile pro ELSE BEGIN a a 0:i 1 we wrote the a s content in a widget xdisplayfile toto text a title pfile n 1 _extra ex ENDELSE FREE_LUN unit free the file unit ENDIF ELSE ras report le fichier demande n existe pas return end "); 393 393 a[391] = new Array("./buildinit.html", "buildinit.pro", "", " NAME: PURPOSE: CATEGORY: CALLING SEQUENCE: INPUTS: OPTIONAL INPUTS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUTS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: EXAMPLE: MODIFICATION HISTORY: slightly mofified version of cw_field FUNCTION CW_FIELD2 Parent COLUMN Column ROW Row EVENT_FUNC efun FLOATING Float INTEGER Int LONG Long STRING String FONT LabelFont FRAME Frame TITLE Title UVALUE UValue VALUE TextValueIn RETURN_EVENTS ReturnEvents ALL_EVENTS AllUpdates FIELDFONT FieldFont NOEDIT NoEdit TEXT_FRAME Text_Frame XSIZE XSize YSIZE YSize UNAME uname FLOOR vmin CEILING vmax compile_opt idl2 strictarrsubs resolve_routine cw_field compile_full_file is_function Examine our keyword list and set default values for keywords that are not explicitly set Column KEYWORD_SET Column Row 1 Column AllEvents 1 KEYWORD_SET NoEdit Enum Update None All CRonly Update 0 IF KEYWORD_SET AllUpdates THEN Update 1 IF KEYWORD_SET ReturnEvents THEN Update 2 IF N_ELEMENTS efun LE 0 THEN efun IF N_ELEMENTS Title EQ 0 THEN Title Input Field: TextValue N_ELEMENTS TextValueIn gt 0 TextValueIn : Convert non string values to strings if SIZE TextValue TNAME ne STRING then TextValue STRTRIM TextValue 2 IF N_ELEMENTS YSize EQ 0 THEN YSize 1 IF N_ELEMENTS uname EQ 0 THEN uname CW_FIELD_UNAME Type 0 string is default IF KEYWORD_SET Float THEN Type 1 IF KEYWORD_SET Int THEN Type 2 IF KEYWORD_SET Long THEN Type 3 Don t allow multiline non string widgets if Type ne 0 then YSize 1 YSize YSize 1 Build Widget Base WIDGET_BASE Parent ROW Row COLUMN Column UVALUE UValue EVENT_FUNC CW_FIELD_EVENT PRO_SET_VALUE CW_FIELD_SET FUNC_GET_VALUE CW_FIELD_GET FRAME Frame UNAME uname FOR i 0 n_elements title 1 DO Label WIDGET_LABEL Base VALUE Title i FONT LabelFont UNAME uname _LABEL align_left Text WIDGET_TEXT Base VALUE TextValue XSIZE XSize YSIZE YSize FONT FieldFont ALL_EVENTS AllEvents EDITABLE AllEvents AND TYPE EQ 0 FRAME Text_Frame UNAME uname _TEXT NO_ECHO AllEvents AND TYPE NE 0 Save our internal state in the first child widget State efun: efun TextId:Text Title:Title Update:Update Type:Type WIDGET_CONTROL WIDGET_INFO Base CHILD SET_UVALUE State NO_COPY RETURN Base END PRO printerdef_event event get back the ids of the cw_field widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue cwids IF size cwids n_dimensions EQ 1 THEN cwids reform cwids 3 1 help cwids dims size cwids dimensions help dims print dims results strarr dims FOR i 0 dims 1 1 DO BEGIN widget_control cwids 0 i get_value res results 0 i res widget_control cwids 1 i get_value res results 1 i res widget_control cwids 2 i get_value res results 2 i res ENDFOR nothing where results EQ count IF count NE 0 THEN BEGIN nothing dialog_message Some of the text box are still empty dialog_parent event top information return ENDIF now we give the result to buildinit pro by using the pointer uvalue widget_control event top get_uvalue ptresult ptresult temporary results we destroy the widget widget_control event top destroy RETURN END PRO papsize_event event get back the ids of the cw_field widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue uvalue IF uvalue 0 NE ok THEN return idist widget_info event top find_by_uname list id widget_info idist list_select widget_control idist get_uvalue selected selected selected id selected strsplit selected extract now we give the result to buildinit pro by using the pointer uvalue widget_control event top get_uvalue ptresult ptresult float selected 3 float selected 4 we destroy the widget widget_control event top destroy RETURN END PRO xask_event event now we give the answer to buildinit pro by using the pointer uvalue compile_opt idl2 strictarrsubs widget_control event top get_uvalue ptranswer ptranswer event value we destroy the widget widget_control event top destroy RETURN END FUNCTION xask _extra ex compile_opt idl2 strictarrsubs base widget_base field cw_field2 base frame return_events column _extra ex ptranswer ptr_new allocate_heap we realize the widget and wait for an answer widget_control base realize set_uvalue ptranswer xmanager xask base we get the answer answer ptranswer we freeing the pointer ptr_free ptranswer RETURN answer END FUNCTION getdir title title nomark nomark nowrite nowrite compile_opt idl2 strictarrsubs REPEAT BEGIN dir dialog_pickfile directory must_exist title title make sure dir is ok check read write access and directory separator mark dir file_search dir test_directory test_read test_write 1 keyword_set nowrite mark_directory 1 keyword_set nomark dir dir 0 ENDREP UNTIL dir NE RETURN dir END PRO buildinit compile_opt idl2 strictarrsubs IF fix strmid version release 0 1 LT 6 THEN BEGIN print print ERROR print print This version of SAXO needs at least IDL version 6 0 print print ERROR print return ENDIF IF lmgr demo EQ 1 THEN BEGIN print impossible to use buildinit in demo mode return ENDIF init This is the initialisation file it defines the path and the defaut values of some of the common variables this is supposed to speed up IDL a fltarr 1000 1000 100 a 0 path definition define myIDL directory myIDL getdir title Select the home directory my IDL nomark define SAXO directory saxodir getdir title Select SAXO directory nomark nowrite define the path init init path expand_path myIDL : expand_path saxodir : expand_path dir should we keep the compatibility with the old version yes dialog_message shall we keep the compatibility with the old version question default_no yes strlowcase yes init init compatibility with the old version keep_compatibility strtrim fix yes EQ yes 2 define all the commons init init define all the commons all_cm define default directories init init define default directories homedir isadirectory myIDL title Select the default HOME directory iodir getdir title Select the default IO directory init init iodir isadirectory iodir title Select the default IO directory psdir getdir title Select the default postscripts directory init init psdir isadirectory psdir title Select the default postscripts directory imagedir getdir title Select the default images directory init init imagedir isadirectory imagedir title Select the default images directory animdir getdir title Select the default animations directory init init animdir isadirectory animdir title Select the default animations directory number of printer ptnumb xask title Number of accessible printers value 0 long define all the printer parameters init init define printer parameters IF ptnumb NE 0 THEN BEGIN base widget_base column frame cwids lonarr 3 ptnumb FOR i 0 ptnumb 1 DO BEGIN subbase widget_base base row cwids 0 i cw_field subbase string Title printer_human_names strtrim i 2 cwids 1 i cw_field subbase string Title printer_machine_names strtrim i 2 cwids 2 i cw_field subbase string value lpr P Title print_command strtrim i 2 ENDFOR trash widget_button base value ok uvalue cwids ptresult ptr_new allocate_heap we realize the widget and wait for an answer widget_control base realize set_uvalue ptresult xmanager printerdef base init init printer_human_names strarr strtrim ptnumb 2 printer_machine_names strarr strtrim ptnumb 2 print_command strarr strtrim ptnumb 2 FOR i 0 ptnumb 1 DO BEGIN init init printer_human_names strtrim i 2 ptresult 0 i printer_machine_names strtrim i 2 ptresult 1 i print_command strtrim i 2 ptresult 2 i ENDFOR we freeing the pointer ptr_free ptresult ENDIF ELSE BEGIN init init printer_human_names printer_machine_names print_command ENDELSE Colors init init colors device decomposed 0 device retain 2 default color tables loadct get_names names ntables 40 title Choose the default color table the following lines come from loadct procedure nlines ntables 2 3 of lines to print nend nlines nlines 3 ntables for i 0 nend 1 do Print each line title title string format i2 a17 3x i2 a17 3x i2 a17 i names i i nlines names i nlines i 2 nlines xask title title value 39 long xask title title value 0 long 2 init init archive_ps strtrim archive_ps 2 end of the part that should be modified by the users if needed keep compatibility with the old version updateold filename xask title name of the init file written in homedir: myIDL value init pro string journal myIDL filename FOR i 0 n_elements init 1 DO journal init i journal RETURN END"); 394 394
Note: See TracChangeset
for help on using the changeset viewer.