PRO read_amsr_averaged_v5, file_name, sst, wind, vapor, cloud, rain ; this routine will read the AMSR-E or AMSR-J time_averaged bytemap files (version-5). ; The 3-day, weekly and monthly data files all have the same format. ; arguments are: ; file_name : name of file to read complete with path ; filename with path in forms: ; satname_yyyymmddv5_d3d.gz 3-day (mean of 3 days ending on file date) ; satname_yyyymmddv5.gz weekly (mean of 7 days ending on Saturday file date) ; satname_yyyymmv5.gz monthly (mean of days in month) ; ; where satname = name of satellite (amsre or amsra) ; yyyy = year ; mm = month ; dd = day of month ; ; The routine returns: ; sst, wind, vapor, cloud, rain real arrays sized (1440,720) ; sst is the sea surface temperature in degree Celcius, valid range=[-3.0,34.5] ; wind is the 10 meter surface wind speed in m/s, valid range=[0.,50.] ; vapor is the columnar atmospheric water vapor in mm, valid range=[0.,75.] ; cloud is the liquid cloud water in mm, valid range = [0.,2.5] ; rain is the derived radiometer rain rate in mm/hr, valid range = [0.,25.0] ; ; Longitude is 0.25*(xdim+1)- 0.125 !IDL is zero based East longitude ; Latitude is 0.25*(ydim+1)-90.125 ; ; ; Please read the data description on www.remss.com ; for infomation on the various fields ; To contact RSS email our support desk: ; support@remss.com ;binary data in file binarydata= bytarr(1440,720,5) ;output products (lon,lat,asc/dsc) sst =fltarr(1440,720) wind =fltarr(1440,720) vapor=fltarr(1440,720) cloud=fltarr(1440,720) rain =fltarr(1440,720) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;determine if file exists exist=findfile(file_name,COUNT=cnt) if (cnt eq 1) then begin ;open file, read binary data, close file close,2 openr,2,file_name, error=err, /compress ;compress keyword allows reading of gzip file, do not use if file is unzipped if (err gt 0) then begin print, 'ERROR OPENING FILE: ', file_name endif else begin readu,2,binarydata close,2 endelse ; multipliers to change binary data to real data xscale=[0.15,.2,.3,.01,.1] offset=[-3.0,0.,0.,0.,0.] ; loop through 5 geo parameters for ivar=0,4 do begin ; extract 1 variable, scale and assign to real array dat=binarydata[*,*,ivar] dat=float(dat) ok=where(dat le 250) dat[ok]=dat[ok]*xscale[ivar]+offset[ivar] case ivar of 0: sst [*,*] =dat 1: wind [*,*] =dat 2: vapor[*,*] =dat 3: cloud[*,*] =dat 4: rain [*,*] =dat endcase endfor ;ivar endif return END