<div dir="ltr"><div dir="ltr">Hi Scott,<div><br></div><div>See this: <a href="http://mailman.ucar.edu/pipermail/ncl-talk/2016-October/007059.html">http://mailman.ucar.edu/pipermail/ncl-talk/2016-October/007059.html</a></div><div><br></div><div>Remember when setting up the Proj4 Lambert Conformal string for WRF to use a sphere with a radius of 6370000. I believe that function will give you fractional x,y values, which you'll need to do some kind of interpolation (or nearest neighbor if that's good enough) to do your computation.</div><div><br></div><div>Hope this helps,</div><div><br></div><div>Bill</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 1:58 PM Scott Capps <<a href="mailto:scapps@atmosdatasolutions.com">scapps@atmosdatasolutions.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div>I have created a NetCDF file with data (terrain slope) on the WGS84 4326 map projection (ncdump -h output shown below):</div><div dir="ltr"><br clear="all"><div><div>dimensions:</div><div><span style="white-space:pre-wrap">   </span>lon = 27382 ;</div><div><span style="white-space:pre-wrap">    </span>lat = 25569 ;</div><div>variables:</div><div><span style="white-space:pre-wrap">   </span>char crs ;</div><div><span style="white-space:pre-wrap">               </span>crs:grid_mapping_name = "latitude_longitude" ;</div><div><span style="white-space:pre-wrap">         </span>crs:long_name = "CRS definition" ;</div><div><span style="white-space:pre-wrap">             </span>crs:longitude_of_prime_meridian = 0. ;</div><div><span style="white-space:pre-wrap">           </span>crs:semi_major_axis = 6378137. ;</div><div><span style="white-space:pre-wrap">         </span>crs:inverse_flattening = 298.257223563 ;</div><div><span style="white-space:pre-wrap">         </span>crs:spatial_ref = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]" ;</div><div><span style="white-space:pre-wrap">               </span>crs:GeoTransform = "-121.3651264724438 0.0002790528478797247 0 39.07036311976184 0 -0.0002790528478797247 " ;</div><div><span style="white-space:pre-wrap">  </span>double lat(lat) ;</div><div><span style="white-space:pre-wrap">                </span>lat:standard_name = "latitude" ;</div><div><span style="white-space:pre-wrap">               </span>lat:long_name = "latitude" ;</div><div><span style="white-space:pre-wrap">           </span>lat:units = "degrees_north" ;</div><div><span style="white-space:pre-wrap">  </span>double lon(lon) ;</div><div><span style="white-space:pre-wrap">                </span>lon:standard_name = "longitude" ;</div><div><span style="white-space:pre-wrap">              </span>lon:long_name = "longitude" ;</div><div><span style="white-space:pre-wrap">          </span>lon:units = "degrees_east" ;</div><div><span style="white-space:pre-wrap">   </span>float Band1(lat, lon) ;</div><div><span style="white-space:pre-wrap">          </span>Band1:long_name = "GDAL Band Number 1" ;</div><div><span style="white-space:pre-wrap">               </span>Band1:_FillValue = -9999.f ;</div><div><span style="white-space:pre-wrap">             </span>Band1:grid_mapping = "crs" ;</div><div><br></div><div>// global attributes:</div><div><span style="white-space:pre-wrap">              </span>:GDAL_AREA_OR_POINT = "Area" ;</div><div><span style="white-space:pre-wrap">         </span>:Conventions = "CF-1.5" ;</div><div><span style="white-space:pre-wrap">              </span>:GDAL = "GDAL 2.3.2, released 2018/09/21" ;</div><div><span style="white-space:pre-wrap">            </span>:history = "Wed Dec 05 11:41:45 2018: GDAL CreateCopy( <a href="http://territory_epsg4326_slope.nc" target="_blank">territory_epsg4326_slope.nc</a>, ... )" ;</div><div>}</div></div><div><br></div><div>And, I would like to calculate the average terrain slope in each grid cell on my coarser WRF domain (2km resolution).  </div><div><br></div><div>Can NCL correctly handle the re-projection from the file above:</div><div><br></div><div><div>Geodetic CRS: WGS84</div><div>Datum: World Geodetic System 1984</div><div>Ellipsoid: WGS 84</div><div>Prime Meridian: Greenwich</div></div><div><br></div><div>to my WRF Lambert Conformal Conic projection while calculating the average terrain slope in each overlapping, coarser resolution WRF gridcell?  </div><div><br></div><div>Any help or suggestions are appreciated.</div><div><br></div><div>Thank you,</div><div><br></div><div>Scott</div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>