[gradsusr] Question about xdfopen
Jennifer Adams
jma at cola.iges.org
Sun Sep 6 18:35:19 EDT 2015
On Sep 6, 2015, at 1:57 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
> Thanks for the replies.
>
> So, to make sure I'm understanding this correctly: if I DON'T use the PDEF entry in a control file, then my XDEF and YDEF (and any TDEF/ZDEF/EDEF as well) must be an exact match to the data.
Correct. Although you have some wiggle room with Z because you can define a Z axis but then specify a variable that does not vary in Z.
> If you DO use PDEF, then you can set XDEF and YDEF to be whatever
Correct.
> as long as they span the actual range of coordinates.
No, there is no restriction on the destination grid. It can be global or regional. If parts of your destination grid are outside the domain of the data, they will be populated with missing values.
>
> Do I have this right?
You had it 99.44% right.
—Jennifer
>
> Jeff
>
> On Sun, Sep 6, 2015 at 8:46 AM, Jennifer Adams <jma at cola.iges.org> wrote:
> Jeff,
> The ncdump output from KAMA_whatever.nc says the grid has 800 longitudes and 638 latitudes. So your descriptor file should have 'XDEF 800 …’ and ‘YDEF 638 …’. Use ncdump -c to find out what the start and increment are (or all the levels if the dimensions are not linear) to populate the remainder of your XDEF and YDEF statements. That should get rid of your error messages about exceeding the dimension bounds.
>
> Your wrfoutput files have a PDEF entry. So you will be interpolating that data to a destination grid of your choice. You currently have:
>> xdef 750 linear -119.22278 0.05291406
>> ydef 700 linear 22.99725 0.03706590
>
> But there is no need to use the identical dimension sizes as the native grid, and the increments are awkward. Make your life simple, and use the same grid from your reflectivity data — grab the same XDEF and YDEF from your KAMA.ctl descriptor file.
>
> If you want to interpolate to a higher res grid, perhaps the one you define like this:
>> XDEF lon 1500 linear -105 0.01
>> YDEF lat 1500 linear 32 0.01
> The use those in your wrfoutput descriptor instead of the KAMA grid and use lterp() to interpolate the reflectivity data to that grid:
> ga-> d lterp(obsrefl.1,refdcom.2)
>
>
> —Jennifer
>
>
>
>
>
> On Sep 4, 2015, at 11:24 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> 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.
>>
>> 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.
>>
>> 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):
>>
>> ------control file code----------------------
>> DSET KAMA_V03_20100613_235808.nc
>> XDEF lon 1500 linear -105 0.01
>> YDEF lat 1500 linear 32 0.01
>> TDEF time 1 linear 00Z14JUN2010 1hr
>> VARS 1
>> Reflectivity=>obsrefl 1
>> ENDVARS
>> -----end control file code------------------
>>
>> This corresponds to the metadata of the observed radar data from ncdump that follows:
>>
>> -----------ncdump -h output-----------------------------------------------------------
>> netcdf KAMA_V03_20100613_235808 {
>> dimensions:
>> lat = 638 ;
>> lon = 800 ;
>> time = 1 ;
>> variables:
>> double Reflectivity(time, lat, lon) ;
>> Reflectivity:long_name = "Nexrad 2 radar dataset" ;
>> Reflectivity:missing_value = -999. ;
>> Reflectivity:units = "dBz" ;
>> double lat(lat) ;
>> lat:units = "degrees_north" ;
>> lat:spacing = "0.006905108991704942" ;
>> lat:datum = "NAD83 - NOAA Standard" ;
>> double lon(lon) ;
>> lon:units = "degrees_east" ;
>> lon:spacing = "0.006905108991704942" ;
>> lon:datum = "NAD83 - NOAA Standard" ;
>> int time(time) ;
>> time:units = "seconds since 1970-1-1" ;
>>
>> // global attributes:
>> :title = "Nexrad 2 radar dataset 23:58:08 UTC 06/13/2010" ;
>> :Conventions = "CF-1.0" ;
>> :History = "Exported to NetCDF-3 CF-1.0 conventions by the NOAA Weather and Climate Toolkit (version 3.7.4) \n",
>> "Export Date: Fri Sep 04 21:43:37 CDT 2015" ;
>> :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]]" ;
>> :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]]" ;
>> }
>> ----end ncdump -h output------------------------------------------------------------------------------
>>
>> Unfortunately, the above control file is not right, as I get this error when attempting to plot just the observed radar data:
>>
>> ga-> d obsrefl
>> gancgrid error: nc_get_vara_double failed; NetCDF: Start+count exceeds dimension bound
>> Data Request Error: Error for variable 'obsrefl'
>> Error ocurred at column 1
>> DISPLAY error: Invalid expression
>> Expression = obsrefl
>>
>> So I need help figuring out how to correct that.
>>
>> Now, onto the control file for my forecast data (with unnecessary entries removed):
>> ---------------control file code-----------------------------------------------------------------
>> dset /work/jdduda/analysis/FLSM/m1/wrfout_d01_2010-06-%d2_%h2:00:00
>> dtype netcdf
>> undef -9999
>> options template
>> title OUTPUT FROM WRF V3.6.1 MODEL - scalar fields - by Jeff Duda
>> pdef 750 700 lcc 22.99725 -113.57413 1 1 38.50000 38.50000 -99.38000 4000.00000 4000.00000
>> xdef 750 linear -119.22278 0.05291406
>> ydef 700 linear 22.99725 0.03706590
>> zdef 50 linear 1 1.0
>> tdef 37 linear 00Z13JUN2010 1HR
>> VARS 1
>> REFD_COM=>refdcom 0 t,y,x AFWA COMPOSITE RADAR REFL (dbZ)
>> ENDVARS
>> ------------------end control file code-------------------------------------------------------------------
>>
>> Does anyone know how I can remedy this situation? Thanks for your attention.
>>
>> Jeff Duda
>> --
>> Jeff Duda
>> Graduate research assistant
>> University of Oklahoma School of Meteorology
>> Center for Analysis and Prediction of Storms
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
> --
> Jennifer M. Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> 111 Research Hall, Mail Stop 2B3
> George Mason University
> 4400 University Drive
> Fairfax, VA 22030
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
> --
> Jeff Duda
> Graduate research assistant
> University of Oklahoma School of Meteorology
> Center for Analysis and Prediction of Storms
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150906/cf2eafb1/attachment-0001.html
More information about the gradsusr
mailing list