;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME:restoreatt ; ; PURPOSE:permet de reattribuer les variables globales associees a un ; champ qd on donne une stucture cree par ex par saveatt.pro. ; ; CATEGORY:allegement d''ecriture ; ; CALLING SEQUENCE:restoreatt, structure ; ; INPUTS:une structure comme celle que lit litchamp. ; cf. IDL> xhelp,'litchamp' ; ; COMMON BLOCKS: ; common.pro ; ; SIDE EFFECTS: change la valeur des variables globales attributs ; d''un champ: vargrid, varname, varunit, vardate, varexp , valmask, ; niveau et time ; ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) ; 15/6/1999 ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO restoreatt, struct @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) 'l':niveau = 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