Changeset 93 for trunk/SRC/Documentation/idldoc_html_output/search.js
- Timestamp:
- 06/07/06 19:12:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/search.js
r91 r93 1 1 a = new Array(); 2 2 3 a[1] = new Array("./Calendar/date2jul.html", "date2jul.pro", "", " NAME: date2jul PURPOSE: gives julian day equivalent of a date in yyyymmdd format CATEGORY: calendar CALLING SEQUENCE: jday juldate 19930124 INPUTS: date in yyyymmdd format KEYWORD PARAMETERS: GRADS: if 1 year 2000 year if 50 year 1900 year OUTPUTS:date en jour julien COMMON BLOCKS: none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print date2jul 19931205 EQ julday 12 5 1993 1 IDL print date2jul 931205 grads EQ julday 12 5 1993 1 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2005 function date2jul date GRADS grads 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 ");4 a[2] = new Array("./Calendar/date2string.html", "date2string.pro", "", " NAME: date2string PURPOSE: create a nice and readable format to print a date CATEGORY: calendar string CALLING SEQUENCE: nice_date date2string yyyymmdd INPUTS: yyyymmdd the date in the format yearyearyearyearmonthmonthdayday KEYWORD PARAMETERS:those of string fonction to specify the format of the month the C format OUTPUTS: a string containing the date in a easy readable format COMMON BLOCKS:none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print date2string 19900123 Jan 23 1990 IDL print date2string 19900123 format C CMOA JAN 23 1990 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr Creation update review June 2005 Sebastien Masson FUNCTION date2string yyyymmdd _EXTRA ex 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");5 a[3] = new Array("./Calendar/daysinmonth.html", "daysinmonth.pro", "", " NAME:daysinmonth PURPOSE:give the nomber of days in a specefic month CATEGORY: calandar CALLING SEQUENCE: ndays daysinmonth month year INPUTS optionnal : month and year Year is used only if the common variable key_caltype greg In that case month and year must have the same number of elements if not provided we take month and year from time common variable KEYWORD PARAMETERS: OUTPUTS: COMMON BLOCKS: cm_4cal SIDE EFFECTS: return 1 in case of error RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 2 7 98 update review english new commons: June 2005 Sebastien Masson function daysinmonth month year include commons 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/jul2date.html", "jul2date.pro", "", " NAME: jul2date PURPOSE: gives yyyymmdd date equivalent of a julian day CATEGORY: calendar CALLING SEQUENCE: date jul2date jday INPUTS:jday: julian day KEYWORD PARAMETERS: None OUTPUTS: date in yyyymmdd format COMMON BLOCKS: None SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print jul2date julday 12 23 1999 19991223 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2005 function jul2date jday 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");7 a[5] = new Array("./Calendar/leapyr.html", "leapyr.pro", "", " function leapyr year NAME: leapyr PURPOSE: determine whether the input year is a leap year or not Very useful for finding number of days in a year eg NUM_DAYS_IN_YR 365 leapyr year CATEGORY: Utility CALLING SEQUENCE: result leapyr year INPUTS: year test if year is a leap year OUTPUTS: result 0 then not a leap year 1 then year is a leap year COMMON BLOCKS: cm_4cal SIDE EFFECTS: none MODIFICATION HISTORY: Originally Written by: Trevor Harris Physics Dept University of Adelaide 20 09 88 November 2004: correction for century years S Masson Every year divisible by 4 is a leap year But every year divisible by 100 is NOT a leap year Unless the year is also divisible by 400 then it is still a leap year This means that year 1800 1900 2100 2200 2300 and 2500 are NOT leap years while year 2000 and 2400 are leap years supress the automatic change 89 1989 June 2005 update for new commons Sebastien Masson include commons cm_4calyr long year IF n_elements key_caltype EQ 0 THEN key_caltype greg IF key_caltype NE greg THEN BEGIN sd size yr dimensions IF sd 0 EQ 0 THEN return 0b ELSE return bytarr size yr dimensions ENDIF ELSE return yr MOD 4 EQ 0 yr MOD 100 NE 0 yr MOD 400 EQ 0 end");8 a[6] = new Array("./Calendar/monthname.html", "monthname.pro", "", " NAME:monthname PURPOSE:gives the name of a month CATEGORY: CALLING SEQUENCE:name monthname number INPUTS: number the month number from 1 to 12 KEYWORD PARAMETERS:those of string fonction to specify the format of the month the C format OUTPUTS: an integer the month s name COMMON BLOCKS:None SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 1 October 2001 FUNCTION monthname mm1 _extra ex return string format C CMoA0 31 mm1 1 _extra ex end");3 a[1] = new Array("./Calendar/date2jul.html", "date2jul.pro", "", " gives julian day equivalent of a date in yyyymmdd format categories calendar param date in required date in yyyymmdd format keyword GRADS in optional 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 function date2jul date GRADS grads 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 "); 4 a[2] = new Array("./Calendar/date2string.html", "date2string.pro", "", " create a nice and readable format to print a date categories calendar string param yyyymmdd in required the date in the format yyyymmdd file_comments keyword parameters of string function to specify the format of the month the C format can be used returns a string containing the date in a easy readable format 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 FUNCTION date2string yyyymmdd _EXTRA ex 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"); 5 a[3] = new Array("./Calendar/daysinmonth.html", "daysinmonth.pro", "", " give the number of days in a specific month categories calendar param month in optional param year in optional Year is used only if the common variable key_caltype greg In that case month and year must have the same number of elements If not provided we take month and year from time common variable returns number of days in a month or 1 in case of error uses cm_4cal 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 function daysinmonth month year include commons 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/jul2date.html", "jul2date.pro", "", " 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 function jul2date jday 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"); 7 a[5] = new Array("./Calendar/leapyr.html", "leapyr.pro", "", " determine whether the input year is a leap year or not Very useful for finding number of days in a year eg NUM_DAYS_IN_YR 365 leapyr year categories calendar param year in required year to be tested as a leap year returns 0 then not a leap year 1 then year is a leap year uses cm_4cal examples IDL result leapyr 2000 history Originally Written by: Trevor Harris Physics Dept University of Adelaide 20 09 88 November 2004: correction for century years S Masson Every year divisible by 4 is a leap year But every year divisible by 100 is NOT a leap year Unless the year is also divisible by 400 then it is still a leap year This means that year 1800 1900 2100 2200 2300 and 2500 are NOT leap years while year 2000 and 2400 are leap years supress the automatic change 89 1989 June 2005 update for new commons Sebastien Masson function leapyr year include commons cm_4cal yr long year IF n_elements key_caltype EQ 0 THEN key_caltype greg IF key_caltype NE greg THEN BEGIN sd size yr dimensions IF sd 0 EQ 0 THEN return 0b ELSE return bytarr size yr dimensions ENDIF ELSE return yr MOD 4 EQ 0 yr MOD 100 NE 0 yr MOD 400 EQ 0 end"); 8 a[6] = new Array("./Calendar/monthname.html", "monthname.pro", "", " gives the name of a month categories calendar param number in required the month number from 1 to 12 file_comments keyword parameters of string function to specify the format of the month the C format can be used returns the month s name examples IDL name monthname 2 history Sebastien Masson smasson lodyc jussieu fr 1 October 2001 FUNCTION monthname mm1 _extra ex return string format C CMoA0 31 mm1 1 _extra ex end"); 9 9 a[7] = new Array("./Commons/all_cm.html", "all_cm.pro", "", ""); 10 10 a[8] = new Array("./Commons/cm_4cal.html", "cm_4cal.pro", "", ""); … … 14 14 a[12] = new Array("./Commons/cm_demomode.html", "cm_demomode.pro", "", ""); 15 15 a[13] = new Array("./Commons/cm_general.html", "cm_general.pro", "", ""); 16 a[14] = new Array("./Documentation/xmldoc/idldoc_html_ 6832.html", "idldoc_html_6832.pro", "", "");16 a[14] = new Array("./Documentation/xmldoc/idldoc_html_16774.html", "idldoc_html_16774.pro", "", ""); 17 17 a[15] = new Array("./Documentation/xmldoc/idlfiles/init_example.html", "init_example.pro", "", ""); 18 18 a[16] = new Array("./ForOldVersion/keep_compatibility.html", "keep_compatibility.pro", "", " NAME: keep_compatibility PURPOSE: 1 define key_forgetold 1b keyword_set flag 2 remove all oldcm_used pro found in path 3 define and create myuniquetmpdir and add it to path 4 copy oldcm_full _empty to myuniquetmpdir oldcm_used pro CATEGORY: compatibility with old version CALLING SEQUENCE:keep_compatibility flag INPUTS: flag: 1 or 0 to keep or forget the compatibility dir: the directory where we create oldcm_used pro if omitted is automatically defined to 1b keyword_set key_forgetold COMMON BLOCKS: cm_general SIDE EFFECTS: see purpose RESTRICTIONS: copy oldcm_full or oldcm_empty must be found in the path dir must aslo be in the path MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2005 PRO keep_compatibility flag cm_general version should be at least 6 0 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 n_elements myuniquetmpdir NE 0 THEN BEGIN path path : expand_path myuniquetmpdir return ENDIF if n_elements flag eq 0 then flag 1b keyword_set key_forgetold 1 automatic definition of key_forgetold key_forgetold 1b keyword_set flag 2 remove all oldcm_used pro found in path to_rm find oldcm_used IF to_rm 0 NE NOT FOUND THEN file_delete to_rm 3 define and create myuniquetmpdir and add it to path def_myuniquetmpdir 4 copy oldcm_full _empty to myuniquetmpdir oldcm_used pro select which file should be copied to oldcm_used pro IF key_forgetold THEN BEGIN oldcm find oldcm_empty print We forget the compatibility with the old version ENDIF ELSE BEGIN oldcm find oldcm_full print We keep the compatibility with the old version ENDELSE oldcm oldcm 0 IF oldcm EQ NOT FOUND THEN BEGIN print Error: oldcm_full or oldcm_empty must be found in the path stop ENDIF copy file_copy oldcm myuniquetmpdir oldcm_used pro overwrite make sure we can make the plots enev if we are using the demo mode demomode_compatibility make sure that the common variables are correctly initialized IF size ccmeshparameters type NE 8 THEN BEGIN computegrid 1 1 1 1 1 1 fullcgrid cm_4data varname vargrid T vardate 0 varexp varunit valmask 1 e20 ENDIF return END"); … … 383 383 a[381] = 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 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 changer 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"); 384 384 a[382] = 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 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 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 faire 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"); 385 a[383] = new Array("./Utilities/createfunc.html", "createfunc.pro", "", " NAME:createfunc PURPOSE: write an idl function compile it and execute it usefull to avoid the use of execute CATEGORY: CALLING SEQUENCE:res createfunc command INPUTS: command: a scalar string defining the result to be byven back by the function see examples KEYWORD PARAMETERS: FILENAMEIN: name of the funccedure to be created for_createfunc pro by default KWDLIST: 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 _EXTRA: used to pass your keywords to the created function OUTPUTS: none COMMON BLOCKS: none SIDE EFFECTS: ends the function name with pro if needed RESTRICTIONS:arguments can be given only through keywords EXAMPLE: IDL print createfunc 3 2 filename test IDL print createfunc 3 two filename test kwdlist two two two 2 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr May 2005 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");386 a[384] = new Array("./Utilities/createpro.html", "createpro.pro", "", " NAME:createpro PURPOSE: write an idl procedure compile it and execute it CATEGORY: CALLING SEQUENCE:createpro command INPUTS: command: a string array defining the procedure to be created each element will be a line of the created procedure KEYWORD PARAMETERS: FILENAMEIN: name of the procedure to be created for_createpro pro by default KWDLIST: 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 _EXTRA: used to pass your keywords to the created procedure OUTPUTS: none COMMON BLOCKS: none SIDE EFFECTS: ends the procedure name with pro if needed RESTRICTIONS:is not working with functions use createfunc instead arguments can be given only through keywords EXAMPLE: 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 MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr cleaning new keywords: October 2005 Feb 2006: supress keyword kwdused and use call_procedure instead of execute 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 exaemples 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");387 a[385] = new Array("./Utilities/def_myuniquetmpdir.html", "def_myuniquetmpdir.pro", "", " NAME: def_myuniquetmpdir PURPOSE: if needed define and create myuniquetmpdir common variable from cm_general and add it to path CATEGORY: utilities CALLING SEQUENCE:def_myuniquetmpdir COMMON BLOCKS: cm_general SIDE EFFECTS: see purpose MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2005 PRO def_myuniquetmpdir cm_general IF n_elements myuniquetmpdir EQ 0 THEN BEGIN define a new and unique directory in getenv IDL_TMPDIR by using systime 1 look for the login if we use unix system IF d name EQ X THEN spawn whoami login noshell ELSE login idl myuniquetmpdir file_search getenv IDL_TMPDIR mark_directory myuniquetmpdir myuniquetmpdir 0 login 0 strtrim long systime 1 1 create it file_mkdir myuniquetmpdir add it to path path path : expand_path myuniquetmpdir ENDIF return end");388 a[386] = new Array("./Utilities/demomode_compatibility.html", "demomode_compatibility.pro", "", " PRO demomode_compatibilitycm_general 1 remove all cm_demomode_used pro found in path to_rm find cm_demomode_used IF to_rm 0 NE NOT FOUND THEN file_delete to_rm 2 copy oldcm_full _empty to myuniquetmpdir oldcm_used pro select which file should be copied to oldcm_used pro IF lmgr demo EQ 1 THEN BEGIN democm find cm_demomode file_copy democm myuniquetmpdir cm_demomode_used pro overwrite ENDIF ELSE BEGIN create an empty file close the journal if already open IF journal NE 0 THEN journal open a new one journal myuniquetmpdir cm_demomode_used pro close it it will be empty journal ENDELSE return END");389 a[387] = new Array("./Utilities/find.html", "find.pro", "", " NAME:find PURPOSE: based on file_search but it is possible to speficy a set of possibles names and a different set of possibles directories names By defaut look for files included in path CATEGORY:find a file CALLING SEQUENCE: found find filename INPUTS: A scalar or array variable of string type containing file names to match Input names specifications may contain wildcard characters enabling them to match multiple files see file_search for more informations By defaut and if necessary find is looking for filename and also for filename completed with pro KEYWORD PARAMETERS: FIRSTFOUND: activate this keyword to stop looking for the file as soon as we found one IODIRECTORY: A scalar or array variable of string type containing directories names where we are looking for the file by defaut we use path Different directories can be separated by path_sep search_path : on unix type machine as it is done to define path Note that if filename s dirname is different from this keyword is not taken into account LOOKALLDIR:activate to look for the file with a recursive search in iodir homedir path the DATA:TestsData directory if it exists NOPRO: activate to avoid the automatic search of filename completed with pro ONLYPRO:force to look only at file ending with pro ONLYNC:force to look only at file ending with nc RECURSIVE: performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument REPERTOIRE: obsolete keep for compatibility use directory keyword UNIQUE: activate to make sure that each element of the output vector is unique all file_search keywords OUTPUTS: A scalar or array variable of string type containing the name with the full path of the matching files If no files exist with names matching the input arguments find returns the scalar string : NOT FOUND COMMON BLOCKS: none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print find loadct usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir dir recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find loadct pro usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct nopro NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir usr local rsi idl_6 0 lib test_write NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find mesh iodirectory iodir path Users sebastie DATA ORCA2 meshmaskORCA2closea nc Users sebastie IDL meshmaskclosesea pro Users sebastie IDL meshmaskclosesea pro Users sebastie SAXO_RD Obsolete meshlec pro usr local rsi idl_6 0 lib mesh_obj pro MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 28 4 1999 6 7 1999: compatibilite mac et windows June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION find filein IODIRECTORY iodirectory RECURSIVE recursive REPERTOIRE repertoire NOPRO nopro ONLYPRO onlypro ONLYNC onlync UNIQUE unique FIRSTFOUND firstfound LOOKALLDIR LOOKALLDIR _extra ex define where we look for the file CASE 1 OF keyword_set lookalldir :BEGIN cm_general dirnames iodir homedir path tstdtadir file_dirname find find onlypro mark_directory tstdtadir file_search tstdtadir DATA TestsData 0 IF tstdtadir NE THEN dirnames tstdtadir dirnames END keyword_set iodirectory : dirnames iodirectory keyword_set repertoire : dirnames repertoire ELSE: dirnames path ENDCASE tmp dirnames dirnames dummy FOR i 0 n_elements tmp 1 DO dirnames dirnames strsplit tmp i path_sep search_path extract dirnames dirnames 1: fileout dummy FOR i 0 n_elements filein 1 DO BEGIN dir file_dirname filein i base file_basename filein i try to complete the file name with pro or nc if needed CASE 1 OF keyword_set onlypro :BEGIN promiss strpos base pro reverse_search promiss promiss strlen base 4 bad where promiss NE 0 OR strlen base LE 4 cnt IF cnt NE 0 THEN base bad base bad pro end keyword_set onlync :BEGIN ncmiss strpos base nc reverse_search ncmiss ncmiss strlen base 3 bad where ncmiss NE 0 OR strlen base LE 3 cnt IF cnt NE 0 THEN base bad base bad nc END ELSE:if strmid base 0 1 reverse_offset NE AND NOT keyword_set nopro THEN base base pro ENDCASE use dirnames only if dir eq IF dir EQ THEN BEGIN if keyword_set recursive THEN found file_search dirnames base _extra ex ELSE found file_search dirnames base _extra ex ENDIF ELSE found file_search dir base _extra ex IF found 0 NE THEN BEGIN IF keyword_set firstfound THEN BEGIN IF keyword_set unique THEN return found uniq found sort found ELSE return found ENDIF fileout fileout found ENDIF ENDFOR IF n_elements fileout EQ 1 THEN fileout NOT FOUND ELSE fileout fileout 1: IF n_elements fileout GT 1 THEN BEGIN IF keyword_set unique THEN fileout fileout uniq fileout sort fileout ENDIF ELSE fileout fileout 0 RETURN fileout END");390 a[388] = new Array("./Utilities/isadirectory.html", "isadirectory.pro", "", " NAME:isadirectory PURPOSE:check if a directory exists and make sure that it ends with the directory separator mark CATEGORY: io CALLING SEQUENCE: directory isadirectory dirname INPUTS:optional:a proposed directory If neither dirname input parameter of IODIRECTORY keyword are defined the ask the user to choose a directory KEYWORD PARAMETERS: IODIRECTORY:a proposed directory TITLE the title of the window all dialog_pickfile keywords like filter OUTPUTS: the directory name COMMON BLOCKS:none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print dir usr local rsi idl_6 0 IDL print isadirectory dir usr local rsi idl_6 0 IDL print isadirectory dir notgood MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 28 2000 June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION isadirectory directoryin TITLE title IODIRECTORY iodirectory _extra ex CASE 1 OF size directoryin type 0 EQ 7:directory directoryin keyword_set iodirectory :directory iodirectory ELSE:directory directory that is not existing ENDCASE testfile file_test directory directory if directory doesn t exist we ask the user to provide a directory name IF total testfile NE n_elements directory THEN BEGIN IF NOT keyword_set title THEN title choose a directory FOR i 0 n_elements directory 1 DO BEGIN IF testfile i EQ 0 THEN BEGIN directory i dialog_pickfile directory title title must_exist _extra ex if directory i EQ THEN RETURN report check find directory canceled ENDIF ENDFOR ENDIF directory file_search directory mark_directory IF n_elements directory EQ 1 THEN RETURN directory 0 ELSE RETURN directory END");391 a[389] = new Array("./Utilities/isafile.html", "isafile.pro", "", " NAME: isafile PURPOSE: same as find pro except that as long as the file is NOT FOUND isafile calls dialog_pickfile to ask the user to select a file CATEGORY: io CALLING SEQUENCE:filename isafile filein INPUTS:optional:a proposed name If neither filein input parameter of filename keyword are defined the ask the user to choose a file KEYWORD PARAMETERS: FILENAME: a proposed filename IODIRECTORY: a directory where we look for the file this keyword is taken into account only if the dirmame of filein or filename is NEW:to specify that filename is a new file and that we should check only its path ONLYPRO:force to look only at file ending with pro ONLYNC:force to look only at file ending with nc RECURSIVE: performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument all find file_search and dialog_pickfile keywords like title OUTPUTS:the filename with its path COMMON BLOCKS:none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print isafile Users sebastie SAXO_RD Commons cm_4mesh pro Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD Commons Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir path Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir getenv HOME recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile fake_file pro MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr 11 2 2000 June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION isafile filein FILENAME filename IODIRECTORY iodirectory NEW new RECURSIVE RECURSIVE ONLYPRO onlypro ONLYNC onlync _extra ex CASE 1 OF size filein type 0 EQ 7:fileout filein keyword_set filename :fileout filename ELSE:fileout file that is not existing ENDCASE if size fileout type NE 7 THEN return 1 CASE 1 OF keyword_set onlypro : filter pro keyword_set onlync : filter nc else: filter ENDCASE basename file_basename fileout dirname file_dirname fileout should we redefine dirname if keyword_set iodirectory AND dirname EQ then dirname iodirectory if keyword_set new then return dirname path_sep basename fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex WHILE fileout 0 EQ NOT FOUND DO BEGIN fileout dialog_pickfile path dirname 0 filter filter _extra ex if fileout EQ THEN RETURN report check find file canceled check again everything basename file_basename fileout dirname file_dirname fileout check if the name of the dirname is ok dirname isadirectory dirname title choose a directory for the file basename if we cancel the check IF size dirname type NE 7 THEN return report check find file canceled fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex ENDWHILE RETURN fileout END");392 a[390] = new Array("./Utilities/protype.html", "protype.pro", "", " NAME: protype PURPOSE: test is a pro file corresponds to an IDL procedure function or batch file CATEGORY: CALLING SEQUENCE: type protype profilename INPUTS: A scalar of string type the name of the pro file to be tested if necessary the input name is completed with pro and its path found in path KEYWORD PARAMETERS: NONE OUTPUTS: A scalar of string type: proc func or batch COMMON BLOCKS: none SIDE EFFECTS: RESTRICTIONS: EXAMPLE: IDL print protype protype func IDL print protype protype pro func IDL print protype init batch IDL print protype plt proc MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr Feb 2006 FUNCTION protype file filepro find file 0 onlypro firstfound 0 if filepro EQ NOT FOUND then return 1 name file_basename filepro pro allines getfile filepro CASE 1 OF this is a procedure max stregex allines pro name fold_case boolean :RETURN proc this is a function max stregex allines function name fold_case boolean :RETURN func this is an IDL batch file ELSE:RETURN batch ENDCASE RETURN 1 END");385 a[383] = new Array("./Utilities/createfunc.html", "createfunc.pro", "", " write an idl function compile it and execute it usefull to avoid the use of execute param command in required a scalar string defining the result to be byven back by the function see examples keyword FILENAMEIN in name of the funccedure to be created for_createfunc pro by default 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 SIDE EFFECTS: ends the function name with pro if needed restrictions arguments can be given only through keywords examples IDL print createfunc 3 2 filename test IDL print createfunc 3 two filename test kwdlist two two two 2 history Sebastien Masson smasson lodyc jussieu fr May 2005 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"); 386 a[384] = new Array("./Utilities/createpro.html", "createpro.pro", "", " 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 name of the procedure to be created for_createpro pro by default keyword KWDLIST 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 _EXTRA used to pass your keywords to the created procedure SIDE EFFECTS: ends the procedure name with pro if needed restrictions is not working with functions use createfunc instead arguments can be given only through keywords 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 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 exaemples 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"); 387 a[385] = new Array("./Utilities/def_myuniquetmpdir.html", "def_myuniquetmpdir.pro", "", " if needed define and create myuniquetmpdir common variable from cm_general and add it to path categories utilities examples IDL def_myuniquetmpdir uses cm_general file_comments SIDE EFFECTS: see purpose history Sebastien Masson smasson lodyc jussieu fr June 2005 PRO def_myuniquetmpdir cm_general IF n_elements myuniquetmpdir EQ 0 THEN BEGIN define a new and unique directory in getenv IDL_TMPDIR by using systime 1 look for the login if we use unix system IF d name EQ X THEN spawn whoami login noshell ELSE login idl myuniquetmpdir file_search getenv IDL_TMPDIR mark_directory myuniquetmpdir myuniquetmpdir 0 login 0 strtrim long systime 1 1 create it file_mkdir myuniquetmpdir add it to path path path : expand_path myuniquetmpdir ENDIF return end"); 388 a[386] = new Array("./Utilities/demomode_compatibility.html", "demomode_compatibility.pro", "", " categories utilities PRO demomode_compatibility cm_general 1 remove all cm_demomode_used pro found in path to_rm find cm_demomode_used IF to_rm 0 NE NOT FOUND THEN file_delete to_rm 2 copy oldcm_full _empty to myuniquetmpdir oldcm_used pro select which file should be copied to oldcm_used pro IF lmgr demo EQ 1 THEN BEGIN democm find cm_demomode file_copy democm myuniquetmpdir cm_demomode_used pro overwrite ENDIF ELSE BEGIN create an empty file close the journal if already open IF journal NE 0 THEN journal open a new one journal myuniquetmpdir cm_demomode_used pro close it it will be empty journal ENDELSE return END"); 389 a[387] = new Array("./Utilities/find.html", "find.pro", "", " based on file_search but it is possible to speficy a set of possibles names and a different set of possibles directories names By defaut look for files included in path categories find a file param filein in required A scalar or array variable of string type containing file names to match Input names specifications may contain wildcard characters enabling them to match multiple files see file_search for more informations By defaut and if necessary find is looking for filename and also for filename completed with pro keyword FIRSTFOUND activate this keyword to stop looking for the file as soon as we found one keyword IODIRECTORY A scalar or array variable of string type containing directories names where we are looking for the file by defaut we use path Different directories can be separated by path_sep search_path : on unix type machine as it is done to define path Note that if filename s dirname is different from this keyword is not taken into account keyword LOOKALLDIR activate to look for the file with a recursive search in iodir homedir path the DATA:TestsData directory if it exists keyword NOPRO activate to avoid the automatic search of filename completed with pro keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument keyword REPERTOIRE obsolete keep for compatibility use directory keyword keyword UNIQUE activate to make sure that each element of the output vector is unique file_comments all file_search keywords can be used returns A scalar or array variable of string type containing the name with the full path of the matching files If no files exist with names matching the input arguments find returns the scalar string : NOT FOUND examples IDL print find loadct usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir dir recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find loadct pro usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct nopro NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir usr local rsi idl_6 0 lib test_write NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find mesh iodirectory iodir path Users sebastie DATA ORCA2 meshmaskORCA2closea nc Users sebastie IDL meshmaskclosesea pro Users sebastie IDL meshmaskclosesea pro Users sebastie SAXO_RD Obsolete meshlec pro usr local rsi idl_6 0 lib mesh_obj pro history Sebastien Masson smasson lodyc jussieu fr 28 4 1999 6 7 1999: compatibilite mac et windows June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION find filein IODIRECTORY iodirectory RECURSIVE recursive REPERTOIRE repertoire NOPRO nopro ONLYPRO onlypro ONLYNC onlync UNIQUE unique FIRSTFOUND firstfound LOOKALLDIR LOOKALLDIR _extra ex define where we look for the file CASE 1 OF keyword_set lookalldir :BEGIN cm_general dirnames iodir homedir path tstdtadir file_dirname find find onlypro mark_directory tstdtadir file_search tstdtadir DATA TestsData 0 IF tstdtadir NE THEN dirnames tstdtadir dirnames END keyword_set iodirectory : dirnames iodirectory keyword_set repertoire : dirnames repertoire ELSE: dirnames path ENDCASE tmp dirnames dirnames dummy FOR i 0 n_elements tmp 1 DO dirnames dirnames strsplit tmp i path_sep search_path extract dirnames dirnames 1: fileout dummy FOR i 0 n_elements filein 1 DO BEGIN dir file_dirname filein i base file_basename filein i try to complete the file name with pro or nc if needed CASE 1 OF keyword_set onlypro :BEGIN promiss strpos base pro reverse_search promiss promiss strlen base 4 bad where promiss NE 0 OR strlen base LE 4 cnt IF cnt NE 0 THEN base bad base bad pro end keyword_set onlync :BEGIN ncmiss strpos base nc reverse_search ncmiss ncmiss strlen base 3 bad where ncmiss NE 0 OR strlen base LE 3 cnt IF cnt NE 0 THEN base bad base bad nc END ELSE:if strmid base 0 1 reverse_offset NE AND NOT keyword_set nopro THEN base base pro ENDCASE use dirnames only if dir eq IF dir EQ THEN BEGIN if keyword_set recursive THEN found file_search dirnames base _extra ex ELSE found file_search dirnames base _extra ex ENDIF ELSE found file_search dir base _extra ex IF found 0 NE THEN BEGIN IF keyword_set firstfound THEN BEGIN IF keyword_set unique THEN return found uniq found sort found ELSE return found ENDIF fileout fileout found ENDIF ENDFOR IF n_elements fileout EQ 1 THEN fileout NOT FOUND ELSE fileout fileout 1: IF n_elements fileout GT 1 THEN BEGIN IF keyword_set unique THEN fileout fileout uniq fileout sort fileout ENDIF ELSE fileout fileout 0 RETURN fileout END"); 390 a[388] = new Array("./Utilities/isadirectory.html", "isadirectory.pro", "", " check if a directory exists and make sure that it ends with the directory separator mark categories io param directoryin in optional a proposed directory If neither dirname input parameter of IODIRECTORY keyword are defined the ask the user to choose a directory keyword IODIRECTORY a proposed directory keyword TITLE the title of the window file_comments all dialog_pickfile keywords like filter can be used returns the directory name examples IDL print dir usr local rsi idl_6 0 IDL print isadirectory dir usr local rsi idl_6 0 IDL print isadirectory dir notgood history Sebastien Masson smasson lodyc jussieu fr June 28 2000 June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION isadirectory directoryin TITLE title IODIRECTORY iodirectory _extra ex CASE 1 OF size directoryin type 0 EQ 7:directory directoryin keyword_set iodirectory :directory iodirectory ELSE:directory directory that is not existing ENDCASE testfile file_test directory directory if directory doesn t exist we ask the user to provide a directory name IF total testfile NE n_elements directory THEN BEGIN IF NOT keyword_set title THEN title choose a directory FOR i 0 n_elements directory 1 DO BEGIN IF testfile i EQ 0 THEN BEGIN directory i dialog_pickfile directory title title must_exist _extra ex if directory i EQ THEN RETURN report check find directory canceled ENDIF ENDFOR ENDIF directory file_search directory mark_directory IF n_elements directory EQ 1 THEN RETURN directory 0 ELSE RETURN directory END"); 391 a[389] = new Array("./Utilities/isafile.html", "isafile.pro", "", " same as find pro except that as long as the file is NOT FOUND isafile calls dialog_pickfile to ask the user to select a file categories io param filein in optional a proposed name If neither filein input parameter of filename keyword are defined the ask the user to choose a file keyword FILENAME a proposed filename keyword IODIRECTORY a directory where we look for the file this keyword is taken into account only if the dirmame of filein or filename is keyword NEW to specify that filename is a new file and that we should check only its path keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument file_comments all find file_search and dialog_pickfile keywords like title can be used returns the filename with its path examples IDL print isafile Users sebastie SAXO_RD Commons cm_4mesh pro Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD Commons Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir path Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir getenv HOME recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile fake_file pro history Sebastien Masson smasson lodyc jussieu fr 11 2 2000 June 2005: Sebastien Masson: cleaning use for file_ functions FUNCTION isafile filein FILENAME filename IODIRECTORY iodirectory NEW new RECURSIVE RECURSIVE ONLYPRO onlypro ONLYNC onlync _extra ex CASE 1 OF size filein type 0 EQ 7:fileout filein keyword_set filename :fileout filename ELSE:fileout file that is not existing ENDCASE if size fileout type NE 7 THEN return 1 CASE 1 OF keyword_set onlypro : filter pro keyword_set onlync : filter nc else: filter ENDCASE basename file_basename fileout dirname file_dirname fileout should we redefine dirname if keyword_set iodirectory AND dirname EQ then dirname iodirectory if keyword_set new then return dirname path_sep basename fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex WHILE fileout 0 EQ NOT FOUND DO BEGIN fileout dialog_pickfile path dirname 0 filter filter _extra ex if fileout EQ THEN RETURN report check find file canceled check again everything basename file_basename fileout dirname file_dirname fileout check if the name of the dirname is ok dirname isadirectory dirname title choose a directory for the file basename if we cancel the check IF size dirname type NE 7 THEN return report check find file canceled fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex ENDWHILE RETURN fileout END"); 392 a[390] = new Array("./Utilities/protype.html", "protype.pro", "", " test is a pro file corresponds to an IDL procedure function or batch file categories utilities param file in A scalar of string type the name of the pro file to be tested if necessary the input name is completed with pro and its path found in path returns A scalar of string type: proc func or batch examples IDL print protype protype func IDL print protype protype pro func IDL print protype init batch IDL print protype plt proc history Sebastien Masson smasson lodyc jussieu fr Feb 2006 FUNCTION protype file filepro find file 0 onlypro firstfound 0 if filepro EQ NOT FOUND then return 1 name file_basename filepro pro allines getfile filepro CASE 1 OF this is a procedure max stregex allines pro name fold_case boolean :RETURN proc this is a function max stregex allines function name fold_case boolean :RETURN func this is an IDL batch file ELSE:RETURN batch ENDCASE RETURN 1 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 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 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 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 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 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 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 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 printer_machine_names 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.