Home > atmlab > deprecated > colloc_process_data_cpr_avhrr.m

colloc_process_data_cpr_avhrr

PURPOSE ^

colloc_process_data_cpr_avhrr Gather collocation data to store for CPR+AVHRR

SYNOPSIS ^

function M = colloc_process_data_cpr_avhrr(~, M_c, ~, ~, data1, ~, ~, data2)

DESCRIPTION ^

 colloc_process_data_cpr_avhrr Gather collocation data to store for CPR+AVHRR

 After collocating, and gathering information about the collocations, we
 want to collect some actual data: in this case, brightness temperatures.

 Because this m-file has the same format as other colloc_process_data_* files
 (so that the caller doesn't need to know what is being collocated), some of
 the arguments are ignored.

 FORMAT

   M = process_data_cpr_avhrr(collocations, M_c, ...
       sat1, date1, data1, ...
       sat2, date2, data2)

 IN

   collocations    Nx4 matrix  (ignored) as returned by collocate
   M_c             Nxp matrix  As returned by process_cpr_avhrr
   sat1            string      name of 1st satellite
   date1           1x5 vector  (ignored) starting time of 1st satellite
   data1           structure   As returned by read_cpr
   sat2            string      name of 2nd satellite
   date2           1x5 vector  As date1, but for secondary granule.
   data2           structure   As returned by read_avhrr

 OUT

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

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

colloc_process_data_cpr_avhrr.m

SOURCE CODE ^

0001 function M = colloc_process_data_cpr_avhrr(~, M_c, ~, ~, data1, ~, ~, data2)
0002 
0003 % colloc_process_data_cpr_avhrr Gather collocation data to store for CPR+AVHRR
0004 %
0005 % After collocating, and gathering information about the collocations, we
0006 % want to collect some actual data: in this case, brightness temperatures.
0007 %
0008 % Because this m-file has the same format as other colloc_process_data_* files
0009 % (so that the caller doesn't need to know what is being collocated), some of
0010 % the arguments are ignored.
0011 %
0012 % FORMAT
0013 %
0014 %   M = process_data_cpr_avhrr(collocations, M_c, ...
0015 %       sat1, date1, data1, ...
0016 %       sat2, date2, data2)
0017 %
0018 % IN
0019 %
0020 %   collocations    Nx4 matrix  (ignored) as returned by collocate
0021 %   M_c             Nxp matrix  As returned by process_cpr_avhrr
0022 %   sat1            string      name of 1st satellite
0023 %   date1           1x5 vector  (ignored) starting time of 1st satellite
0024 %   data1           structure   As returned by read_cpr
0025 %   sat2            string      name of 2nd satellite
0026 %   date2           1x5 vector  As date1, but for secondary granule.
0027 %   data2           structure   As returned by read_avhrr
0028 %
0029 % OUT
0030 %
0031 %   M               Nxp matrix  Matrix containing p fields of information for
0032 %                               all N collocations.
0033 %
0034 % $Id: colloc_process_data_cpr_avhrr.m 7553 2012-04-27 19:08:16Z gerrit $
0035 
0036 % prepare
0037 c = colloc_constants('cols_cpr_avhrr');
0038 n = size(M_c, 1);
0039 M = nan*zeros(n, c.data.NCOLS);
0040 
0041 % row and column numbers
0042 r1 = M_c(:, c.overlap.C_I);
0043 r2 = M_c(:, c.overlap.AVHRR_ROW);
0044 c2 = M_c(:, c.overlap.AVHRR_COL);
0045 
0046 %% cloudsat data
0047 M(:, c.data.ROIWP) = data1.RO_ice_water_path(r1);
0048 M(:, c.data.dROIWP) = data1.RO_ice_water_path_uncertainty(r1);
0049 M(:, c.data.IOROIWP) = data1.IO_RO_ice_water_path(r1);
0050 M(:, c.data.dIOROIWP) = data1.IO_RO_ice_water_path_uncertainty(r1);
0051 
0052 %% AVHRR data
0053 
0054 % index for direct addressing
0055 i2 = sub2ind(size(data2.lat), r2, c2);
0056 
0057 % WARNING! channel 3b->column 4, 4->column 5, 5->column 6!
0058 M(:, c.data.AVHRR(1)) = data2.albedoCh1(i2);
0059 M(:, c.data.AVHRR(2)) = data2.albedoCh2(i2);
0060 M(:, c.data.AVHRR(3)) = data2.albedoCh3A(i2);
0061 M(:, c.data.AVHRR(4)) = data2.brightnessTempCh3B(i2);
0062 M(:, c.data.AVHRR(5)) = data2.brightnessTempCh4(i2);
0063 M(:, c.data.AVHRR(6)) = data2.brightnessTempCh5(i2);
0064 M(:, c.data.CLOUDFLAG) = data2.cloudFlag(i2);
0065 
0066 is_3A = logical(data2.chan3A3B);
0067 M(is_3A(r2), c.data.AVHRR(4)) = nan; % set 3B to 0 if 3A on
0068 M(~is_3A(r2), c.data.AVHRR(3)) = nan; % set 3A to 0 if 3B on

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