[Dart-dev] [3872] DART/trunk: Adding documentation for the obs_seq_to_netcdf program -

nancy at ucar.edu nancy at ucar.edu
Wed May 13 21:49:53 MDT 2009


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090513/6c1c03b2/attachment-0001.html 
-------------- next part --------------
Added: DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	                        (rev 0)
+++ DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	2009-05-14 03:49:53 UTC (rev 3872)
@@ -0,0 +1,669 @@
+<HTML>
+<HEAD>
+<TITLE>program obs_seq_to_netcdf</TITLE>
+<link rel="stylesheet" type="text/css" href="../../doc/html/doc.css"></link> 
+</HEAD>
+<BODY>
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!                                                                       !!
+!!                   GNU General Public License                          !!
+!!                                                                       !!
+!! This file is part of the Data Assimilation Research Testbed (DART).   !!
+!!                                                                       !!
+!! DART is free software; you can redistribute it and/or modify          !!
+!! it and are expected to follow the terms of the GNU General Public     !!
+!! License as published by the Free Software Foundation.                 !!
+!!                                                                       !!
+!! DART is distributed in the hope that it will be useful,               !!
+!! but WITHOUT ANY WARRANTY; without even the implied warranty of        !!
+!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         !!
+!! GNU General Public License for more details.                          !!
+!!                                                                       !!
+!! You should have received a copy of the GNU General Public License     !!
+!! along with DART; if not, write to:                                    !!
+!!          Free Software Foundation, Inc.                               !!
+!!          59 Temple Place, Suite 330                                   !!
+!!          Boston, MA  02111-1307  USA                                  !!
+!! or see:                                                               !!
+!!          http://www.gnu.org/licenses/gpl.txt                          !!
+!!                                                                       !!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+<DIV ALIGN=CENTER>
+<A HREF="#Modules">MODULES</A> / 
+<A HREF="#Namelist1">NAMELIST</A> / 
+<A HREF="#FilesUsed">FILES</A> /
+<A HREF="#Usage">USAGE </A> / 
+<A HREF="#References">REFERENCES</A> /
+<A HREF="#Errors">ERRORS</A> /
+<A HREF="#KnownBugs">BUGS</A> /
+<A HREF="#FuturePlans">PLANS</A>
+</DIV>
+
+<!--==================================================================-->
+
+<H1>PROGRAM obs_seq_to_netcdf</H1>
+<A NAME="HEADER"></A>
+<TABLE summary="">
+<TR><TD>Contact:       </TD><TD> Tim Hoar </TD></TR>
+<TR><TD>Revision:      </TD><TD> $Revision$ </TD></TR>
+<TR><TD>Source:        </TD><TD> $URL$ </TD></TR>
+<TR><TD>Change Date:   </TD><TD> $Date$ </TD></TR>
+<TR><TD>Change history:</TD><TD> try "svn log" or "svn diff" </TD></TR>
+</TABLE>
+
+<!--==================================================================-->
+
+<A NAME="OVERVIEW"></A>
+<HR>
+<H2>OVERVIEW</H2>
+
+<P>
+   <em class=program>obs_seq_to_netcdf</em> 
+   is a routine to extract the observation components from
+   observation sequence files and write out netCDF files 
+   that can be easily digested by other applications. 
+   This routine will allow you to plot the spatial distribution
+   of the observations and be able to discern which observations were
+   assimilated or rejected, for example. Here are some graphics from 
+   <em class=file>DART/observations/utilities/threed_sphere/</em><em 
+    class=program>plot_obs_netcdf.m</em>.
+   <br />
+   <br />
+   <a  href="../../doc/images/plot_obs_netcdf_fig1.png">
+   <img src="../../doc/images/plot_obs_netcdf_fig1.png" 
+        alt="DART observation 3D scatterplot" height=300 /></a>
+   <a  href="../../doc/images/plot_obs_netcdf_fig2.png">
+   <img src="../../doc/images/plot_obs_netcdf_fig2.png" 
+        alt="DART 'bad' QC 3D scatterplot" height=300 /></a>
+   <br />
+   <br />
+   The intent is that user input is queried and a series of output
+   files -&nbsp;one&nbsp;per&nbsp;assimilation&nbsp;cycle&nbsp;- 
+   will contain the observations for that cycle. It is hoped this 
+   will be useful for experiment design or, perhaps, debugging. 
+   This routine is also the first to use the new 
+   <em class=program>schedule_mod</em> module which will ultimately 
+   control the temporal aspects of the assimilations 
+   (i.e. the assimilation schedule). 
+   <br />
+   <br />
+   There is also a facility for exploring the spatial distributions 
+   of quantities like bias between the ensemble mean and the 
+   observations: 
+   <em class=file>DART/observations/utilities/threed_sphere/</em><em 
+       class=program>plot_obs_netcdf_diffs.m</em>.
+</P>
+
+<P>
+   Required namelist interfaces
+   <A HREF="#Namelist1"><em class=code>&#38;obs_seq_to_netcdf</em></A> and
+   <A HREF="#Namelist2"><em class=code>&#38;schedule_nml</em></A>
+   are read from file <em class=file>input.nml</em>.
+</P>
+
+<H3 class="indent1">What's on the horizon ...</H3>
+<P>
+   <em class=program>obs_seq_to_netcdf</em> 
+   is a step toward encoding our observations in netCDF files.
+</P>
+
+<!--==================================================================-->
+
+<A NAME="Modules"></A>
+<BR><HR><BR>
+<H2>OTHER MODULES USED</H2>
+<PRE>
+location_mod
+netcdf
+obs_def_mod
+obs_kind_mod
+obs_sequence_mod
+schedule_mod
+time_manager_mod
+typeSizes
+types_mod
+utilities_mod
+</PRE>
+<P>
+Naturally, the program must be compiled with support for the observation
+types contained in the observation sequence files, so
+<em class="program">preprocess</em> must be run to build appropriate
+<em class="file">obs_def_mod</em> and 
+<em class="file">obs_kind_mod</em> modules - which may need specific
+obs_def_?????.f90 files.
+</P>
+
+
+<!--==================================================================-->
+<!--=================== DESCRIPTION OF A NAMELIST  ===================-->
+
+<A NAME="Namelist1"></A>
+<BR><HR><BR>
+<H2>NAMELIST</H2>
+<P>We adhere to the F90 standard of starting a namelist with an 
+   ampersand '&#38;' and terminating with a slash '/'.
+   <div class=namelist><pre>
+   <em class=call>namelist / obs_seq_to_netcdf_nml / </em> &#38;
+      obs_sequence_name, lonlim1, lonlim2, latlim1, latlim2, verbose
+   </pre></div>
+</P>
+
+<H3 class=indent1>Discussion</H3>
+
+<P>This namelist is read in a file called <em class=file>input.nml</em>. <BR>
+   The allowable ranges for the region boundaries are: latitude [-90.,90], 
+   longitude [0.,360.] ... but it is possible to specify a region that spans
+   the dateline by specifying the <em class="code">lonlim2</em> to be less 
+   than <em class="code">lonlim1</em>.
+</P>
+
+
+<TABLE border=0 cellpadding=3 width=100%>
+<TR><TH align=left>Contents    </TH>
+    <TH align=left>Type        </TH>
+    <TH align=left>Description </TH></TR>
+
+<TR><!--contents--><TD valign=top> obs_sequence_name  </TD>
+    <!--  type  --><TD valign=top> character(len=129) </TD>
+    <!--descript--><TD>Name of the observation sequence files. <BR>
+            This may be a relative or absolute filename. If the filename
+            contains a '/', the filename is considered to be comprised of
+	    everything to the right, and a directory structure to the left.
+	    The directory structure is then queried to see if it can be
+	    incremented to handle a sequence of observation files.
+	    The default behavior of <em class="program">obs_seq_to_netcdf</em> 
+	    is to look for additional files to include until the files 
+	    are exhausted or an <em class=file>obs_seq.final</em> file 
+	    is found that contains observations beyond the timeframe of 
+	    interest.<BR>e.g. 'obsdir_001/obs_seq.final' will cause
+	    <em class="program">obs_seq_to_netcdf</em> to look for
+	    'obsdir_002/obs_seq.final', and so on.<BR>
+	    Default 'obs_seq.final'</TD></TR>  
+
+<TR><!--contents--><TD valign=top>   lonlim1   </TD>
+    <!--  type  --><TD valign=top>   real      </TD>
+    <!--descript--><TD>Westernmost longitude of the region.<BR>
+	    Default: none </TD></TR>  
+
+<TR><!--contents--><TD valign=top>   lonlim2   </TD>
+    <!--  type  --><TD valign=top>   real      </TD>
+    <!--descript--><TD>Easternmost longitude of the region.
+            <em class="new">If this value is <b>less than</b>
+	    the westernmost value, it defines a region that spans the 
+	    prime meridian. No problem.</em> It is perfectly acceptable 
+	    to specify lonlim1 = 330 , lonlim2 = 50 to identify a region
+	    like "Africa".<BR>
+	    Default: none</TD></TR>  
+
+<TR><!--contents--><TD valign=top>   latlim1    </TD>
+    <!--  type  --><TD valign=top>   real       </TD>
+    <!--descript--><TD>Southernmost latitude of the region.<BR>
+	    Default: none</TD></TR>  
+
+<TR><!--contents--><TD valign=top>   latlim2    </TD>
+    <!--  type  --><TD valign=top>   real       </TD>
+    <!--descript--><TD>Northernmost latitude of the region.<BR>
+	    Default: none</TD></TR>  
+
+<TR><!--contents--><TD valign=top>   verbose   </TD>
+    <!--  type  --><TD valign=top>   logical   </TD>
+    <!--descript--><TD>Print extra info about the obs_seq_to_netcdf run.<BR>
+            Default: .false. </TD></TR>  
+
+</TABLE>
+
+<!--=================== DESCRIPTION OF A NAMELIST  ===================-->
+
+<A NAME="Namelist2"></A>
+<BR><HR><BR>
+<H2>schedule NAMELIST</H2>
+<P><div class=namelist><pre>
+   <em class=call>namelist / schedule_nml / </em> &#38;
+      calendar, first_bin_start, first_bin_end, last_bin_end, &#38;
+      bin_interval_days, bin_interval_seconds, max_num_bins, print_table
+   </pre></div>
+</P>
+
+<H3 class=indent1>Discussion</H3>
+
+<P>This namelist is read in a file called <em class=file>input.nml</em>.
+   <br />
+   <br />
+   If the <em class="code">print_table</em> variable is 'true', a summary
+   of the assimilation schedule will be written to the screen. Hopefully,
+   a picture will be worth a thousand words ...<br />
+   <center>
+   <img src="../../doc/images/schedule.png" alt="DART assimilation schedule" height=200></img>
+   </center>
+
+</P>
+
+<TABLE border=0 cellpadding=3 width=100%>
+<TR><TH align=left>Contents    </TH>
+    <TH align=left>Type        </TH>
+    <TH align=left>Description </TH></TR>
+
+<TR><!--contents--><TD valign=top> calendar  </TD>
+    <!--  type  --><TD valign=top> character(len=32) </TD>
+    <!--descript--><TD>Type of calendar to use to interpret dates.<BR>
+                       May be any type supported by the 
+                       <em class="program">time_manager_mod</em>.
+                       The string is case-INsensitive.
+	               Default 'Gregorian'</TD></TR>  
+
+<TR><!--contents--><TD valign=top> first_bin_start </TD>
+    <!--  type  --><TD valign=top> integer, dimension(6) </TD>
+    <!--descript--><TD>the first time of the first assimilation period.
+            The six integers are: year, month, day, hour, hour, minute, 
+            second -- in that order.<br>
+            Default: 2008, 9, 7, 0, 0, 0</TD></TR>
+
+<TR><!--contents--><TD valign=top> first_bin_end  </TD>
+    <!--  type  --><TD valign=top> integer, dimension(6) </TD>
+    <!--descript--><TD>the end of the first assimilation period.
+            The six integers are: year, month, day, hour, hour, minute,
+            second -- in that order.<br>
+            Default: 2008, 9, 7, 2, 0, 0</TD></TR>
+
+<TR><!--contents--><TD valign=top> last_bin_end  </TD>
+    <!--  type  --><TD valign=top> integer, dimension(6) </TD>
+    <!--descript--><TD>the approximate end of the last assimilation period.
+            The six integers are: year, month, day, hour, hour, minute,
+            second -- in that order. This does not need to be exact,
+            the values from <em class=code>last_bin_end</em>, 
+            <em class=code>bin_interval_days</em>, and
+            <em class=code>bin_interval_seconds</em> are used to derive the
+            assimilation schedule. The assimilation periods are repeated and  
+            will stop on or before the time defined by
+            <em class=code>last_bin_end</em>. 
+            See also <em class=code>max_num_bins</em>.<BR>
+            Default: 2008, 9, 11, 0, 0, 0</TD></TR>
+
+<TR><!--contents--><TD valign=top> bin_interval_days, bin_interval_seconds </TD>
+    <!--  type  --><TD valign=top> integer </TD>
+    <!--descript--><TD>Collectively, <em class=code>bin_interval_days</em> 
+            and <em class=code>bin_interval_seconds</em> define the time 
+            between the start of successive assimilation windows. It is
+            not possible to define a bin_interval such that there are 
+	    overlapping bins (i.e. you can't use the same observations 
+	    more than once). The default is 6 hours. <BR>
+            Default: <em class=code>bin_interval_days</em> == 0, and <br />
+            <em class=code>bin_interval_seconds</em> == 21600 <br /></TD></TR>
+
+<TR><!--contents--><TD valign=top> max_num_bins </TD>
+    <!--  type  --><TD valign=top> integer </TD>
+    <!--descript--><TD>An alternate way to specify the maximum number of
+            assimilation periods.  The assimilation bin is repeated by 
+	    the bin_interval until one of two things happens: either 
+	    the last time of interest is encountered (defined by 
+	    <em class=code>last_bin_end</em>) or the maximum number 
+	    of assimilation periods has been reached (defined by 
+	    <em class=code>max_num_bins</em>).<BR>
+            Default: 1000</TD></TR>
+
+<TR><!--contents--><TD valign=top> print_table </TD>
+    <!--  type  --><TD valign=top> logical </TD>
+    <!--descript--><TD>Prints the assimilation schedule.<BR>
+            Default: .false. </TD></TR>  
+
+</TABLE>
+
+<!--==================================================================-->
+<!-- Describe the Files Used by this module.                          -->
+<!--==================================================================-->
+
+<A NAME="FilesUsed"></A>
+<BR><HR><BR>
+<H2>FILES</H2>
+<H3 class="indent1">Run-Time</H3>
+<UL><LI><em class="file">input.nml</em> is used for 
+        <em class="code">obs_seq_to_netcdf_nml</em> and 
+        <em class="code">schedule_nml</em>.
+	</LI>
+    <LI><em class="file">obs_sequence_xxx.nc</em> is a 
+        netCDF output file for assimilation period 'xxx'. Each
+        observation copy is preserved - as are any/all QC values/copies.
+	</LI>
+    <LI><em class="file">dart_log.out</em> list directed output 
+        from the obs_seq_to_netcdf.</LI>
+</UL>
+<H3 class="indent1">Related Matlab functions</H3>
+<UL><LI><em class="file">observations/utilities/plot_obs_netcdf.m</em> may
+        be used to explore the spatial distribution of observations and 
+	their values.  More on that in the 'Usage' section below.
+	</LI>
+    <LI><em class="file">observations/utilities/plot_obs_netcdf_diffs.m</em> will
+        take the difference between any two observation copies and plot the
+        spatial distribution and value of the difference. Useful for exploring
+        the bias between 'observation' and 'prior ensemble mean', for example.
+        Again, more on that in the 'Usage' section below.
+	</LI>
+</UL>
+
+<H3 class="indent1">Discussion of obs_sequence_xxx.nc structure</H3>
+<P>
+<a href="http://www.image.ucar.edu/DAReS/Documentation/index.jsp#sequences">
+This might be a good time to review the basic observation sequence 
+file structure.</a>
+The only thing missing in the netcdf files is the 'shared' metadata 
+for observations (e.g. GPS occultations).  The observation locations, 
+values, qc flags, error variances, etc., are all preserved in the 
+netCDF files. The intent is to provide everything you need to make 
+sensible plots of the observations. Some important aspects are highlighted. 
+</P>
+<pre>
+[shad] % <em class="input">ncdump -v QCMetaData,CopyMetaData,ObsTypesMetaData obs_sequence_001.nc</em>
+netcdf obs_sequence_001 {
+dimensions:
+        linelen = 129 ;
+        nlines = 104 ;
+        stringlength = 32 ;
+        copy = 7 ;
+        qc_copy = 2 ;
+        location = 3 ;
+        ObsTypes = 58 ;
+        <em class="changed">ObsIndex = UNLIMITED</em> ; // (4752 currently)
+variables:
+        int copy(copy) ;
+                copy:explanation = "see CopyMetaData" ;
+        int qc_copy(qc_copy) ;
+                qc_copy:explanation = "see QCMetaData" ;
+        int ObsTypes(ObsTypes) ;
+                ObsTypes:explanation = "see ObsTypesMetaData" ;
+        char <em class="changed">ObsTypesMetaData(ObsTypes, stringlength)</em> ;
+                ObsTypesMetaData:long_name = "DART observation types" ;
+                ObsTypesMetaData:comment = "table relating integer to observation type string" ;
+        char <em class="changed">QCMetaData(qc_copy, stringlength)</em> ;
+                QCMetaData:long_name = "quantity names" ;
+        char <em class="changed">CopyMetaData(copy, stringlength)</em> ;
+                CopyMetaData:long_name = "quantity names" ;
+        char namelist(nlines, linelen) ;
+                namelist:long_name = "input.nml contents" ;
+        int <em class="changed">ObsIndex(ObsIndex)</em> ;
+                ObsIndex:long_name = "observation index" ;
+                ObsIndex:units = "dimensionless" ;
+        double time(ObsIndex) ;
+                time:long_name = "time of observation" ;
+                time:units = "days since 1601-1-1" ;
+                time:calendar = "GREGORIAN" ;
+                time:valid_range = 1.15740740740741e-05, 0.25 ;
+        int <em class="changed">obs_type(ObsIndex)</em> ;
+                obs_type:long_name = "DART observation type" ;
+                obs_type:explanation = "see ObsTypesMetaData" ;
+        int which_vert(ObsIndex) ;
+                which_vert:long_name = "vertical coordinate system code" ;
+        double location(ObsIndex, location) ;
+                location:long_name = "location of observation" ;
+                location:units = "deg_Lon deg_Lat vertical" ;
+        double observations(ObsIndex, <em class="changed">copy</em>) ;
+                observations:long_name = "org observation, estimates, etc." ;
+                observations:explanation = "see CopyMetaData" ;
+                observations:missing_value = 9.96920996838687e+36 ;
+        int qc(ObsIndex, <em class="changed">qc_copy</em>) ;
+                qc:long_name = "QC values" ;
+                qc:explanation = "see QCMetaData" ;
+// global attributes:
+                :creation_date = "YYYY MM DD HH MM SS = 2009 05 01 16 51 18" ;
+                :obs_seq_to_netcdf_source = "$URL$" ;
+                :obs_seq_to_netcdf_revision = "$Revision$" ;
+                :obs_seq_to_netcdf_revdate = "$Date$" ;
+                :horizontal_wind = "vector wind derived from U,V components" ;
+                :obs_seq_file_001 = "bgrid_solo/work/01_01/obs_seq.final" ;
+data:
+
+ ObsTypesMetaData =
+  "RADIOSONDE_U_WIND_COMPONENT     ",
+  "RADIOSONDE_V_WIND_COMPONENT     ",
+  "RADIOSONDE_SURFACE_PRESSURE     ",
+  "RADIOSONDE_TEMPERATURE          ",
+  "RADIOSONDE_SPECIFIC_HUMIDITY    ",
+  ...
+  <em>yeah, yeah, yeah ... we're very impressed ...</em>
+  ...
+  "VORTEX_PMIN                     ",
+  "VORTEX_WMAX                     " ;
+
+ QCMetaData =
+  "Quality Control                 ",
+  "DART quality control            " ;
+
+ CopyMetaData =
+  "observations                    ",
+  "truth                           ",
+  "prior ensemble mean             ",
+  "posterior ensemble mean         ",
+  "prior ensemble spread           ",
+  "posterior ensemble spread       ",
+  "<em class="changed">observation error variance</em>      " ;
+}
+</pre>
+
+<P class="indent">So, first off, the UNLIMITED dimension is not 'time'.
+It's simply the number of observations - a coordinate variable 
+called <em class="unix">ObsIndex</em>. The <em class="unix">observations</em> 
+variable is a 2D array - each column is a 'copy' of the observation. The
+interpretation of the column is found in the <em class="unix">CopyMetaData</em>
+variable. Same thing goes for the <em class="unix">qc</em> variable - 
+each column is defined by the <em class="unix">QCMetaData</em> variable.
+<br />
+<br />
+The <em class="unix">Obs_Type</em> variable is crucial. Each observation
+has an integer code to define the specific ... DART observation type. 
+In our example - lets assume that observation number 10 (i.e. 
+ObsIndex&nbsp;==&nbsp;10) has an <em class="unix">obs_type</em> of 3 
+[i.e.&nbsp;obs_type(10)&nbsp;=&nbsp;3]. Since 
+<em class="unix">ObsTypesMetaData(3) == "RADIOSONDE_SURFACE_PRESSURE"</em>, 
+we know that any/all quantities where ObsIndex == 10 pertain to a
+radiosonde surface pressure observation.
+</P>
+
+
+<!--==================================================================-->
+<!-- Discuss  typical usage of obs_seq_to_netcdf.                     -->
+<!--==================================================================-->
+
+<A NAME="Usage"></A>
+<BR><HR><BR>
+<H2>USAGE</H2>
+
+<H3 class="indent1">obs_seq_to_netcdf</H3>
+<P>
+<em class="program">obs_seq_to_netcdf</em> is built and run in 
+...<em class="file">/DART/models/</em>your_model<em class="file">/work</em>, 
+in the same way as the other DART components. After the program has been run,
+<em class="file">/DART/observations/utilities/threed_sphere/</em><em
+class="program">plot_obs_netcdf.m</em> can be run to plot the observations.
+The only thing that is tricky is the fact that the table of known
+observation types in the netCDF file is not pruned down to reflect the
+contents of the netCDF file. As a consequence, a dump of <em
+class="unix">ObsObsTypesMetaData</em> might lead you to try to plot 
+observation types that do not exist in the file. Stay tuned.
+<P/>
+
+<H3 class="indent1">Matlab helper functions</H3>
+<P>
+For better or for worse, the Matlab <em class="file">netcdf_toolbox</em> 
+subset of functions is no longer being supported by their developers,
+who are now supporting the <a
+href="http://mexcdf.sourceforge.net/">snctools</a> set of 
+functions. The Matlab functions <em class="program">plot_obs_netcdf</em>
+and <em class="program">plot_obs_netcdf_diffs</em> both use the
+supported <em class="file">snctools</em> toolbox. A slow migration of
+the DART use of the <em class="file">netcdf_toolbox</em> and the CSIRO
+toolbox <em class="file">matlab_netCDF_OPeNDAP</em> (i.e. the 'getnc'
+function) is underway. In the end - this will greatly ease the
+installation of the Matlab netcdf widgets and allow for the same code
+to operate using Matlab's native low-level interface or the historical
+third-party interface (mexnc, mexcdf, mexcdf53).
+<br />
+<br />
+As is standard practice, the instructions for using the Matlab scripts
+are available by using the Matlab 'help' facility (i.e.  
+<em class="input">help plot_obs_netcdf</em>&nbsp;). A quick discussion
+of them here still seems appropriate. If you run the following Matlab
+commands with an <em class="file">obs_sequence_001.nc</em> file you 
+couldn't possibly have:
+<br />
+<br />
+<div class="unix">
+<pre>&#62;&#62; <em class="input">help plot_obs_netcdf</em>
+fname         = 'obs_sequence_001.nc';
+ObsTypeString = 'RADIOSONDE_U_WIND_COMPONENT';
+region        = [0 360 -90 90 -Inf Inf];
+CopyString    = 'NCEP BUFR observation';
+QCString      = 'DART quality control';
+maxQC         = 2;
+verbose       = 1;
+
+bob = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);
+
+<em class="input">
+&#62;&#62; fname         = 'obs_sequence_001.nc';
+&#62;&#62; ObsTypeString = 'RADIOSONDE_U_WIND_COMPONENT';
+&#62;&#62; region        = [0 360 -90 90 -Inf Inf];
+&#62;&#62; CopyString    = 'NCEP BUFR observation';
+&#62;&#62; QCString      = 'DART quality control';
+&#62;&#62; maxQC         = 2;
+&#62;&#62; verbose       = 1;
+&#62;&#62; bob = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);</em>
+
+N =  3336 RADIOSONDE_U_WIND_COMPONENT  obs (type   1) between levels 550.00 and 101400.00
+N =  3336 RADIOSONDE_V_WIND_COMPONENT  obs (type   2) between levels 550.00 and 101400.00
+N =    31 RADIOSONDE_SURFACE_PRESSURE  obs (type   3) between levels 0.00 and 1378.00
+N =  1276 RADIOSONDE_TEMPERATURE       obs (type   4) between levels 550.00 and 101400.00
+N =   691 RADIOSONDE_SPECIFIC_HUMIDITY obs (type   5) between levels 30000.00 and 101400.00
+N = 11634 AIRCRAFT_U_WIND_COMPONENT    obs (type   6) between levels 17870.00 and 99510.00
+N = 11634 AIRCRAFT_V_WIND_COMPONENT    obs (type   7) between levels 17870.00 and 99510.00
+N =  8433 AIRCRAFT_TEMPERATURE         obs (type   8) between levels 17870.00 and 76710.00
+N =  6993 ACARS_U_WIND_COMPONENT       obs (type  10) between levels 17870.00 and 76680.00
+N =  6993 ACARS_V_WIND_COMPONENT       obs (type  11) between levels 17870.00 and 76680.00
+N =  6717 ACARS_TEMPERATURE            obs (type  12) between levels 17870.00 and 76680.00
+N = 20713 SAT_U_WIND_COMPONENT         obs (type  22) between levels 10050.00 and 99440.00
+N = 20713 SAT_V_WIND_COMPONENT         obs (type  23) between levels 10050.00 and 99440.00
+N = 20713 SAT_V_WIND_COMPONENT         obs (type  23) between levels 10050.00 and 99440.00
+N =   723 GPSRO_REFRACTIVITY           obs (type  46) between levels 220.00 and 12000.00
+NCEP BUFR observation is copy   1
+DART quality control is copy   2
+Removing 993 obs with a DART quality control value greater than 2.000000
+</pre>
+</div>
+<br />
+<br />
+you get the plots at the top of this document. If you have a relatively
+new version of Matlab, you can dynamically rotate the 3D view ...
+coooool. The vertical levels are reported so you can restrict the area
+of interest with the 'region' variable [minlon maxlon minlat maxlat
+minlevel maxlevel]. The observation Only the observations with a QC value less than or
+equal to 'maxQC' are plotted in 'Figure 1'. Note the values of 'QCString' 
+and 'CopyString' must match some value of <em class="unix">QCMetaData</em> 
+and <em class="unix">CopyMetaData</em>, respectively. If you're not so
+keen on a 3D plot, simply change the view to be directly 'overhead':
+<br />
+<br />
+<div class="unix">
+<pre>&#62;&#62; <em class="input">view(0,90)</em></pre>
+</div>
+<br />
+And if you act today, we'll throw in a structure containing the selected
+data AT NO EXTRA CHARGE:
+<br />
+<br />
+<div class="unix">
+<pre>&#62;&#62; <em class="input">bob</em>
+bob = 
+            fname: 'obs_sequence_001.nc'
+    ObsTypeString: 'RADIOSONDE_U_WIND_COMPONENT'
+           region: [0 360 -90 90 -Inf Inf]
+       CopyString: 'NCEP BUFR observation'
+         QCString: 'DART quality control'
+            maxQC: 2
+          verbose: 1
+             lons: [2343x1 double]
+             lats: [2343x1 double]
+                z: [2343x1 double]
+              obs: [2343x1 double]
+             Ztyp: [2343x1 double]
+               qc: [2343x1 double]
+</pre>
+</div>
+</P>
+
+<!--==================================================================-->
+<!-- Cite references, if need be.                                     -->
+<!--==================================================================-->
+
+<A NAME="References"></A>
+<BR><HR><BR>
+<H2>REFERENCES</H2>
+
+<!--==================================================================-->
+<!-- Describe all the error conditions and codes.                     -->
+<!-- Putting a <BR> after the synopsis creates a nice effect.         -->
+<!--==================================================================-->
+
+<A NAME="Errors"></A>
+<HR>
+<H2>ERROR CODES and CONDITIONS</H2>
+<div class="errors">
+<TABLE border=1 cellspacing=1 cellpadding=10 width=100%>
+<TR><TH>Routine</TH><TH>Message</TH><TH>Comment</TH></TR>
+
+<TR><!-- routine --><TD VALIGN=top>obs_seq_to_netcdf</TD>
+    <!-- message --><TD VALIGN=top>No first observation in sequence.</TD>
+    <!-- comment --><TD VALIGN=top>get_first_obs couldn't find a "first obs" 
+                                   in the obs_seq.final. </TD>
+</TR>
+<TR><!-- routine --><TD VALIGN=top>obs_seq_to_netcdf</TD>
+    <!-- message --><TD VALIGN=top>No last observation in sequence</TD>
+    <!-- comment --><TD VALIGN=top>get_last_obs couldn't find a "last obs" 
+                                   in the obs_seq.final </TD>
+</TR>
+<TR><!-- routine --><TD VALIGN=top>obs_seq_to_netcdf</TD>
+    <!-- message --><TD VALIGN=top>metadata:observation not found</TD>
+    <!-- comment --><TD VALIGN=top>Couldn't find the index for the
+    observation value in the observation sequence file. It is the only
+    one that is required.</TD>
+</TR>
+</TABLE>
+</div>
+
+<A NAME="PrivateComponents"></A>
+<BR><HR><BR>
+<H2>PRIVATE COMPONENTS</H2>
+<!--==================================================================-->
+<!-- Internal subroutines and functions.                              -->
+<!--==================================================================-->
+
+
+<!--==================================================================-->
+<!-- Describe the bugs.                                               -->
+<!--==================================================================-->
+<A NAME="KnownBugs"></A>
+<BR><HR><BR>
+<H2>KNOWN BUGS</H2>
+<P>
+None at this time, but it doesn't do all we want it to do. Give us a
+chance!
+</P>
+
+<!--==================================================================-->
+<!-- Descibe Future Plans.                                            -->
+<!--==================================================================-->
+
+<A NAME="FuturePlans"></A>
+<BR><HR><BR>
+<H2>FUTURE PLANS</H2>
+<P>
+Extend to record all the metadata for the observations, even the
+'shared' metadata. The supporting matlab scripts have a desired 
+feature list a mile long.
+</P>
+
+<!--==================================================================-->
+
+<HR>
+</BODY>
+</HTML>


Property changes on: DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html
___________________________________________________________________
Name: svn:mime-type
   + text/html
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: DART/trunk/doc/images/plot_obs_netcdf_fig1.png
===================================================================
(Binary files differ)


Property changes on: DART/trunk/doc/images/plot_obs_netcdf_fig1.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: DART/trunk/doc/images/plot_obs_netcdf_fig2.png
===================================================================
(Binary files differ)


Property changes on: DART/trunk/doc/images/plot_obs_netcdf_fig2.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: DART/trunk/doc/images/schedule.png
===================================================================
(Binary files differ)


Property changes on: DART/trunk/doc/images/schedule.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m
===================================================================
--- DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m	2009-05-11 22:31:11 UTC (rev 3871)
+++ DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m	2009-05-14 03:49:53 UTC (rev 3872)
@@ -1,4 +1,4 @@
-function h = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, ...
+function obsstruct = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, ...
                                      QCString, maxQC, verbose)
 %
 % fname         = 'obs_sequence_001.nc';


More information about the Dart-dev mailing list