NCAR / rwrfhydro

A community-contributed tool box for managing, analyzing, and visualizing WRF Hydro (and NWM) input and output files in R.
Other
74 stars 68 forks source link

GetProj function in geospatial.R #94

Open ChuliangXiao opened 6 years ago

ChuliangXiao commented 6 years ago

This is an example of the global attributes in a geo_em.d02.nc file DX : 2500 DY : 2500 DYN_OPT : 2 CEN_LAT : 41.38548 CEN_LON : -84.25238 TRUELAT1 : 30 TRUELAT2 : 60 MOAD_CEN_LAT : 41.2 STAND_LON : -84.5 POLE_LAT : 90 POLE_LON : 0 corner_lats : <ARRAY of 16 elements> corner_lons : <ARRAY of 16 elements> MAP_PROJ : 1 In your code, you use "CEN_LAT", which is true when no domain is nested.

cen_lat <- ncdf4::ncatt_get(coordNC, varid=0, attname="CEN_LAT")$value

CEN_LAT and CEN_LON are specific to the nest. If available, MOAD_CEN_LAT and STAND_LON are should be used.