Home > atmlab > atmlab > atmlab_demo.m

atmlab_demo

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

atmlab_demo.m

SOURCE CODE ^

0001 echo off
0002 fprintf('Enlarge command window vertically as much as screen\n');
0003 fprintf('allows, for best performance. And press a key.\n');
0004 pause
0005 echo on
0006 
0007 more on
0008 
0009 clc
0010 %
0011 %--- Demonstration of *atmlab* ------------------------------------------------
0012 %
0013 %- Global settings in Atmlab are handled by *atmlab*.
0014 %- To check out all present settings:
0015 %
0016 atmlab;
0017 
0018 
0019 %- To get a specific field:
0020 %
0021 warea = atmlab( 'WORK_AREA' )
0022 %
0023 pause   % Press a key
0024 
0025 clc
0026 %
0027 %- To set a specific field:
0028 %
0029 atmlab( 'WORK_AREA', '/stupid' ); 
0030 
0031 atmlab;
0032 
0033 
0034 %- Go back to original setting:
0035 %
0036 atmlab( 'WORK_AREA', warea ); 
0037 %
0038 %
0039 pause   % Press a key
0040 
0041 
0042 clc
0043 %
0044 %- Information on Atmlab settings are obtained by: help atmlab
0045 %
0046 pause   % Press a key
0047 %
0048 help atmlab
0049 %
0050 pause   % Press a key
0051 
0052 
0053 clc
0054 %
0055 %--- What is found in Atmlab? ------------------------------------------------
0056 %
0057 %- Use *extra* list all Atmlab functions:
0058 %
0059 pause   % Press a key
0060 %
0061 extra
0062 %
0063 %
0064 %- Use *lookfor* to search for a function for a specific task.
0065 %
0066 pause   % Press a key
0067 
0068 
0069 clc
0070 %
0071 %--- Demonstration of *gridselect2D* ------------------------------------------
0072 %
0073 %- Create a test case by *peaks*
0074 %
0075 np = 101;
0076 xf = linspace( -3, 3, np );
0077 yf = linspace( -3, 3, np );
0078 Af = peaks( np );
0079 figure(1)
0080 mesh( yf, xf, Af )
0081 title( 'Data to fit with shorter grids' );
0082 %
0083 pause   % Press a key
0084 %
0085 %- Select shorter grids that represent data within an absolut accuracy
0086 %- of 0.1 using a piecewise linear represntation
0087 %
0088 [xc,yc,Ac] = gridselect2D( xf, yf, Af, 0.1, 'linear' );
0089 size(Af)   % Original size
0090 size(Ac)   % New size
0091 %
0092 mesh( yc, xc, Ac )
0093 title( 'Data on coarser representation' );
0094 %
0095 pause   % Press a key
0096 
0097 clc
0098 %
0099 %- Show representation error
0100 %
0101 Ac = interp2( yc, xc', Ac, yf, xf', 'linear');
0102 mesh( yf, xf, Ac-Af )
0103 title( 'Representation error (inside given limit everywhere!)' );
0104 pause   % Press a key
0105 %
0106 clear xf yf Af xc yc Ac
0107 close(1);
0108 
0109 
0110 
0111 clc
0112 %
0113 %--- Qarts --------------------------------------------------------------------
0114 %
0115 %- Calculations with ARTS are controled by a structure, denoted as Q. The
0116 %- function defining all existing fields is called *qarts*:
0117 %
0118 pause   % Press a key
0119 %
0120 Q = qarts
0121 %
0122 pause   % Press a key
0123 
0124 clc
0125 %
0126 %- Field documentation is obtained by *qinfo*:
0127 %
0128 qinfo( @qarts, 'R_GEOID' )
0129 %
0130 pause   % Press a key
0131 
0132 clc
0133 %
0134 %- Set field name to 'all' to list everything
0135 %
0136 pause   % Press a key
0137 %
0138 qinfo( @qarts, 'all' )
0139 %
0140 pause   % Press a key
0141 
0142 
0143 clc
0144 %
0145 %- Trailing widcard can also be used:
0146 %
0147 qinfo( @qarts, 'P*' )
0148 %
0149 pause   % Press a key
0150 
0151 
0152 clc
0153 %
0154 %- To call ARTS, use *arts*:
0155 %
0156 if ~isnan( atmlab( 'ARTS_PATH' ) )
0157   %
0158   arts( '-v' );
0159   %
0160 else
0161   %
0162   %arts( '-v' );
0163   %
0164 end
0165 %
0166 pause   % Press a key
0167 
0168 
0169 clc
0170 %
0171 %- A detailed example on possible usage of Q structures, including
0172 %- practical calculations, is found in arts/qarts_demo.m.
0173 %- The function will be displayed below.
0174 %
0175 pause   % Press a key
0176 %
0177 type qarts_demo
0178 %
0179 pause   % Press a key
0180 
0181 
0182 clc
0183 %
0184 %- Ask if *qarts_demo* shall be run using the Atmlab function *yes_or_no*.
0185 %- *qarts_demo* requires that both ARTS is available, and that
0186 %- corresponding Atmlab settings are given.
0187 %
0188 if yes_or_no( 'Run *qarts_demo*' )
0189   qarts_demo;
0190 end
0191 %
0192 
0193 clc
0194 %
0195 %--- End of demonstration -----------------------------------------------------
0196 %
0197 echo off

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