Ignore:
Timestamp:
08/09/06 12:12:54 (18 years ago)
Author:
navarro
Message:

english and nicer header (3a)

Location:
trunk/SRC/ToBeReviewed/POSTSCRIPT
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/POSTSCRIPT/calibre.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: calibre 
    6 ; 
    7 ; PURPOSE:a partir d''un rapport d''aspect et des valeurs (en ligne de 
    8 ; characteres) des differentes marges, calcul posfenetre et posbar qui 
    9 ; servent a placer le dessin et la barre de couleur grace a 
    10 ; !p.position sur une feuille ou 
    11 ; sur une sortie ecran dont la fenetre a les memes proportions 
    12 ; 
    13 ; CATEGORY: positionnement du graphe 
    14 ; 
    15 ; CALLING SEQUENCE: 
    16 ;     calibre, rapportyx,marge,margebar, smalldraw,posfenetre, posbar  
    17 ; 
    18 ; INPUTS: 
    19 ;       rapportyx: rapport d''echelle entre la longueur de l''axe des 
    20 ;       y et celle des x. par ex pour une carte xy, 
    21 ;       rapportyx=(lat2-lat1)/(lon2-lon1) 
    22 ; 
    23 ;       marge: vecteur de 4 elements contenant la taille des marges a gauche, 
    24 ; a droite, en bas et en haut devant entourer le graphe. tout est 
    25 ; mesure en lignes de characteres 
    26 ; 
    27 ;       margebar: vecteur de 4 elements contenant la taille des marges a gauche, 
    28 ; a droite, en bas et -ATTENTION- le dernier element est cette fois-ci 
    29 ; la position de coin en haut a droite, devant entourer la barre de 
    30 ; couleur. tout est mesure en lignes de characteres 
    31 ; 
    32 ;       smalldraw: 2 possiblites 
    33 ;             un vecteur de 4 elements donnant (en portrait ou 
    34 ; en landscape) la position de cadre ds lequel doit rentrer le 
    35 ; dessin. cette position est donne par les coordonnes des 2 coins du 
    36 ; cadre: en bas a gauche et en haut a droite. elle s''exprime tjs 
    37 ; (pour un postscript ou une sortie ecran) en cm, l''origine etant le 
    38 ; coin en bas a gauche. 
    39 ;             un vecteur de 3 elements donnant le nombre de colonnes a 
    40 ; faire de le dessin, le nombre de lignes et enfin le numero de la 
    41 ; case que doit occuper le dessin (cf matlab). par ex pour faire 6 
    42 ; dessin en 2 colonnes et 3 lignes et occuper la 4 eme case, small=[2,3,4] 
    43 ; 
    44 ; KEYWORD PARAMETERS: 
    45 ; 
    46 ;       /REMPLI:oblige le dessin a occuper l'espace maximum definit 
    47 ; par smalldraw sans resperter le rapport y sur x. 
    48 ; 
    49 ;       YXASPECT: force le rapport y sur x a prendre la valeur 
    50 ; rapportyx*yxaspect. ce mot cle est utile ds deux cas:  
    51 ;   1) yxaspect=1 : oblige rapportyx a etre bien respecte sinon 
    52 ;         calibre se reserve le droit de changer un peu celui-ci dans 
    53 ;         le cas ou le rapport d''aspect de small dessin est trop 
    54 ;         different de celui de smalldraw. 
    55 ;   2) yxaspect=n : multiplie par n le rapport d''aspect donne par 
    56 ;         defaut.par ex ds plt, rapportyx est calcule pour que le 
    57 ;         repere soit orthonorme, pour avoir un repere ou l''axe des y 
    58 ;         est 2 fois plus dilate que celui des y YXASPECT=2 
     5; @file_comments 
     6; From a rapport of aspect and values (in line of character) of different margins,  
     7; it calculate POSFENETRE and POSBAR which serve to place the drawing and the color  
     8; bar thanks to !p.position on a leaf or a screen output whose the window has the same  
     9; proportion. 
     10; 
     11; @categories  
     12; graphics 
     13; 
     14;  
     15; @param RAPPORTYX {in}{required} 
     16; Scale rapport between the lenght of the y axis and the x one. For example,  
     17; for an xy map: RAPPORTYX=(lat2-lat1)/(lon2-lon1) 
     18; 
     19; @param MARGE {in}{required} 
     20; Vector made of 4 elements containing the size of the left, right, up and  
     21; bottom margin having to surround the graph. All is measured in lines of characters. 
     22; 
     23; @param MARGEBAR {in}{required} 
     24; Vector made of 4 elements containing the size of the left, right and bottom  
     25; margin and -BEWARE- the last element is this time the positio of the right up  
     26; corner, having to surround the color bar. All is measured in lines of characters. 
     27; 
     28; @param SMALLDRAW {in}{required} 
     29; 2 possibilities: 
     30;    It is vector made of 4 elements giving (in portrait or landscape) the position  
     31; of the frame in which the drawing must go in. This position is given by coordinates  
     32; of the 2 corners of the frame: in the left bottom and the right up. It is always  
     33; (for a postscript or a screen output) express in cm, the origin being the  
     34; left bottom corner. 
     35;    It is a vector made of 3 elements giving the number of column to be done in the  
     36; drawing, the number of line and the number of the case the number have to occupy  
     37; (see matlab). For example, to do 6 drawing in 3 columns and 2 lines and occupy  
     38; the 4th case, small=[2,3,4] 
     39; 
     40; @keyword REMPLI 
     41; Force the drawing to occupy the biggest possible place defined by  
     42; SMALLDRAW without respect the rapport y on x. 
     43; 
     44; @keyword YXASPECT 
     45; Force the rapport y on x to take the value RAPPORTYX*YXASPECT.  
     46; This keyword can be used in 2 cases: 
     47;   1) YXASPECT=1 : force RAPPORTYX to be respected otherwise, Calibre take the  
     48;   initiative to change it a little inthe case of the aspect rapport of SMALL  
     49;   is too different of the one of SMALLDRAW.  
     50;   2) YXASPECT=n : multiply by n the aspect rapport given by default.  
     51;   For example in plt, RAPPORTYX is calculated to the reference be orthonormal, 
     52;   to have a reference where the y axis is 2 time bigger than the x one, YXASPECT=2. 
    5953;        
    60 ;       PORTRAIT et LANDSCAPE: mots cles plus utilises mais tjs fonctionnels 
    61 ; 
    62 ; OUTPUTS: 
    63 ;       posfenetre: un vecteur de 4 elements contenant la position de 
    64 ;       cadre contenant les legendes + le graphe en coordonnes 
    65 ;       normalises. Rq: pour positionner le dessin il faut apres 
    66 ;       l''appelle de calibre faire !p.position=posfenetre 
    67 ; 
    68 ;       posbar: cf posfentre mais pour la barre de couleur. meme 
    69 ;       remarque pour positionner la barre de couleur, !p.position=posbar 
    70 ; 
    71 ; COMMON BLOCKS: 
    72 ;       common.pro               
    73 ; 
    74 ; SIDE EFFECTS: 
    75 ; 
    76 ; RESTRICTIONS: 
    77 ; 
    78 ; EXAMPLE: 
    79 ; 
    80 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     54; @keyword PORTRAIT        
     55; Force the page or the window to be in standing position. 
     56;  
     57; @keyword LANDSCAPE        
     58; Force the page or the window on the screen to be in lenthened position. 
     59;  
     60; @keyword _EXTRA 
     61; Used to pass your keywords 
     62; 
     63; @param POSFENETRE 
     64; It is a vector made of 4 elements containing the position of the frame  
     65; containing captions + the graph in normalized coordinates.  
     66; Comment: to position the drawing, we have to do !p.position=POSFENETRE  
     67; after the call of calibre. 
     68; 
     69; @param POSBAR 
     70; See POSFENTRE but for the color bar. Same comment to position the color bar, !p.position=POSBAR 
     71; 
     72; @uses 
     73; common.pro 
     74; 
     75; @history 
     76; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    8177;                       11/12/98 
     78; 
     79; @version 
     80; $Id$ 
    8281;- 
    8382;------------------------------------------------------------ 
     
    9897;--------------------------------------------------------- 
    9998;------------------------------------------------------------ 
    100    tempsun = systime(1)         ; pour key_performance 
     99   tempsun = systime(1)         ; For key_performance 
    101100;------------------------------------------------------------- 
    102101   if keyword_set(portrait) then key_portrait=1 
     
    112111    mipgsz = min(page_size, max = mapgsz) 
    113112;------------------------------------------------------------ 
    114 ; choix de Landscape ou Portrait 
     113; choice of Landscape or Portrait 
    115114;------------------------------------------------------------ 
    116115   if n_elements(key_portrait) eq 0  then begin 
     
    119118   endif 
    120119;------------------------------------------------------------- 
    121 ; si smalldraw est compte comme ds matlab 
     120; If smalldraw is count like in matlab 
    122121;------------------------------------------------------------- 
    123122   if n_elements(smalldraw) EQ 3  then begin 
     
    136135   endif 
    137136;------------------------------------------------------------ 
    138 ; determination de la taille des characteres (!p.charsize) 
     137; determination of the size of characters (!p.charsize) 
    139138;------------------------------------------------------------ 
    140139   nombre_de_mots_ds_titre = 60. 
     
    143142   if !p.charsize gt 1 then !p.charsize=1 
    144143;------------------------------------------------------------ 
    145 ; transfert de marge en cm 
     144; transfert of margin in cm 
    146145;------------------------------------------------------------ 
    147146   cm=1.*!d.x_px_cm 
     
    149148   margebar=1.* margebar * !d.y_ch_size * !p.charsize / cm 
    150149;------------------------------------------------------------ 
    151 ; definition de la portion de feuille ou on dessine 
     150; definition of the part of the leaf where we draw 
    152151;------------------------------------------------------------ 
    153152   if key_portrait eq 0 then begin 
     
    162161   else rapportmax=1.*(small-marge[2]-marge[0])/(big-marge[3]-marge[1]) 
    163162;------------------------------------------------------------ 
    164 ; si yxaspect n'est pas specifie on modifie la valeur de rapportyx pour que 
    165 ; ca colle un peu plus aux proportions de la feuille 
     163; If YXASPECT is not specified, we modify the value of RAPPORTYX  
     164; to it match better with the leaf's proportions. 
    166165;------------------------------------------------------------ 
    167166   if rapportyx le rapportmax then begin 
     
    183182   endelse 
    184183;------------------------------------------------------------ 
    185 ; dans le cas ou on fait un Landscape: 
     184; in the case where we do a Landscape: 
    186185;------------------------------------------------------------ 
    187186   if key_portrait eq 0 then begin        
     
    214213   endif $ 
    215214;------------------------------------------------------------ 
    216 ; dans le cas ou on fait un portrait: 
     215; In the case where we do a portrait: 
    217216;------------------------------------------------------------ 
    218217   else begin        
  • trunk/SRC/ToBeReviewed/POSTSCRIPT/ps.pro

    r134 r150  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:ps 
     5; @file_comments 
     6; Redirect the content of the graphic window in a postscript,  
     7; by redoing commands in the postscript's environment. 
    68; 
    7 ; PURPOSE:redirige le contenu de la fenetre graphique ds un postcript, 
    8 ; en reeffectuant les commandes ds l''environnement postscript. 
     9; @categories 
     10; utilities 
     11;  
     12; @restrictions 
     13; We use journal which allows to stock commands we pass.  
    914; 
    10 ; CATEGORY:pour faire un ps 
     15; @restrictions 
     16; Can break down if some wierd commands are passed... 
     17; Comment: we erase Syntax error, Illegal characters, comapatible 
     18; with oups, text_box...  
    1119; 
    12 ; CALLING SEQUENCE:@ps 
    13 ; 
    14 ; INPUTS: 
    15 ; 
    16 ; KEYWORD PARAMETERS: 
    17 ;; 
    18 ; OUTPUTS: 
    19 ; 
    20 ; COMMON BLOCKS: 
    21 ; 
    22 ; SIDE EFFECTS: on utilise journal qui perment de stoker les commandes 
    23 ; que l''on passe.  
    24 ; 
    25 ; RESTRICTIONS:peut planter si des commandes bizarres sont passees... 
    26 ; rq: on efface les Syntax error, les Illegal character, commapatible 
    27 ; avec oups, text_box...  
    28 ; 
    29 ; EXAMPLE: 
    30 ; 
    31 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     20; @history 
     21; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3222;                       5/3/1999 
    3323;- 
     
    3626;------------------------------------------------------------ 
    3727;------------------------------------------------------------ 
    38 ; il faut fermer le journal! 
     28; We have to close the journal! 
    3929;------------------------------------------------------------ 
    40 ;   if !journal EQ 0 then begin 
    41 ;      print, 'Il n''y a pas de journal ouvert !!' 
    42 ;      GOTO, sortie 
     30   if !journal EQ 0 then begin 
     31      print, 'Il n''y a pas de journal ouvert !!' 
     32      GOTO, sortie 
    4333journal 
    4434;------------------------------------------------------------ 
    45 ; on complete le journal ... 
     35; we complete the journal ... 
    4636;------------------------------------------------------------ 
    47 ; on recupere le journal sous la forme d''un vecteur de string: 
     37; We recuperate the journal as a vector of string : 
    4838vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    49 ;FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i] 
     39FOR i = 0,n_elements(vectjournal)-1 DO  print, vectjournal[i] 
    5040;------------------------------------------------------------ 
    51 ; on coupe la derniere ligne qui est @ps 
     41; We cut the last line which is \@ps 
    5242;------------------------------------------------------------ 
    5343IF strpos(vectjournal[n_elements(vectjournal)-1],'@ps') ne -1 then $ 
    5444  vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
    5545;------------------------------------------------------------ 
    56 ; on le corrige si besoin est... 
     46; We correct it if needed... 
    5747;------------------------------------------------------------ 
    5848for i = 0, n_elements(vectjournal)-1 do $ 
    5949 if strpos(vectjournal[i],'text_box' ) EQ -1 then $ 
    6050 vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2) 
    61 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    62 ;2 lignes sont identiques ?? 
     51FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     52;2 lines are identical ?? 
    6353for i = 0, n_elements(vectjournal)-2 do $ 
    6454 if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' ' 
    65 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    66  
     55FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     56; 
    6757for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    6858 if strpos(vectjournal[i],'oups' ) NE -1 $ 
     
    7060 OR strpos(vectjournal[i],'Illegal character' ) NE -1 $ 
    7161 then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & endfor 
    72 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     62FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    7363for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    7464 if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $ 
     
    7969 OR strpos(vectjournal[i],'print' ) NE -1 $ 
    8070 then  vectjournal[i] = ' ' & endfor 
    81 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     71FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    8272for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    8373 if strpos(strtrim(vectjournal[i], 1),'plt' ) NE -1 THEN BEGIN & $ 
     
    8676 vectjournal[i] = vectjournal[i]+',/noerase' & $ 
    8777 ENDIF & endfor 
    88 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     78FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    8979for i = 0, n_elements(vectjournal)-1 do BEGIN & $ 
    9080 if strpos(vectjournal[i],'text_box' ) NE -1 then $ 
     
    9282 vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor 
    9383 
    94 ; on le complete pour le transformer en une procedure equivalente a plein2dessin 
    95 ;   vectjournal = ['reinitplt, /z,/invert' $ 
     84; We complete it to transform it in a procedure equivalent to plein2dessin 
     85   vectjournal = ['reinitplt, /z,/invert' $ 
    9686   vectjournal = ['openps, infowidget= infowidget' $ 
    9787                  , vectjournal $ 
    9888                  ,'closeps, infowidget= infowidget' $ 
    9989                  ,'printps' ] 
    100 ;FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
    101 ; on reecrit idlsave.pro 
     90FOR i = 0,n_elements(vectjournal)-1 DO print, vectjournal[i] 
     91; We rewrite idlsave.pro 
    10292   putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    103 ; applique idlsave 
     93; apply idlsave 
    10494   cd,  current = curdir 
    10595   cd, myuniquetmpdir 
    10696@idlsave    
    10797   cd, curdir 
    108 ; on reouvre le journal et on y met les elements de 
    109 ; vectjournal sauf les 2 premieres lignes et les 3 dernieres lignes 
     98; We reopen the journal and we put in it all elements of vectjournal but the 2 first and the 3 last line. 
    11099journal, myuniquetmpdir+'idlsave.pro' 
    111100for i = 2, n_elements(vectjournal)-3 DO $ 
Note: See TracChangeset for help on using the changeset viewer.