On Thu, 7 Jan 2010, Middel, Kevin (MNR) wrote:

Hi,

I am trying to read a netcdf file and create spatial grid files
compatible with a GIS from the various time arrays, but ran into a
problem right off with rgdal.  The .nc file contains daily air
temperatures across North America for a given year.



Using the command:
GDALinfo("air.2m.1979.nc")

Where is your sessionInfo() information? Does gdalDrivers() include the NetCDF driver (no, you are on Windows using the standard binary rgdal package - guesses based on the file path quoted below)? Have you read file.show(system.file("README.windows", package="rgdal")), which tells you how to install rgdal from source on Windows to access extra drivers depending on external software?

The user needing more exotic drivers (those not provided by GDAL itself) has to provide the external dependencies and install from the source package on all platforms. If ncdf can import the data, please use that if you do not want to install rgdal from source.

Hope this helps,

Roger



I get the error:
CPL ERROR 4: `air.2m.1979.nc' not recognised as a supported file format.



Error in .local(.Object, ...) :

 `air.2m.1979.nc' not recognised as a supported file format.



I am able read the file using the package ncdf, and the utility ncdump,
as well as view the data in panoply, so I'm not sure what I'm doing
incorrectly.   I've also tried using FWTools to view the data and in
this program the image is inverted (N-S).  Finally I've had a look at
the data using GDALInfo installed with FWTools and have pasted the
output below, as well as the output from NCDump.



It's probably pretty obvious that I'm new to this format, so any
help/guidance anyone can provide would be greatly appreciated.



Thanks in advance,

Kevin



GDALInfo Output:



Driver: netCDF/Network Common Data Format

Files: d:\databases\climate\narr\air.2m.1979.nc

Size is 512, 512

Coordinate System is `'

Metadata:

 NC_GLOBAL#standardpar1=50

 NC_GLOBAL#standardpar2=50

 NC_GLOBAL#centerlon=-107

 NC_GLOBAL#centerlat=50

 NC_GLOBAL#latcorners=1.000001e+000, 8.979450e-001, 4.635440e+001,
4.663433e+001

 NC_GLOBAL#loncorners=-1.455000e+002, -6.832005e+001, -2.569891e+000,
1.486418e+002

 NC_GLOBAL#stream=s1

 NC_GLOBAL#title=Daily NARR

 NC_GLOBAL#Conventions=CF-1.0

 NC_GLOBAL#history=On Thu Feb  9 16:48:19 2006 single precision time
renamed oldtime,

values transferred to double precision new time variable.

created 2005 by Jeff Whitaker

 NC_GLOBAL#institution=National Centers for Environmental Prediction

 NC_GLOBAL#platform=Model


NC_GLOBAL#references=http://wwwt.emc.ncep.noaa.gov/mmb/rreanl/index.html

http://www.cdc.noaa.gov/cdc/data.narr.html

Subdatasets:


SUBDATASET_1_NAME=NETCDF:"d:\databases\climate\narr\air.2m.1979.nc":lat

 SUBDATASET_1_DESC=[277x349] latitude (32-bit floating-point)


SUBDATASET_2_NAME=NETCDF:"d:\databases\climate\narr\air.2m.1979.nc":lon

 SUBDATASET_2_DESC=[277x349] longitude (32-bit floating-point)


SUBDATASET_3_NAME=NETCDF:"d:\databases\climate\narr\air.2m.1979.nc":time
_bnds

 SUBDATASET_3_DESC=[365x2] time_bnds (64-bit floating-point)


SUBDATASET_4_NAME=NETCDF:"d:\databases\climate\narr\air.2m.1979.nc":air

 SUBDATASET_4_DESC=[365x277x349] air_temperature (8-bit integer)

Corner Coordinates:

Upper Left  (    0.0,    0.0)

Lower Left  (    0.0,  512.0)

Upper Right (  512.0,    0.0)

Lower Right (  512.0,  512.0)

Center      (  256.0,  256.0)





NCDump Output:



netcdf air.2m.1979 {

dimensions:

       time = UNLIMITED ; // (365 currently)

       y = 277 ;

       x = 349 ;

       nbnds = 2 ;

variables:

       float lat(y, x) ;

               lat:long_name = "latitude coordinate" ;

               lat:units = "degrees_north" ;

               lat:axis = "Y" ;

               lat:coordinate_defines = "point" ;

               lat:standard_name = "latitude" ;

       float lon(y, x) ;

               lon:units = "degrees_east" ;

               lon:long_name = "longitude coordinate" ;

               lon:axis = "X" ;

               lon:coordinate_defines = "point" ;

               lon:standard_name = "longitude" ;

       float x(x) ;

               x:long_name = "eastward distance from southwest corner
of domain in projection coordinates" ;

               x:units = "m" ;

               x:standard_name = "projection_x_coordinate" ;

       float y(y) ;

               y:long_name = "northward distance from southwest corner
of domain in projection coordinates" ;

               y:units = "m" ;

               y:standard_name = "projection_y_coordinate" ;

       int Lambert_Conformal ;

               Lambert_Conformal:grid_mapping_name =
"lambert_conformal_conic" ;

               Lambert_Conformal:standard_parallel = 50., 50. ;

               Lambert_Conformal:longitude_of_central_meridian = -107.
;

               Lambert_Conformal:latitude_of_projection_origin = 50. ;

               Lambert_Conformal:false_easting = 5632642.22547 ;

               Lambert_Conformal:false_northing = 4612545.65137 ;

       double time(time) ;

               time:units = "hours since 1800-1-1 00:00:0.0" ;

               time:long_name = "analysis time" ;

               time:axis = "T" ;

               time:standard_name = "time" ;

               time:coordinate_defines = "start" ;

               time:delta_t = "0000-00-01 00:00:00" ;

               time:actual_range = 1569072., 1577808. ;

               time:avg_period = "0000-00-01 00:00:00" ;

       double time_bnds(time, nbnds) ;

               time_bnds:long_name = "Time Boundaries" ;

       short air(time, y, x) ;

               air:units = "K" ;

               air:long_name = "Daily Air Temperature at 2 m" ;

               air:unpacked_valid_range = 151.f, 400.f ;

               air:precision = 0.003799786f ;

               air:actual_range = 219.7989f, 312.3237f ;

               air:missing_value = 32767s ;

               air:valid_range = -32765s, 32765s ;

               air:_FillValue = -32767s ;

               air:GRIB_name = "TMP" ;

               air:GRIB_id = 11 ;

               air:var_desc = "Air temperature" ;

               air:standard_name = "air_temperature" ;

               air:level_desc = "2 m" ;

               air:dataset = "NARR Daily Averages" ;

               air:statistic = "Mean" ;

               air:parent_stat = "Individual Obs" ;

               air:grid_mapping = "Lambert_Conformal" ;

               air:coordinates = "lat lon" ;

               air:add_offset = 275.5f ;

               air:scale_factor = 0.003799786f ;

               air:cell_methods = "time: mean (of 8 3-hourly values in
one day)" ;



// global attributes:

               :standardpar1 = 50. ;

               :standardpar2 = 50.000001 ;

               :centerlon = -107. ;

               :centerlat = 50. ;

               :latcorners = 1.000001f, 0.897945f, 46.3544f, 46.63433f
;

               :loncorners = -145.5f, -68.32005f, -2.569891f, 148.6418f
;

               :stream = "s1" ;

               :title = "Daily NARR" ;

               :Conventions = "CF-1.0" ;

               :history = "On Thu Feb  9 16:48:19 2006 single precision
time renamed oldtime,\n",

                       "values transferred to double precision new time
variable.\n",

                       "created 2005 by Jeff Whitaker" ;

               :institution = "National Centers for Environmental
Prediction" ;

               :platform = "Model" ;

               :references =
"http://wwwt.emc.ncep.noaa.gov/mmb/rreanl/index.html\n";,

                       "http://www.cdc.noaa.gov/cdc/data.narr.html"; ;

}








        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: roger.biv...@nhh.no

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to