source: trunk/SRC/ToBeReviewed/PLOTS/DIVERS/restoreatt.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME:restoreatt
6;
7; PURPOSE:permet de reattribuer les variables globales associees a un
8; champ qd on donne une stucture cree par ex par saveatt.pro.
9;
10; CATEGORY:allegement d''ecriture
11;
12; CALLING SEQUENCE:restoreatt, structure
13;
14; INPUTS:une structure comme celle que lit litchamp.
15;        cf. IDL> xhelp,'litchamp'
16;
17; COMMON BLOCKS:
18;       common.pro
19;
20; SIDE EFFECTS: change la valeur des variables globales attributs
21; d''un champ: vargrid, varname, varunit, vardate, varexp , valmask,
22; et time
23;
24; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr)
25;                       15/6/1999
26;-
27;------------------------------------------------------------
28;------------------------------------------------------------
29;------------------------------------------------------------
30PRO restoreatt, struct
31;
32  compile_opt idl2, strictarrsubs
33;
34@common
35;------------------------------------------------------------
36   nomelements = tag_names(struct)
37   for i = 0, n_tags(struct)-1 do begin
38      case strlowcase(strmid(nomelements[i], 0, 1)) of
39         'g':vargrid = strupcase(struct.(i))
40         'n':varname = struct.(i)
41         'u':varunit = struct.(i)
42         'e':varexp = struct.(i)
43         'm':valmask = struct.(i)
44         'd':BEGIN
45            if size(struct.(i),/type) EQ 7 THEN BEGIN
46               vardate = struct.(i)
47            ENDIF ELSE BEGIN
48               vardate =  'time series'
49               time = struct.(i)
50            ENDELSE
51         end
52         ELSE:BEGIN
53            ras = report('Le nom '+nomelements[i]+' ne correspont a aucun element reconnu de la structure. !C cf. IDL> xhelp, ''litchamp''')
54         end
55      endcase
56   endfor
57;------------------------------------------------------------
58   return
59end
Note: See TracBrowser for help on using the repository browser.