source: trunk/SRC/Documentation/xmldoc/firststeps.xml @ 376

Last change on this file since 376 was 354, checked in by pinsard, 16 years ago

some improvements in wiki production

  • Property svn:keywords set to Id
File size: 33.9 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE article [
3<!ENTITY % isolat1 SYSTEM "http://www.w3.org/2003/entities/iso8879/isolat1.ent">
4%isolat1;
5<!ENTITY % isolat2 SYSTEM "http://www.w3.org/2003/entities/iso8879/isolat2.ent">
6%isolat2;
7<!ENTITY % isogrk3 SYSTEM "http://www.w3.org/2003/entities/iso8879/isogrk3.ent">
8%isogrk3;
9<!ENTITY % isopub SYSTEM "http://www.w3.org/2003/entities/iso8879/isopub.ent">
10%isopub;
11<!ENTITY % isotech SYSTEM "http://www.w3.org/2003/entities/iso8879/isotech.ent">
12%isotech;
13<!ENTITY % isonum SYSTEM "http://www.w3.org/2003/entities/iso8879/isonum.ent">
14%isonum;
15<!ENTITY promptidl "idl&gt;">
16<!ENTITY numb1 '<inlinemediaobject><imageobject><imagedata fileref="images/callouts/1.png" format="PNG"/></imageobject><textobject><phrase>1</phrase></textobject></inlinemediaobject>'>
17<!ENTITY numb2 '<inlinemediaobject><imageobject><imagedata fileref="images/callouts/2.png" format="PNG"/></imageobject><textobject><phrase>2</phrase></textobject></inlinemediaobject>'>
18<!ENTITY showfig '<inlinemediaobject><imageobject><imagedata fileref="images/showfig.png" format="PNG"/></imageobject><textobject><phrase>show result</phrase></textobject></inlinemediaobject>'>
19]>
20
21<article version="5.0"
22xmlns="http://docbook.org/ns/docbook"
23xmlns:xl="http://www.w3.org/1999/xlink"
24xmlns:xi="http://www.w3.org/2001/XInclude"
25xml:lang="en"
26xml:id="firststeps">
27
28<!--
29instructions to create html file
30xsltproc ?-?-param  section.autolabel 1 -output firststep.html /sw/share/xml/xsl/docbook-xsl/xhtml/docbook.xsl firststep.xml
31xsltproc -output firststep.html /sw/share/xml/xsl/docbook-xsl/xhtml/docbook.xsl firststep.xml
32xsltproc  /sw/share/xml/xsl/docbook-xsl/xhtml/chunk.xsl  firststep.xml
33xsltproc ?-?-param  section.autolabel 1 /sw/share/xml/xsl/docbook-xsl/xhtml/chunk.xsl firststep.xml
34
35-->
36
37<!--
38module :
39first steps with SAXO ...
40
41source :
42./SRC/Documentation/xmldoc/firststeps.xml
43
44-->
45  <title> First steps with <application>SAXO</application> </title>
46
47  <info>
48    <authorgroup>
49      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>Sebastien.Masson_at_locean-ipsl.upmc.fr</email></author>
50      <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_locean-ipsl.upmc.fr</email></author>
51    </authorgroup>
52    <keywordset>
53      <keyword>IDL</keyword>
54      <keyword>SAXO</keyword>
55    </keywordset>
56    <revhistory>
57      <revision>
58<revnumber>0.0</revnumber>
59<date>29 July 2005</date>
60<revremark>First draft</revremark>
61      </revision>
62      <revision>
63<revnumber>0.1</revnumber>
64<date>29 August 2005</date>
65<revremark>last Japanese version!</revremark>
66      </revision>
67      <revision>
68<revnumber>0.2</revnumber>
69<date>May 2006</date>
70<revremark>split with getsaxo</revremark>
71      </revision>
72      <revision>
73        <revnumber>0.3</revnumber>
74        <date>April 2008</date>
75        <revremark>migration from DocBook 4.2 to Docbook 5.0</revremark>
76      </revision>
77
78     </revhistory>
79     <pubdate>$Id$</pubdate>
80  </info>
81<sect1 xml:id="beforefirststeps">
82<title>Before this</title>
83<para>
84In this document, we supposed that you followed <link xl:href="./getsaxo.html">Get SAXO</link> recommendations.
85</para>
86</sect1>
87
88  <sect1 xml:id="first_plots">
89    <title> First plots &hellip; </title>
90    <sect2 xml:id="start_with_init">
91      <title> Start IDL session: <userinput><command>@init</command></userinput> </title>
92      <para>
93Each IDL session using <application>SAXO</application> must always start with:
94<screen>
95 <prompt>&promptidl;</prompt> <userinput><command>@init</command></userinput>
96</screen>
97      </para>
98      <para>
99<emphasis>The @ is equivalent to an include. It is used to execute a set of IDL commands that will be directly executed without any compilation (as it is the case for a procedure or a function). All variables defined and used in the @&hellip; file will still be accessible after the execution of the @&hellip; is finished (which is not the case for procedures and functions that ends with the return instruction).</emphasis>
100</para>
101<para>
102<screen>
103  <prompt>$</prompt> <userinput><command>cd</command> <filename class="directory">${HOME}/My_IDL/</filename></userinput>
104  <prompt>$</prompt> <userinput><command>idl</command></userinput>
105  <computeroutput>IDL Version 6.0, Mac OS X (darwin ppc m32). (c) 2003, Research Systems, Inc.</computeroutput>
106  <computeroutput>Installation number: 35411.</computeroutput>
107  <computeroutput>Licensed for personal use by Jean-Philippe BOULANGER only.</computeroutput>
108  <computeroutput>All other use is strictly prohibited.</computeroutput>
109  <prompt>&promptidl;</prompt> <userinput><command>@init</command></userinput>
110  <computeroutput>% Compiled module: KEEP_COMPATIBILITY.</computeroutput>
111  <computeroutput>% Compiled module: FIND.</computeroutput>
112  <computeroutput>% Compiled module: PATH_SEP.</computeroutput>
113  <computeroutput>% Compiled module: STRSPLIT.</computeroutput>
114  <computeroutput>% Compiled module: DEF_MYUNIQUETMPDIR.</computeroutput>
115  <computeroutput>We forget the compatibility with the old version</computeroutput>
116  <computeroutput>% Compiled module: DEMOMODE_COMPATIBILITY.</computeroutput>
117  <computeroutput>% Compiled module: ISADIRECTORY.</computeroutput>
118  <computeroutput>% Compiled module: LCT.</computeroutput>
119  <computeroutput>% Compiled module: RSTRPOS.</computeroutput>
120  <computeroutput>% Compiled module: REVERSE.</computeroutput>
121  <computeroutput>% Compiled module: STR_SEP.</computeroutput>
122  <computeroutput>% Compiled module: LOADCT.</computeroutput>
123  <prompt>&promptidl;</prompt>
124</screen>
125</para>
126<para>
127As an IDL session using <application>SAXO</application> must always start with :
128<screen>
129 <prompt>&promptidl;</prompt> <userinput><command>@init</command></userinput>
130</screen>
131, it could be convenient to define the environment variable <envar>IDL_STARTUP</envar> to <filename>${HOME}/My_IDL/init.pro</filename>. In that way, <filename>init.pro</filename> will automatically been executed when starting IDL. This can be done with the following command:
132      <variablelist>
133<varlistentry>
134<term><command>csh</command></term>
135<listitem><screen><prompt>$</prompt> <userinput><command>setenv</command> <envar>IDL_STARTUP</envar> <filename>${HOME}/My_IDL/init.pro</filename></userinput></screen></listitem>
136</varlistentry>
137<varlistentry>
138<term><command>ksh</command></term>
139<listitem><screen><prompt>$</prompt> <userinput><command>export</command> <envar>IDL_STARTUP</envar>=<filename>${HOME}/My_IDL/init.pro</filename></userinput></screen></listitem>
140</varlistentry>
141      </variablelist>
142      </para>
143    </sect2>
144    <sect2 xml:id="basic_plots">
145      <title> Basic plots &hellip; </title>
146      <sect3 xml:id="basic_splot">
147      <title> splot </title>
148
149      <para>
150<screenco>
151  <areaspec>
152    <area xml:id="findgen" coords="2"/>
153  </areaspec>
154<screen>
155   <prompt>&promptidl;</prompt> <userinput><command>n = 10</command></userinput>
156   <prompt>&promptidl;</prompt> <userinput><command>y = findgen(n)</command></userinput> &numb1;
157   <prompt>&promptidl;</prompt> <userinput><command>plot, y</command></userinput> <link xl:href="./figpng/basic_plot.png">&showfig;</link>
158</screen>
159   <calloutlist>
160    <callout arearefs="findgen">
161      <para>
162<command>findgen</command> stands for <emphasis role="bold">f</emphasis>loat <emphasis role="bold">ind</emphasis>ex <emphasis role="bold">gen</emphasis>erator.
163<screen>
164  <prompt>&promptidl;</prompt> <userinput><command>print, findgen(6)</command></userinput>
165  <computeroutput>      0.00000      1.00000      2.00000      3.00000      4.00000      5.00000</computeroutput>
166</screen>
167      </para>
168    </callout>
169  </calloutlist>
170</screenco>
171     </para>
172      <para>
173Using IDL <command>plot</command> command is quite inconvenient to save the figure as a postscript. In addition, positioning the figure on the window/page by using <varname>!p.position</varname>, <varname>!p.region</varname> and <varname>!p.multi</varname> is often a nightmare. That's why we developed <command>splot</command> (like super-plot) which can be used in the same way as plot but is much more convenient to make postscript and position the figure.
174<screen>
175  <prompt>&promptidl;</prompt> <userinput><command>splot, y</command></userinput> <link xl:href="./figpng/basic_splot1.png">&showfig;</link>
176  <computeroutput>% Compiled module: SPLOT.</computeroutput>
177  <computeroutput>% Compiled module: REINITPLT.</computeroutput>
178  <computeroutput>% Compiled module: PLACEDESSIN.</computeroutput>
179  <computeroutput>% Compiled module: CALIBRE.</computeroutput>
180  <computeroutput>% Compiled module: GIVEWINDOWSIZE.</computeroutput>
181  <computeroutput>% Compiled module: GET_SCREEN_SIZE.</computeroutput>
182  <computeroutput>% Compiled module: TERMINEDESSIN.</computeroutput>
183</screen>
184Save the figure seen on the screen as a (real, not a screen capture) postscript in only one command.
185<screenco>
186  <areaspec>
187    <area xml:id="make_ps" coords="6"/>
188  </areaspec>
189<screen>
190  <prompt>&promptidl;</prompt> <userinput><command>@ps</command></userinput>
191  <computeroutput>% Compiled module: GETFILE.</computeroutput>
192  <computeroutput>% Compiled module: PUTFILE.</computeroutput>
193  <computeroutput>% Compiled module: OPENPS.</computeroutput>
194  <computeroutput>% Compiled module: XQUESTION.</computeroutput>
195  <computeroutput>Name of the postscript file? (default answer is idl.ps)</computeroutput><userinput>first_ps</userinput> &numb1;
196  <computeroutput>% Compiled module: ISAFILE.</computeroutput>
197  <computeroutput>% Compiled module: XNOTICE.</computeroutput>
198  <computeroutput>% Compiled module: CLOSEPS.</computeroutput>
199  <computeroutput>% Compiled module: PRINTPS.</computeroutput>
200  <computeroutput>% Compiled module: FILE_WHICH.</computeroutput>
201  <computeroutput>% Compiled module: CW_BGROUP.</computeroutput>
202  <computeroutput>% Compiled module: XMANAGER.</computeroutput>
203</screen>
204  <calloutlist>
205    <callout arearefs="make_ps">
206      <simpara>
207If needed, the name of the postscript will automatically be completed with .ps. Just hit return, if you want to use the default postscript name: <filename>idl.ps</filename>.
208      </simpara>
209    </callout>
210  </calloutlist>
211</screenco>
212Check that the <quote><filename>first_ps.ps</filename></quote> file is now existing &hellip;
213<screen>
214  <prompt>&promptidl;</prompt> <userinput><command>print, file_test(psdir + 'first_ps.ps')</command></userinput>
215  <computeroutput>           1</computeroutput>
216  <prompt>&promptidl;</prompt> <userinput><command>help, file_info(psdir + 'first_ps.ps'), /structure</command></userinput>
217  <computeroutput>** Structure FILE_INFO, 21 tags, length=64, data length=63:</computeroutput>
218  <computeroutput>   NAME            STRING    '/Users/sebastie/IDL/first_ps.ps'</computeroutput>
219  <computeroutput>   EXISTS          BYTE         1</computeroutput>
220  <computeroutput>   READ            BYTE         1</computeroutput>
221  <computeroutput>   WRITE           BYTE         1</computeroutput>
222  <computeroutput>   EXECUTE         BYTE         0</computeroutput>
223  <computeroutput>   REGULAR         BYTE         1</computeroutput>
224  <computeroutput>   DIRECTORY       BYTE         0</computeroutput>
225  <computeroutput>   BLOCK_SPECIAL   BYTE         0</computeroutput>
226  <computeroutput>   CHARACTER_SPECIAL</computeroutput>
227  <computeroutput>                   BYTE         0</computeroutput>
228  <computeroutput>   NAMED_PIPE      BYTE         0</computeroutput>
229  <computeroutput>   SETUID          BYTE         0</computeroutput>
230  <computeroutput>   SETGID          BYTE         0</computeroutput>
231  <computeroutput>   SOCKET          BYTE         0</computeroutput>
232  <computeroutput>   STICKY_BIT      BYTE         0</computeroutput>
233  <computeroutput>   SYMLINK         BYTE         0</computeroutput>
234  <computeroutput>   DANGLING_SYMLINK</computeroutput>
235  <computeroutput>                   BYTE         0</computeroutput>
236  <computeroutput>   MODE            LONG               420</computeroutput>
237  <computeroutput>   ATIME           LONG64                1122424373</computeroutput>
238  <computeroutput>   CTIME           LONG64                1122424373</computeroutput>
239  <computeroutput>   MTIME           LONG64                1122424373</computeroutput>
240  <computeroutput>   SIZE            LONG64                      4913</computeroutput>
241</screen>
242      </para>
243<para xml:id="splot_description">
244<command>splot</command> accepts the same keywords as <command>plot</command> (<computeroutput xml:id="plot_kwd">/ISOTROPIC, MAX_VALUE=value, MIN_VALUE=value, NSUM=value, /POLAR, THICK=value, /XLOG, /YLOG, /YNOZERO</computeroutput>), including the graphics keywords (<computeroutput xml:id="gr_kwd">BACKGROUND, CHARSIZE, CHARTHICK, CLIP, COLOR, DATA, DEVICE, FONT, LINESTYLE, NOCLIP, NODATA, NOERASE, NORMAL, POSITION, PSYM, SUBTITLE, SYMSIZE, T3D, THICK, TICKLEN, TITLE, [XYZ]CHARSIZE, [XYZ]GRIDSTYLE, [XYZ]MARGIN, [XYZ]MINOR, [XYZ]RANGE, [XYZ]STYLE, [XYZ]THICK, [XYZ]TICKFORMAT, [XYZ]TICKINTERVAL, [XYZ]TICKLAYOUT, [XYZ]TICKLEN, [XYZ]TICKNAME, [XYZ]TICKS, [XYZ]TICKUNITS, [XYZ]TICKV, [XYZ]TICK_GET, [XYZ]TITLE, ZVALUE</computeroutput>).
245</para>
246<simpara>
247It can therefore be customized <emphasis>as much as you want</emphasis>. See this short example:
248</simpara>
249<para>
250<screen>
251  <prompt>&promptidl;</prompt> <userinput><command>splot, y, y^2, linestyle = 2, thick = 2, title = 'y = x^2', /portrait</command></userinput> <link xl:href="./figpng/basic_splot2.png">&showfig;</link>
252</screen>
253<command>splot</command> can be used to setup the graphic environment (<varname>!p</varname>, <varname>!x</varname>, <varname>!y</varname>, <varname>!z</varname> variables) needed by procedures like <command>oplot</command>
254<screen>
255  <prompt>&promptidl;</prompt> <userinput><command>splot, y, yrange = [0, (n-1)^2], title = 'x and x^2'</command></userinput>
256  <prompt>&promptidl;</prompt> <userinput><command>oplot, y^2, color = 50, linestyle = 2</command></userinput> <link xl:href="./figpng/basic_splot4.png">&showfig;</link>
257</screen>
258Use the keyword small to produce multi plots figures.
259<screenco>
260  <areaspec>
261    <areaset xml:id="small">
262      <area xml:id="small.1" coords="1"/>
263      <area xml:id="small.2" coords="2"/>
264    </areaset>
265    <area xml:id="noerase" coords="2"/>
266  </areaspec>
267<screen>
268  <prompt>&promptidl;</prompt> <userinput><command>splot, y, y^2, title = 'y = x^2', psym = 2, small &numb1; = [1, 2, 1]</command></userinput>
269  <prompt>&promptidl;</prompt> <userinput><command>splot, findgen(360)/36., findgen(360)*2.*!dtor, /polar $</command></userinput>
270  <prompt>&promptidl;</prompt> <userinput><command>    , small &numb1; = [1, 2, 2], /noerase &numb2;</command></userinput> <link xl:href="./figpng/basic_splot3.png">&showfig;</link>
271</screen>
272  <calloutlist>
273    <callout arearefs="small">
274      <simpara>
275the <computeroutput>small</computeroutput> keyword is a 3 elements vector which defines how we divide the page and in which case we should make the plot: [number of columns, number of rows, case number]. The case numbering is starting at 1, from top to bottom and left to right.
276      </simpara>
277    </callout>
278    <callout arearefs="noerase">
279      <simpara>
280you must put <computeroutput>/noerase</computeroutput> otherwise the second plot will be done in a new window.
281      </simpara>
282    </callout>
283  </calloutlist>
284</screenco>
285      </para>
286      </sect3>
287
288      <sect3 xml:id="basic_contour">
289      <title> scontour </title>
290      <para>
291Following <command><link linkend="basic_splot">splot</link></command> example, we provide <command>scontour</command> as a <quote>super <command>contour</command></quote>.
292<screen>
293  <prompt>&promptidl;</prompt> <userinput><command>z = dist(n)</command></userinput>
294  <computeroutput>% Compiled module: DIST.</computeroutput>
295  <prompt>&promptidl;</prompt> <userinput><command>scontour, z</command></userinput> <link xl:href="./figpng/basic_scontour1.png">&showfig;</link>
296  <computeroutput>% Compiled module: SCONTOUR.</computeroutput>
297  <computeroutput>% Compiled module: CHKSTRU.</computeroutput>
298</screen>
299<command>scontour</command> accepts the same keywords as <command>contour</command> (<computeroutput>C_ANNOTATION=vector_of_strings, C_CHARSIZE=value, C_CHARTHICK=integer, C_COLORS=vector, C_LABELS=vector{each element 0 or 1}, C_LINESTYLE=vector, { /FILL | /CELL_FILL | C_ORIENTATION=degrees}, C_SPACING=value, C_THICK=vector, /CLOSED, /DOWNHILL, /FOLLOW, /IRREGULAR, /ISOTROPIC, LEVELS=vector, NLEVELS=integer{1 to 60}, MAX_VALUE=value, MIN_VALUE=value, /OVERPLOT, {/PATH_DATA_COORDS, PATH_FILENAME=string, PATH_INFO=variable, PATH_XY=variable}, TRIANGULATION=variable, /PATH_DOUBLE, /XLOG, /YLOG, ZAXIS={0 | 1 | 2 | 3 | 4}</computeroutput>), including the <link linkend="gr_kwd">graphics keywords</link> (except <computeroutput>LINESTYLE, PSYM, SYMSIZE</computeroutput>).
300      </para>
301      <simpara>It can therefore be customized <emphasis>as much as you want</emphasis>. See these short examples:</simpara>
302      <para>
303<screen>
304  <prompt>&promptidl;</prompt> <userinput><command>scontour, z, /fill, nlevels = 15, subtitle = 'nicer contour' $</command></userinput>
305  <prompt>&promptidl;</prompt> <userinput><command>    , xtitle = 'x index', charsize = 1.5</command></userinput> <link xl:href="./figpng/basic_scontour2.png">&showfig;</link>
306</screen>
307It can be used in combination with contour to make more complex plots:
308<screenco>
309  <areaspec>
310    <area xml:id="rebin" coords="1"/>
311  </areaspec>
312<screen>
313  <prompt>&promptidl;</prompt> <userinput><command>ind = findgen(2*n)/(2.*n)</command></userinput>
314  <prompt>&promptidl;</prompt> <userinput><command>scontour, z, levels = n*ind, c_orientation = 180*ind, c_spacing = 0.4*ind</command></userinput>
315  <prompt>&promptidl;</prompt> <userinput><command>contour, z, /overplot, c_label = rebin([1, 0], 2, n) &numb1;, levels = n*ind $</command></userinput>
316  <prompt>&promptidl;</prompt> <userinput><command>    , c_charthick = 2, c_charsize = 1.5, c_colors = 250*ind</command></userinput> <link xl:href="./figpng/basic_scontour3.png">&showfig;</link>
317</screen>
318<calloutlist>
319  <callout arearefs="rebin">
320    <para>
321      <command>rebin</command> is used to build an array containing an alternation of 1 and 0 in order to label one contour every two contours.
322<screen>
323  <prompt>&promptidl;</prompt> <userinput><command>print, rebin([1, 0], 2, 3)</command></userinput>
324  <computeroutput>       1       0</computeroutput>
325  <computeroutput>       1       0</computeroutput>
326  <computeroutput>       1       0</computeroutput>
327</screen>
328    </para>
329  </callout>
330</calloutlist>
331</screenco>
332<command>scontour</command> is compatible with the positioning method associated with the <computeroutput>small</computeroutput> keyword. See for example the test file <link xl:href="../../Tests/tst_basic.pro"><filename>tst_basic.pro</filename></link>:
333<screen>
334  <prompt>&promptidl;</prompt> <userinput><command>tst_basic</command></userinput> <link xl:href="./figpng/tst_basic.png">&showfig;</link>
335</screen>
336      </para>
337      </sect3>
338
339      <sect3 xml:id="tvplus">
340<title> Quick look and explore 2D arrays: <command>tvplus</command> </title>
341<para>
342  <command>tvplus</command> is a enhanced version of <command>tvscl</command> and allow you to have a quick look and perform basic exploration of 2D arrays.
343<screen>
344 <prompt>&promptidl;</prompt> <userinput><command>tvplus, dist(20)</command></userinput> <link xl:href="./figpng/tvplus.png">&showfig;</link>
345 <computeroutput>left button  : mouse position and associated array value</computeroutput>
346 <computeroutput>middle button: use it twice to define a zoom box</computeroutput>
347 <computeroutput>right button : quit</computeroutput>
348 <computeroutput>(x, y) = (  5,   5), value = 7.07107</computeroutput>
349 <computeroutput>(x, y) = ( 12,   8), value = 11.3137</computeroutput>
350 </screen>
351</para>
352<para>
353For more informations on <command>tvplus</command>, try:
354<screen>
355 <prompt>&promptidl;</prompt> <userinput><command>xhelp, 'tvplus'</command></userinput>
356</screen>
357</para>
358<para>
359To see the source code of <command>tvplus</command>, try:
360<screen>
361 <prompt>&promptidl;</prompt> <userinput><command>xfile, 'tvplus'</command></userinput>
362</screen>
363<note><title>New Feature</title>
364<para>
365If you use an IDL 6.2 or later revision, you can simply get the help of any command by typing ?<replaceable>command_name</replaceable>, for example:
366<screen>
367 <prompt>&promptidl;</prompt> <userinput><command>?tvplus</command></userinput>
368</screen>
369</para>
370</note>
371</para>
372</sect3>
373
374      <sect3 xml:id="pltv">
375<title> Formal quick look at 2D arrays: pltv </title>
376<para>
377  <command>pltv</command> is a mix between <link linkend="tvplus">tvplus</link> and <link linkend="plt">plt</link> and allow you to have formal quick look of 2D arrays.
378  <screen>
379  <prompt>&promptidl;</prompt> <userinput><command>pltv, dist(20)</command></userinput> <link xl:href="./figpng/pltv.png">&showfig;</link>
380  </screen>
381</para>
382      </sect3>
383    </sect2>
384  </sect1>
385
386  <sect1 xml:id="gridded_data">
387    <title> Explore gridded data (model outputs and observations) </title>
388    <para>
389      This section briefly describes the main functionalities offered by SAXO to explore gridded data on regular or irregular grid.
390    </para>
391
392    <sect2 xml:id="load_grid">
393      <title> Load the data grid </title>
394      <para>
395As we focus in this section on the gridded data, we must first load the grid informations before reading and plotting the data. Loading the grid independently of the data allow you to reload the grid only when it is strictly necessary and not every time you access the data. In <filename class="directory">${HOME}/SAXO_DIR/Tests/</filename>, we provide several examples to load a grid.
396      </para>
397      <sect3 xml:id="load_fromdata">
398<title> Easiest solution: load data grid (regular or not) directly from the data file </title>
399<para>
400  Example of Levitus temperature on a regular 1x1 grid.
401  <screen>
402  <prompt>&promptidl;</prompt> <userinput><command>@tst_initlev</command></userinput>
403  <computeroutput>% Compiled module: INITNCDF.</computeroutput>
404  <computeroutput>% Compiled module: ISAFILE.</computeroutput>
405  <computeroutput>% Compiled module: UNIQ.</computeroutput>
406  <computeroutput>% Loaded DLM: NCDF.</computeroutput>
407  <computeroutput>% Compiled module: COMPUTEGRID.</computeroutput>
408  <computeroutput>% Compiled module: DOMDEF.</computeroutput>
409  <computeroutput>% Compiled module: INTER.</computeroutput>
410  <computeroutput>% Compiled module: TRIANGULE.</computeroutput>
411  <computeroutput>% Compiled module: TRIANGULE_C.</computeroutput>
412  <computeroutput>% Compiled module: UNDEFINE.</computeroutput>
413  <computeroutput>% Compiled module: TESTVAR.</computeroutput>
414  <computeroutput>% Compiled module: DIFFERENT.</computeroutput>
415  <computeroutput>% Compiled module: DEFINETRI.</computeroutput>
416  </screen>
417  This <link xl:href="../../Tests/tst_initlev.pro"><command>@tst_initlev</command></link> command allows us to define:
418  <itemizedlist>
419    <listitem><simpara>domain dimensions, stored in <varname>jpi, jpj and jpk</varname></simpara></listitem>
420    <listitem><simpara>points abscissa, stored in 2D array <varname></varname>glamt</simpara></listitem>
421    <listitem><simpara>points ordinates, stored in 2D array <varname></varname>gphit</simpara></listitem>
422    <listitem><simpara>points depths, stored in 1D array <varname></varname>gdept</simpara></listitem>
423    <listitem><simpara>cells corners abscissa, stored in 2D array <varname></varname>glamf</simpara></listitem>
424    <listitem><simpara>cells corners ordinates, stored in 2D array <varname></varname>gphif</simpara></listitem>
425    <listitem><simpara>cells upper boundary depth, stored in 1D array <varname></varname>gdepw</simpara></listitem>
426    <listitem><simpara>land-sea mask, stored in <varname>tmask</varname></simpara></listitem>
427    <listitem><simpara>the cells size in the longitudinal direction, stored in 2D array <varname></varname>e1t</simpara></listitem>
428    <listitem><simpara>the cells size in the latitudinal direction, stored in 2D array <varname></varname>e2t</simpara></listitem>
429    <listitem><simpara>the cells size in the vertical direction, stored in 1D array <varname></varname>e3t</simpara></listitem>
430    <listitem><simpara>the triangulation used to fill the land points, stored in <varname></varname>triangles_list</simpara></listitem>
431  </itemizedlist>
432
433  <screen>
434  <prompt>&promptidl;</prompt> <userinput><command>help, jpi,jpj,jpk</command></userinput>
435  <computeroutput>JPI (LOCAL_COORD)   LONG      =          360</computeroutput>
436  <computeroutput>JPJ (LOCAL_COORD)   LONG      =          180</computeroutput>
437  <computeroutput>JPK (LOCAL_COORD)   LONG      =           33</computeroutput>
438  <prompt>&promptidl;</prompt> <userinput><command>help, glamt, gphit,glamf, gphif</command></userinput>
439  <computeroutput>GLAMT (LONGITUDES)  FLOAT     = Array[360, 180]</computeroutput>
440  <computeroutput>GPHIT (LATITUDES)   FLOAT     = Array[360, 180]</computeroutput>
441  <computeroutput>GLAMF (LONGITUDES)  FLOAT     = Array[360, 180]</computeroutput>
442  <computeroutput>GPHIF (LATITUDES)   FLOAT     = Array[360, 180]</computeroutput>
443  <prompt>&promptidl;</prompt> <userinput><command>help, gdept, gdepw</command></userinput>
444  <computeroutput>GDEPT (VERTICAL)    FLOAT     = Array[33]</computeroutput>
445  <computeroutput>GDEPW (VERTICAL)    FLOAT     = Array[33]</computeroutput>
446  <prompt>&promptidl;</prompt> <userinput><command>help, e1t, e2t, e3t</command></userinput>
447  <computeroutput>E1T (SCALE_FACTORS) FLOAT     = Array[360, 180]</computeroutput>
448  <computeroutput>E2T (SCALE_FACTORS) FLOAT     = Array[360, 180]</computeroutput>
449  <computeroutput>E3T (VERTICAL)      FLOAT     = Array[33]</computeroutput>
450  <prompt>&promptidl;</prompt> <userinput><command>help, tmask</command></userinput>
451  <computeroutput>TMASK (MASKS)       BYTE      = Array[360, 180, 33]</computeroutput>
452  <prompt>&promptidl;</prompt> <userinput><command>help, triangles_list</command></userinput>
453  <computeroutput>TRIANGLES_LIST (LIEES_A_TRIANGULE) LONG      = Array[3, 128880]</computeroutput>
454  <prompt>&promptidl;</prompt> <userinput><command>tvplus, glamt*tmask[*,*,0]</command></userinput>
455  <prompt>&promptidl;</prompt> <userinput><command>tvplus, gphit*tmask[*,*,0]</command></userinput>
456  </screen>
457  We provide other initialization methods/examples
458  <itemizedlist>
459    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_short.pro">@tst_initorca2_short</link> : ORCA2 example</simpara></listitem>
460    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_short.pro">@tst_initorca05_short</link> : ORCA05 example</simpara></listitem>
461    <listitem><simpara><link xl:href="../../Tests/tst_initlev_stride.pro">@tst_initlev_stride</link> : same as @tst_initlev but we skip on point over 2 in x and y direction</simpara></listitem>
462    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_short_stride.pro">@tst_initorca2_short_stride</link> : ORCA2 with stride</simpara></listitem>
463    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_short_stride.pro">@tst_initorca05_short_stride</link> : ORCA05 with stride</simpara></listitem>
464    <listitem><simpara><link xl:href="../../Tests/tst_initlev_index.pro">@tst_initlev_index</link> : in that case we load the grid using points index as axis instead of the longitude/latitude position</simpara></listitem>
465    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_index.pro">@tst_initorca2_index</link> : load ORCA2 as it see by the model</simpara></listitem>
466    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_index.pro">@tst_initorca05_index</link> : load ORCA05 as it see by the model</simpara></listitem>
467    <listitem><simpara><link xl:href="../../Tests/tst_initlev_index_stride.pro">@tst_initlev_index_stride</link> : @tst_initlev_index with stride</simpara></listitem>
468    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_index_stride.pro">@tst_initorca2_index_stride</link> : ORCA2 in index with stride</simpara></listitem>
469    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_index_stride.pro">@tst_initorca05_index_stride</link> : ORCA05 in index with stride</simpara></listitem>
470  </itemizedlist>
471</para>
472      </sect3>
473      <sect3 xml:id="load_meshmask">
474<title> Load the grid from OPA <filename>meshmask</filename> file </title>
475<para>
476  When the grid is really irregular (its abscissa and ordinate cannot be descried by a vector), loading the grid directly from the data forces us to make an approximation when computing the grid corners position and the cells size. In that case, it can be preferable to load the grid from the meshmask file created by OPA. As OPA use a Arakawa-C discretization, loading the grid from the meshmask will also define all parameters related to the U, V and F grids (glam[uv],gphi[uv], e[12][uvf]). Note that, when using a simple <link linkend="load_fromdata">grid definition from the data itself</link> (with <filename>initncdf</filename> or <filename>computegrid</filename>), adding the keyword /FULLCGRID leads also to the definition of all U, V and F grids parameters. There is the examples to load ORCA grids from OPA meshmask.
477  <itemizedlist>
478    <listitem><simpara><link xl:href="../../Tests/tst_initorca2.pro">@tst_initorca2</link> : ORCA2</simpara></listitem>
479    <listitem><simpara><link xl:href="../../Tests/tst_initorca05.pro">@tst_initorca05</link> : ORCA05</simpara></listitem>
480    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_stride.pro">@tst_initorca2_stride</link> : ORCA2 with stride</simpara></listitem>
481    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_stride.pro">@tst_initorca05_stride</link> : ORCA05 with stride</simpara></listitem>
482    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_index.pro">@tst_initorca2_index</link> : load ORCA2 as it see by the model</simpara></listitem>
483    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_index.pro">@tst_initorca05_index</link> : load ORCA05 as it see by the model</simpara></listitem>
484    <listitem><simpara><link xl:href="../../Tests/tst_initorca2_index_stride.pro">@tst_initorca2_index_stride</link> : ORCA2 in index with stride</simpara></listitem>
485    <listitem><simpara><link xl:href="../../Tests/tst_initorca05_index_stride.pro">@tst_initorca05_index_stride</link> : ORCA05 in index with stride</simpara></listitem>
486  </itemizedlist>
487</para>
488        </sect3>
489    </sect2>
490
491    <sect2 xml:id="plt">
492      <title> Horizontal plots and maps </title>
493<para>
494  A quick presentation of horizontal plots and maps is shown in <link xl:href="../../Tests/tst_plt.pro">tst_plt</link>. After loading any of the grid (for example with one of the <link linkend="load_grid">above examples</link>). Just try:
495  <screen>
496  <prompt>&promptidl;</prompt> <userinput><command>tst_plt</command></userinput>
497  </screen>
498</para>
499<simpara><emphasis>Beware, the command is <command>tst_plt</command> and not <command>@tst_plt</command> as <filename>tst_plt.pro</filename> is a procedure and not an include.</emphasis></simpara>
500<para>
501  See the results with
502  <itemizedlist>
503  <listitem><simpara><command>@tst_initlev</command>&figsplt_lev;</simpara></listitem>
504  <listitem><simpara><command>@tst_initorca2</command>&figsplt_orca2;</simpara></listitem>
505  <listitem><simpara><command>@tst_initorca05</command>&figsplt_orca05;</simpara></listitem>
506  <listitem><simpara><command>@tst_initlev_stride</command>&figsplt_lev_stride;</simpara></listitem>
507  <listitem><simpara><command>@tst_initorca2_stride</command>&figsplt_orca2_stride;</simpara></listitem>
508  <listitem><simpara><command>@tst_initorca05_stride</command>&figsplt_orca05_stride;</simpara></listitem>
509  </itemizedlist>
510</para>
511    </sect2>
512
513<sect2 xml:id="pltz">
514<title> Vertical sections </title>
515<para>
516  A quick presentation of vertical sections is shown in <link xl:href="../../Tests/tst_pltz.pro">tst_pltz</link>. After loading any of the grid (for example with one of the <link linkend="load_grid">above examples</link>). Just try:
517  <screen>
518  <prompt>&promptidl;</prompt> <userinput><command>tst_pltz</command></userinput>
519  </screen>
520</para>
521  <simpara><emphasis>Beware, the command is <command>tst_pltz</command> and not <command>@tst_pltz</command> as <filename>tst_pltz.pro</filename> is a procedure and not an include.</emphasis></simpara>
522<para>
523  See the results with
524  <itemizedlist>
525  <listitem><simpara><command>@tst_initlev</command>&figspltz_lev;</simpara></listitem>
526  <listitem><simpara><command>@tst_initorca2</command>&figspltz_orca2;</simpara></listitem>
527  <listitem><simpara><command>@tst_initorca05</command>&figspltz_orca05;</simpara></listitem>
528  <listitem><simpara><command>@tst_initlev_stride</command>&figspltz_lev_stride;</simpara></listitem>
529  <listitem><simpara><command>@tst_initorca2_stride</command>&figspltz_orca2_stride;</simpara></listitem>
530  <listitem><simpara><command>@tst_initorca05_stride</command>&figspltz_orca05_stride;</simpara></listitem>
531  </itemizedlist>
532</para>
533    </sect2>
534
535    <sect2 xml:id="pltt">
536      <title> Hovmoellers and time series </title>
537<para>
538  A quick presentation of hovmoellers and time series is shown in <link xl:href="../../Tests/tst_pltt.pro">tst_pltt</link>. After loading any of the grid (for example with one of the <link linkend="load_grid">above examples</link>). Just try:
539  <screen>
540  <prompt>&promptidl;</prompt> <userinput><command>tst_pltt</command></userinput>
541  </screen>
542</para>
543  <simpara><emphasis>Beware, the command is <command>tst_pltt</command> and not <command>@tst_pltt</command> as <filename>tst_pltt.pro</filename> is a procedure and not an include.</emphasis></simpara>
544<para>
545  See the results with
546  <itemizedlist>
547  <listitem><simpara><command>@tst_initlev</command>&figspltt_lev;</simpara></listitem>
548  <listitem><simpara><command>@tst_initorca2</command>&figspltt_orca2;</simpara></listitem>
549  <listitem><simpara><command>@tst_initorca05</command>&figspltt_orca05;</simpara></listitem>
550  <listitem><simpara><command>@tst_initlev_stride</command>&figspltt_lev_stride;</simpara></listitem>
551  <listitem><simpara><command>@tst_initorca2_stride</command>&figspltt_orca2_stride;</simpara></listitem>
552  <listitem><simpara><command>@tst_initorca05_stride</command>&figspltt_orca05_stride;</simpara></listitem>
553  </itemizedlist>
554</para>
555    </sect2>
556
557<sect2 xml:id="plt1d">
558<title> 1D plots </title>
559<para>
560To be continued &hellip;
561</para>
562</sect2>
563
564
565</sect1>
566
567</article>
Note: See TracBrowser for help on using the repository browser.