Home > atmlab > deprecated > colloc_process_data_collocation_cpr_poes_avhrr.m

colloc_process_data_collocation_cpr_poes_avhrr

PURPOSE ^

colloc_process_data_collocation_cpr_poes_avhrr Gather collocation data

SYNOPSIS ^

function M_d = colloc_process_data_collocation_cpr_poes_avhrr(~, M_c,~, ~, ~,~, ~, data2)

DESCRIPTION ^

 colloc_process_data_collocation_cpr_poes_avhrr Gather collocation data 

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

 FORMAT

   M_d = colloc_process_data_hirscs_poes(collocations, M_c, ...
         name1, date1, data1, name2, date2, data2)

 IN

   collocations    Nx4 matrix  (not used here)
   M_c             matrix      As returned by
                               colloc_process_collocation_cpr_poes_avhrr
   name1           string      name of satellite 1
   date1           1x5 vector  Contains [year month day hour minute] for the
                               start of the primary granule
   data1           structure   Fields for brightness temperature should be
                               present
   name2           string      name of satellite 2
   date2           1x5 vector  As date1, but for secondary granule
   data2           structure   As data1, but for secondary granule.

 OUT

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

 $Id: colloc_process_data_collocation_cpr_poes_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_collocation_cpr_poes_avhrr.m

SOURCE CODE ^

0001 function M_d = colloc_process_data_collocation_cpr_poes_avhrr(~, M_c, ...
0002     ~, ~, ~, ...
0003     ~, ~, data2)
0004 
0005 % colloc_process_data_collocation_cpr_poes_avhrr Gather collocation data
0006 %
0007 % After collocating, and gathering information about the collocations, we
0008 % want to collect some actual data.
0009 %
0010 % FORMAT
0011 %
0012 %   M_d = colloc_process_data_hirscs_poes(collocations, M_c, ...
0013 %         name1, date1, data1, name2, date2, data2)
0014 %
0015 % IN
0016 %
0017 %   collocations    Nx4 matrix  (not used here)
0018 %   M_c             matrix      As returned by
0019 %                               colloc_process_collocation_cpr_poes_avhrr
0020 %   name1           string      name of satellite 1
0021 %   date1           1x5 vector  Contains [year month day hour minute] for the
0022 %                               start of the primary granule
0023 %   data1           structure   Fields for brightness temperature should be
0024 %                               present
0025 %   name2           string      name of satellite 2
0026 %   date2           1x5 vector  As date1, but for secondary granule
0027 %   data2           structure   As data1, but for secondary granule.
0028 %
0029 % OUT
0030 %
0031 %   M_d             Nxp matrix  Matrix containing p fields of information for
0032 %                               all N collocations.
0033 %
0034 % $Id: colloc_process_data_collocation_cpr_poes_avhrr.m 7553 2012-04-27 19:08:16Z gerrit $
0035 
0036 
0037 c = colloc_constants('cols_collocation_cpr_mhs_avhrr');
0038 
0039 % row and column numbers; use M_c, not collocations, because the latter are
0040 % sorted and the former aren't, and this has to be in the same order
0041 r2 = M_c(:, c.overlap.AVHRR_ROW);
0042 c2 = M_c(:, c.overlap.AVHRR_COL);
0043 
0044 % index for direct addressing
0045 %i1 = sub2ind(size(data1.lat), r1, c1);
0046 i2 = sub2ind(size(data2.lat), r2, c2);
0047 
0048 M_d = nan*zeros(size(M_c, 1), c.data.NCOLS);
0049 M_d(:, c.data.AVHRR(1)) = data2.albedoCh1(i2);
0050 M_d(:, c.data.AVHRR(2)) = data2.albedoCh2(i2);
0051 M_d(:, c.data.AVHRR(3)) = data2.albedoCh3A(i2);
0052 M_d(:, c.data.AVHRR(4)) = data2.brightnessTempCh3B(i2);
0053 M_d(:, c.data.AVHRR(5)) = data2.brightnessTempCh4(i2);
0054 M_d(:, c.data.AVHRR(6)) = data2.brightnessTempCh5(i2);
0055 M_d(:, c.data.CLOUDFLAG) = data2.cloudFlag(i2);
0056 
0057 % there is some confusion about channel 3: even if albedoCh3A is fully
0058 % flagged and brightnessTempCh3B contains values, those values are
0059 % (sometimes? consistently? not sure yet) in the range [0, 100] and thus
0060 % actually albedo's.
0061 
0062 % but see http://www2.ncdc.noaa.gov/docs/klm/html/c8/s83133-1.htm
0063 % for if chan3A3B is true, then it's 3A
0064 is_3A = logical(data2.chan3A3B);
0065 M_d(is_3A(r2), c.data.AVHRR(4)) = nan; % set 3B to 0 if 3A on
0066 M_d(~is_3A(r2), c.data.AVHRR(3)) = nan; % set 3A to 0 if 3B on
0067

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