function [sst,windLF,windMF,vapor,cloud,rain,windAW,wdir]=read_gmi_averaged_v8(data_file) % [sst,windLF,windMF,vapor,cloud,rain,windAW,wdir]=read_gmi_averaged_v8(data_file); % % this subroutine reads compressed or uncompressed RSS GMI time-averaged bytemaps (3-day, week, month) % % File name format is f35_yyyymmddvN.N_d3d for 3-day (average of 3 days ending on file date) % f35_yyyymmddvN.N for weekly (start sunday, end saturday, named by saturday date) % f35_yyyymmvN.N for monthly % input argument is the full path file name: % get_gmi_averaged_v8(filename) % % output arguments: % [sst,windLF,windMF,vapor,cloud,rain,windAW,wdir] % sst is surface water temperature at depth of about 1 mm in deg C % windLF is 10 meter surface wind in m/s made using 10.7 GHz channel and above % windMF is 10 meter surface wind in m/s made using 18.7 GHz channel and above % vapor is atmospheric water vapor in millimeters % cloud is liquid cloud water in millimeters % rain is rain rate in millimeters/hour % windAW is 10 meter surface wind for all weather conditions made using 3 algorithms % wdir is wind direction oceanographic convention, blowing North = 0 in degrees % % The center of the first cell of the 1440 column and 720 row map is at 0.125 E longitude and -89.875 latitude. % The center of the second cell is 0.375 E longitude, -89.875 latitude. % XLAT=0.25*ILAT-90.125 % XLON=0.25*ILON-0.125 % % Data from the daily files are scalar (wind speed) and vector (wind direction) averaged % to produce the values in the time-averaged files. A data value for a given cell is only provided in a % time-averaged file if a minimum number of data exist within the time period being produced % (3-day maps, 2 obs; week maps, 5 obs; month maps, 20 obs) % % 3-day = (average of 3 days ending on file date) % weekly = (average of 7 days ending on Saturday of file date) % monthly = (average of all days in month) % % Details of the binary data file format is provided at % http://www.remss.com/windsat/windsat_data_description.html#binary_data_files % % To contact RSS support: % http://www.remss.com/support % % xscale=[ 0.15,0.2,0.2,0.3, 0.01,0.1]; offset=[-3.0 ,0.0,0.0,0.0,-0.05,0.0]; xdim=1440;ydim=720;numvar=6; if ~exist(data_file,'file') disp(['file not found: ', data_file]); sst=[];windLF=[];windMF=[];vapor=[];cloud=[];rain=[];windAW=[];wdir=[]; return; end; if ~isempty(regexp(data_file,'.gz', 'once')) data_file=char(gunzip(data_file)); end fid=fopen(data_file,'rb'); data=fread(fid,xdim*ydim*numvar,'uint8'); fclose(fid); disp(data_file); map=reshape(data,[xdim ydim numvar]); for i=1:numvar tmp=map(:,:,i); ia=find(tmp<=250);tmp(ia)=tmp(ia)*xscale(i)+offset(i); map(:,:,i)=tmp; end % ivar loop sst=squeeze(map(:,:,1,:)); windLF=squeeze(map(:,:,2,:)); windMF=squeeze(map(:,:,3,:)); vapor=squeeze(map(:,:,4,:)); cloud=squeeze(map(:,:,5,:)); rain=squeeze(map(:,:,6,:)); return; end