;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	Reads an enviheader file.  ;;	    returns a struct :;;		    ns:number of samples in the file;;		    nl:number of lines in the file;;		    nb:number of bands in the file;;		    map: an envi map structure (includes utm coords and pixelsize);;		    desc: The description field in the .hdr;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;function getFileInfo, name	 envi_open_file, name, r_fid=id	 	 if id eq -1 then return, {errorstruct, name:name, ns:-1, nl:-1, nb:-1}	 envi_file_query, id, nb=nb, nl=nl, ns=ns, h_map=maph, descrip=desc, $	 	interleave=interleave, data_type=type	 if maph eq -1 then return, {errorstruct, name:name, ns:-1, nl:-1, nb:-1}	 	 handle_value, maph, map	 envi_file_mng, id=id, /remove	 return, {imagestruct, name:name, ns:ns, nl:nl, nb:nb, map:map, desc:desc, $	 	interleave:interleave, type:type}end;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	Sets envi header info (map and ns, nl, nb, type, interleave);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;pro setHdr, info, fname	envi_setup_head, fname=fname, ns=info.ns, nl=info.nl, nb=info.nb, $		interleave=info.interleave, data_type=info.type, $		descrip=info.desc, map_info=info.map, /writeendpro changePsize		scenes=findfile('*')		cd, current=masterDIR	envistart		for i=0, n_elements(scenes)-1 do begin		current=strtok(scenes(i),':', /extract)		if (strtok(scenes(i), '.'))(0) eq 0 then begin			cd, current(0)			print, ' ', string(byte(13))			print, '**************************',current(0),'**************************'			fname = 'sandRS'			dirname='::sand:'			if file_test(fname) then begin				info=getFileInfo(fname)				if info.ns ne -1 then begin					map=info.map					map.ps(*) = 300					info.map=map										sethdr, info, fname										newfname='sandMRS'					applymasks, 'maskRS', fname, newfname					fname=newfname					print, move(fname, dirname+current(0)+fname, /copy)					print, move(fname+'.hdr', dirname+current(0)+fname+'.hdr', /copy)				endif			endif						cd, masterDIR		endif	endforend