Displaying 19 results from an estimated 19 matches for "nc_open".
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
I have a series of nertCDF files containing global data for a particular
variable, e.g. tmin/tmax/precipiation/windspeed/relative
humuidity/radiation etc. I get the following information when using
*nc_open* function in R:
datafile: https://www.dropbox.com/s/xpo7zklcmtm3g5r/gfdl_preci.nc?dl=0
File gfdl_preci.nc (NC_FORMAT_NETCDF4_CLASSIC):
1 variables (excluding dimension variables):
float prAdjust[lon,lat,time]
_FillValue: 1.00000002004088e+20
missing_value: 1.00000...
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
...file containing three variables for Switzerland. All data outside of the country are NAs. The third variable is calculated from the first two variables. Basically there is no problem to do that. I copy the file with the data of the first variable, open this file with 'write=TRUE' (nc1 <- nc_open()), read the data to 'var1', open the other file (nc2 <- nc_open()), read the data to variable 'var2', put this variable to the file (nc1) and calculate the third variable based on var1 and var2.
So far everything is fine. But I figured out that when I write the data 'var2...
2017 Aug 28
0
Extracting subset from netCDF file using lat/lon and converting into .csv in R
...Aug 28, 2017, at 2:21 PM, Eeusha Nafi <eshad002 at gmail.com> wrote:
>
> I have a series of nertCDF files containing global data for a particular
> variable, e.g. tmin/tmax/precipiation/windspeed/relative
> humuidity/radiation etc. I get the following information when using
> *nc_open* function in R:
>
> datafile: https://www.dropbox.com/s/xpo7zklcmtm3g5r/gfdl_preci.nc?dl=0
>
> File gfdl_preci.nc (NC_FORMAT_NETCDF4_CLASSIC):
>
> 1 variables (excluding dimension variables):
> float prAdjust[lon,lat,time]
> _FillValue: 1.00000002004088e...
2016 Apr 22
2
Unexpected values obtained when reading in data using ncdf and ncdf4
...ering a problem when reading nc files into R using the ncdf and ncdf4 libraries. The nc files are too large to attach an example (but if someone is interested in helping out I could send a file privately via an online drive), but the code is basic:
for(i in 1:length(thesenames[,1])){
data <- nc_open(paste(INDIR, thesenames[i,c("wholename")], sep=""), write=F)
d.vars <- names(data$var)
d.size <- (data$var[[length(d.vars)]])$size
# Obtaining longitude and latitude values
d.lon <- as.vector(ncvar_get(data, varid="lon", start=c(1,1), count=c(d.si...
2017 Aug 14
0
ncdf4: Why are NAs converted to _FillValue when saving?
...three variables for Switzerland. All data outside of the country
> are NAs. The third variable is calculated from the first two variables.
> Basically there is no problem to do that. I copy the file with the data of
> the first variable, open this file with 'write=TRUE' (nc1 <- nc_open()),
> read the data to 'var1', open the other file (nc2 <- nc_open()), read the
> data to variable 'var2', put this variable to the file (nc1) and calculate
> the third variable based on var1 and var2.
>
> So far everything is fine. But I figured out that when I wr...
2016 Apr 22
0
Unexpected values obtained when reading in data using ncdf and ncdf4
...e ncdf and ncdf4 libraries. What are the details --
what operating system are you running on, what version of R and the netcdf
library are you using?
If you make the files available to me I can take a look.
Regards,
--Dave Pierce
?
> for(i in 1:length(thesenames[,1])){
> data <- nc_open(paste(INDIR, thesenames[i,c("wholename")], sep=""),
> write=F)
> d.vars <- names(data$var)
> d.size <- (data$var[[length(d.vars)]])$size
>
> # Obtaining longitude and latitude values
> d.lon <- as.vector(ncvar_get(data, varid="lon"...
2018 Mar 28
3
Creating the right table from lapply list
...the variable from each file will be 696 to 744 (depending on how many days x 24 hours there were in the month).What I achieved is to to read the values from all 12 files stored in directory with a function and add them as vectors to a lapply-list:
Myfunction <- function(filename) {
nc <- nc_open(filename)
lon <- ncvar_get(nc, "lon")
lat <- ncvar_get(nc, "lat")
RW <- ncvar_get(nc, "X")
HW <- ncvar_get(nc, "Y")
pt.geo <- c(8.6810 , 50.1143)
dist <- sqrt( (lon - pt.geo[1])^2 + (lat - pt.geo[2])^2 )
ind <- which(dist==min(dist...
2018 Mar 28
0
netCDF to GeoTIFF by layer in r
...c.water.content.at..33.kPa' If you want to know more about the what is in the file, then I suggest you use the ncdf4 package to open the file and explore it's contents - you should get a clear picture of it's contents from that. Something like this (untested)...
library(ncdf4)
x <- nc_open(file.nc)
x
nc_close(x)
While print lots of info about the file.
Ben
> On Mar 28, 2018, at 10:37 AM, Ahmed Attia <ahmedatia80 at gmail.com> wrote:
>
> Hi
>
> I have a netCDF file of volumetric soil water content at four
> different soil layers and want to convert each so...
2018 Mar 29
0
Creating the right table from lapply list
...ach file will be 696 to 744 (depending on how many days x 24 hours there were in the month).What I achieved is to to read the values from all 12 files stored in directory with a function and add them as vectors to a lapply-list:
Myfunction <- function(filename) {
nc <- nc_open(filename)
lon <- ncvar_get(nc, "lon")
lat <- ncvar_get(nc, "lat")
RW <- ncvar_get(nc, "X")
HW <- ncvar_get(nc, "Y")
pt.geo <- c(8.6810 , 50.1143)
dist <- sqrt( (lon - pt.geo[1])^2 + (lat - pt.geo[2])^2 )
in...
2011 Sep 05
1
Receive "unable to load shared object RNetCDF.o" during R INSTALL of RNetCDF
...ther we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking for nc_open in -lnetcdf... yes
checking for utInit in -ludunits2... no
checking for utScan in -ludunits2... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... no
che...
2010 Mar 24
1
install ncdf package
...for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking netcdf.h usability... yes
checking netcdf.h presence... yes
checking for netcdf.h... yes
Found netcdf.h in: .
checking for nc_open in -lnetcdf... yes
Found netcdf library file libnetcdf.a in directory .
configure: creating ./config.status
config.status: creating R/load.R
config.status: creating src/Makevars
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -I. -I/usr/local/include -fpic -O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=...
2013 Feb 05
1
ncdf4 installation problem: undefined symbol [SEC=UNCLASSIFIED]
...pSxjZ1u/R.INSTALL3e7b250a942e/ncdf4/man/ancdf4.Rd:76: missing file link 'ncvar_put'
ancvar_put html
nc_close html
nc_create html
nc_enddef html
nc_open html
nc_redef html
nc_sync html
nc_version html
ncatt_get html
ncatt_put html
n...
2012 Aug 28
4
[ncdf4] error converting GEIA data to netCDF
summary: I can successfully ncvar_put(...) data to a file, but when I
try to ncvar_get(...) the same data, I get
> Error in if (nc$var[[li]]$hasAddOffset) addOffset = nc$var[[li]]$addOffset else addOffset = 0 :
> argument is of length zero
How to fix or debug?
details:
R code @
https://github.com/TomRoche/GEIA_to_NetCDF
successfully (if crudely) uses R packages={ncdf4, maps, fields}
2009 Aug 13
1
ncdf
...for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking netcdf.h usability... yes
checking netcdf.h presence... yes
checking for netcdf.h... yes
Found netcdf.h in: .
checking for nc_open in -lnetcdf... yes
Found netcdf library file libnetcdf.a in directory .
configure: creating ./config.status
config.status: creating R/load.R
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/lib64/R/include -I/usr/lib64/R/include -I.
-I/usr/local/include -fpic -g -O2 -c ncdf2.c -o...
2018 Mar 28
2
Fwd: netCDF to GeoTIFF by layer in r
Hi
I have a netCDF file of volumetric soil water content at four
different soil layers and want to convert each soil layer in the
netCDF file to a GeoTIFF layer. This code converts the netCDF file to
one GeoTIFF layer, i.e. unclear which soil depth.
file.nc <- "C:/Soil_Weather_data/Agro/VMC21/VMC21.nc"
file.tiff <- "C:/Soil_Weather_data/Agro /VMC21/VMC21"
importnetcdf
2013 Mar 07
1
install error - Netcdf library (linux)
...declaration of function ?nc_inq_unlimdims? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_inq?:
ncdf.c:451:2: warning: implicit declaration of function ?nc_inq? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_open?:
ncdf.c:475:2: warning: implicit declaration of function ?nc_open? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_create?:
ncdf.c:499:15: error: ?NC_SHARE? undeclared (first use in this function)
ncdf.c:501:15: error: ?NC_64BIT_OFFSET? undeclared (first use in this function)
ncdf.c:503:15: error: ?NC_NETCDF4? undeclared (first use in this function)...
2013 Mar 07
0
install Netcdf library (linux)
...declaration of function ?nc_inq_unlimdims? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_inq?:
ncdf.c:451:2: warning: implicit declaration of function ?nc_inq? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_open?:
ncdf.c:475:2: warning: implicit declaration of function ?nc_open? [-Wimplicit-function-declaration]
ncdf.c: In function ?R_nc4_create?:
ncdf.c:499:15: error: ?NC_SHARE? undeclared (first use in this function)
ncdf.c:501:15: error: ?NC_64BIT_OFFSET? undeclared (first use in this function)
ncdf.c:503:15: error: ?NC_NETCDF4? undeclared (first use in this function)...
2008 Jan 22
1
install ncdf package on a 64-bit machine
Dear All,
I recently got a 64bit machine and had netcdf-3.6.2 installed. Then I tried
to install ncdf package but got the following error message when using
netcdflib:
gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
-I/home/ljin/share/R-2.6.1/include
-I. -I/usr/local/include -fpic -g -O2 -c ncdf2.c -o ncdf2.o
gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include
2009 Nov 06
1
centos 5.3 install ncview X libraries error and netcdf header error
I was trying to install software named ncview on a centos 5.3 box.
./configure command gave this error:
Error, the X libraries and development headers must be installed for ncview
to work!
I was surprised that there were many google hits related to ubuntu, none for
centos. So even though I eventually figured out what to do, I decided to
share this with the list anyhow, so maybe next time I