<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Jeff,<br><br>What model is the forecast data coming from? Have you tried to use the re() function?&nbsp; http://opengrads.org/doc/udxt/re/re.html<br><br>Maybe you could define your variables something like:<br><br>fcst = re(reflecitivty, 0.1)<br>obs = re(reflectivity.2, 0.1)<br><br>I would define this near the beginning of your script (before you set lat/lon). I guess the idea would be to make match up the grids by regridding. <br><br>-James<br><br><br><div><hr id="stopSpelling">Date: Fri, 4 Sep 2015 22:24:12 -0500<br>From: jeffduda319@gmail.com<br>To: gradsusr@gradsusr.org<br>Subject: [gradsusr] Question about xdfopen<br><br><div dir="ltr"><div><div><div>I want to overlay some forecast radar reflectivity with observed reflectivity from NEXRAD radars across the US. I obtained the radar data from NCDC, then used the Weather and Climate Toolkit to convert the level 2 or level 3 radar data into netCDF.<br><br></div>The first problem: if I just use sdfopen to open the radar observations file, the dimensions do not line up with those of my forecast reflectivity, and I can't figure out a way to get them to line up so that both will plot on the same set of axes. I tried messing around with "set dfile" and then setting the dimension environment to favor the observed radar data after the forecast data were already plotted, but it didn't work. I also tried using lterp() to interpolate the observed data to the forecast, but that didn't work either.<br><br></div>The second problem: I looked into creating a short descriptor file so I can use xdfopen to control the dimensions of the observed radar data and force them to correspond better with those in the control file for my forecast reflectivity. Below is the file I used (for observed radar data):<br><br></div>------control file code----------------------<br clear="all"><div><div><div><div><div>DSET KAMA_V03_20100613_235808.nc<br>XDEF lon 1500 linear -105 0.01<br>YDEF lat 1500 linear 32 0.01<br>TDEF time 1 linear 00Z14JUN2010 1hr<br>VARS 1<br>Reflectivity=&gt;obsrefl 1<br>ENDVARS<br></div><div>-----end control file code------------------<br><br></div><div>This corresponds to the metadata of the observed radar data from ncdump that follows:<br><br></div><div>-----------ncdump -h output-----------------------------------------------------------<br></div><div>netcdf KAMA_V03_20100613_235808 {<br>dimensions:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat = 638 ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lon = 800 ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time = 1 ;<br>variables:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double Reflectivity(time, lat, lon) ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reflectivity:long_name = "Nexrad 2 radar dataset" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reflectivity:missing_value = -999. ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reflectivity:units = "dBz" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double lat(lat) ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat:units = "degrees_north" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat:spacing = "0.006905108991704942" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat:datum = "NAD83 - NOAA Standard" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double lon(lon) ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lon:units = "degrees_east" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lon:spacing = "0.006905108991704942" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lon:datum = "NAD83 - NOAA Standard" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int time(time) ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time:units = "seconds since 1970-1-1" ;<br><br>// global attributes:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :title = "Nexrad 2 radar dataset&nbsp; 23:58:08 UTC&nbsp; 06/13/2010" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :Conventions = "CF-1.0" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :History = "Exported to NetCDF-3 CF-1.0 conventions by the NOAA Weather and Climate Toolkit (version 3.7.4)&nbsp; \n",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Export Date: Fri Sep 04 21:43:37 CDT 2015" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :geographic_datum_ESRI_PRJ = "GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]]" ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :geographic_datum_OGC_WKT = "GEOGCS[\"NAD83\", DATUM[\"NAD83\", SPHEROID[\"GRS_1980\", 6378137.0, 298.25722210100002],TOWGS84[0,0,0,0,0,0,0]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"degree\",0.017453292519943295], AXIS[\"Longitude\",EAST], AXIS[\"Latitude\",NORTH]]" ;<br>}<br></div><div>----end ncdump -h output------------------------------------------------------------------------------<br></div><div><br></div><div>Unfortunately, the above control file is not right, as I get this error when attempting to plot just the observed radar data:<br><br>ga-&gt; d obsrefl<br>gancgrid error: nc_get_vara_double failed; NetCDF: Start+count exceeds dimension bound<br>Data Request Error:&nbsp; Error for variable 'obsrefl'<br>&nbsp; Error ocurred at column 1<br>DISPLAY error:&nbsp; Invalid expression <br>&nbsp; Expression = obsrefl<br><br></div><div>So I need help figuring out how to correct that.<br><br></div><div>Now, onto the control file for my forecast data (with unnecessary entries removed):<br></div><div>---------------control file code-----------------------------------------------------------------<br></div><div>dset /work/jdduda/analysis/FLSM/m1/wrfout_d01_2010-06-%d2_%h2:00:00<br>dtype netcdf<br>undef -9999<br>options template<br>title&nbsp; OUTPUT FROM WRF V3.6.1 MODEL - scalar fields - by Jeff Duda<br>pdef&nbsp; 750&nbsp; 700 lcc&nbsp;&nbsp; 22.99725 -113.57413 1 1&nbsp;&nbsp; 38.50000&nbsp;&nbsp; 38.50000&nbsp; -99.38000 4000.00000 4000.00000<br>xdef&nbsp;&nbsp; 750 linear -119.22278 0.05291406<br>ydef&nbsp;&nbsp; 700 linear&nbsp;&nbsp; 22.99725 0.03706590<br>zdef&nbsp;&nbsp;&nbsp; 50 linear 1 1.0<br>tdef 37 linear 00Z13JUN2010 1HR<br>VARS&nbsp; 1<br>REFD_COM=&gt;refdcom&nbsp;&nbsp; 0 t,y,x AFWA COMPOSITE RADAR REFL (dbZ)<br></div><div>ENDVARS<br></div><div>------------------end control file code-------------------------------------------------------------------<br><br></div><div>Does anyone know how I can remedy this situation? Thanks for your attention.<br><br></div><div>Jeff Duda<br></div><div>-- <br><div class="ecxgmail_signature">Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br></div>
</div></div></div></div></div></div>
<br>_______________________________________________
gradsusr mailing list
gradsusr@gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr</div>                                               </div></body>
</html>