Home > atmlab > sensors > amsub_cloudfilter.m

amsub_cloudfilter

PURPOSE ^

% AMSUB_CLOUDFILTER gets a cloud/surface filter for passive microwave

SYNOPSIS ^

function [combifilter,tooCold,diffFilter]=amsub_cloudfilter(tb18, tdiff, viewangle)

DESCRIPTION ^

% AMSUB_CLOUDFILTER gets a cloud/surface filter for passive microwave

 PUPOSE
           Performs a cloud filter according to a given angle dependent
           threshold for Tb18 and the difference between channels 19/20
           and 18

 IN
       tb18            vect        Channel 18 brightness temperature
       tdiff           vect        Difference vector:
                                   ch20 - ch18, or ch19 - ch18
       viewangle       vect        satellite viewangle. (0=nadir)

 OUT
       combifilter     vect        filter, true where the data (not too
                                   cold & not cloud filtered) are OK

       tooCold         vect        filter, true where the tb18 is warmer
                                   than the angular dependent cutoff temp 

       diffFilter     vect        filter, true where tdiff > 0 (angular
                                    dependent) 

 $Id: amsub_cloudfilter.m 7909 2012-10-09 06:44:36Z seliasson $
 Mathias Milz and Salomon Eliasson

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

amsub_cloudfilter.m

SOURCE CODE ^

0001 function [combifilter,tooCold,diffFilter]=amsub_cloudfilter(tb18, tdiff, viewangle)
0002 %% AMSUB_CLOUDFILTER gets a cloud/surface filter for passive microwave
0003 %
0004 % PUPOSE
0005 %           Performs a cloud filter according to a given angle dependent
0006 %           threshold for Tb18 and the difference between channels 19/20
0007 %           and 18
0008 %
0009 % IN
0010 %       tb18            vect        Channel 18 brightness temperature
0011 %       tdiff           vect        Difference vector:
0012 %                                   ch20 - ch18, or ch19 - ch18
0013 %       viewangle       vect        satellite viewangle. (0=nadir)
0014 %
0015 % OUT
0016 %       combifilter     vect        filter, true where the data (not too
0017 %                                   cold & not cloud filtered) are OK
0018 %
0019 %       tooCold         vect        filter, true where the tb18 is warmer
0020 %                                   than the angular dependent cutoff temp
0021 %
0022 %       diffFilter     vect        filter, true where tdiff > 0 (angular
0023 %                                    dependent)
0024 %
0025 % $Id: amsub_cloudfilter.m 7909 2012-10-09 06:44:36Z seliasson $
0026 % Mathias Milz and Salomon Eliasson
0027 
0028 % angles are in buehler et. al 2005
0029 ang=[0.5500 1.6500 2.7500 3.8500 4.9500 6.0500 7.1500 8.2500 9.3500 ...
0030     10.4500 11.5500 12.6500 13.7500 14.8500 15.9500 17.0500 18.1500 ...
0031     19.2500 20.3500 21.4500 22.5500 23.6500 24.7500 25.8500 26.9500 ...
0032     28.0500 29.1500 30.2500 31.3500 32.4500 33.5500 34.6500 35.7500 ...
0033     36.8500 37.9500 39.0500 40.1500 41.2500 42.3500 43.4500 44.5500 ...
0034     45.6500 46.7500 47.8500 48.9500];
0035 
0036 % These thresholds are to protect against the measurement being
0037 % contaminated by the surface or clouds simply being too thick
0038 thresh_tb = [ 240.1 240.1 240.1 240.1 240.1 240.1 240.1 239.9 239.9 ...
0039     239.8 239.8 239.7 239.7 239.6 239.6 239.5 239.4 239.3 ...
0040     239.2 239.2 239.1 239.0 238.8 238.7 238.6 238.5 238.3 ...
0041     238.2 238.0 237.8 237.6 237.4 237.2 237.0 236.7 236.6 ...
0042     236.4 236.1 235.8 235.5 235.2 234.9 234.4 233.9 233.3 ];
0043 
0044 TB = zeros(size(viewangle),'single');
0045 
0046 % LOOP over the viewing angles
0047 for k = 1:length(viewangle)
0048     % Find the CLOSET ANGLE in the lookup table to the angles given as input.
0049     % Pick closest_angle(1) since sometimes there are two answers
0050     closest_angle=find(abs(ang-viewangle(k))<= min(abs(ang-viewangle(k))));
0051     TB(k) = thresh_tb(closest_angle(1));
0052 end
0053 
0054 tooCold = tb18 > TB;
0055 diffFilter = tdiff > 0;
0056 
0057 combifilter = tooCold & diffFilter; %i.e. surface & cloud
0058 
0059 end

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