Home > atmlab > retrieval > spareice > compare_collocated_iwp_products.m

compare_collocated_iwp_products

PURPOSE ^

This function for backward-compatibility. No need to call it.

SYNOPSIS ^

function compare_collocated_iwp_products

DESCRIPTION ^

 This function for backward-compatibility.  No need to call it.

 This funciton needs to be here because the neural networks as stored
 contain references to required function handles of anonymous functions
 or subfunctions defined herein.  Copying the functions to their own
 files won't help because when the neural network was initially defined,
 it was from this function.  There is no need to call this function.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

compare_collocated_iwp_products.m

SOURCE CODE ^

0001 function compare_collocated_iwp_products
0002 
0003 % This function for backward-compatibility.  No need to call it.
0004 %
0005 % This funciton needs to be here because the neural networks as stored
0006 % contain references to required function handles of anonymous functions
0007 % or subfunctions defined herein.  Copying the functions to their own
0008 % files won't help because when the neural network was initially defined,
0009 % it was from this function.  There is no need to call this function.
0010 
0011 %
0012 % See also: CollocatedNNIWP, NNTrainedProduct, InstrumentVisualiser,
0013 %           CollocationRetrievalDatabaseProduct, compare_ice_retrievals
0014 
0015 % which input-combination to include
0016 inps_solar = {'avhrr_12', 'avhrr_12_angles', 'avhrr_12_lat', 'avhrr_12_lat_angles'};
0017 inps_tir = {'avhrr_45', 'avhrr_45_tsurf', 'avhrr_45_angles', 'avhrr_45_lat', 'avhrr_45_lat_tsurf', 'avhrr_45_lat_tsurf_angles'};
0018 inps_mw = {'mhs_345_only', 'mhs_345_lat', 'mhs_345_angles', 'mhs_345_lat_angles'};
0019 % inps = inps_mw;
0020 % inps = {'avhrr_12_lat_angles', 'avhrr_45_lat_tsurf', 'mhs_345_lat_angles', ...
0021 %      'avhrr_1245_lat_angles_tsurf', 'avhrr_1245_mhs_345_lat_angles_tsurf', ...
0022 %      'avhrr_12345_mhs_345_lat_angles', 'avhrr_12345_mhs_345_lat_angles_elevn'};
0023 % inps = {'avhrr_12_mhs_345_lat_angles', 'avhrr_45_mhs_345_lat_angles_tsurf'}
0024 %inps = {'avhrr_12345_mhs_345_lat_angles', 'avhrr_12345_mhs_345_lat_angles_elevn', 'avhrr_12345_mhs_345_lat_angles_elevn_dz'};
0025 %inps = { 'avhrr_12345_angles_elevn_tsurfcfsr', 'avhrr_345_angles_elevn_tsurfcfsr', 'avhrr_12345_mhs_345_lat_angles_elevn_dz', 'avhrr_12345_lat_angles_elevn_dz', 'avhrr_12345_lat_angles_elevn', 'avhrr_12345_lat_lza_sza_saa_elevn'};
0026 %inps = {'avhrr_345_angles_elevn_tsurfcfsr', 'avhrr_12345_mhs_345_lat_angles_elevn_dz', 'avhrr_12345_lat_angles_elevn_dz', 'avhrr_12345_lat_angles_elevn', 'avhrr_12345_lat_lza_sza_saa_elevn'};
0027 %inps = {'avhrr_12345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0028 %        'avhrr_12345_mhs_345_angles_elevn_tsurfcfsr', ...
0029 %        'avhrr_12345_mhs_345_lat_angles_elevn', ...
0030 %        'avhrr_345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0031 %        'avhrr_345_mhs_345_angles_elevn_tsurfcfsr', ...
0032 %        'avhrr_12345_mhs_345_lat_angles_tsurfcfsr', ...
0033 %        'avhrr_12345_mhs_345_angles_tsurfcfsr', ...
0034 %        'avhrr_12345_mhs_345_lat_angles', ...
0035 %        'avhrr_12345_mhs_345_angles', ...
0036 %        'avhrr_345_mhs_345_lat_angles_tsurfcfsr', ...
0037 %        'avhrr_345_mhs_345_angles_tsurfcfsr', ...
0038 %        'avhrr_345_mhs_345_lat_angles'};
0039 % inps = {'avhrr_12345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0040 %         'avhrr_12345_mhs_345_angles_elevn_tsurfcfsr', ...
0041 %         'avhrr_12345_mhs_345_lat_angles_elevn', ...
0042 %         'avhrr_345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0043 %         'avhrr_345_mhs_345_angles_elevn_tsurfcfsr', ...
0044 %         'avhrr_345_mhs_345_lat_angles_elevn', ...
0045 %         'avhrr_345_mhs_345_lat_angles_tsurfcfsr', ...
0046 %         'avhrr_345_mhs_345_angles_tsurfcfsr', ...
0047 %         'avhrr_345_mhs_345_lat_angles'};
0048 inps = {'avhrr_345_mhs_345_angles_tsurfcfsr'}; 
0049 % inps = {'avhrr_12345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0050 %         'avhrr_12345_mhs_345_angles_elevn_tsurfcfsr', ...
0051 %         'avhrr_12345_mhs_345_lat_angles_elevn', ...
0052 %         'avhrr_12345_mhs_345_angles_elevn', ...
0053 %         'avhrr_345_mhs_345_lat_angles_elevn_tsurfcfsr', ...
0054 %         'avhrr_345_mhs_345_angles_elevn_tsurfcfsr', ...
0055 %         'avhrr_345_mhs_345_lat_angles_elevn', ...
0056 %         'avhrr_345_mhs_345_angles_elevn', ...
0057 %         'avhrr_12345_mhs_345_lat_angles_tsurfcfsr', ...
0058 %         'avhrr_12345_mhs_345_angles_tsurfcfsr', ...
0059 %         'avhrr_12345_mhs_345_lat_angles', ...
0060 %         'avhrr_12345_mhs_345_angles', ...
0061 %         'avhrr_345_mhs_345_lat_angles_tsurfcfsr', ...
0062 %         'avhrr_345_mhs_345_angles_tsurfcfsr', ...
0063 %         'avhrr_345_mhs_345_lat_angles', ...
0064 %         'avhrr_345_mhs_345_angles'};
0065 
0066 %inps = {'avhrr_12345_mhs_345_lat_angles_elevn_dz'}; % = spareice
0067 collocation_limits = struct('B_BT', [100 400], ...
0068     'MEAN_AVHRR_Y', [0 400], ...
0069     'LAT1', [-90, 90], ...
0070     'B_SZA', [0 85]);
0071 
0072 limname = 'global';
0073 process_month = true;
0074 no_nets = 5;
0075 homog = true;
0076 
0077 ylims = [0, 300];
0078 %ylims = [0, 800]; % avhrr 45 global peak
0079 %ylims = [0, 1200]; % avhrr 12 global peak
0080 %ylims = [0, 450]; % mhs 345 global peak (not really)
0081 %
0082 %             self.members.AVHRR_FLAG_3AB.type = 'int';
0083 %             self.members.AVHRR_FLAG_3AB.atts.long_name = 'AVHRR-3 flag: 3A/3B';
0084 %             self.members.AVHRR_FLAG_3AB.atts.valid_range = [0, 1];
0085 %             self.members.AVHRR_FLAG_3AB.atts.origin = 'Based on AVHRR L1 data from NOAA CLASS archive';
0086 %
0087              
0088 
0089 inputs.avhrr_12 = struct(...
0090         'MEAN_AVHRR_Y', struct(...
0091             'transform', @(x)x, ...
0092             'invtransform', @(x)x, ...
0093             'lims', [0, 100], ...
0094             'chans', [1, 2]));
0095 
0096 inputs.avhrr_12.MEAN_AVHRR_Y.stored.type = 'float';
0097 inputs.avhrr_12.MEAN_AVHRR_Y.stored.atts.valid_min = 0;
0098 inputs.avhrr_12.MEAN_AVHRR_Y.stored.long_name = 'AVHRR measurements averaged over MHS footprint';
0099 inputs.avhrr_12.MEAN_AVHRR_Y.stored.atts.units = 'reflectance or BT [K]';
0100 inputs.avhrr_12.MEAN_AVHRR_Y.stored.atts.origin = 'Based on AVHRR l1a data from NOAA CLASS archive';
0101 
0102 inputs.avhrr_123 = struct(...
0103         'MEAN_AVHRR_Y', struct(...
0104             'transform', @(x)x, ...
0105             'invtransform', @(x)x, ...
0106             'lims', [0, 100], ...
0107             'chans', [1, 2, 3], ...
0108             'stored', inputs.avhrr_12.MEAN_AVHRR_Y.stored));
0109         
0110 inputs.avhrr_1245 = struct(...
0111         'MEAN_AVHRR_Y', struct(...
0112             'transform', @(x)x, ...
0113             'invtransform', @(x)x, ...
0114             'lims', [0, 400], ...
0115             'chans', [1, 2, 4, 5], ...
0116             'stored', inputs.avhrr_12.MEAN_AVHRR_Y.stored));
0117 
0118 inputs.avhrr_12345 = struct(...
0119         'MEAN_AVHRR_Y', struct(...
0120             'transform', @(x)x, ...
0121             'invtransform', @(x)x, ...
0122             'lims', [0, 400], ...
0123             'chans', [1, 2, 3, 4, 5], ...
0124             'stored', inputs.avhrr_12.MEAN_AVHRR_Y.stored));
0125 
0126 angles = struct(...
0127         'B_LZA', struct(...
0128             'transform', @cosd, ...
0129             'invtransform', @acosd, ...
0130             'lims', [0, 180]), ...
0131         'B_LAA', struct(...
0132             'transform', @cosd, ...
0133             'invtransform', @acosd, ...
0134             'lims', [-180, 180]), ...
0135         'B_SZA', struct(...
0136             'transform', @cosd, ...
0137             'invtransform', @acosd, ...
0138             'lims', [0, 85]), ...
0139         'B_SAA', struct(...
0140             'transform', @cosd, ...
0141             'invtransform', @acosd, ...
0142             'lims', [-180, 180]));
0143         
0144 angles.B_LZA.stored.type = 'float';
0145 angles.B_LZA.stored.atts.long_name = 'MHS local zenith angle';
0146 angles.B_LZA.stored.atts.valid_range = [0, 180];
0147 angles.B_LZA.stored.atts.units = 'degrees';
0148 angles.B_LZA.stored.atts.origin = 'Copied from MHS L1 data from NOAA CLASS archive';
0149 %
0150 angles.B_LAA.stored.type = 'float';
0151 angles.B_LAA.stored.atts.units = 'degrees';
0152 angles.B_LAA.stored.atts.long_name = 'MHS local azimuth angle';
0153 angles.B_LAA.stored.atts.valid_range = [0, 360];
0154 angles.B_LAA.stored.atts.origin = angles.B_LZA.stored.atts.origin;
0155 %
0156 angles.B_SZA.stored.type = 'float';
0157 angles.B_SZA.stored.atts.units = 'degrees';
0158 angles.B_SZA.stored.atts.long_name = 'Solar zenith angle';
0159 angles.B_SZA.stored.atts.valid_range = [0, 180];
0160 angles.B_SZA.stored.atts.origin = angles.B_LZA.stored.atts.origin;
0161 %
0162 angles.B_SAA.stored.type = 'float';
0163 angles.B_SAA.stored.atts.units = 'degrees';
0164 angles.B_SAA.stored.atts.long_name = 'Solar azimuth angle';
0165 angles.B_SAA.stored.atts.valid_range = [0, 360];
0166 angles.B_SAA.stored.atts.origin = angles.B_LZA.stored.atts.origin;
0167 %
0168 lat = struct(...
0169         'LAT1', struct(...
0170             'transform', @cosd, ...
0171             'invtransform', @acosd, ...
0172             'lims', [-90, 90]));
0173 lat.LAT1.stored.type = 'float';
0174 lat.LAT1.stored.atts.units = 'degrees_north';
0175 lat.LAT1.stored.atts.long_name = 'Latitude (used as input)';
0176 lat.LAT1.stored.atts.valid_range = [-90, 90];
0177 lat.LAT1.stored.realname = 'LAT';
0178 
0179 
0180 tsurf = struct(...
0181         'MEAN_ECMWF_Skin_temperature', struct(...
0182             'transform', @(x)x, ...
0183             'invtransform', @(x)x, ...
0184             'lims', [200, 400]));
0185         
0186 tsurfcfsr = struct(...
0187         'CFSR_Skin_temperature', struct(...
0188             'transform', @(x)x, ...
0189             'invtransform', @(x)x, ...
0190             'lims', [200, 400], ...
0191             'process', ...
0192                 {{@get_cfsr_skin_temperature, ...
0193                     struct(...
0194                         'LAT1', ...
0195                             struct(...,
0196                                 'transform', @(x)x, ...
0197                                 'invtransform', @(x)x, ...
0198                                 'lims', [-90, 90]), ...
0199                         'LON1', ...
0200                             struct(...
0201                                 'transform', @(x)x, ...
0202                                 'invtransform', @(x)x, ...
0203                                 'lims', [-180, 180]), ...
0204                         'TIME1', ...
0205                             struct(...
0206                                 'transform', @(x)x, ...
0207                                 'invtransform', @(x)x, ...
0208                                 'lims', [-180, 180]))}}, ...
0209             'stored', struct(...
0210                 'type', 'float', ...
0211                 'atts', struct(...
0212                     'units', 'K', ...
0213                     'long_name', 'NCEP CFSR skin temperature', ...
0214                     'valid_range', [0, 400], ...
0215                     'origin', 'NCEP CFSR ds093.1'))));
0216 
0217 elev = struct(...
0218         'Surface_elevation', struct(...
0219                 'process', ...
0220                 {{@get_surface_elevation, ...
0221                  struct(...
0222                     'LAT1', ...
0223                         struct(...
0224                             'transform', @(x)x, ...
0225                             'invtransform', @(x)x, ...
0226                             'lims', [-90, 90]), ...
0227                     'LON1', ...
0228                         struct(...
0229                             'transform', @(x)x, ...
0230                             'invtransform', @(x)x, ...
0231                             'lims', [-180, 180]))}}, ...
0232         'transform', @(x)max(x, 0)/1000, ... % NB: see below
0233         'invtransform', @(x)x*1000));
0234     
0235 elev.Surface_elevation.stored.type = 'float';
0236 elev.Surface_elevation.stored.atts.units = 'km';
0237 elev.Surface_elevation.stored.atts.long_name = 'Surface_elevation';
0238 elev.Surface_elevation.stored.atts.valid_range = [0, 10];
0239 elev.Surface_elevation.stored.atts.origin = 'NOAA ETOPO1 1 Arc-Minute Global Relief Model';
0240 
0241 % NB: rather than max(x, 0) as above, more correct would be to set to 0
0242 % when ocean, leave as it is otherwise.  However, we can likely safely
0243 % consider sub-ocean land surfaces as 0-elevation land surfaces for the
0244 % present purpose.
0245     
0246 dz = struct(...
0247         'Surface_elevation_std', struct(...
0248                 'process', ...
0249                 {{@(lat, lon) get_surface_elevation(lat, lon, 1), ...
0250                 struct(...
0251                     'LAT1', elev.Surface_elevation.process{2}.LAT1, ...
0252                     'LON1', elev.Surface_elevation.process{2}.LON1)}}, ...
0253         'transform', elev.Surface_elevation.transform, ...
0254         'invtransform', elev.Surface_elevation.invtransform));
0255 
0256 % FIXME: calculate one or two relevant angles from this?
0257 %
0258 % according to http://en.wikipedia.org/wiki/Great-circle_distance#Formulas
0259 
0260 inputs.avhrr_12_angles = catstruct(...
0261     inputs.avhrr_12, angles);
0262 
0263 inputs.avhrr_12_lat = catstruct(...
0264     inputs.avhrr_12, lat);
0265 
0266 inputs.avhrr_12_lat_angles = catstruct(...
0267     inputs.avhrr_12_lat, angles);
0268 
0269 inputs.avhrr_123_angles = catstruct(...
0270     inputs.avhrr_123, angles);
0271 
0272 inputs.avhrr_1245_angles = catstruct(...
0273     inputs.avhrr_1245, angles);
0274 
0275 inputs.avhrr_1245_lat_angles = catstruct(...
0276     inputs.avhrr_1245, lat, angles);
0277 
0278 inputs.avhrr_1245_lat_angles_tsurf = catstruct(...
0279     inputs.avhrr_1245, lat, angles, tsurfcfsr);
0280 
0281 inputs.avhrr_12345_angles = catstruct(...
0282     inputs.avhrr_12345, angles);
0283 
0284 inputs.avhrr_12_lat_angles = catstruct(...
0285     inputs.avhrr_12_angles, lat);
0286 
0287 inputs.avhrr_12345_lat_angles = catstruct(...
0288     inputs.avhrr_12345_angles, lat);
0289 
0290 inputs.avhrr_12345_lat_angles_tsurf = catstruct(...
0291     inputs.avhrr_12345, lat, angles, tsurfcfsr);
0292 
0293 % inputs.vis_angles = catstruct(...
0294 %     inputs.vis, ...
0295 %     struct(...
0296 %         'B_SZA', struct(...
0297 %             'transform', @cosd, ...
0298 %             'invtransform', @acosd, ...
0299 %             'lims', [0, 180])));
0300 
0301 inputs.avhrr_345 = struct(...
0302         'MEAN_AVHRR_Y', struct(...
0303             'transform', @(x)x, ...
0304             'invtransform', @(x)x, ...
0305             'lims', [0, 400], ...
0306             'chans', [3, 4, 5]));
0307 
0308 
0309 inputs.avhrr_45 = struct(...
0310         'MEAN_AVHRR_Y', struct(...
0311             'transform', @(x)x, ...
0312             'invtransform', @(x)x, ...
0313             'lims', [100, 400], ...
0314             'chans', [4, 5]));
0315 
0316 avhf = {'123', '1234', '12345', '345', '45'};
0317 for i = 1:length(avhf)
0318     a = sprintf('avhrr_%s', avhf{i});
0319     inputs.(a).MEAN_AVHRR_Y.stored = inputs.avhrr_12.MEAN_AVHRR_Y.stored;
0320 end
0321 
0322 %inputs.avhrr_45_tsurf = catstruct(inputs.avhrr_45, tsurf);
0323 inputs.avhrr_45_tsurf = catstruct(inputs.avhrr_45, tsurfcfsr);
0324         
0325 inputs.avhrr_45_lat = catstruct(inputs.avhrr_45, lat);
0326 
0327 inputs.avhrr_45_angles = catstruct(inputs.avhrr_45, angles);
0328         
0329 %inputs.avhrr_45_lat_tsurf = catstruct(inputs.avhrr_45, lat, tsurf);
0330 inputs.avhrr_45_lat_tsurf = catstruct(inputs.avhrr_45, lat, tsurfcfsr);
0331 
0332 %inputs.avhrr_45_lat_tsurf_angles = catstruct(inputs.avhrr_45, lat, tsurf, angles);
0333 inputs.avhrr_45_lat_tsurf_angles = catstruct(inputs.avhrr_45, lat, tsurfcfsr, angles);
0334 
0335 inputs.dir = struct(...
0336         'dt', struct(...
0337             'process', ...
0338                 {{@(bt, surf) bsxfun(@minus, bt, surf), ...
0339                  struct(...
0340                     'MEAN_AVHRR_Y', ...
0341                         struct(...
0342                             'transform', @(x)x, ...
0343                             'invtransform', @(x)x, ...
0344                             'lims', [100 400], ...
0345                             'chans', [4, 5]), ...
0346                     'MEAN_ECMWF_Skin_temperature', ...
0347                         struct(...
0348                             'transform', @(x)x, ...
0349                             'invtransform', @(x)x, ...
0350                             'lims', [100 400]))}}));
0351                         
0352 %             'transform', @(x)x, ...
0353 %             'invtransform', @(x)x, ...
0354 %             'lims', [-100, 400], ...
0355 %             'chans', [4, 5]));
0356         
0357 % inputs.lmw = struct(...
0358 %         'B_BT', struct(...
0359 %             'transform', @(x)x, ...
0360 %             'invtransform', @(x)x, ...
0361 %             'lims', [100 400], ...
0362 %             'chans', 1));
0363 
0364 inputs.mhs_345 = struct(...
0365         'B_BT', struct(...
0366             'transform', @(x)x, ...
0367             'invtransform', @(x)x, ...
0368             'lims', [100 400], ...
0369             'chans', 3:5, ...
0370             'net', 'fit')); % only for the fitnet
0371 
0372 inputs.mhs_345.B_BT.stored.realname = 'MHS';
0373 inputs.mhs_345.B_BT.stored.type = 'float';
0374 inputs.mhs_345.B_BT.stored.atts.long_name = 'MHS radiance, channels 3-5';
0375 inputs.mhs_345.B_BT.stored.atts.valid_range = [100, 400];
0376 inputs.mhs_345.B_BT.stored.atts.units = 'K';
0377 inputs.mhs_345.B_BT.stored.atts.origin = 'Copied from MHS L1 data from NOAA CLASS archive';
0378 inputs.mhs_345.B_BT.stored.dims = {'MHS_HUM_CHANS', 3};
0379 %
0380 inputs.mhs_345_only = inputs.mhs_345;
0381 inputs.mhs_345_only.B_BT = rmfield(inputs.mhs_345_only.B_BT, 'net');
0382 %
0383 inputs.mhs_345_lat = catstruct(inputs.mhs_345_only, lat);
0384 
0385 inputs.mhs_345_angles = catstruct(inputs.mhs_345_only, angles);
0386 
0387 inputs.mhs_345_lat_angles = catstruct(inputs.mhs_345_only, lat, angles);
0388 
0389 %inputs.vis_dir = catstruct(inputs.vis, inputs.dir);
0390 
0391 %inputs.vis_dir_ang = catstruct(inputs.vis_dir, angles);
0392 
0393 inputs.avhrr_12_mhs_345 = catstruct(inputs.avhrr_12, inputs.mhs_345);
0394 
0395 inputs.avhrr_12_mhs_345_angles = catstruct(inputs.avhrr_12_mhs_345, angles);
0396 
0397 inputs.avhrr_12_mhs_345_lat_angles = catstruct(inputs.avhrr_12_mhs_345, angles, lat);
0398 
0399 inputs.avhrr_12_mhs_345_lat_angles_tsurf = catstruct(inputs.avhrr_12_mhs_345, angles, lat, tsurf);
0400 
0401 inputs.avhrr_45_mhs_345 = catstruct(inputs.avhrr_45, inputs.mhs_345);
0402 
0403 inputs.avhrr_45_mhs_345_lat = catstruct(inputs.avhrr_45_mhs_345, lat);
0404 
0405 inputs.avhrr_45_mhs_345_lat_angles = catstruct(inputs.avhrr_45_mhs_345, lat, angles);
0406 
0407 inputs.avhrr_45_mhs_345_lat_angles_tsurf = catstruct(inputs.avhrr_45_mhs_345, lat, angles, tsurfcfsr);
0408 
0409 %inputs.dir_mw = catstruct(inputs.dir, inputs.mw);
0410 
0411 inputs.avhrr_1245_mhs_345 = catstruct(inputs.avhrr_1245, inputs.mhs_345);
0412 
0413 inputs.avhrr_1245_mhs_345_angles = catstruct(inputs.avhrr_1245_mhs_345, angles);
0414 
0415 inputs.avhrr_1245_mhs_345_lat_angles = catstruct(inputs.avhrr_1245_mhs_345, lat, angles);
0416 
0417 inputs.avhrr_1245_mhs_345_lat_angles_tsurf = catstruct(inputs.avhrr_1245_mhs_345, lat, angles, tsurfcfsr);
0418 
0419 inputs.avhrr_12345_mhs_345 = catstruct(inputs.avhrr_12345, inputs.mhs_345);
0420 
0421 inputs.avhrr_12345_mhs_345_angles = catstruct(inputs.avhrr_12345_mhs_345, angles);
0422 
0423 inputs.avhrr_12345_mhs_345_lat_angles = catstruct(inputs.avhrr_12345_mhs_345_angles, lat);
0424 
0425 inputs.avhrr_12345_mhs_345_lat_angles_elevn = catstruct(inputs.avhrr_12345_mhs_345_angles, lat, elev);
0426 
0427 %inputs.avhrr_12345_mhs_345_lat_angles_elevn_dz = catstruct(inputs.avhrr_12345_mhs_345_angles, lat, elev, dz);
0428 
0429 inputs.avhrr_12345_mhs_345_lat_angles_tsurf = catstruct(inputs.avhrr_12345_mhs_345_angles, lat, tsurfcfsr);
0430 
0431 inputs.avhrr_12345_lat_angles_elevn = catstruct(inputs.avhrr_12345, lat, angles, elev);
0432 
0433 inputs.avhrr_12345_lat_lza_sza_saa_elevn = catstruct(inputs.avhrr_12345, lat, getfields(angles, 'B_LZA', 'B_SZA', 'B_SAA'), elev);
0434 
0435 %inputs.avhrr_12345_lat_angles_elevn_dz = catstruct(inputs.avhrr_12345, lat, angles, elev, dz);
0436 
0437 %inputs.avhrr_12345_angles_elevn_tsurfcfsr = catstruct(inputs.avhrr_12345, angles, elev, tsurfcfsr);
0438 
0439 %inputs.avhrr_345_angles_elevn_tsurfcfsr = catstruct(inputs.avhrr_12345, angles, elev, tsurfcfsr);
0440 
0441 inputs.avhrr_12345_mhs_345_lat_angles_elevn_tsurfcfsr = ...
0442     catstruct(inputs.avhrr_12345, inputs.mhs_345, lat, angles, elev, tsurfcfsr);
0443 inputs.avhrr_12345_mhs_345_angles_elevn_tsurfcfsr = ...
0444     catstruct(inputs.avhrr_12345, inputs.mhs_345, angles, elev, tsurfcfsr);
0445 inputs.avhrr_12345_mhs_345_lat_angles_elevn = ...
0446     catstruct(inputs.avhrr_12345, inputs.mhs_345, lat, angles, elev);
0447 inputs.avhrr_12345_mhs_345_angles_elevn = ...
0448     catstruct(inputs.avhrr_12345, inputs.mhs_345, angles, elev);
0449 inputs.avhrr_345_mhs_345_lat_angles_elevn_tsurfcfsr = ...
0450     catstruct(inputs.avhrr_345, inputs.mhs_345, lat, angles, elev, tsurfcfsr);
0451 inputs.avhrr_345_mhs_345_angles_elevn_tsurfcfsr = ...
0452     catstruct(inputs.avhrr_345, inputs.mhs_345, angles, elev, tsurfcfsr);
0453 inputs.avhrr_345_mhs_345_lat_angles_elevn = ...
0454     catstruct(inputs.avhrr_345, inputs.mhs_345, lat, angles, elev);
0455 inputs.avhrr_345_mhs_345_angles_elevn = ...
0456     catstruct(inputs.avhrr_345, inputs.mhs_345, angles, elev);
0457 inputs.avhrr_12345_mhs_345_lat_angles_tsurfcfsr = ...
0458     catstruct(inputs.avhrr_12345, inputs.mhs_345, lat, angles, tsurfcfsr);
0459 inputs.avhrr_12345_mhs_345_angles_tsurfcfsr = ...
0460     catstruct(inputs.avhrr_12345, inputs.mhs_345, angles, tsurfcfsr);
0461 inputs.avhrr_12345_mhs_345_lat_angles = ...
0462     catstruct(inputs.avhrr_12345, inputs.mhs_345, lat, angles);
0463 inputs.avhrr_12345_mhs_345_angles = ...
0464     catstruct(inputs.avhrr_12345, inputs.mhs_345, angles);
0465 inputs.avhrr_345_mhs_345_lat_angles_tsurfcfsr = ...
0466     catstruct(inputs.avhrr_345, inputs.mhs_345, lat, angles, tsurfcfsr);
0467 inputs.avhrr_345_mhs_345_angles_tsurfcfsr = ...
0468     catstruct(inputs.avhrr_345, inputs.mhs_345, angles, tsurfcfsr);
0469 inputs.avhrr_345_mhs_345_lat_angles = ...
0470     catstruct(inputs.avhrr_345, inputs.mhs_345, lat, angles);
0471 inputs.avhrr_345_mhs_345_angles = ...
0472     catstruct(inputs.avhrr_345, inputs.mhs_345, angles);
0473 
0474 %inputs.vis_dir_mw = catstruct(inputs.vis_dir, inputs.mw);
0475 
0476 %inputs.vis_dir_mw_ang = catstruct(inputs.vis_dir_mw, angles);
0477 
0478 
0479 collocation_filters = {...
0480     {@(avhrr, surf) avhrr(:, 5) - surf < -20, ...
0481     {'MEAN_AVHRR_Y', 'MEAN_ECMWF_Skin_temperature'}}, ...
0482     {@(avhrr) avhrr(:, 5) - avhrr(:, 4) > -2, ...
0483     {'MEAN_AVHRR_Y'}}, ...
0484     };
0485 
0486 %            'MEAN_ECMWF_Skin_temperature', struct(...
0487 %                'transform', @(x)x, ...
0488 %                'invtransform', @(x)x, ...
0489 %                'lims', [100 400]), ...
0490 %            'B_SZA', struct(...
0491 %                'transform', @sind, ...
0492 %                'invtransform', @asind, ...
0493 %                'lims', [0 80]));
0494 %        inputs = struct(...
0495 %            'B_BT', struct(...
0496 %                 'transform', @(x)x, ...
0497 %                 'invtransform', @(x)x, ...
0498 %                 'lims', [100 400], ...
0499 %                 'chans', [3, 4, 5]));
0500             
0501 % figure(1);
0502 % clf();
0503 % hold all;
0504 % grid on;
0505 
0506 set(0,'DefaultAxesLineStyleOrder',{'-','--', '-.', ':'});
0507 %set(0,'DefaultFigureWindowStyle','docked');
0508 
0509 filters.all = {};
0510 filters.dsurf = collocation_filters(1);
0511 filters.dchan = collocation_filters(2);
0512 filters.dsurf_dchan = collocation_filters;
0513 % using https://en.wikipedia.org/wiki/Extreme_points_of_Greenland#Extreme_points
0514 filters.NoGreenland = {{@(lat, lon) ~((lat > 59.75) & (lat < 83.5) & (lon > -73) & (lon < -11)), {'LAT1', 'LON1'}}};
0515 
0516 %inps = fieldnames(inputs);
0517 %inps = {'vis', 'avhrr_123', 'vis_angles', 'avhrr_123_angles'};
0518 %inps = {'vis', 'avhrr_123', 'vis_angles', 'avhrr_123_angles', 'ir', 'vis_ir', 'vis_ir_ang', 'avhrr_12345', 'avhrr_12345_angles'};
0519 %inps = {'vis', 'vis_angles', 'vis_ir', 'vis_ir_ang', 'vis_mw', 'vis_mw_ang', 'vis_ir_mw', 'vis_ir_mw_ang'};
0520 %inps = {'vis_angles', 'ir', 'dir', 'mw', 'vis_ir_ang', 'ir_mw', 'vis_mw_ang', 'vis_ir_mw_ang'};
0521 %inps = {'avhrr_12', 'avhrr_123', 'avhrr_45', 'avhrr_1245', 'avhrr_12345'};
0522 %inps = {'avhrr_12_angles', 'avhrr_45', 'avhrr_45_tsurf', 'dir', ...
0523 %    'avhrr_12345_angles', 'avhrr_12_mhs_345_angles', ...
0524 %    'avhrr_45_mhs_345', 'avhrr_45_mhs_345_lat', 'avhrr_12345_mhs_345_angles', ...
0525 %    'mhs_345', 'mhs_345_lat', 'avhrr_12_lat_angles', ...
0526 %    'avhrr_12345_lat_angles', 'avhrr_12345_mhs_345_lat_angles'};
0527 %inps = {'avhrr_12', 'avhrr_12_angles', 'avhrr_12_lat', 'avhrr_12_lat_angles'};
0528 %filts = fieldnames(filters);
0529 %filts = {'all', 'NoGreenland'};
0530 filts = {'all'};%, 'NoGreenland'};
0531 
0532 cloud_filters = figure('visible', 'off');
0533 hold all;
0534 grid on;
0535 cloud_filters_leg = {};
0536 
0537 figs_inps_retr = struct();
0538 leg_inps_retr = struct();
0539 figs_filts_retr = struct();
0540 leg_filts_retr = struct();
0541 
0542 D = datasets();
0543 pcd = PersistentCachedData('/local/gerrit/cache');
0544 for i = 1:length(inps)
0545     inp = inps{i};
0546     figs_inps_retr.(inp) = figure('visible', 'off');
0547     hold all;
0548     grid on;
0549     
0550     for j = 1:length(filts)
0551         filt = filts{j};
0552     
0553         if homog
0554             nm = [inp '_' filt '_' limname '_h'];
0555         else
0556             nm = [inp '_' filt '_' limname];
0557         end
0558         
0559         if isfield(D, nm)
0560             datasets('delete', D.(nm));
0561         end
0562         
0563         ccn = CollocatedNNIWP('name', nm, ...
0564             'inputs', inputs.(inp), ...
0565             'collocation_filters', filters.(filt), ...
0566             'collocation_limits', collocation_limits, ...
0567             'version', '0.7', ...
0568             'homog', homog);
0569         
0570         % FIXME: disable this one later
0571         %ccn.overwrite = true;
0572         
0573         ccn.getdata();
0574 %        if isfield(ccn.inputs, 'CFSR_Skin_temperature')
0575 %            ccn.overwrite = true;
0576 %        end
0577         ccn.make_and_train_network(0, no_nets);
0578         % plot ALL performances for the various networks --> some kind of
0579         % error
0580         [best, allperf] = ccn.bestnet(0);
0581         N = length(allperf);
0582         f_nets = figure('visible', 'off');
0583         hold all; grid on;
0584         for k = 1:N
0585             plot(allperf{k}{1}, allperf{k}{2}.rel_medfracerr*100);
0586         end
0587         title(['Net var ' strrep(nm, '_', ' ')]);
0588         xlabel('IWP [g/m^2]');
0589         ylabel('med frac err');
0590         set(gca(), 'XScale', 'log');
0591         xlim([1e-1, 1e4]);
0592         ylim(ylims);
0593         save_figure_multi(f_nets, ...
0594             fullfile(cscol('plot_base'), ['allnet_h' num2str(homog) '_' nm '_log']), ...
0595             'png', 'eps', 'fig');
0596         % and in a table
0597         pp = arrayfun(@(i) allperf{i}{2}.rel_medfracerr, 1:5, 'UniformOutput', false);
0598         M = [allperf{1}{1}, horzcat(pp{:})];
0599         save(fullfile(cscol('plotdata_base'), ['allnet_h' num2str(homog) '_' nm '_log.dat']), '-ascii', 'M');
0600 
0601         % and consider performance for best net
0602         [xx, perf] = ccn.get_performance(0);
0603         
0604         % plot false positive / false negative for colud filter
0605         [bn, fp, fn, fp_med_ref, fp_med_retr, fn_med_ref, fn_med_retr] = ccn.test_patternnet_performance();
0606         figure('visible', 'off');
0607         plot(bn, fp, bn, fn, bn, fp+fn);
0608         legend({'false positive', 'false negative', 'false total'}, ...
0609             'Location', 'NorthWest');
0610         title(['Cloud filter performance ' strrep(nm, '_', ' ')]);
0611         ylabel('Error fraction');
0612         xlabel('Probability cutoff');
0613         save_figure_multi(gcf(), fullfile(cscol('plot_base'), ['cloud_filter_' nm]), 'png', 'eps', 'fig');
0614         
0615         % store to file
0616         M = [bn; fp; fn; fp+fn; fp_med_ref; fp_med_retr; fn_med_ref; fn_med_retr].'; %#ok<NASGU>
0617         save(fullfile(cscol('plotdata_base'), ['cloud_filter_' num2str(homog) '_' ccn.name '.dat']), '-ascii', 'M');
0618         
0619         % plot to filters plot for technique
0620         figure(figs_inps_retr.(inp)); set(gcf(), 'Visible', 'off');
0621         plot(xx, 100*perf.rel_medfracerr);
0622         leg_inps_retr.(inp){j} = strrep(filt, '_', ' ');
0623         
0624         % plot cloud filter performance overall
0625         figure(cloud_filters); set(gcf(), 'Visible', 'off');
0626         plot(bn, fp+fn);
0627         cloud_filters_leg = [cloud_filters_leg, strrep(nm, '_', ' ')]; %#ok<AGROW>
0628         
0629         % plot to techniques plot for this filter
0630         if ~isfield(figs_filts_retr, filt)
0631             figs_filts_retr.(filt) = figure('visible', 'off');
0632             hold all;
0633             grid on;
0634         end
0635         figure(figs_filts_retr.(filt)); set(gcf(), 'Visible', 'off');
0636         plot(xx, 100*perf.rel_medfracerr);
0637         leg_filts_retr.(filt){i} = strrep(inp, '_', ' ');
0638         
0639         % store performance to file
0640         M = [xx, 100*perf.rel_medfracerr]; %#ok<NASGU>
0641         save(fullfile(cscol('plotdata_base'), [ccn.name '.dat']), '-ascii', 'M');
0642         
0643         % plot scatter density plot
0644         f = figure('visible', 'off');
0645         [x, y_ref, y_retr] = ccn.evaluate_test_data(0);
0646         [h_ax, h_cb] = scatter_density_plot(...
0647             y_ref, ...
0648             y_retr, ...
0649             struct(...
0650                 'trans', @(x)log10(x), ...
0651                 'invtrans', @(x)10.^x, ...
0652                 'axprops', struct(...
0653                     'xscale', 'log', ...
0654                     'yscale', 'log', ...
0655                     'xlim', [1e-1, 1e4], ...
0656                     'ylim', [1e-1, 1e4]), ...
0657                 'medprops', struct(...
0658                     'LineWidth', 3, ...
0659                     'LineStyle', '-', ...
0660                     'Color', [.5, .5, .5]), ...
0661                 'diagonal', struct(...
0662                     'LineWidth', 1, ...
0663                     'LineStyle', '-', ...
0664                     'Color', [0, 0, 0])));
0665         xlabel(h_ax, '2C-ICE testing IWP [g/m^2]');
0666         ylabel(h_ax, 'Passive retrieved IWP [g/m^2]');
0667         title(['Retrieved vs. reference, ' strrep(nm, '_', ' ')]);
0668         bn = ['sdp_h' num2str(homog) '_' nm '_2cice'];
0669         save_figure_multi(f, fullfile(cscol('plot_base'), bn), 'png', 'eps', 'fig');
0670         
0671         % second sdp version without axis etc., for use inside pgfplots
0672         axis(gca(), 'off');
0673         set(h_cb, 'Visible', 'off');
0674         title('');
0675         save_figure_multi(f, fullfile(cscol('plot_base'), [bn '_bare']), 'png', 'eps', 'fig');
0676         f2 = figure('Visible', 'off');
0677         set(h_cb, 'YTick', []);
0678         set(h_cb, 'Visible', 'on');
0679         copyobj(h_cb, f2);
0680         set(f2, 'Colormap', get(f, 'Colormap'));
0681         save_figure_multi(f2, fullfile(cscol('plot_base'), [bn '_bare_legend']), 'png', 'eps', 'fig');
0682         
0683         if process_month
0684             ccn.basedir = fullfile('/storage3/user_data/gerrit/products/experimental', ccn.name);
0685             if ~exist(ccn.basedir, 'file')
0686                 mkdir(ccn.basedir);
0687             end
0688             ccn.subdir = '$YEAR4/$MONTH/$DAY';
0689             ccn.filename = 'granule_$VERSION_$SAT_$HOUR_$MINUTE.nc.gz';
0690             ccn.altbasedir = '/storage3/user_data/gerrit/products/passive_syn_iwp';
0691 %            ccn.altfilename = '$SAT_$HOUR_$MINUTE.nc.gz';
0692             ccn.altfilename = 'ccniwp_$VERSION_$SAT_$HOUR_$MINUTE.nc.gz';
0693             ccn.reader_processor = @ccniwp_proc;
0694             logtext(atmlab('OUT'), 'Processing data\n');
0695             
0696             start = [2007, 1, 1];
0697             finish = [2007, 12, 31];
0698             sat = 'noaa18';
0699             if ~isempty(ccn.find_granules_by_date(start, sat)) && ~isempty(ccn.find_granules_by_date(finish, sat))
0700                 logtext(atmlab('OUT'), 'It seems I''m already done.\n');
0701             else
0702                 ccn.retrieve_and_store_period(start, finish, sat);
0703             end
0704             
0705             % and plot it
0706             %gridmean = pcd.evaluate(1, @ccn.level3, start, finish, sat, {'IWP'}, 1, @(X)(X(X<5e5)), 'EXTRA', ccn.name);
0707             S = gmt_get_struct_gridded_map_iwp;
0708             S.header = [ccn.name datestr(datenum(start), 'YYYY-mm-dd'), '--', datestr(datenum(finish), 'YYYY-mm-dd'), ' v' ccn.version];
0709             S.header_fontsize = '18p';
0710             S.filename = ['map_gridded_IWP_' ccn.name '_' datestr(datenum(start), 'YYYYmmdd'), '-', datestr(datenum(finish), 'YYYYmmdd'), 'v' strrep(ccn.version, '.', '_') '.pdf'];
0711             S.outdir = cscol('plot_base');
0712             if exist(fullfile(S.outdir, S.filename), 'file')
0713                 logtext(atmlab('OUT'), 'Already exists: %s.  Skipping.\n', fullfile(S.outdir, S.filename));
0714             else
0715                 S.data = pcd.evaluate(1, @ccn.level3, start, finish, sat, {'IWP'}, 1, @(X)(X(X<5e5)), 'EXTRA', ccn.name);            
0716                 gmt_plot(S);
0717             end
0718 
0719         end
0720         
0721         datasets('delete', ccn);
0722     end
0723 end
0724 
0725 % finalise all figures
0726 
0727 allfigs_retr = vec2row(cell2mat(struct2cell(catstruct(figs_filts_retr, figs_inps_retr))));
0728 for fig = allfigs_retr
0729     figure(fig);set(fig, 'Visible', 'off');
0730     xlabel('IWP [g/m^2]');
0731     ylabel('IWP difference to reference [%]');
0732     ylim(ylims);
0733     xlim([0, 3000]);
0734 end
0735 
0736 base_plotfile = fullfile(cscol('plot_base'), 'comparison_collocated_iwp_products');
0737 for i = 1:length(inps)
0738     inp = inps{i};    
0739     figure(figs_inps_retr.(inp)); set(gcf(), 'Visible', 'off');
0740     legend(leg_inps_retr.(inp){:}, 'Location', 'SouthWest');
0741     title([strrep(inp, '_', ' '), ' ', limname]);
0742     nm = [base_plotfile, '_h', num2str(homog), '_', limname, '_', inp, '_', strjoin(filts, ','), '_filters'];
0743     save_figure_multi(figs_inps_retr.(inp), ...
0744         [nm '_lin'], ...
0745         'png', 'eps', 'fig');
0746     set(gca(), 'XScale', 'log');
0747     xlim([1e-1, 1e4]);
0748     save_figure_multi(figs_inps_retr.(inp), ...
0749         [nm '_log'], ...
0750         'png', 'eps', 'fig');
0751 end
0752 
0753 for i = 1:length(filts)
0754     filt = filts{i};
0755     figure(figs_filts_retr.(filt)); set(gcf(), 'Visible', 'off');
0756     legend(leg_filts_retr.(filt){:}, 'Location', 'SouthWest');
0757     title([strrep(filt, '_', ' '), ' ', limname]);
0758     nm = [base_plotfile, '_h', num2str(homog), '_', limname, '_', filt, '_', strjoin(vec2row(inps), ','), '_techniques'];
0759     % check if name too long?
0760     [~, bnm] = fileparts(nm);
0761     if length(bnm) >= 220 % 252 because '.png' or '.eps' will be added still
0762         logtext(atmlab('OUT'), 'Name too long, shortening %s...\n', nm);
0763 %        nm = [bnm(1:100), '........', bnm(end-100:end)];
0764 %        nm = strrep(nm, 'avhrr_', 'a');
0765         [dirname, bnm] = fileparts(nm);
0766         bnm = [bnm(1:100) '...' num2str(length(inps)) '...' bnm(end-100:end)];
0767         nm = fullfile(dirname, bnm);
0768 %        if length(bnm) >= 250
0769 %            nm = strrep(nm, 'mhs_', 'm');
0770 %            nm = strrep(nm, 'angles', 'g');
0771 %            [~, bnm] = fileparts(nm);
0772 %            if length(bnm) >= 250
0773 %                [core, bnm] = fileparts(nm);
0774 %                bnm = regexprep(bnm, '\d*', '');
0775 %                bnm = strrep(bnm, 'comparison_collocated_iwp_products_', 'ccip_');
0776 %                nm = fullfile(core, bnm);
0777 %                %nm = regexprep(nm, '\d*', '');
0778 %                if length(bnm) >= 250
0779 %                    [core, bnm] = fileparts(nm);
0780 %                    bnm = [bnm(1:100) '.........' bnm(end-100:end)];
0781 %                    nm = fullfile(core, bnm);
0782 %                end
0783 %            end
0784 %        end
0785     end
0786     save_figure_multi(figs_filts_retr.(filt), ...
0787         [nm '_lin'], ...
0788         'png', 'eps', 'fig');
0789     set(gca(), 'XScale', 'log');
0790     xlim([1e-1, 1e4]);
0791     save_figure_multi(figs_filts_retr.(filt), ...
0792         [nm '_log'], ...
0793         'png', 'eps', 'fig');    
0794 end
0795 
0796 figure(cloud_filters); set(gcf(), 'Visible', 'off');
0797 xlabel('NN prob. cutoff');
0798 ylabel('Total error rate (fp + fn)');
0799 title(['Cloud filter quality, ', strrep(limname, '_', ' ')]);
0800 legend(cloud_filters_leg{:}, 'Location', 'NorthWest');
0801 save_figure_multi(cloud_filters, fullfile(cscol('plot_base'), ['cloud_filters_h', num2str(homog), '_' limname]), 'png', 'eps', 'fig');
0802 %
0803 %     allnames = {[inp '_all'], [inp '_filt_dsurf'], [inp '_filt_dchan'], [inp '_filt_dsurf_dchan']};
0804 %     nm = [inp '_all'];
0805 %     ccn.(nm) = CollocatedNNIWP('name', nm, ...
0806 %         'inputs', inputs.(inp), ...
0807 %         'collocation_filters', {}, ...
0808 %         'collocation_limits', collocation_limits);
0809 %     nm = [inp '_filt_dsurf'];
0810 %     ccn.(nm) = CollocatedNNIWP('name', nm, ...
0811 %         'inputs', inputs.(inp), ...
0812 %         'collocation_filters', collocation_filters(1), ...
0813 %         'collocation_limits', collocation_limits);
0814 %     nm = [inp '_filt_dchan'];
0815 %     ccn.(nm) = CollocatedNNIWP('name', nm, ...
0816 %         'inputs', inputs.(inp), ...
0817 %         'collocation_filters', collocation_filters(2), ...
0818 %         'collocation_limits', collocation_limits);
0819 %     nm = [inp '_filt_dsurf_dchan'];
0820 %     ccn.(nm) = CollocatedNNIWP('name', nm, ...
0821 %         'inputs', inputs.(inp), ...
0822 %         'collocation_filters', collocation_filters, ...
0823 %         'collocation_limits', collocation_limits);
0824 %
0825 %     for k = 1:length(allnames)
0826 %         ff = allnames{k};
0827 %         if isfield(figs_filts.(ff))
0828 %             figure(figs_filts.(ff));
0829 %         else
0830 %             figs_filts.(ff) = figure();
0831 %             hold all;
0832 %             grid on;
0833 %         end
0834 %         % for each combination technique / filter, plot both in
0835 %         % all-techniques plot, and in all-filters plot
0836 %         ccn.(ff).getdata();
0837 %         ccn.(ff).make_and_train_network(1, 5);
0838 %         ccn.(ff).plot_performance_with_requirements(1);
0839 %
0840 %         [xx, perf.(ff)] = ccn.(ff{1}).get_performance(1);
0841 %
0842 %         % plot to all-techniques plot
0843 %         figure(figs_inps.(inp));
0844 %         plot(xx, 100*perf.(ff).rel_medfracerr);
0845 %         leg_inps.(inp){i} = strrep(ff{1}, '_', ' ');
0846 %     end
0847 % end
0848 % figure(1);
0849 % xlabel('IWP [g/m^2]');
0850 % ylabel('IWP difference to reference [%]');
0851 % ylim([0, 100]);
0852 % xlim([0, 3000]);
0853 % %nms = cellfun(@(s) strrep(s, '_', ' '), allf, 'UniformOutput', false);
0854 % %legend(nms{:});
0855 % legend(leg{:}, 'Location', 'SouthWest');
0856 % save_figure_multi(1, fullfile(cscol('plot_base'), 'comparison_collocated_iwp_products_lin'), 'png', 'eps', 'fig');
0857 % set(gca(), 'XScale', 'log');
0858 % xlim([5e0, 1e4]);
0859 % save_figure_multi(1, fullfile(cscol('plot_base'), 'comparison_collocated_iwp_products_log'), 'png', 'eps', 'fig');
0860 end
0861 
0862 function T = get_cfsr_skin_temperature(lat, lon, time)
0863 D = datasets();
0864 [ye, mo, da, ho, mi, se] = unixsecs2date(time);
0865 dv = [ye, mo, da, ho, mi, se];
0866 [dv_sorted, I] = sortrows(dv);
0867 cf = D.CFSR;
0868 pcd = PersistentCachedData('/local/gerrit/cache');
0869 S = pcd.evaluate(1, @cf.read_from_grid, lat(I), lon(I), dv(I, :), {'TMP_L1'});
0870 T(I) = S.TMP_L1;
0871 end

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