Home > atmlab > datasets > cloud_cci_postprocessor.m

cloud_cci_postprocessor

PURPOSE ^

% clouds_cci_postprocessor

SYNOPSIS ^

function S = cloud_cci_postprocessor(self,S,fields)

DESCRIPTION ^

% clouds_cci_postprocessor

 PURPOSE: To create "pseudo" fields that are not in the original cloud_cci
          data by post-processing fields that are in the original data


 IN
     self = dataset
     S = Data structure to add pseudo field to (from self.reader)
     fields = {'names','of','pseudo','fields'}

 OUT
     S = Data structure + pseudo field/s

 NOTE: See also help Satdataset/pseudo_fields

 $Id: cloud_cci_postprocessor.m 8312 2013-03-26 19:17:31Z seliasson $
 Salomon Eliasson

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

cloud_cci_postprocessor.m

SOURCE CODE ^

0001 function S = cloud_cci_postprocessor(self,S,fields)
0002 %% clouds_cci_postprocessor
0003 %
0004 % PURPOSE: To create "pseudo" fields that are not in the original cloud_cci
0005 %          data by post-processing fields that are in the original data
0006 %
0007 %
0008 % IN
0009 %     self = dataset
0010 %     S = Data structure to add pseudo field to (from self.reader)
0011 %     fields = {'names','of','pseudo','fields'}
0012 %
0013 % OUT
0014 %     S = Data structure + pseudo field/s
0015 %
0016 % NOTE: See also help Satdataset/pseudo_fields
0017 %
0018 % $Id: cloud_cci_postprocessor.m 8312 2013-03-26 19:17:31Z seliasson $
0019 % Salomon Eliasson
0020 
0021 
0022 for F =fields
0023     field = F{1};
0024     mv = self.pseudo_fields.(field).atts.missing_value;
0025     switch field
0026         case {'iwp','ref_ice','cot_ice','iwp_error'}
0027             % Keeping record of the pixels that are deemed to be cloud free
0028             clearPixel = S.cc_total==0;
0029             
0030             % grab values flagged as ice phase
0031             icePhase = S.phase==2;
0032 
0033       otherwise
0034         error(['atmlab:' mfilename],'field: %s not found',field)
0035     end
0036     switch field
0037         case 'iwp'
0038             % depends on {cwp'  'phase'  'cc_total'}
0039 
0040             S.cwp(~(clearPixel | icePhase)) = mv;
0041             S.iwp = S.cwp;
0042             S.iwp(clearPixel) = 0; 
0043         case 'ref_ice'
0044             % depends on {'phase','ref','cc_total'}
0045             
0046             S.ref(~(clearPixel | icePhase)) = mv;
0047             S.ref_ice = S.ref;
0048             S.ref_ice(clearPixel) = 0; 
0049         case 'cot_ice'
0050             % depends on {'phase','cot','cc_total'}
0051             
0052             S.cot(~(clearPixel | icePhase)) = mv;
0053             S.cot_ice = S.cot;
0054             S.cot_ice(clearPixel) = 0; 
0055             
0056         case 'iwp_error'
0057             S.iwp_error = S.cwp_uncertainty;
0058             S.iwp_error(~icePhase) = mv;
0059         otherwise
0060             error(['atmlab:' mfilename],'field: %s not found',field)
0061     end
0062     
0063 end
0064 
0065 end

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