Home > atmlab > sensors > backend_amsutype.m

backend_amsutype

PURPOSE ^

BACKEND_AMSUTYPE Creates ARTS backend workspace variables

SYNOPSIS ^

function [f_backend,B,f_grid] = backend_amsutype(C)

DESCRIPTION ^

 BACKEND_AMSUTYPE   Creates ARTS backend workspace variables

    The function aims at setting up the ARTS workspace variables associated
    with the backend, for sensor of AMSU type. The channels can have an
    arbitrary number of passbands. The passbands of each channel are
    assumed to have the same width. The response of each passband is
    treated to be of rectangular type, but with some distance for the
    transition between 0 and 1 response. 

    A suitable f_grid is also created. The grid has equidistant points over
    each passband.

    The channels are described by a structure having the fields:
     C(i).centre_f       : The centre frequency of the channel, such as
                           183.31e9 for AMSU channel 18.
     C(i).passband_dfs   : The position of the passbands, with respect to
                           the centre frequency. Examples: [0], [-1e9 1e9]
                           and [-20e6 -10e6 10e6 20e6]
     C(i).passband_width : The FWHM of each passband of the channel.
     C(i).length_0to1    : The length (in frequency) for the transition
                           from 0 to 1 response.
     C(i).passband_nf    : The number of frequencies in f_grid to cover
                           each passband of the channel..

    See the second FORMAT version for how to obtain pre-defined data for C.

 FORMAT [f_backend,B,f_grid] = backend_amsutype(C)

 OUT   f_backend   As the ARTS WSV with the same name
       B           Matches ARTS' backend_channel_response
       f_grid      As the ARTS WSV with the same name
 IN    C           Channel description structure vector

   or

 FORMAT C = backend_amsutype( sensor )

 OUT   C      Channel description structure vector
 IN    sensor String with sensor name. The following options are at hand
  'amsu': AMSU A and B (AMSU-B channels have index 16 to 20).
          C.passband_nf set to give an approximate accuracy of about 0.1 K
          (but only tested for a single case).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

DOWNLOAD ^

backend_amsutype.m

SOURCE CODE ^

0001 % BACKEND_AMSUTYPE   Creates ARTS backend workspace variables
0002 %
0003 %    The function aims at setting up the ARTS workspace variables associated
0004 %    with the backend, for sensor of AMSU type. The channels can have an
0005 %    arbitrary number of passbands. The passbands of each channel are
0006 %    assumed to have the same width. The response of each passband is
0007 %    treated to be of rectangular type, but with some distance for the
0008 %    transition between 0 and 1 response.
0009 %
0010 %    A suitable f_grid is also created. The grid has equidistant points over
0011 %    each passband.
0012 %
0013 %    The channels are described by a structure having the fields:
0014 %     C(i).centre_f       : The centre frequency of the channel, such as
0015 %                           183.31e9 for AMSU channel 18.
0016 %     C(i).passband_dfs   : The position of the passbands, with respect to
0017 %                           the centre frequency. Examples: [0], [-1e9 1e9]
0018 %                           and [-20e6 -10e6 10e6 20e6]
0019 %     C(i).passband_width : The FWHM of each passband of the channel.
0020 %     C(i).length_0to1    : The length (in frequency) for the transition
0021 %                           from 0 to 1 response.
0022 %     C(i).passband_nf    : The number of frequencies in f_grid to cover
0023 %                           each passband of the channel..
0024 %
0025 %    See the second FORMAT version for how to obtain pre-defined data for C.
0026 %
0027 % FORMAT [f_backend,B,f_grid] = backend_amsutype(C)
0028 %
0029 % OUT   f_backend   As the ARTS WSV with the same name
0030 %       B           Matches ARTS' backend_channel_response
0031 %       f_grid      As the ARTS WSV with the same name
0032 % IN    C           Channel description structure vector
0033 %
0034 %   or
0035 %
0036 % FORMAT C = backend_amsutype( sensor )
0037 %
0038 % OUT   C      Channel description structure vector
0039 % IN    sensor String with sensor name. The following options are at hand
0040 %  'amsu': AMSU A and B (AMSU-B channels have index 16 to 20).
0041 %          C.passband_nf set to give an approximate accuracy of about 0.1 K
0042 %          (but only tested for a single case).
0043 
0044 % 2014-03-20  Created, Patrick Eriksson
0045 
0046 
0047 function [f_backend,B,f_grid] = backend_amsutype(C)
0048 
0049 %- Only return pre-defined sensor specification?
0050 %
0051 if ischar(C)
0052   if nargout > 1
0053     error( 'If *C* is a string, there can only be one output argument.' );
0054   end
0055   f_backend = instrument_specs( C );
0056   return;
0057 end
0058 %---
0059 
0060 
0061 % Init output arguments
0062 %
0063 f_backend = [];
0064 f_grid    = [];
0065 
0066 
0067 for i = 1 : length(C)
0068   
0069   % Check channel data
0070   if C(i).centre_f <= 0
0071     error( 'C(%d).centre_f is <= 0', i ); 
0072   end
0073   if max(abs(C(i).passband_dfs)) > 20e9
0074     error( 'Value(s) in C(i).passband_dfs appears too large (>20GHz)', i ); 
0075   end
0076   if ~issorted(C(i).passband_dfs)
0077     error( 'C(i).passband_dfs must be sorted', i ); 
0078   end
0079   if C(i).passband_width <= 0
0080     error( 'C(%d).passband_width is <= 0', i ); 
0081   end
0082   if C(i).passband_width > 10e9
0083     error( 'C(i).passband_dfs appears too large (>10>GHz)', i ); 
0084   end
0085   if length(C(i).passband_dfs) > 1  &  ...
0086                             C(i).passband_width > min(diff(C(i).passband_dfs))
0087     error( 'C(i).passband_dfs too large compared to C(i).passband_dfs' );
0088   end
0089   if C(i).length_0to1 < 1e3
0090     error( 'C(%d).length_0to1 is < 1 kHz', i ); 
0091   end
0092   if C(i).length_0to1 > C(i).passband_width
0093     error( 'C(%d).length_0to1 can not exceed C(%d).passband_width', i ); 
0094   end
0095   if C(i).passband_nf < 2
0096     error( 'C(%d).passband_nf is < 2', i ); 
0097   end
0098   
0099   
0100   f_backend = [ f_backend; C(i).centre_f ]; 
0101   
0102   B{i}.name      = 'Backend channel response function';
0103   B{i}.gridnames = { 'Frequency' };
0104   B{i}.dataname  = 'Response';
0105   %
0106   grid           = [];
0107   data           = [];
0108   df             = symgrid( C(i).passband_width / 2 + ...
0109                             C(i).length_0to1 * [-0.5;0.5] );
0110   %
0111   for j = 1 : length( C(i).passband_dfs )
0112     grid         = [ grid; C(i).passband_dfs(j)+df ];
0113     data         = [ data; 0; 1; 1; 0 ];
0114     
0115     f_grid       = [ f_grid; C(i).centre_f+C(i).passband_dfs(j)+...
0116                              linspace( min(df), max(df), C(i).passband_nf)' ];
0117   end
0118   %
0119   B{i}.grids   = { grid };
0120   B{i}.data    = data;
0121 
0122 end
0123 
0124 
0125 %- Final steps
0126 %
0127 f_grid = unique( f_grid );
0128 
0129 
0130 
0131 
0132 
0133 
0134 %--------------------------------------------------------------------------
0135 
0136 function C = instrument_specs( sensor )
0137 
0138 switch upper( sensor )
0139  
0140  case 'AMSU'
0141   % Set dummy/default values
0142   [C(1:20).centre_f]       = deal( -1 );   % Dummy value
0143   [C(1:20).passband_dfs]   = deal( 0 );    % OK for 1 passband channels
0144   [C(1:20).passband_width] = deal( -1 );   % Dummy value
0145   [C(1:20).length_0to1]    = deal( 10e6 ); % OK, beside for narrow channels
0146   
0147   % Data (mainly) taken from
0148   % AMSU-A: http://mirs.nesdis.noaa.gov/amsua.php
0149   % AMSU-B: http://mirs.nesdis.noaa.gov/amsub.php
0150   % Some bandwidths set to be consistent with the arts include files.
0151     
0152   % Channel  1
0153   C(1).centre_f        = 23.800e9;
0154   C(1).passband_width  = 270e6;
0155   C(1).passband_nf     = 2;
0156   % Channel  2
0157   C(2).centre_f        = 31.400e9;
0158   C(2).passband_width  = 180e6;
0159   C(2).passband_nf     = 2;
0160   % Channel  3
0161   C(3).centre_f        = 50.300e9;
0162   C(3).passband_width  = 180e6;
0163   C(3).passband_nf     = 2;
0164   % Channel  4
0165   C(4).centre_f        = 52.800e9;
0166   C(4).passband_width  = 400e6;
0167   C(4).passband_nf     = 5;
0168   % Channel  5
0169   C(5).centre_f        = 53.596e9;
0170   C(5).passband_dfs    = symgrid( 115e6 );
0171   C(5).passband_width  = 170e6;
0172   C(5).passband_nf     = 5;
0173   % Channel  6
0174   C(6).centre_f        = 54.400e9;
0175   C(6).passband_width  = 400e6;
0176   C(6).passband_nf     = 8;
0177   % Channel  7
0178   C(7).centre_f        = 54.940e9;
0179   C(7).passband_width  = 400e6;
0180   C(7).passband_nf     = 7;
0181   % Channel  8
0182   C(8).centre_f        = 55.500e9;
0183   C(8).passband_width  = 330e6;
0184   C(8).passband_nf     = 5;
0185   % Channel  9
0186   C(9).centre_f        = 57.290344e9;
0187   C(9).passband_width  = 330e6;
0188   C(9).passband_nf     = 7;
0189   % Channel 10
0190   C(10).centre_f       = 57.290344e9;
0191   C(10).passband_dfs   = symgrid( 217e6 );
0192   C(10).passband_width = 78e6;
0193   C(10).length_0to1    = 7.8e6;
0194   C(10).passband_nf    = 5;
0195   % Channel 11
0196   C(11).centre_f       = 57.290344e9;
0197   C(11).passband_dfs   = symgrid( 322.2e6 + 48e6*[-1 1] );
0198   C(11).passband_width = 36e6;
0199   C(11).length_0to1    = 3.6e6;
0200   C(11).passband_nf    = 4;
0201   % Channel 12
0202   C(12).centre_f       = 57.290344e9;
0203   C(12).passband_dfs   = symgrid( 322.2e6 + 22e6*[-1 1] );
0204   C(12).passband_width = 16e6;
0205   C(12).length_0to1    = 1.6e6;
0206   C(12).passband_nf    = 4;
0207   % Channel 13
0208   C(13).centre_f       = 57.290344e9;
0209   C(13).passband_dfs   = symgrid( 322.2e6 + 10e6*[-1 1] );
0210   C(13).passband_width = 8e6;
0211   C(13).length_0to1    = 0.8e6;
0212   C(13).passband_nf    = 4;
0213   % Channel 14
0214   C(14).centre_f       = 57.290344e9;
0215   C(14).passband_dfs   = symgrid( 322.2e6 + 4.5e6*[-1 1] );
0216   C(14).passband_width = 3e6;
0217   C(14).length_0to1    = 0.3e6;
0218   C(14).passband_nf    = 3;
0219   % Channel 15
0220   C(15).centre_f       = 89.900e9;
0221   C(15).passband_width = 2000e6;
0222   C(15).passband_nf    = 2;
0223 
0224   % Channel 16
0225   C(16).centre_f       = 89.900e9;
0226   C(16).passband_dfs   = symgrid( 900e6 );
0227   C(16).passband_width = 1000e6;
0228   C(16).passband_nf    = 2;
0229   % Channel 17
0230   C(17).centre_f       = 150.000e9;
0231   C(17).passband_dfs   = symgrid( 900e6 );
0232   C(17).passband_width = 1000e6;
0233   C(17).passband_nf    = 2;
0234   % Channel 18
0235   C(18).centre_f       = 183.310e9;
0236   C(18).passband_dfs   = symgrid( 1000e6 );
0237   C(18).passband_width = 500e6;
0238   C(18).passband_nf    = 2;
0239   % Channel 19
0240   C(19).centre_f       = 183.310e9;
0241   C(19).passband_dfs   = symgrid( 3000e6 );
0242   C(19).passband_width = 1000e6;
0243   C(19).passband_nf    = 3;
0244   % Channel 20
0245   C(20).centre_f       = 183.310e9;
0246   C(20).passband_dfs   = symgrid( 7000e6 );
0247   C(20).passband_width = 2000e6;
0248   C(20).passband_nf    = 3;
0249   
0250  otherwise
0251   error( 'Unknown option for *C*.' )
0252 end
0253 
0254

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