Home > atmlab > deprecated > colloc_process_data_x_to_x.m

colloc_process_data_x_to_x

PURPOSE ^

colloc_process_data_x_to_x Gather collocation data to store for identical sensors

SYNOPSIS ^

function M = colloc_process_data_x_to_x(~, M_c,~, sensor1, ~, data1,~, sensor2, ~, data2)

DESCRIPTION ^

 colloc_process_data_x_to_x Gather collocation data to store for identical sensors

 After collocating, and gathering information about the collocations, we
 want to collect some actual data.

 FORMAT

   M = colloc_process_data_x_to_x(collocations, M, ...
       name1, date1, data1, name2, date2, data2)

 IN

   collocations    Nx4 matrix  As returned by collocate
   M_c             matrix      As returned by colloc_process_poes_poes
   sat1
   sensor1         string      name of satellite 1
   date1           1x5 vector  Contains [year month day hour minute] for the
                               start of the primary granule (ignored here)
   data1           structure   Fields for brightness temperature should be
                               present
   sat2
   sensor2         string      name of satellite 2
   date2           1x5 vector  As date1, but for secondary granule
                               (ignored here)
   data2           structure   As data1, but for secondary granule.

 OUT

   M               Nxp matrix  Matrix containing p fields of information for
                               all N collocations.

 $Id: colloc_process_data_x_to_x.m 7553 2012-04-27 19:08:16Z gerrit $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

colloc_process_data_x_to_x.m

SOURCE CODE ^

0001 function M = colloc_process_data_x_to_x(~, M_c, ...
0002     ~, sensor1, ~, data1, ...
0003     ~, sensor2, ~, data2)
0004 
0005 % colloc_process_data_x_to_x Gather collocation data to store for identical sensors
0006 %
0007 % After collocating, and gathering information about the collocations, we
0008 % want to collect some actual data.
0009 %
0010 % FORMAT
0011 %
0012 %   M = colloc_process_data_x_to_x(collocations, M, ...
0013 %       name1, date1, data1, name2, date2, data2)
0014 %
0015 % IN
0016 %
0017 %   collocations    Nx4 matrix  As returned by collocate
0018 %   M_c             matrix      As returned by colloc_process_poes_poes
0019 %   sat1
0020 %   sensor1         string      name of satellite 1
0021 %   date1           1x5 vector  Contains [year month day hour minute] for the
0022 %                               start of the primary granule (ignored here)
0023 %   data1           structure   Fields for brightness temperature should be
0024 %                               present
0025 %   sat2
0026 %   sensor2         string      name of satellite 2
0027 %   date2           1x5 vector  As date1, but for secondary granule
0028 %                               (ignored here)
0029 %   data2           structure   As data1, but for secondary granule.
0030 %
0031 % OUT
0032 %
0033 %   M               Nxp matrix  Matrix containing p fields of information for
0034 %                               all N collocations.
0035 %
0036 % $Id: colloc_process_data_x_to_x.m 7553 2012-04-27 19:08:16Z gerrit $
0037 
0038 % Created by Gerrit Holl
0039 %
0040 % $Id: colloc_process_data_x_to_x.m 7553 2012-04-27 19:08:16Z gerrit $
0041 
0042 % prepare
0043 c = colloc_constants(sprintf('cols_%s_%s', sensor1, sensor2));
0044 
0045 % row and column numbers
0046 r1 = M_c(:, c.overlap.I1);
0047 r2 = M_c(:, c.overlap.I2);
0048 c1 = M_c(:, c.overlap.C1);
0049 c2 = M_c(:, c.overlap.C2);
0050 
0051 % index for direct addressing
0052 i1 = sub2ind(size(data1.lat), r1, c1);
0053 i2 = sub2ind(size(data2.lat), r2, c2);
0054 
0055 % reshape so that I can use direct addressing for brightness temperatures
0056 
0057 tb1 = reshape(data1.tb, numel(data1.lat), []);
0058 tb2 = reshape(data2.tb, numel(data2.lat), []);
0059 
0060 %% store info
0061 
0062 M = [tb1(i1, :) tb2(i2, :)];

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