Home > atmlab > demos > qarts_demo.m

qarts_demo

PURPOSE ^

QARTS_DEMO A simple demonstration of Qarts

SYNOPSIS ^

function [Q,f,y] = qarts_demo( varargin )

DESCRIPTION ^

 QARTS_DEMO   A simple demonstration of Qarts

    Gives an example on basic usage of Qarts. All agendas are defined in
    the file (agendas.arts not used).

    The example simulated Odin-SMR observations around 501 GHz, but 
    with a simplified set-up. 

 FORMAT   [Q,f,y] = qarts_demo( [ ztan ] )
        
 OUT   Q          Qarts setting structure.
       f          Frequency grid
       y          Calculated spectrum
 OPT   ztan       Tangent altitude. Default is 30 km.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

qarts_demo.m

SOURCE CODE ^

0001 % QARTS_DEMO   A simple demonstration of Qarts
0002 %
0003 %    Gives an example on basic usage of Qarts. All agendas are defined in
0004 %    the file (agendas.arts not used).
0005 %
0006 %    The example simulated Odin-SMR observations around 501 GHz, but
0007 %    with a simplified set-up.
0008 %
0009 % FORMAT   [Q,f,y] = qarts_demo( [ ztan ] )
0010 %
0011 % OUT   Q          Qarts setting structure.
0012 %       f          Frequency grid
0013 %       y          Calculated spectrum
0014 % OPT   ztan       Tangent altitude. Default is 30 km.
0015 
0016 % 2008-05-27   Updated to ARTS2 by Patrick Eriksson.
0017 % 2007-08-21   Cleaned and updated by Patrick Eriksson.
0018 % 2005-01-26   Sensor part added by Mattias Ekstrom.
0019 % 2004-??-??   Created by Patrick Eriksson.
0020 
0021 function [Q,f,y] = qarts_demo( varargin )
0022 %
0023 [ztan] = optargs( varargin, { 30e3 } );
0024 
0025 
0026 %= Init Q structures
0027 %
0028 Q  = qarts;
0029 %
0030 Q.INCLUDES              = { fullfile( 'ARTS_INCLUDES', 'general.arts' ), ...
0031                             fullfile( 'ARTS_INCLUDES', 'continua.arts' ), ...
0032                             fullfile( 'ARTS_INCLUDES', 'planet_earth.arts' ) };
0033 
0034 
0035 %= De-activate parts not used
0036 %
0037 Q.CLOUDBOX_DO           = false;
0038 Q.J_DO                  = false;
0039   
0040 
0041 %= Some basic settings
0042 %
0043 Q.OUTPUT_FILE_FORMAT    = 'ascii';
0044 
0045 
0046 %= Define atmosphere and surface
0047 %
0048 Q.ATMOSPHERE_DIM        = 1;
0049 %
0050 Q.P_GRID                = z2p_simple( [0:500:45e3 46e3:1e3:95e3]' );
0051 %
0052 arts_xmldata_path       = atmlab( 'ARTS_XMLDATA_PATH' );
0053 if isnan( arts_xmldata_path )
0054   error('You need ARTS_XMLDATA_PATH to run this example.');
0055 end
0056 %
0057 Q.RAW_ATMOSPHERE        = fullfile( arts_xmldata_path, 'planets', 'Earth', ...
0058                                             'Fascod', 'tropical', 'tropical' );
0059 Q.RAW_ATM_EXPAND_1D     = false;
0060 %
0061 Q.WIND_U_FIELD          = [];
0062 Q.WIND_V_FIELD          = [];
0063 Q.WIND_W_FIELD          = [];
0064 Q.MAG_U_FIELD           = [];
0065 Q.MAG_V_FIELD           = [];
0066 Q.MAG_W_FIELD           = [];
0067 %
0068 Q.REFELLIPSOID          = ellipsoidmodels( 'SphericalEarth' );
0069 Q.Z_SURFACE             = { 'Arts2{', 'Extract( z_surface, z_field, 0 )', '}' };
0070 
0071 
0072 %= To enforce detailed hydrostatic equilibrium
0073 %
0074 % This demands that a geographical position is specified, through LAT/LON_TRUE.
0075 %
0076 Q.HSE.ON                = true;
0077 Q.HSE.P                 = Q.P_GRID(1);
0078 Q.HSE.ACCURACY          = 1;
0079 %
0080 Q.LAT_TRUE              = 15;
0081 Q.LON_TRUE              = -30;
0082 
0083 
0084 %= Absorption
0085 %
0086 Q.ABS_SPECIES(1).TAG{1} = 'ClO';
0087 Q.ABS_SPECIES(2).TAG    = { 'O3' };   % Note the different way to set TAG!
0088 Q.ABS_SPECIES(3).TAG{1} = 'N2O';
0089 Q.ABS_SPECIES(4).TAG{1} = 'H2O-*-490e9-510e9';   % Some local lines not in PWR98
0090 Q.ABS_SPECIES(4).TAG{2} = 'H2O-PWR98';
0091 Q.ABS_SPECIES(5).TAG{1} = 'N2-SelfContStandardType';
0092 %
0093 Q.ABSORPTION            = 'OnTheFly';  % A simple, but slow, option!
0094 Q.ABS_LINES_FORMAT      = 'Arts';
0095 Q.ABS_LINES             = fullfile( atmlab_example_data , 'lines501.4' );
0096 Q.ABS_LINESHAPE         = 'Voigt_Kuntz6';
0097 Q.ABS_LINESHAPE_CUTOFF  = -1;
0098 Q.ABS_LINESHAPE_FACTOR  = 'VVH';
0099 
0100 
0101 %= Set RTE variables (refraction is here neglected)
0102 %
0103 Q.IY_MAIN_AGENDA        = { 'iyEmissionStandard' };
0104 Q.BLACKBODY_RADIATION_AGENDA = { 'blackbody_radiationPlanck' };
0105 Q.IY_SPACE_AGENDA       = { 'Ignore(rtp_pos)', 'Ignore(rtp_los)', ...
0106                             'MatrixCBR(iy,stokes_dim,f_grid)' };
0107 Q.SURFACE_RTPROP_AGENDA = { 'Ignore(rtp_pos)', 'Ignore(rtp_los)', ...
0108                            ['InterpAtmFieldToPosition(out=surface_skin_t,', ...
0109                                                          'field=t_field)'], ...
0110                             'surfaceBlackbody' };
0111 Q.IY_SURFACE_AGENDA     = { 'iySurfaceRtpropAgenda' };
0112 Q.IY_AUX_VARS           = [];
0113 %
0114 Q.YCALC_WSMS            = { 'yCalc' };
0115 %
0116 Q.PPATH_LMAX            = 10e3;
0117 Q.PPATH_STEP_AGENDA     = { 'Ignore(t_field)', 'Ignore(vmr_field)', ... 
0118                             'Ignore(f_grid)', ... 
0119                             'Ignore(ppath_lraytrace)', 'ppath_stepGeometric' };
0120 Q.PPATH_AGENDA          = { 'Ignore(rte_pos2)', 'ppathStepByStep' };
0121 Q.WSMS_AT_START{end+1}  = 'FlagOff( ppath_inside_cloudbox_do )';
0122 %
0123 Q.STOKES_DIM            = 1;
0124 Q.IY_UNIT                = 'RJBT';
0125 %
0126 zplat                   = 600e3;
0127 Q.SENSOR_POS            = zplat;
0128 Q.SENSOR_LOS            = geomztan2za( Q.REFELLIPSOID(1), zplat, ztan );
0129 Q.TRANSMITTER_POS       = [];
0130 
0131   
0132 %= Sensor
0133 %
0134 Q.F_GRID                = linspace( 501.18e9, 501.58e9, 201 )';
0135 %
0136 % Simple example, only including a narrow antenna pattern.
0137 %
0138 if 1   % Commit only with 1 here, to make *make_check* to work
0139   Q.SENSOR_DO           = false;
0140 else
0141   H                     = qartsSensor;
0142   %
0143   H.SENSOR_NORM         = true;
0144   %
0145   Q.ANTENNA_DIM         = 1;
0146   Q.MBLOCK_ZA_GRID      = [-0.04:0.02:0.04]';
0147   H.ANTENNA_DO          = true;
0148   H.ANTENNA_LOS         = 0;
0149   H.ANTENNA_RESPONSE    = fullfile( atmlab_example_data, 'antenna.xml' );
0150   %
0151   Q.SENSOR_DO           = true;
0152   Q.SENSOR_RESPONSE     = H;
0153 end
0154 
0155 
0156 if nargout == 1
0157   return
0158 end
0159 
0160 
0161 %= Calculate spectrum/spectra
0162 %
0163 y = arts_y( Q );
0164 %
0165 f = Q.F_GRID;
0166 
0167 
0168 %= Plot
0169 %
0170 if ~nargout
0171   plot( Q.F_GRID/1e9, y, 'LineWidth', 2 );
0172   xlabel( 'Frequency [GHz]' )
0173   ylabel( 'Brightness temperature [K]' )
0174   title( sprintf( 'Odin-SMR ClO band (tangent altitude = %.1f km)', ztan/1e3));
0175 end
0176

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