[Dart-dev] [3888] DART/trunk: More predictable region subsetting.

nancy at ucar.edu nancy at ucar.edu
Wed May 27 14:08:25 MDT 2009


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090527/52572082/attachment.html 
-------------- next part --------------
Modified: DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	2009-05-27 19:15:25 UTC (rev 3887)
+++ DART/trunk/diagnostics/threed_sphere/obs_seq_to_netcdf.html	2009-05-27 20:08:25 UTC (rev 3888)
@@ -398,7 +398,11 @@
         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
+<UL><LI><em class="file">observations/utilities/read_obs_netcdf.m</em>
+        reads the netcdf files and returns an structure with easy-to-plot
+	components.  More on that in the 'Usage' section below.
+	</LI>
+    <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>
@@ -408,8 +412,6 @@
         the bias between 'observation' and 'prior ensemble mean', for example.
         Again, more on that in the 'Usage' section below.
 	</LI>
-    <LI><em class="file">observations/utilities/read_obs_netcdf.m</em> will
-        be coming soon to a repository near you. </LI>
 </UL>
 
 <H3 class="indent1">Discussion of obs_sequence_xxx.nc structure</H3>
@@ -677,9 +679,9 @@
 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 away
+functions. The Matlab function <em class="program">read_obs_netcdf</em>
+uses the supported <em class="file">snctools</em> toolbox. 
+A slow migration away
 from the existing 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
@@ -714,11 +716,13 @@
 <br />
 <br />
 As is standard practice, the instructions for using the Matlab scripts
+<em class="program">plot_obs_netcdf</em>
+and <em class="program">plot_obs_netcdf_diffs</em> 
 are available by using the Matlab 'help' facility 
 (i.e.&nbsp;<em class="input">help&nbsp;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:
+cannot possibly have:
 <br />
 <br />
 <div class="unix">
@@ -731,7 +735,7 @@
 maxQC         = 2;
 verbose       = 1;
 
-bob = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);
+obs = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);
 
 &#62;&#62;<em class="input"> fname         = 'obs_sequence_001.nc';</em>
 &#62;&#62;<em class="input"> ObsTypeString = 'RADIOSONDE_U_WIND_COMPONENT';</em>
@@ -740,7 +744,7 @@
 &#62;&#62;<em class="input"> QCString      = 'DART quality control';</em>
 &#62;&#62;<em class="input"> maxQC         = 2;</em>
 &#62;&#62;<em class="input"> verbose       = 1;</em>
-&#62;&#62;<em class="input"> bob = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);</em>
+&#62;&#62;<em class="input"> obs = 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
@@ -784,14 +788,12 @@
 </div>
 <br />
 And if you act today, we'll throw in a structure containing the selected
-data AT NO EXTRA CHARGE.  Ryan has requested the obvious ... a function 
-to simply return the observations without plotting. I'm working on it.
-I am embarrassed I didn't start with that.
+data AT NO EXTRA CHARGE. 
 <br />
 <br />
 <div class="unix">
-<pre>&#62;&#62; <em class="input">bob</em>
-bob = 
+<pre>&#62;&#62; <em class="input">obs</em>
+obs = 
             fname: 'obs_sequence_001.nc'
     ObsTypeString: 'RADIOSONDE_U_WIND_COMPONENT'
            region: [0 360 -90 90 -Inf Inf]
@@ -805,8 +807,14 @@
               obs: [2343x1 double]
              Ztyp: [2343x1 double]
                qc: [2343x1 double]
+         numbadqc: 993
+           badobs: [1x1 struct]
 </pre>
 </div>
+<br />
+If there are observations with QC values above that defined by 
+<em class="code">maxQC</em> there will be a <em class="code">badobs</em> 
+structure as a component in the <em class="code">obs</em> structure.
 </P>
 
 <!--==================================================================-->

Modified: DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m
===================================================================
--- DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m	2009-05-27 19:15:25 UTC (rev 3887)
+++ DART/trunk/observations/utilities/threed_sphere/plot_obs_netcdf.m	2009-05-27 20:08:25 UTC (rev 3888)
@@ -42,13 +42,12 @@
 zmin = min(obsstruct.z);
 zmax = max(obsstruct.z);
 
-
-axis([xmin xmax ymin ymax zmin zmax])
-
 scalearray = scaleme(obsstruct.obs, 36);
 scatter3(obsstruct.lons, obsstruct.lats, obsstruct.z, ...
          scalearray, obsstruct.obs, 'd', 'filled');
 
+axis([xmin xmax ymin ymax zmin zmax])
+
 str1 = sprintf('%s level (%.2f - %.2f)',ObsTypeString,zmin,zmax);
 str2 = sprintf('%s (%d locations)',CopyString,length(obsstruct.obs));
 str3 = sprintf('%s - %s',obsstruct.timestring(1,:),obsstruct.timestring(2,:));
@@ -91,6 +90,8 @@
    
    scatter3(obsstruct.badobs.lons, obsstruct.badobs.lats, obsstruct.badobs.z, ...
             scalearray, obsstruct.badobs.qc,'filled')
+
+   axis([xmin xmax ymin ymax zmin zmax])
    
    str2 = sprintf('%s (%d bad observations)',CopyString,length(obsstruct.badobs.obs));
    
@@ -111,7 +112,6 @@
       zlabel('height')
    end
    
-   axis([xmin xmax ymin ymax zmin zmax])
    myworldmap;
    set(gca,'CLim',[min(obsstruct.badobs.qc) max(obsstruct.badobs.qc)])
    h = colorbar;

Modified: DART/trunk/observations/utilities/threed_sphere/read_obs_netcdf.m
===================================================================
--- DART/trunk/observations/utilities/threed_sphere/read_obs_netcdf.m	2009-05-27 19:15:25 UTC (rev 3887)
+++ DART/trunk/observations/utilities/threed_sphere/read_obs_netcdf.m	2009-05-27 20:08:25 UTC (rev 3888)
@@ -11,7 +11,26 @@
 %
 % obs = read_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxQC, verbose);
 %
+% The return variable 'obs' is a structure. As an example ...
+%
+%           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
+%      timestring: [2x20 char]
+%            lons: [2343x1 double]
+%            lats: [2343x1 double]
+%               z: [2343x1 double]
+%             obs: [2343x1 double]
+%            Ztyp: [2343x1 double]
+%        numbadqc: 993
+%              qc: [2343x1 double]
+%          badobs: [1x1 struct]
 
+
 % Data Assimilation Research Testbed -- DART
 % Copyright 2004-2007, Data Assimilation Research Section
 % University Corporation for Atmospheric Research
@@ -110,11 +129,10 @@
 obsstruct.z    = mylocs(inds,3);
 obsstruct.obs  =  myobs(inds);
 obsstruct.Ztyp = z_type(inds);
+obsstruct.qc   = [];
 obsstruct.numbadqc = 0;
 
-if (isempty(myqc))
-   obsstruct.qc = [];
-else
+if ~ isempty(myqc)
    obsstruct.qc = myqc(inds);
 end
 


More information about the Dart-dev mailing list