function [sst,wind,vapor,cloud,rain] = read_amsr_averaged_v5(data_file) % [sst,wind,vapor,cloud,rain] = read_amsr_averaged_v5(data_file); % % this subroutine reads compressed or uncompressed AMSR-E or AMSR-J data from Remote Sensing Systems' % binary format (version-5) % % File name format is amsre_yyyymmddv5_d3d for 3-day (average of 3 days ending on file date) % amsre_yyyymmddv5 for weekly (start sunday, end saturday, named by saturday date) % amsre_yyyymmv5 for monthly % The averaged files include: 3-Day, weekly, and monthly time composites. % These averaged time composite files all share the same data format. % % input arguments: % data_file = the full path and name of the uncompressed data file % % the function returns these products: % sst = sea surface temperature in deg C % wind = wind speed in meters/second % vapor = atmospheric water vapor in millimeters % cloud = liquid cloud water in millimeters % rain = rain rate in millimeters/hour % % longitude is 0.25*xdim- 0.125 % latitude is 0.25*ydim-90.125 % % For detailed data description, see % http://www.remss.com/amsr/amsr_data_description.html % % Remote Sensing Systems % support@remss.com scale=[.15,.2,.3,.01,.1]; offset=[-3.,0.,0.,0.,0.]; xdim=1440;ydim=720;numvar=5; mapsiz=xdim*ydim; if ~exist(data_file,'file') disp(['file not found: ', data_file]); sst=[];wind=[];vapor=[];cloud=[];rain=[]; return; end; if ~isempty(regexp(data_file,'.gz', 'once')) data_file=char(gunzip(data_file)); end fid=fopen(data_file,'rb'); data=fread(fid,mapsiz*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)*scale(i)+offset(i); map(:,:,i)=tmp; end; sst = squeeze(map(:,:,1)); wind = squeeze(map(:,:,2)); vapor = squeeze(map(:,:,3)); cloud = squeeze(map(:,:,4)); rain = squeeze(map(:,:,5)); return;