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
RevLine 
[2]1;+
2;
[142]3; @file_comments
[226]4; Allows to reattribute global variables associated with a field
[231]5; when we give a structure created by <pro>saveatt</pro> by example.
[2]6;
[226]7; @categories
[142]8; Utilities
[2]9;
[142]10; @param STRUCT {in}{required}
[237]11; a structure like the one who read <pro>litchamp</pro>.
[142]12;        See IDL> xhelp,'litchamp'
[2]13;
[142]14; @uses
[370]15; <pro>common</pro>
[2]16;
[142]17; @restrictions
[226]18; Change the value if global variables attribute of a field: vargrid,
[142]19; varname, varunit, vardate, varexp , valmask and time.
[2]20;
[142]21; @history
[157]22; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[142]23;                       15/6/1999
[2]24;
[142]25; @version
26; $Id$
27;
[2]28;-
29PRO restoreatt, struct
[114]30;
31  compile_opt idl2, strictarrsubs
32;
[2]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)
[226]43         'd':BEGIN
44            if size(struct.(i),/type) EQ 7 THEN BEGIN
[2]45               vardate = struct.(i)
46            ENDIF ELSE BEGIN
47               vardate =  'time series'
48               time = struct.(i)
49            ENDELSE
50         end
[226]51         ELSE:BEGIN
[2]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.