;+ ; ; @file_comments ; Allows to reattribute global variables associated with a field ; when we give a structure created by saveatt by example. ; ; @categories ; Utilities ; ; @param STRUCT {in}{required} ; a structure like the one who read litchamp. ; ; @uses ; common ; ; @restrictions ; Change the value if global variables attribute of a field: vargrid, ; varname, varunit, vardate, varexp, valmask and time. ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 15/6/1999 ; ; @version ; $Id$ ; ;- PRO restoreatt, struct ; compile_opt idl2, strictarrsubs ; @common ;------------------------------------------------------------ nomelements = tag_names(struct) for i = 0, n_tags(struct)-1 do begin case strlowcase(strmid(nomelements[i], 0, 1)) of 'g':vargrid = strupcase(struct.(i)) 'n':varname = struct.(i) 'u':varunit = struct.(i) 'e':varexp = struct.(i) 'm':valmask = struct.(i) 'd':BEGIN if size(struct.(i),/type) EQ 7 THEN BEGIN vardate = struct.(i) ENDIF ELSE BEGIN vardate = 'time series' time = struct.(i) ENDELSE end ELSE:BEGIN ras = report('Le nom '+nomelements[i]+' ne correspont a aucun element reconnu de la structure. !C cf. IDL> xhelp, ''litchamp''') end endcase endfor ;------------------------------------------------------------ return end