[ncl-talk] Using Shapefiles to create subset from global forecast datasets

Klemm, Toni toni at ou.edu
Mon May 22 22:10:24 MDT 2017


Good evening,

I am analyzing seasonal climate forecasts skill for the U.S. Great Plains, specifically Texas, Oklahoma, Kansas, and Colorado. So far I’ve been using lat/lon to define my study region. However, this rectangular box includes parts of Mexico and the Gulf of Mexico that are outside my study region and which have extreme outliers that distort my results.

To get more accurate results, I’d like to use a shapefile of my 4 states (TX_OK_KS_CO.shp, created in QGIS 2.18 from a U.S. states shapefile) to define my study region. However, I’m not sure how to interpret and use the results I’m getting. I used   “ncl_convert2nc TX_OK_KS_CO.shp -nc2c“  to create   “TX_OK_KS_CO.nc“ .

“printVarSummary(TX_OK_KS_CO.nc)” and ”PrintMinMax“ of the x-coordinate (longitude) as well as y-coordinate (latitude) look like this:

Variable: shp
Type: file
File path: /home/States_shapefile_data/GADM/TX_OK_KS_CO.nc
Number of global attributes: 11
Number of dimensions: 5
Number of variables: 4
(0) min=0   max=0

ncdump -h TX_OK_KS_CO.nc returns this:

netcdf TX_OK_KS_CO {
dimensions:
geometry = 2 ;
segments = 2 ;
num_features = 4 ;
num_segments = 262 ;
num_points = 102749 ;
variables:
int geometry(num_features, geometry) ;
int segments(num_segments, segments) ;
double x(num_points) ;
double y(num_points) ;

// global attributes:
:segs_numPnts = 1 ;
:segs_xyzIndex = 0 ;
:geom_numSegs = 1 ;
:geom_segIndex = 0 ;
:geometry_type = "polygon" ;
:layer_name = "TX_OK_KS_CO" ;
:creation_date = "Mon May 22 17:20:46 EDT 2017" ;
:NCL_Version = "6.4.0" ;
:system = "Linux ou.edu<http://ou.edu> x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux" ;
:Conventions = "None" ;
:title = "NCL: convert-OGR-to-netCDF" ;
}

I am not sure how to use this information, or if this is even the information I should be getting, to define the study region when extracting data from my global forecast dataset. I am fairly sure the shapefile is correct. Opening it again in QGIS showed the four states with their outlines and filling, and nothing else.

I appreciate any help!

Thank you very much,
Toni


Toni Klemm
Ph.D. Candidate
The University of Oklahoma
South Central Climate Science Center
phone: 405 325 1272
www.toni-klemm.de<http://www.toni-klemm.de>
Early Career Climate Forum<https://www.eccforum.org>
Twitter: @toniklemm<https://twitter.com/ToniKlemm>






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170523/7ee132f9/attachment.html 


More information about the ncl-talk mailing list