Home > atmlab > demos > qarts_backend_demo.m

qarts_backend_demo

PURPOSE ^

QARTS_BACKEND_DEMO Example on how to introduce a passband filter backend

SYNOPSIS ^

function [f,y] = qarts_backend_demo(zplat,za)

DESCRIPTION ^

 QARTS_BACKEND_DEMO   Example on how to introduce a passband filter backend

    A simple simulation of a ground-based temperature radiometer, having
    passbbands of different widths.

 FORMAT   [f,y] = qarts_backend_demo( zplat, za )
        
 OUT   f          Centre frequency of passbands.
       y          Simulated brightness temperature (RJTB)
 IN    zplat      Platform altitude.
       za         Zenith angle.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

qarts_backend_demo.m

SOURCE CODE ^

0001 % QARTS_BACKEND_DEMO   Example on how to introduce a passband filter backend
0002 %
0003 %    A simple simulation of a ground-based temperature radiometer, having
0004 %    passbbands of different widths.
0005 %
0006 % FORMAT   [f,y] = qarts_backend_demo( zplat, za )
0007 %
0008 % OUT   f          Centre frequency of passbands.
0009 %       y          Simulated brightness temperature (RJTB)
0010 % IN    zplat      Platform altitude.
0011 %       za         Zenith angle.
0012 
0013 % 2013-04-17   Created, Patrick Eriksson.
0014 
0015 function [f,y] = qarts_backend_demo(zplat,za)
0016 
0017   
0018 %= Atmlab settings
0019 %
0020 arts_xmldata_path = atmlab( 'ARTS_XMLDATA_PATH' );
0021 %
0022 if isnan( arts_xmldata_path )
0023   error('You need to ARTS_XMLDATA_PATH to run this example.');
0024 end
0025 %
0026 fascod = fullfile( arts_xmldata_path, 'planets', 'Earth', 'Fascod' );
0027 
0028   
0029 %= Init Q structures
0030 %
0031 Q  = qarts;
0032 %
0033 Q.INCLUDES              = { fullfile( 'ARTS_INCLUDES', 'general.arts' ), ...
0034                             fullfile( 'ARTS_INCLUDES', 'agendas.arts' ), ...
0035                             fullfile( 'ARTS_INCLUDES', 'continua.arts' ), ...
0036                             fullfile( 'ARTS_INCLUDES', 'planet_earth.arts' ) };
0037 
0038 
0039 %= Define agendas
0040 %
0041 Q.PPATH_AGENDA               = { 'ppath_agenda__FollowSensorLosPath'   };
0042 Q.PPATH_STEP_AGENDA          = { 'ppath_step_agenda__GeometricPath'    };
0043 Q.BLACKBODY_RADIATION_AGENDA = { 'blackbody_radiation_agenda__Planck'  };
0044 Q.IY_SPACE_AGENDA            = { 'iy_space_agenda__CosmicBackground'   };
0045 Q.IY_SURFACE_AGENDA          = { 'iy_surface_agenda__UseSurfaceRtprop' };
0046 Q.IY_MAIN_AGENDA             = { 'iy_main_agenda__Emission'            };
0047 
0048 
0049 
0050 %= Species
0051 %
0052 Q.ABS_SPECIES(1).TAG{1} = 'N2-SelfContStandardType';;
0053 Q.ABS_SPECIES(2).TAG{1} = 'H2O-PWR98';
0054 Q.ABS_SPECIES(3).TAG{1} = 'O2-PWR93';
0055 
0056 
0057 %= Set-up atmosphere and surface
0058 %
0059 Q.ATMOSPHERE_DIM         = 1;
0060 %
0061 Q.P_GRID                 = z2p_simple( [-100:250:50e3]' );
0062 %
0063 atm = 'midlatitude-summer';
0064 Q.RAW_ATMOSPHERE        = fullfile( arts_xmldata_path, 'planets', 'Earth', ...
0065                                                           'Fascod', atm, atm );
0066 Q.RAW_ATM_EXPAND_1D     = false;
0067 %
0068 Q.REFELLIPSOID          = ellipsoidmodels( 'SphericalEarth' );
0069 Q.Z_SURFACE             = 0;
0070 
0071 
0072 %= Absorption
0073 %
0074 Q.ABS_LINES_FORMAT       = 'none';
0075 %
0076 Q.ABSORPTION             = 'OnTheFly';
0077 
0078 
0079 %= Various
0080 %
0081 Q.CLOUDBOX_DO       = false;
0082 Q.J_DO              = false;
0083 %
0084 Q.STOKES_DIM        = 1;
0085 Q.PPATH_LMAX        = -1;
0086 %
0087 Q.YCALC_WSMS        = { 'yCalc' };
0088 %
0089 Q.IY_UNIT           = 'RJBT';
0090 
0091 
0092 %= Define spectrometer passbands
0093 %
0094 f                   = 1e9 * [ 51.26 52.28 53.86 54.94 56.66 57.3 58.0 ]';
0095 df                  = 1e6 * [   230   230   230   230   600 1000 2000 ]';
0096 
0097 
0098 %= Init sensor definition
0099 %
0100 Q.SENSOR_POS        = zplat;
0101 Q.SENSOR_LOS        = za;    
0102 %
0103 H                   = qartsSensor;
0104 H.SENSOR_NORM       = true;
0105 H.ANTENNA_DO        = false;
0106 
0107 
0108 %= Include spectrometer
0109 %
0110 H.BACKEND_DO        = true;
0111 H.F_BACKEND         = f;
0112 %
0113 B.name              = 'Spectrometer channel response function';
0114 B.gridnames         = {'Frequency'};
0115 B.dataname          = 'Response';
0116 B.data              = [1 1];
0117 %
0118 % Here we need to define one response for each channel, but only the
0119 % width differs
0120 for i = 1 : length(df)
0121   B.grids  = { df(i)/2*[-1 1] };
0122   H.BACKEND_CHANNEL_RESPONSE{i} = B;
0123 end
0124 
0125 
0126 %= Frequency grid
0127 %
0128 Q.F_GRID            = linspace( f(1)-df(1)*0.51, f(end)+df(end)*0.51, 100 )';
0129 
0130 
0131 %= One option to manage with a shorter F_GRID is to use "filling", but make
0132 %  very careful tests before starting to use it:
0133 %
0134 %H.FILL_FGRID        = [ 4 5 ];
0135 
0136 
0137 %= Finalise sensor definition
0138 %
0139 Q.SENSOR_RESPONSE   = H;
0140 Q.SENSOR_DO         = true;
0141 
0142 
0143 
0144 %= Calculate spectrum/spectra
0145 %
0146 y = arts_y( Q );

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