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

patmosxL3

PURPOSE ^

SATREADERS.PATMOSX reads patmosx data

SYNOPSIS ^

function [S,attr] = patmosxL3(file, varargin)

DESCRIPTION ^

 SATREADERS.PATMOSX reads patmosx data

 Read PATMOS-x data and output the data in the format common to all
 satreaders.<dataset>.m readers in atmlab. Geodata and time data are
 always retrieved from the data file.

 NOTE: This reader actually reads 2 files, one ascending, one descending

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

 IN

   file    string      Path to gzipped file
   extra   cell array (optional) extra fields.

 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

 NOTE: no time output since it's monthly data

 FORMAT

   S = satreaders.patmosx(file, varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

patmosxL3.m

SOURCE CODE ^

0001 function [S,attr] = patmosxL3(file, varargin)
0002 
0003 % SATREADERS.PATMOSX reads patmosx data
0004 %
0005 % Read PATMOS-x data and output the data in the format common to all
0006 % satreaders.<dataset>.m readers in atmlab. Geodata and time data are
0007 % always retrieved from the data file.
0008 %
0009 % NOTE: This reader actually reads 2 files, one ascending, one descending
0010 %
0011 % For info on the common format, see <a href="matlab:help SatDataset/reader">SatDataset/reader</a>.
0012 %
0013 % IN
0014 %
0015 %   file    string      Path to gzipped file
0016 %   extra   cell array (optional) extra fields.
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 % NOTE: no time output since it's monthly data
0026 %
0027 % FORMAT
0028 %
0029 %   S = satreaders.patmosx(file, varargin)
0030 
0031 % $Id: patmosxL3.m 8777 2014-02-12 12:45:13Z gerrit $
0032 % Salomon Eliasson
0033 
0034 core_fields = {'cell_latitude','cell_longitude'};
0035 extra_fields = optargs(varargin, {{}});
0036 all_fields = [core_fields(:); extra_fields(:)];
0037 
0038 % read the data. This also scales the data automatically!
0039 S       = read_clavrx_hdf(file,all_fields);
0040 
0041 % rename some fields
0042 S.lon   = double(S.cell_longitude(:));
0043 S.lat   = double(S.cell_latitude(:));
0044 S.time  = zeros(size(S.lat)); % since Gerrits codes require time
0045 D           = datasets;
0046 
0047 date        = D.patmosxL3.find_info_from_granule(file);
0048 % get the month from the filename
0049 info        = regexp(file,'patmosx_aft_mor_.+(?<year>\d{4})_(?<month>.{3})','names');
0050 % the month is unhappily given as a string so...
0051 strmonths   = {'jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'}; x=1:12;
0052 date.month  = x(ismember(strmonths,info.month));
0053 
0054 S.epoch     = round(date2unixsecs(str2double(date.year), date.month, 1)); %monthly mean
0055 S.version = '4'; %this is given in the README in /storage3/data/patmosx/level3
0056 S.path = file;
0057 
0058 S = rmfield(S,core_fields);
0059 
0060 end

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