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

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

improvemnts of headers (typo, links)

  • 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;        See IDL> xhelp,'litchamp'
13;
14; @uses
15; <pro>common</pro>
16;
17; @restrictions
18; Change the value if global variables attribute of a field: vargrid,
19; varname, varunit, vardate, varexp , valmask and time.
20;
21; @history
22; Sebastien Masson (smasson\@lodyc.jussieu.fr)
23;                       15/6/1999
24;
25; @version
26; $Id$
27;
28;-
29PRO restoreatt, struct
30;
31  compile_opt idl2, strictarrsubs
32;
33@common
34;------------------------------------------------------------
35   nomelements = tag_names(struct)
36   for i = 0, n_tags(struct)-1 do begin
37      case strlowcase(strmid(nomelements[i], 0, 1)) of
38         'g':vargrid = strupcase(struct.(i))
39         'n':varname = struct.(i)
40         'u':varunit = struct.(i)
41         'e':varexp = struct.(i)
42         'm':valmask = struct.(i)
43         'd':BEGIN
44            if size(struct.(i),/type) EQ 7 THEN BEGIN
45               vardate = struct.(i)
46            ENDIF ELSE BEGIN
47               vardate =  'time series'
48               time = struct.(i)
49            ENDELSE
50         end
51         ELSE:BEGIN
52            ras = report('Le nom '+nomelements[i]+' ne correspont a aucun element reconnu de la structure. !C cf. IDL> xhelp, ''litchamp''')
53         end
54      endcase
55   endfor
56;------------------------------------------------------------
57   return
58end
Note: See TracBrowser for help on using the repository browser.