Home > atmlab > datasets > +satreaders > poes_radiometer.m

poes_radiometer

PURPOSE ^

satreaders.poes_radiometer Read POES data and arrange in the common format

SYNOPSIS ^

function data = poes_radiometer(file, ~)

DESCRIPTION ^

 satreaders.poes_radiometer Read POES data and arrange in the common format

 This file reads data from a POES l1b radiometer file and rearranges the
 fields to the common format. See README.

 For info on the common format, see <a href="matlab:help SatDataset/reader">SatDataset/reader</a>.

 FORMAT

   data = satreaders.poes_radiometer(file)

 IN

   file    string  Path to l1b file. Must be FULL PATH!

 OUT

   data    struct  With fields:
                   time    time in seconds since 00:00 UT
                   lat     latitude in degrees, one column per viewing angle
                   lon     longitude in [-180, 180] degrees, colums as for lat

 $Id: poes_radiometer.m 8720 2013-10-21 20:41:39Z gerrit $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

poes_radiometer.m

SOURCE CODE ^

0001 function data = poes_radiometer(file, ~)
0002 
0003 % satreaders.poes_radiometer Read POES data and arrange in the common format
0004 %
0005 % This file reads data from a POES l1b radiometer file and rearranges the
0006 % fields to the common format. See README.
0007 %
0008 % For info on the common format, see <a href="matlab:help SatDataset/reader">SatDataset/reader</a>.
0009 %
0010 % FORMAT
0011 %
0012 %   data = satreaders.poes_radiometer(file)
0013 %
0014 % IN
0015 %
0016 %   file    string  Path to l1b file. Must be FULL PATH!
0017 %
0018 % OUT
0019 %
0020 %   data    struct  With fields:
0021 %                   time    time in seconds since 00:00 UT
0022 %                   lat     latitude in degrees, one column per viewing angle
0023 %                   lon     longitude in [-180, 180] degrees, colums as for lat
0024 %
0025 % $Id: poes_radiometer.m 8720 2013-10-21 20:41:39Z gerrit $
0026 
0027 if length(file)>3 && strcmpi(file(end-2:end), 'l1c') % already in l1c (like at LERMA)
0028     data = atovs_read_data(file);
0029 else
0030     data = atovs_get_l1c(file);
0031 end
0032 
0033 % convert time from milliseconds to seconds
0034 
0035 data.time = data.time'/1000;
0036 
0037 % compensate time wrapping around
0038 
0039 data.time = compensate_wraparound(data.time);
0040 
0041 % verify data integrity
0042 
0043 assert(~isempty(data.time), ...
0044     'atmlab:invalid_data', ...
0045     'Time axis empty: %s', file)
0046 
0047 assert(all(diff(data.time)>0), ...
0048     'atmlab:invalid_data', ...
0049     'POES time not monotonically increasing: %s', file);
0050 
0051 % shift dimensions so that it's [row col (channel)]
0052 
0053 for field = {'lat', 'lon', 'lza', 'laa', 'sza', 'saa', 'elev'}
0054     if isfield(data, field)
0055         data.(field{1}) = shiftdim(data.(field{1}), 1);
0056     end
0057 end
0058 data.tb = shiftdim(data.tb, 2);
0059 
0060 % add filename and version
0061 
0062 data.path = file;
0063 data.version = '0'; % dunno
0064 
0065 % add epoch
0066 
0067 d = datasets;
0068 info = d.mhs.find_info_from_granule(file);
0069 data.epoch = round(date2unixsecs(str2double(info.year), str2double(info.month), ...
0070     str2double(info.day)));

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005