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

Last change on this file since 378 was 378, checked in by pinsard, 16 years ago

improvements of headers (typo, links, paragraphes, etc)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1;+
2;
3; @file_comments
4; Allows to reattribute global variables associated with a field
5; when we give a structure created by <pro>saveatt</pro> by example.
6;
7; @categories
8; Utilities
9;
10; @param STRUCT {in}{required}
11; a structure like the one who read <pro>litchamp</pro>.
12;
13; @uses
14; <pro>common</pro>
15;
16; @restrictions
17; Change the value if global variables attribute of a field: vargrid,
18; varname, varunit, vardate, varexp, valmask and time.
19;
20; @history
21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
22;                       15/6/1999
23;
24; @version
25; $Id$
26;
27;-
28PRO restoreatt, struct
29;
30  compile_opt idl2, strictarrsubs
31;
32@common
33;------------------------------------------------------------
34   nomelements = tag_names(struct)
35   for i = 0, n_tags(struct)-1 do begin
36      case strlowcase(strmid(nomelements[i], 0, 1)) of
37         'g':vargrid = strupcase(struct.(i))
38         'n':varname = struct.(i)
39         'u':varunit = struct.(i)
40         'e':varexp = struct.(i)
41         'm':valmask = struct.(i)
42         'd':BEGIN
43            if size(struct.(i),/type) EQ 7 THEN BEGIN
44               vardate = struct.(i)
45            ENDIF ELSE BEGIN
46               vardate =  'time series'
47               time = struct.(i)
48            ENDELSE
49         end
50         ELSE:BEGIN
51            ras = report('Le nom '+nomelements[i]+' ne correspont a aucun element reconnu de la structure. !C cf. IDL> xhelp, ''litchamp''')
52         end
53      endcase
54   endfor
55;------------------------------------------------------------
56   return
57end
Note: See TracBrowser for help on using the repository browser.