Skip to content

netcdf

2 messages · Matt Pocernich, antonio rodriguez

#
Hello,

I have been having difficulties opening netcdf files using the netcdf
library.  I am able to successfully open the file and I can determine the
names and size.  However, when I try to read it I receive an error.
Reading the documentation, I am wondering if this might be due to a
difference between netcdf version 2 and more recent netcdf format? I've
tried using different values for the count option without luck.  I have
had success reading this file into matlab.
[1] "netCDF"
netCDF file /scratch/pocernic/int_fcst.20021201.0010.nc is open
$types
 [1] "integer" "numeric" "numeric" "integer" "integer" "integer" "single"
 [8] "single"  "single"  "single"  "single"  "single"  "single"  "single"
[15] "single"  "single"  "single"  "single"  "single"  "single"  "single"
[22] "single"  "single"  "single"  "single"
 ... etc

## when I try to read it, I get the following error.
Error: dim: Invalid dimension vector

Thanks

Matt

Matt Pocernich
NCAR - Research Applications Group
303-497-8312
#
Hi Matt,

I use the following procedure after opening a netcdf file:

library(netCDF)
wind<-read.netCDF("C:/To?o/datos/fnomc_nc/wind.nc")
str(wind)
a<-wind$"UV_MAG_MEAN"
a[a == attributes(a)$"missing_value"] <- NA
dimnames(a) <-
list(wind$"TIME_SERIES",wind$"LAT125_128",wind$"LON351_354")

Hope this helps

Cheers,

Antonio Rodriguez