Home > atmlab > collocations > colloc_constants.m

colloc_constants

PURPOSE ^

colloc_constants Defines (pseudo)-constants for collocations subsystem

SYNOPSIS ^

function v = colloc_constants(c)

DESCRIPTION ^

 colloc_constants Defines (pseudo)-constants for collocations subsystem

 This m-file defines values required by functions in the collocations subsystem.
 It differs from collocs_config in the manner that the values here should
 not normally be changed. If called without arguments, returns
 the entire structure containing all properties and values.

 FORMAT

   value = colloc_constants(c)

 IN

   c   string      the property asked for (optional)

 OUT

   v   (any)       the value of property c or the entire struct

 $Id: colloc_constants.m 7175 2011-10-10 09:06:45Z gerrit $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

colloc_constants.m

SOURCE CODE ^

0001 function v = colloc_constants(c)
0002 
0003 % colloc_constants Defines (pseudo)-constants for collocations subsystem
0004 %
0005 % This m-file defines values required by functions in the collocations subsystem.
0006 % It differs from collocs_config in the manner that the values here should
0007 % not normally be changed. If called without arguments, returns
0008 % the entire structure containing all properties and values.
0009 %
0010 % FORMAT
0011 %
0012 %   value = colloc_constants(c)
0013 %
0014 % IN
0015 %
0016 %   c   string      the property asked for (optional)
0017 %
0018 % OUT
0019 %
0020 %   v   (any)       the value of property c or the entire struct
0021 %
0022 % $Id: colloc_constants.m 7175 2011-10-10 09:06:45Z gerrit $
0023 
0024 %% define what processing functions to use for what sensor pair
0025 
0026 A.process_cpr_mhs = @colloc_process_cpr_mhs;
0027 A.process_data_cpr_mhs = @colloc_process_data_cpr_mhs;
0028 A.process_meandata_cpr_mhs = @colloc_process_meandata_cpr_mhs;
0029 
0030 A.no_cpr_mhs = 3;
0031 
0032 % set each combination of amsub and mhs to the same function handle
0033 for s1 = {'amsub', 'mhs'}
0034     for s2 = {'amsub', 'mhs'}
0035         A.(sprintf('process_%s_%s', s1{1}, s2{1})) = ...
0036             partial_x(s1{1}, s2{1});
0037         A.(sprintf('process_data_%s_%s', s1{1}, s2{1})) = ...
0038             partial_data_x(s1{1}, s2{1});
0039         A.(sprintf('no_%s_%s', s1{1}, s2{1})) = 2;
0040     end
0041 end
0042 
0043 A.process_cpr_avhrr = @colloc_process_cpr_avhrr;
0044 A.process_data_cpr_avhrr = @colloc_process_data_cpr_avhrr;
0045 
0046 A.no_cpr_avhrr = 2;
0047 
0048 A.process_hirscs_mhs = @colloc_process_hirscs_poes;
0049 A.process_data_hirscs_mhs = @colloc_process_data_hirscs_poes;
0050 
0051 A.no_hirscs_mhs = 2;
0052 
0053 A.process_amsua_amsua = partial_x('amsua', 'amsua');
0054 A.process_data_amsua_amsua = partial_data_x('amsua', 'amsua');
0055 
0056 A.no_amsua_amsua = 2;
0057 
0058 A.process_hirs_hirs = partial_x('hirs', 'hirs');
0059 A.process_data_hirs_hirs = partial_data_x('hirs', 'hirs');
0060 
0061 A.no_hirs_hirs = 2;
0062 
0063 A.process_collocation_cpr_mhs_avhrr = @colloc_process_collocation_cpr_poes_avhrr;
0064 A.process_data_collocation_cpr_mhs_avhrr = @colloc_process_data_collocation_cpr_poes_avhrr;
0065 A.process_meandata_collocation_cpr_mhs_avhrr = @colloc_process_meandata_collocation_cpr_poes_avhrr;
0066 
0067 A.no_collocation_cpr_mhs_avhrr = 3;
0068 
0069 %% column definitions
0070 
0071 %% helper: anything x/x
0072 
0073 x_x_overlap = struct(...
0074     'LAT1', 1, ...
0075     'LONG1', 2, ...
0076     'START1', 3, ...
0077     'TIME1', 4, ...
0078     'I1', 5, ...
0079     'C1', 6, ...
0080     'LZA1', 7, ...
0081     'LAA1', 8, ...
0082     'SZA1', 9, ...
0083     'SAA1', 10, ...
0084     'LAT2', 11, ...
0085     'LONG2', 12, ...
0086     'START2', 13, ...
0087     'TIME2', 14, ...
0088     'I2', 15, ...
0089     'C2', 16, ...
0090     'LZA2', 17, ...
0091     'LAA2', 18, ...
0092     'SZA2', 19, ...
0093     'SAA2', 20, ...
0094     'DIST', 21, ...
0095     'INT', 22, ...
0096     'NCOLS', 22);
0097 
0098 %% for cpr/mhs
0099 A.cols_cpr_mhs.overlap = struct(...
0100     'C_LONG',    1, ...
0101     'C_LAT',     2, ...
0102     'C_START',   3, ...
0103     'C_TIME',    4, ...
0104     'C_I',       5, ...
0105     'A_LONG',    6, ...
0106     'A_LAT',     7, ...
0107     'A_START',   8, ...
0108     'A_TIME',    9, ...
0109     'A_I',       10, ...
0110     'A_C',       11, ...
0111     'A_DIST',    12, ...
0112     'A_INT',     13, ...
0113     'B_LONG',    14, ...
0114     'B_LAT',     15, ...
0115     'B_START',   16, ...
0116     'B_TIME',    17, ...
0117     'B_I',       18, ...
0118     'B_C',       19, ...
0119     'B_DIST',    20, ...
0120     'B_INT',     21, ...
0121     'B_LZA',     22, ...
0122     'B_LAA',     23, ...
0123     'H_LONG',    24, ...
0124     'H_LAT',     25, ...
0125     'H_START',   26, ...
0126     'H_TIME',    27, ...
0127     'H_I',       28, ...
0128     'H_C',       29, ...
0129     'H_DIST',    30, ...
0130     'H_INT',     31, ...
0131     'SZA',       32, ...
0132     'SAA',       33, ...
0133     'filter_double', {{{}, {'B_START', 'B_I'}}}, ... % for tackling double scanlines
0134     'NCOLS',     33);
0135 
0136 A.cols_cpr_mhs.data = struct(...
0137     'ROIWP',     1, ...
0138     'dROIWP',    2, ...
0139     'IOROIWP',   3, ...
0140     'dIOROIWP',  4, ...
0141     'AMSU', 5:24, ...
0142     'AMSU_A', 5:19, ...
0143     'AMSU_B', 20:24, ...
0144     'MHS', 20:24, ...
0145     'HIRS', 25:44, ...
0146     'MSPPS_IWP', 45, ...
0147     'NCOLS', 45);
0148 
0149 % mean files
0150 A.cols_cpr_mhs.meandata = struct(...
0151     'FIRST', 1, ... % meandata should always start with first/last
0152     'LAST', 2, ...
0153     'NO', 3, ...
0154     'MEAN', 4, ...
0155     'SD', 5, ...
0156     'CV', 6, ...
0157     'FRAC', 7, ...
0158     'INHIRS', 8, ...
0159     'NCOLS', 8);
0160 
0161 %% for POES/POES
0162 
0163 A.cols_mhs_mhs.overlap = x_x_overlap;
0164 A.cols_mhs_mhs.overlap.filter_double = {{{'START1', 'I1'}, {'START2', 'I2'}}}; % for tackling double scanlines
0165 
0166 A.cols_mhs_mhs.data = struct(...
0167     'AMSU_B1', 1:5, ...
0168     'MHS1', 1:5, ...
0169     'AMSU_B2', 6:10, ...
0170     'MHS2', 6:10, ...
0171     'NCOLS', 10);
0172 
0173 %% for AMSUA/AMSUA
0174 
0175 A.cols_amsua_amsua.overlap = x_x_overlap;
0176 
0177 A.cols_amsua_amsua.data = struct(...
0178     'AMSU_A1', 1:15, ...
0179     'AMSU_A2', 16:30, ...
0180     'NCOLS', 30);
0181 
0182 %% for HIRS/HIRS
0183 
0184 A.cols_hirs_hirs.overlap = x_x_overlap;
0185 
0186 A.cols_hirs_hirs.data = struct(...
0187     'HIRS1', 1:20, ...
0188     'HIRS2', 21:40, ...
0189     'NCOLS', 40);
0190 
0191 %% for CPR/AVHRR
0192 
0193 A.cols_cpr_avhrr.overlap = struct(...
0194     'C_LAT', 1, ...
0195     'C_LONG', 2, ...
0196     'C_START', 3, ...
0197     'C_TIME', 4, ...
0198     'C_I', 5, ...
0199     'AVHRR_LAT', 6, ...
0200     'AVHRR_LONG', 7, ...
0201     'AVHRR_START', 8, ...
0202     'AVHRR_TIME', 9, ...
0203     'AVHRR_ROW', 10, ...
0204     'AVHRR_COL', 11, ...
0205     'AVHRR_RAA', 12, ...
0206     'SZA', 13, ...
0207     'AVHRR_LZA', 14, ...
0208     'DIST', 15, ...
0209     'INT', 16, ...
0210     'filter_double', {{{}, {'AVHRR_START', 'AVHRR_ROW'}}}, ... % for tackling double scanlines
0211     'NCOLS', 16);
0212 
0213 A.cols_cpr_avhrr.data = struct(...
0214     'ROIWP', 1, ...
0215     'dROIWP', 2, ...
0216     'IOROIWP', 3, ...
0217     'dIOROIWP', 4, ...
0218     'AVHRR', 5:10, ...
0219     'CLOUDFLAG', 11, ...
0220     'NCOLS', 11);
0221 
0222 A.cols_cpr_avhrr.aliases = struct();
0223 
0224 %% for HIRSCS/MHS
0225 
0226 A.cols_hirscs_mhs.overlap = struct(...
0227     'H_LAT', 1, ...
0228     'H_LONG', 2, ...
0229     'HCS_I', 3, ...
0230     'H_START', 4, ...
0231     'H_TIME', 5, ...
0232     'H_SZA', 6, ...
0233     'H_ALT', 7, ...
0234     'H_I', 8, ...
0235     'H_C', 9, ...
0236     'MHS_LZA', 10, ...
0237     'MHS_LAA', 11, ...
0238     'MHS_LAT', 12, ...
0239     'MHS_LONG', 13, ...
0240     'MHS_ROW', 14, ...
0241     'MHS_COL', 15, ...
0242     'MHS_START', 16, ...
0243     'MHS_TIME', 17, ...
0244     'MHS_SZA', 18, ...
0245     'MHS_SAA', 19, ...
0246     'DIST', 20, ...
0247     'INT', 21, ...
0248     'filter_double', {{{}, {'MHS_START', 'MHS_ROW'}}}, ... % TODO/FIXME: HIRS Not implemented yet
0249     'NCOLS', 21);
0250 
0251 A.cols_hirscs_mhs.data = struct(...
0252     'VIS', 1, ...
0253     'BT', 2:20, ...
0254     'LC', 21:39, ...
0255     'MHS', 40:44, ...
0256     'NCOLS', 44);
0257 
0258 %% for collocation cpr poes/avhrr
0259 
0260 A.cols_collocation_cpr_mhs_avhrr.overlap = struct(...
0261     'CPR_MHS_START', 1, ...
0262     'CPR_MHS_ROW', 2, ...
0263     'CPR_MHS_MEAN_ROW', 3, ...
0264     'AVHRR_LAT', 4, ...
0265     'AVHRR_LONG', 5, ...
0266     'AVHRR_START', 6, ...
0267     'AVHRR_TIME', 7, ...
0268     'AVHRR_ROW', 8, ...
0269     'AVHRR_COL', 9, ...
0270     'AVHRR_RAA', 10, ...
0271     'AVHRR_SZA', 11, ...
0272     'AVHRR_LZA', 12, ...
0273     'DIST_MHS_AVHRR', 13, ...
0274     'DIST_CPR_AVHRR', 14, ...
0275     'INT_MHS_AVHRR', 15, ...
0276      'filter_double', {{{}, {'AVHRR_START', 'AVHRR_ROW'}}}, ... % for tackling double scanlines
0277     'NCOLS', 14);
0278 
0279 A.cols_collocation_cpr_mhs_avhrr.data = struct(...
0280     'AVHRR', 1:6, ...
0281     'CLOUDFLAG', 7, ...
0282     'NCOLS', 7);
0283 
0284 A.cols_collocation_cpr_mhs_avhrr.meandata = struct(...
0285     'FIRST', 1, ... % meandata should always start with first/last
0286     'LAST', 2, ...
0287     'NO', 3:8, ...
0288     'MEAN', 9:14, ...
0289     'SD', 15:20, ...
0290     'NCOLS', 20);
0291 
0292 A.cols_collocation_cpr_mhs_avhrr.links = struct(...
0293     'start', 'CPR_POES_START', ...
0294     'lineno', 'CPR_POES_LINENO', ...
0295     'sat1', 'cloudsat', ...
0296     'sensor1', 'cpr', ...
0297     'sensor2', 'mhs');
0298 
0299 %% stored style, from 2010-09-22
0300 
0301 % for storing in NetCDF, take a structure according to
0302 % A.cols.cpr_poes.stored.C_LONG.type = 'double'; % type is mandatory
0303 % additional atts are optional
0304 % A.cols.cpr_poes.stored.C_LONG.atts.long_name = 'Cloudsat Longitude';
0305 % A.cols.cpr_poes.stored.C_LONG.atts.units = 'degrees_east';
0306 % ... etc., see below
0307 
0308 %% shared
0309 
0310 SZA = struct(...
0311         'type', 'float', ...
0312         'atts', struct(...
0313             'long_name', 'Solar zenith angle', ...
0314             'units', 'degrees', ...
0315             'valid_range', [-180 180]));
0316 SAA = struct(...
0317         'type', 'float', ...
0318         'atts', struct(...
0319             'long_name', 'Solar azimuth angle', ...
0320             'units', 'degrees', ...
0321             'valid_range', [-180 180]));
0322 LZA = struct(...
0323         'type', 'float', ...
0324         'atts', struct(...
0325             'long_name', 'Local zenith angle', ...
0326             'units', 'degrees', ...
0327             'valid_range', [-180 180]));
0328 LAA = struct(...
0329         'type', 'float', ...
0330         'atts', struct(...
0331             'long_name', 'Local azimuth angle', ...
0332             'units', 'degrees', ...
0333             'valid_range', [-180 180]));
0334 RAA = struct(...
0335         'type', 'float', ...
0336         'atts', struct(...
0337             'long_name', 'Relative azimuth angle', ...
0338             'units', 'degrees', ...
0339             'valid_range', [-180 180]));
0340 
0341 hirs = struct(...
0342     'H_LAT', struct(...
0343         'type', 'float', ...
0344         'atts', struct(...
0345             'long_name', 'HIRS Latitude', ...
0346             'units', 'degrees_north', ...
0347             'valid_range', [-90 90])), ...
0348     'H_LONG', struct(...
0349         'type', 'float', ...
0350         'atts', struct(...
0351             'long_name', 'HIRS Longitude', ...
0352             'units', 'degrees_east', ...
0353             'valid_range', [-180 180])), ...
0354     'H_I', struct(...
0355         'type', 'short', ...
0356         'atts', struct(...
0357             'long_name', 'HIRS scanline number')), ...
0358     'H_C', struct(...
0359         'type', 'byte', ...
0360         'atts', struct(...
0361             'long_name', 'HIRS scanline position', ...
0362             'valid_range', [1 56])), ...
0363     'H_START', struct(...
0364         'type', 'int', ...
0365         'atts', struct(...
0366             'long_name', 'HIRS granule start time', ...
0367             'units', 'seconds since 1970-01-01 00:00:00')), ...
0368     'H_TIME', struct(...
0369         'type', 'int', ...
0370         'atts', struct(...
0371             'long_name', 'HIRS measurement time', ...
0372             'units', 'seconds since 1970-01-01 00:00:00')), ...
0373     'HIRS', struct(...
0374         'type', 'float', ...
0375         'dims', {{'HIRS_CHANS', 20}}, ...
0376         'atts', struct(...
0377             'long_name', 'HIRS Brightness Temperature', ...
0378             'units', 'Kelvin')));
0379 
0380 amsu_a = struct(...
0381     'A_LONG', struct(...
0382         'type', 'float', ...
0383         'atts', struct(...
0384             'long_name', 'AMSU-A Longitude', ...
0385             'units', 'degrees_east', ...
0386             'valid_range', [-180 180])), ...
0387     'A_LAT', struct(...
0388         'type', 'float', ...
0389         'atts', struct(...
0390             'long_name', 'AMSU-A Latitude', ...
0391             'units', 'degrees_north', ...
0392             'valid_range', [-90 90])), ...
0393     'A_START', struct(...
0394         'type', 'int', ...
0395         'atts', struct(...
0396             'long_name', 'AMSU-A granule start time', ...
0397             'units', 'seconds since 1970-01-01 00:00:00')), ...
0398     'A_TIME', struct(...
0399         'type', 'int', ...
0400         'atts', struct(...
0401             'long_name', 'AMSU-A measurement time', ...
0402             'units', 'seconds since 1970-01-01 00:00:00')), ...
0403     'A_I', struct(...
0404         'type', 'short', ...
0405         'atts', struct(...
0406             'long_name', 'AMSU-A scanline number')), ...
0407     'A_C', struct(...
0408         'type', 'byte', ...
0409         'atts', struct(...
0410             'long_name', 'AMSU-A scanline position', ...
0411             'valid_range', [1 30])));
0412 
0413 amsu_b = struct(...
0414     'B_LONG', struct(...
0415         'type', 'float', ...
0416         'atts', struct(...
0417             'long_name', 'AMSU-B/MHS Longitude', ...
0418             'units', 'degrees_east', ...
0419             'valid_range', [-180 180])), ...
0420     'B_LAT', struct(...
0421         'type', 'float', ...
0422         'atts', struct(...
0423             'long_name', 'AMSU-B/MHS Latitude', ...
0424             'units', 'degrees_north', ...
0425             'valid_range', [-90 90])), ...
0426     'B_START', struct(...
0427         'type', 'int', ...
0428         'atts', struct(...
0429             'long_name', 'AMSU-B/MHS granule start time', ...
0430             'units', 'seconds since 1970-01-01 00:00:00')), ...
0431     'B_TIME', struct(...
0432         'type', 'int', ...
0433         'atts', struct(...
0434             'long_name', 'AMSU-B/MHS measurement time', ...
0435             'units', 'seconds since 1970-01-01 00:00:00')), ...
0436     'B_I', struct(...
0437         'type', 'short', ...
0438         'atts', struct(...
0439             'long_name', 'AMSU-B/MHS scanline number')), ...
0440     'B_C', struct(...
0441         'type', 'byte', ...
0442         'atts', struct(...
0443             'long_name', 'AMSU-B/MHS scanline position', ...
0444             'valid_range', [1 90])), ...
0445     'B_LZA', LZA, ...
0446     'B_LAA', LAA);
0447 
0448 mhs = struct(...
0449     'MHS_LAT', struct(...
0450         'type', 'double', ...
0451         'atts', struct(...
0452             'long_name', 'AMSU-B/MHS Latitude', ...
0453             'units', 'degrees_north', ...
0454             'valid_range', [-90 90])), ...
0455     'MHS_LONG', struct(...
0456         'type', 'double', ...
0457         'atts', struct(...
0458             'long_name', 'AMSU-B/MHS Longitude', ...
0459             'units', 'degrees_east', ...
0460             'valid_range', [-180 180])), ...
0461     'MHS_ROW', struct(...
0462         'type', 'short', ...
0463         'atts', struct(...
0464             'long_name', 'AMSU-B/MHS scanline number')), ...
0465     'MHS_COL', struct(...
0466         'type', 'byte', ...
0467         'atts', struct(...
0468             'long_name', 'AMSU-B/MHS scanline position', ...
0469             'valid_range', [1 90])), ...
0470     'MHS_START', struct(...
0471         'type', 'int', ...
0472         'atts', struct(...
0473             'long_name', 'AMSU-B/MHS granule start time', ...
0474             'units', 'seconds since 1970-01-01 00:00:00')), ...
0475     'MHS_TIME', struct(...
0476         'type', 'int', ...
0477         'atts', struct(...
0478             'long_name', 'AMSU-B/MHS measurement time', ...
0479             'units', 'seconds since 1970-01-01 00:00:00')), ...
0480     'MHS_LZA', LZA, ...
0481     'MHS_LAA', LAA, ...
0482     'MHS_SZA', SZA, ...
0483     'MHS_SAA', SAA, ...
0484     'MHS', struct(...
0485         'type', 'float', ...
0486         'dims', {{'MHS_CHANS', 5}}, ...
0487         'atts', struct(...
0488             'long_name', 'MHS brightness temperature', ...
0489             'units', 'Kelvin')));
0490  
0491 cloudsat = struct(...
0492     'C_LONG', struct(...
0493         'type', 'double', ...
0494         'atts', struct(...
0495             'long_name', 'Cloudsat Longitude', ...
0496             'units', 'degrees_east', ...
0497             'valid_range', [-180 180])), ...
0498     'C_LAT', struct(...
0499         'type', 'double', ...
0500         'atts', struct(...
0501             'long_name', 'Cloudsat Latitude', ...
0502             'units', 'degrees_north', ...
0503             'valid_range', [-90 90])), ...
0504     'C_START', struct(...
0505         'type', 'int', ...
0506         'atts', struct(...
0507             'long_name', 'Cloudsat granule start time', ...
0508             'units', 'seconds since 1970-01-01 00:00:00')), ...
0509     'C_TIME', struct(...
0510         'type', 'int', ...
0511         'atts', struct(...
0512             'long_name', 'Cloudsat measurement time', ...
0513             'units', 'seconds since 1970-01-01 00:00:00')), ...
0514     'C_I', struct(...
0515         'type', 'int', ... % would like to have ushort here, but no NetCDF-4 support yet
0516         'atts', struct(...
0517             'long_name', 'Cloudsat measurement number')), ...
0518     'ROIWP', struct(...
0519         'type', 'float', ...
0520         'atts', struct(...
0521             'long_name', 'CloudSat Radar-Only CPR IWP', ...
0522             'units', 'g/m^2')), ...
0523     'dROIWP', struct(...
0524         'type', 'float', ...
0525         'atts', struct(...
0526             'long_name', 'Cloudsat Radar-Only CPR IWP uncertainty', ...
0527             'units', 'g/m^2')), ...
0528     'IOROIWP', struct(...
0529         'type', 'float', ...
0530         'atts', struct(...
0531             'long_name', 'Cloudsat Ice-Only Radar-Only CPR IWP', ...
0532             'units', 'g/m^2')), ...
0533     'dIOROIWP', struct(...
0534         'type', 'float', ...
0535         'atts', struct(...
0536             'long_name', 'Cloudsat Ice-Only Radar-Only CPR IWP uncertainty', ...
0537             'units', 'g/m^2')));
0538 
0539 avhrr = struct(...
0540     'AVHRR_LAT', struct(...
0541         'type', 'double', ...
0542         'atts', struct(...
0543             'long_name', 'AVHRR Latitude', ...
0544             'units', 'degrees_north', ...
0545             'valid_range', [-90 90])), ...
0546     'AVHRR_LONG', struct(...
0547         'type', 'double', ...
0548         'atts', struct(...
0549             'long_name', 'AVHRR Longitude', ...
0550             'units', 'degrees_east', ...
0551             'valid_range', [-180 180])), ...
0552     'AVHRR_START', struct(...
0553         'type', 'int', ...
0554         'atts', struct(...
0555             'long_name', 'AVHRR granule start time', ...
0556             'units', 'seconds since 1970-01-01 00:00:00')), ...
0557     'AVHRR_TIME', struct(...
0558         'type', 'int', ...
0559         'atts', struct(...
0560             'long_name', 'AVHRR measurement time', ...
0561             'units', 'seconds since 1970-01-01 00:00:00')), ...
0562     'AVHRR_ROW', struct(...
0563         'type', 'int', ...
0564         'atts', struct(...
0565             'long_name', 'AVHRR scanline number')), ...
0566     'AVHRR_COL', struct(...
0567         'type', 'int', ...
0568         'atts', struct(...
0569             'long_name', 'AVHRR scanline position')), ...
0570     'AVHRR_RAA', RAA, ...
0571     'AVHRR_SZA', SZA, ...
0572     'AVHRR_LZA', LZA, ...
0573     'AVHRR', struct(...
0574         'type', 'float', ...
0575         'dims', {{'AVHRR_CHANS', 6}}, ... # 3A/3B
0576         'atts', struct(...
0577             'long_name', 'AVHRR radiance', ...
0578             'units', '% or K', ...
0579             'note', 'ch 1, 2, 3a, 3b, 4, 5 (6 channels)')), ...
0580     'CLOUDFLAG', struct(...
0581         'type', 'byte', ...
0582         'atts', struct(...
0583             'long_name', 'Cloud flag', ...
0584             'note', 'See AVHRR documentation')));
0585 
0586 
0587 primary = struct(...
0588     'LAT1', struct(...
0589         'type', 'double', ...
0590         'atts', struct(...
0591             'long_name', 'Primary Latitude', ...
0592             'units', 'degrees_north', ...
0593             'valid_range', [-90 90])), ...
0594     'LONG1', struct(...
0595         'type', 'double', ...
0596         'atts', struct(...
0597             'long_name', 'Primary Longitude', ...
0598             'units', 'degrees_east', ...
0599             'valid_range', [-180 180])), ...
0600     'START1', struct(...
0601         'type', 'int', ...
0602         'atts', struct(...
0603             'long_name', 'Primary granule starting time', ...
0604             'units', 'seconds since 1970-01-01 00:00:00')), ...
0605     'TIME1', struct(...
0606         'type', 'int', ...
0607         'atts', struct(...
0608             'long_name', 'Primary measurement time', ...
0609             'units', 'seconds since 1970-01-01 00:00:00')), ...
0610     'I1', struct(...
0611         'type', 'short', ...
0612         'atts', struct(...
0613             'long_name', 'Primary scanline number')), ...
0614     'C1', struct(...
0615         'type', 'short', ...
0616         'atts', struct(...
0617             'long_name', 'Primary scanline position', ...
0618             'valid_range', [1 90])), ...
0619     'LZA1', LZA, ...
0620     'LAA1', LAA, ...
0621     'SZA1', SZA, ...
0622     'SAA1', SAA);
0623 
0624 secondary = struct(...
0625     'LAT2', struct(...
0626         'type', 'double', ...
0627         'atts', struct(...
0628             'long_name', 'Secondary Latitude', ...
0629             'units', 'degrees_north', ...
0630             'valid_range', [-90 90])), ...
0631     'LONG2', struct(...
0632         'type', 'double', ...
0633         'atts', struct(...
0634             'long_name', 'Secondary Longitude', ...
0635             'units', 'degrees_east', ...
0636             'valid_range', [-180 180])), ...
0637     'START2', struct(...
0638         'type', 'int', ...
0639         'atts', struct(...
0640             'long_name', 'Secondary granule starting time', ...
0641             'units', 'seconds since 1970-01-01 00:00:00')), ...
0642     'TIME2', struct(...
0643         'type', 'int', ...
0644         'atts', struct(...
0645             'long_name', 'Secondary measurement time', ...
0646             'units', 'seconds since 1970-01-01 00:00:00')), ...
0647     'I2', struct(...
0648         'type', 'short', ...
0649         'atts', struct(...
0650             'long_name', 'Secondary scanline number')), ...
0651     'C2', struct(...
0652         'type', 'short', ...
0653         'atts', struct(...
0654             'long_name', 'Secondary scanline position', ...
0655             'valid_range', [1 90])), ...
0656     'LZA2', LZA, ...
0657     'LAA2', LAA, ...
0658     'SZA2', SZA, ...
0659     'SAA2', SAA);
0660 
0661 x_with_x = catstruct(...
0662     primary, ...
0663     secondary, ...
0664     struct(...
0665         'DIST', struct(...
0666             'type', 'float', ...
0667             'atts', struct(...
0668                 'long_name', 'Distance', ...
0669                 'units', 'km')), ...
0670         'INT', struct(...
0671             'type', 'float', ...
0672             'atts', struct(...
0673                 'long_name', 'Secondary measurement time - primary measurement time', ...
0674                 'units', 'seconds'))));
0675 
0676 %% for cpr/mhs
0677 
0678 A.cols_cpr_mhs.stored = catstruct(...
0679     cloudsat, ...
0680     amsu_a, ...
0681     amsu_b, ...
0682     hirs, ...
0683     struct( ... % specifics
0684         'SZA', SZA, ...
0685         'SAA', SAA, ...
0686         'A_DIST', struct(...
0687             'type', 'float', ...
0688             'atts', struct(...
0689                 'long_name', 'Distance AMSU-A to Cloudsat', ...
0690                 'units', 'km')), ...
0691         'A_INT', struct(...
0692             'type', 'float', ...
0693             'atts', struct(...
0694                 'long_name', 'AMSU-A measurement time minus Cloudsat measurement time', ...
0695                 'units', 'seconds')), ...
0696         'B_DIST', struct(...
0697             'type', 'float', ...
0698             'atts', struct(...
0699                 'long_name', 'Distance AMSU-B/MHS to CloudSat', ...
0700                 'units', 'km')), ...
0701         'B_INT', struct(...
0702             'type', 'float', ...
0703             'atts', struct(...
0704                 'long_name', 'AMSU-B/MHS measurement time minus CloudSat measurement time', ...
0705                 'units', 'seconds')), ...
0706         'H_DIST', struct(...
0707             'type', 'float', ...
0708             'atts', struct(...
0709                 'long_name', 'Distance HIRS to Cloudsat', ...
0710                 'units', 'km')), ...
0711         'H_INT', struct(...
0712             'type', 'float', ...
0713             'atts', struct(...
0714                 'long_name', 'HIRS measurement time minus Cloudsat measurement time', ...
0715                 'units', 'seconds')), ...
0716         'AMSU', struct(...
0717             'type', 'float', ...
0718             'dims', {{'AMSU_CHANS', 20}}, ...
0719             'atts', struct(...
0720                 'long_name', 'AMSU Brightness Temperature', ...
0721                 'units', 'Kelvin')), ...
0722         'MSPPS_IWP', struct(...
0723             'type', 'float', ...
0724             'atts', struct(...
0725                 'long_name', 'NOAA NESDIS MSPPS IWP', ...
0726                 'units', 'g/m^2')), ...
0727         'FIRST', struct(...
0728             'type', 'int', ... % would like to use ushort here
0729             'atts', struct(...
0730                 'long_name', 'First corresponding row in overlap')), ...
0731         'LAST', struct(...
0732             'type', 'int', ... % would like to use ushort here
0733             'atts', struct(...
0734                 'long_name', 'Last corresponding row in overlap')), ...
0735         'NO', struct(...
0736             'type', 'byte', ...
0737             'atts', struct(...
0738                 'long_name', 'Number of CloudSat pixels in AMSU-B/MHS')), ...
0739         'MEAN', struct(...
0740             'type', 'float', ...
0741             'atts', struct(...
0742                 'long_name', 'Mean CloudSat ROIWP', ...
0743                 'units', 'g/m^2')), ...
0744         'SD', struct(...
0745             'type', 'float', ...
0746             'atts', struct(...
0747                 'long_name', 'Standard deviation CloudSat ROIWP', ...
0748                 'units', 'g/m^2')), ...
0749         'CV', struct(...
0750             'type', 'float', ...
0751             'atts', struct(...
0752                 'long_name', 'Coefficient of variation CloudSat ROIWP')), ...
0753         'FRAC', struct(...
0754             'type', 'float', ...
0755             'atts', struct(...
0756                 'long_name', 'Cloud fraction from CloudSat ROIWP in AMSU-B/MHS')), ...
0757         'INHIRS', struct(...
0758             'type', 'byte', ...
0759             'atts', struct(...
0760                 'long_name', 'Number of CloudSat pixels in HIRS'))));
0761 
0762 A.cols_cpr_mhs.aliases = struct(...
0763      'MHS', {{'AMSU', 16:20}}, ... % MHS = AMSU channels 16--20
0764      'AMSU_B', {{'AMSU', 16:20}}, ...
0765      'AMSU_A', {{'AMSU', 1:15}}); 
0766 
0767 %% for POES/POES
0768 
0769 A.cols_mhs_mhs.stored = catstruct(...
0770     x_with_x, ...
0771     struct(...
0772         'AMSU_B1', struct(...
0773             'type', 'float', ...
0774             'dims', {{'AMSUB_CHANS', 5}}, ...
0775             'atts', struct(...
0776                 'long_name', 'Primary brightness temperature', ...
0777                 'units', 'Kelvin')), ...
0778         'AMSU_B2', struct(...
0779             'type', 'float', ...
0780             'dims', {{'AMSUB_CHANS', 5}}, ...
0781             'atts', struct(...
0782                 'long_name', 'Secondary brightness temperature', ...
0783                 'units', 'Kelvin'))));
0784 
0785 A.cols_mhs_mhs.aliases = struct(...
0786      'MHS1', {{'AMSU_B1', 1:5}}, ...
0787      'MHS2', {{'AMSU_B2', 1:5}});
0788 
0789 %% for HIRS/HIRS
0790 
0791 A.cols_hirs_hirs.stored = catstruct(...
0792     x_with_x, ...
0793     struct(...
0794         'HIRS1', struct(...
0795             'type', 'float', ...
0796             'dims', {{'HIRS_CHANS', 20}}, ...
0797             'atts', struct(...
0798                 'long_name', 'Primary brightness temperature', ...
0799                 'units', 'Kelvin')), ...
0800         'HIRS2', struct(...
0801             'type', 'float', ...
0802             'dims', {{'HIRS_CHANS', 20}}, ...
0803             'atts', struct(...
0804                 'long_name', 'Secondary brightness temperature', ...
0805                 'units', 'Kelvin'))));
0806 
0807 A.cols_hirs_hirs.aliases = struct();
0808 
0809 %% for AMSUA/AMSUA
0810 
0811 A.cols_amsua_amsua.stored = catstruct(...
0812     x_with_x, ...
0813     struct(...
0814         'AMSU_A1', struct(...
0815             'type', 'float', ...
0816             'dims', {{'AMSUA_CHANS', 15}}, ...
0817             'atts', struct(...
0818                 'long_name', 'Primary brightness temperature', ...
0819                 'units', 'Kelvin')), ...
0820         'AMSU_A2', struct(...
0821             'type', 'float', ...
0822             'dims', {{'AMSUA_CHANS', 15}}, ...
0823             'atts', struct(...
0824                 'long_name', 'Secondary brightness temperature', ...
0825                 'units', 'Kelvin'))));
0826 
0827 A.cols_amsua_amsua.aliases = struct();
0828 
0829 %% for CPR/AVHRR
0830 
0831 A.cols_cpr_avhrr.stored = catstruct(...
0832     cloudsat, ...
0833     avhrr, ...
0834     struct(...
0835         'DIST', struct(...
0836             'type', 'float', ...
0837             'atts', struct(...
0838                 'long_name', 'Distance CPR-AVHRR', ...
0839                 'units', 'km')), ...
0840         'INT', struct(...
0841             'type', 'float', ...
0842             'atts', struct(...
0843                 'long_name', 'AVHRR measurement time minus CPR measurement time', ...
0844                 'units', 'seconds'))));
0845 
0846 %% for HIRSCS/MHS
0847 
0848 A.cols_hirscs_mhs.stored = catstruct(...
0849     hirs, ...
0850     mhs, ...
0851     struct(...
0852         'HCS_I', struct(...
0853             'type', 'int', ...
0854             'atts', struct(...
0855                 'long_name', 'HIRS-CS index')), ...
0856         'H_SZA', struct(...
0857             'type', 'float', ...
0858             'atts', struct(...
0859                 'long_name', 'solar zenith angle', ...
0860                 'units', 'degrees', ...
0861                 'valid_range', [0 180])), ...
0862         'H_ALT', struct(...
0863             'type', 'float', ...
0864             'atts', struct(...
0865                 'long_name', 'satellite altitude', ...
0866                 'units', 'km')), ...
0867         'DIST', struct(...
0868             'type', 'float', ...
0869             'atts', struct(...
0870                 'long_name', 'Distance AMSU-B/MHS to HIRS', ...
0871                 'units', 'km')), ...
0872         'INT', struct(...
0873             'type', 'float', ...
0874             'atts', struct(...
0875                 'long_name', 'AMSU-B/MHS time minus HIRS time', ...
0876                 'units', 'seconds')), ...
0877         'VIS', struct(...
0878             'type', 'float', ...
0879             'atts', struct(...
0880                 'long_name', 'HIRS channel 20', ...
0881                 'units', '%')), ...
0882         'BT', struct(...
0883             'type', 'float', ...
0884             'dims', {{'HIRS_CHANS', 19}}, ...
0885             'atts', struct(...
0886                 'long_name', 'HIRS-CS brightness temperature', ...
0887                 'units', 'Kelvin')), ...
0888         'LC', struct(...
0889             'type', 'float', ...
0890             'dims', {{'HIRS_CHANS', 19}}, ...
0891             'atts', struct(...
0892                 'long_name', 'HIRS-CS limb-corrected brightness temperature', ...
0893                 'units', 'Kelvin'))));
0894 % double: already contained in 'BT' (and 'LC')
0895 A.cols_hirscs_mhs.stored = rmfield(A.cols_hirscs_mhs.stored, 'HIRS');
0896 
0897 A.cols_hirscs_mhs.aliases = struct(...
0898      'MHS', {{'AMSU_B', 1:5}});
0899 
0900 %% for collocation cpr poes/avhrr
0901 
0902 A.cols_collocation_cpr_mhs_avhrr.stored = catstruct(...
0903     avhrr, ...
0904     struct(...
0905         'CPR_MHS_START', struct(...
0906             'type', 'int', ...
0907             'atts', struct(...
0908                 'long_name', 'collocation_cpr_mhs granule start time', ...
0909                 'units', 'seconds since 1970-01-01 00:00:00')), ...
0910         'CPR_MHS_ROW', struct(...
0911             'type', 'int', ...
0912             'atts', struct(...
0913                 'long_name', 'collocation_cpr_mhs collocations line number')), ...
0914         'CPR_MHS_MEAN_ROW', struct(...
0915             'type', 'int', ...
0916             'atts', struct(...
0917                 'long_name', 'collocation_cpr_mhs mean collocations line number')), ...
0918         'DIST_MHS_AVHRR', struct(...
0919             'type', 'float', ...
0920             'atts', struct(...
0921                 'long_name', 'Distance MHS-AVHRR', ...
0922                 'units', 'km')), ...
0923         'DIST_CPR_AVHRR', struct(...
0924             'type', 'float', ...
0925             'atts', struct(...
0926                 'long_name', 'Distance CPR-AVHRR', ...
0927                 'units', 'km')), ...
0928         'INT_MHS_AVHRR', struct(...
0929             'type', 'float', ...
0930             'atts', struct(...
0931                 'long_name', 'AVHRR time minus collocated AMSU-B/MHS time', ...
0932                 'units', 'seconds')), ...
0933         'FIRST', struct(...
0934             'type', 'int', ...
0935             'atts', struct(...
0936                 'long_name', 'First row in overlap corresponding to meanrow in averaged data')), ...
0937         'LAST', struct(...
0938             'type', 'int', ...
0939             'atts', struct(...
0940                 'long_name', 'Last row in overlap corresponding to meanrow in averaged data')), ...
0941         'NO', struct(...
0942             'type', 'byte', ...
0943             'dims', {{'AVHRR_CHANS', 5}}, ...
0944             'atts', struct(...
0945                 'long_name', 'Number of valid AVHRR pixels inside AMSU-B/MHS collocated with CloudSat CPR')), ...
0946         'MEAN', struct(...
0947             'type', 'float', ...
0948             'dims', {{'AVHRR_CHANS', 5}}, ...
0949             'atts', struct(...
0950                 'long_name', 'Mean AVHRR brightness temperature for valid AVHRR pixels inside AMSU-B/MHS collocated with CloudSat CPR', ...
0951                 'units', '%/Kelvin', ...
0952                 'note', 'See note for AVHRR')), ...
0953         'SD', struct(...
0954             'type', 'float', ...
0955             'dims', {{'AVHRR_CHANS', 5}}, ...
0956             'atts', struct(...
0957                 'long_name', 'Standard deviation for AVHRR brightness temperature for valid AVHRR pixels inside AMSU-B/MHS collocated with CloudSat CPR', ...
0958                 'units', '%/Kelvin', ...
0959                 'note', 'See note for AVHRR'))));
0960            
0961 A.cols_collocation_cpr_mhs_avhrr.aliases = struct();
0962 
0963 if exist('c', 'var')
0964     if isfield(A, c)
0965         v = A.(c);
0966     else
0967         % replace aliases
0968         c = replace_aliases(c);
0969         v = A.(c);
0970     end
0971 else
0972     v = A;
0973 end
0974 
0975 end
0976 
0977 function p=partial_x(sens1, sens2)
0978 % partial_x Return partial-applied function for process_..._x_to_x
0979 
0980     function res = wrapper(collocations, ...
0981         sat1, date1, data1, ...
0982         sat2, date2, data2)
0983     res = colloc_process_x_to_x(collocations, sat1, sens1, date1, data1, ...
0984         sat2, sens2, date2, data2);
0985     end
0986 p = @wrapper;
0987 end
0988 
0989 function p=partial_data_x(sens1, sens2)
0990 % partial_data_x Return partial-applied function for process_data_..._x-to_x_
0991 
0992 
0993     function res = wrapper(collocations, M_c, ...
0994         sat1, date1, data1, ...
0995         sat2, date2, data2)
0996     res = colloc_process_data_x_to_x(collocations, M_c, sat1, sens1, date1, ...
0997         data1, sat2, sens2, date2, data2);
0998     end
0999 p = @wrapper;
1000                        
1001 end

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