Re: [R] netCDF to GeoTIFF by layer in r

2018-03-28 Thread Ahmed Attia
Hi Ben, Adding 'band' to raster provided what I want; importnetcdf <- raster(file.nc,band=4) writeRaster(importnetcdf,file.tiff,"GTiff",overwrite=FALSE) Thanks for your help. Ahmed Ahmed Attia, Ph.D. Agronomist & Soil Scientist On Wed, Mar 28, 2018 at 11:53 AM, Ben Tupper wrote: > Hi

Re: [R] netCDF to GeoTIFF by layer in r

2018-03-28 Thread Ben Tupper
Hi Ahmed, When reading from a ncdf file you can use the 'varname', 'lvar' and 'level' arguments - see the 'Details' section in the docs https://www.rdocumentation.org/packages/raster/versions/2.6-7/topics/raster We c

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you very much Roy and Jeff for your help. I contacted dear David, the author of ncdf4 package, at first and he lead me here. Sorry for any inconvenience. I wish you success in your work. Regards, On Fri, Jul 8, 2016, 04:28 Roy Mendelssohn - NOAA Federal < roy.mendelss...@noaa.gov> wrote:

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
I have moved this over to the netcdf-group mail list, which I think is the more appropriate place at this point. You are copied, and hopefully someone from ESRL will see it and provide the proper response. HTH, -Roy > On Jul 7, 2016, at 6:02 PM, Ismail SEZEN wrote: > > Thank you Roy. If I u

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you Roy. If I use "round(uwind, digits = 2)”, all data will have 2 decimal places after decimal point. It’s ok. But How do you know you should round the number to 2 decimal digits? According to definitions of precision and least_significant_digit, should I round to 2 decimal digits or 1 de

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
After looking at the file, doing an extract say into the variable uwind, if I do: str(uwind) I see what I expect, but if I just do: uwind I see what you are seeing. Try: uwindnew <- round(uwind, digits = 2) and see if that gives you the results you would expect. HTH, -Roy > On Jul

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you Roy. I use NCEP/NCAR Reanalysis 2 data [1]. More precisely, u-wind data of the year 2015 [2]. I am also pretty sure that the variables like scale_factor or add_offset should be precise like 0.01 or 187.65 but somehow (I hope this is not an issue originated by me) they are not, includ

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Roy Mendelssohn - NOAA Federal
Hi Ismail: Can you point me to a particular netcdf file you are working with. I would like to play with it for awhile. I am pretty certain the scale factor is 0.01 and what you are seeing in rounding error (or mor precisely I should say problems with representations of floating point numbers)

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Thank you very much Jeff. I think I’m too far to be able to explain myself. Perhaps, this is the wrong list for this question but I sent it in hope there is someone has deep understanding of netcdf data and use R. Let me tell the story simpler. Assume that you read a numeric vector of data from

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Correction: ?options (not par) -- Sent from my phone. Please excuse my brevity. On July 7, 2016 3:26:06 PM PDT, Jeff Newmiller wrote: >Same as with any floating point numeric computation environment... you >don't. There is always uncertainty in any floating point number... it >is just larger in

Re: [R] netcdf data precision or least significant digit

2016-07-07 Thread Jeff Newmiller
Same as with any floating point numeric computation environment... you don't. There is always uncertainty in any floating point number... it is just larger in this data than you might be used to. Once you get to the stage where you want to output values, read up on ?round ?par (digits) and don

[R] netcdf data precision or least significant digit

2016-07-07 Thread Ismail SEZEN
Hello, I use ncdf4 and ncdf4.helpers packages to get wind data from ncep/ncar reanalysis ncetcdf files. But data is in the form of (9.18, 8.78, 7.98, 3.08, -6.818, …). I’m aware of precision and least_significant_digit attributes of ncdf4 object [1]. For uwnd data, precisio

Re: [R] Netcdf

2014-08-31 Thread Roy Mendelssohn
Not enough information to be of much help. it is unclear if you downloaded the file and failed to open from your computer, or if you are trying to connect to a remote file. If the former, when I click on the URL you posted, I get an error, but when I correct the URL I get a proper file so the

[R] Netcdf

2014-08-31 Thread Dominic Roye
Hello, I have an issue with a conection to a ncdf file. ftp://ftp.cdc.noaa.gov/Public/www/X91.116.178.214.242.12.49.49.nc open.ncdf("X91.116.178.214.242.12.49.49.nc") Error in R_nc_open: NetCDF: Unknown file format Error in open.ncdf("X91.116.178.214.242.12.49.49.nc") : Error in open.ncdf tryi

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Bea GD
11 To: Bea GD; r-help@r-project.org Subject: Re: [R] netCDF to raster and spatial projection Well no need to have your data. Usually one can find some suitable data in the help for the functions under question. So here is a reproducible example from ?meuse.grid. data(meuse.grid) coordinate

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Frede Aakmann Tøgersen
--Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Frede Aakmann Tøgersen > Sent: 16. april 2014 12:11 > To: Bea GD; r-help@r-project.org > Subject: Re: [R] netCDF to raster and spatial projection > > Well no need to

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Frede Aakmann Tøgersen
//www.vestas.com/> Company reg. name: Vestas Wind Systems A/S This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice<http://www.vestas.com/legal/notice> If you have received this e-mail in error please contact the sender. From: Bea GD [

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Bea GD
D. > Plant Performance & Modeling > > Technology & Service Solutions > T +45 9730 5135 > M +45 2547 6050 > fr...@vestas.com > http://www.vestas.com > > Company reg. name: Vestas Wind Systems A/S > This e-mail is subject to our e-mail disclaimer statement. >

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Frede Aakmann Tøgersen
ase refer to www.vestas.com/legal/notice If you have received this e-mail in error please contact the sender. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Beatriz R. Gonzalez Dominguez > Sent: 16. april 2014 08:2

[R] netCDF to raster and spatial projection

2014-04-15 Thread Beatriz R. Gonzalez Dominguez
I've recently started using R for spatial data. I'd be really grateful if you could could help me with this. Thanks! Sorry I don't provide a reproducible example. Please ask me if you have any questions about the data. I've extracted data from a multidimensional netCDF file. This file had lo

[R] netCDF to raster and projection to UTM: output NA

2013-09-27 Thread gabriela bucini
Dear R colleagues, I'm facing a problem with the projection of a netCDF file. My original netCDF file is in lat/lon coordinates and I want to project it in UTM. I use the raster package with the function"raster" to open the file and then "projectRaster" to change projection (I want to maintain a s

Re: [R] Netcdf file in R

2013-02-22 Thread Jon Olav Skoien
I would also suggest the package raster, which usually make it much easier to extract spatial NetCDF-data than direct use of the NetCDF-packages. Bests, Jon On 22-Feb-13 17:14, Marc Schwartz wrote: NetCDF is a binary file format and will be stripped by the list server filters. Don't bother a

Re: [R] Netcdf file in R

2013-02-22 Thread Marc Schwartz
NetCDF is a binary file format and will be stripped by the list server filters. Don't bother attaching it unless the two of you want to communicate off-list. Anup has not indicated what he has actually tried to do to read in the file. R will not natively read NetCDF files, so he will need to use

Re: [R] Netcdf file in R

2013-02-22 Thread Michael Sumner
There are at least three packages that can read NetCDF in native form, RNetCDF, ncdf and ncdf4. There are other options. Explore these ones. Cheers, Mike. On Sat, Feb 23, 2013 at 2:48 AM, Gyanendra Pokharel wrote: > I can't see your attached file. Can you re-attache it? > Thanks > Gyanendra Pok

Re: [R] Netcdf file in R

2013-02-22 Thread Gyanendra Pokharel
I can't see your attached file. Can you re-attache it? Thanks Gyanendra Pokharel University of Guelph Guelph, ON On Fri, Feb 22, 2013 at 7:58 AM, Anup khanal wrote: > > Good afternoon, > I am a new in R. I have to work with large climate data.I am not able to > read the netcdf file. Can anyone

[R] Netcdf file in R

2013-02-22 Thread Anup khanal
Good afternoon, I am a new in R. I have to work with large climate data.I am not able to read the netcdf file. Can anyone try with this file attached ? Best Regards, ..Anup KhanalNorwegian Institute of science and Technology (NTNU)Trondheim, NorwayMob:(+47) 45174313

Re: [R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-30 Thread Roger Bivand
Douglas M. Hultstrand metstat.com> writes: > > Hello R-Group, > > I am new working with netcdf files and the raster package in R.I am > trying to read in a netcdf file using the package "ncdf".I am able to > get the lat, lon and parameter I need and can plot using > fill.contour. Please pos

Re: [R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-29 Thread Pascal Oettli
Hello, I don't understand why you need to use R first, as GRASS and ArcGIS are able to read NetCDF files. Regards, Pascal Le 30/01/2013 00:37, Douglas M. Hultstrand a écrit : Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file

[R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-29 Thread Douglas M. Hultstrand
Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file using the package "ncdf".I am able to get the lat, lon and parameter I need and can plot using fill.contour.Ultimately, I am trying to create a .asc file to reafd into GIS.I am u

Re: [R] NetCDF, open *.nc

2011-07-11 Thread Barry Rowlingson
On Mon, Jul 11, 2011 at 2:57 PM, kokavolchkov wrote: > mode="wb": AFAIK You have taken the professor somewhat too literally. "AFAIK" means "As Far As I Know". The 'mode="wb"' goes *inside* the download.file function call. It modifies the default behaviour of download.file. STL (SomeThing Lik

Re: [R] NetCDF, open *.nc

2011-07-11 Thread Roy Mendelssohn
did you check that the file was actually downloaded correctly and is a valid netcdf file? My guess. particularly on Windows, is that for the download.file statement you need to add that mode="wb" to the command. -Roy M. On Jul 11, 2011, at 6:57 AM, kokavolchkov wrote: > Well, if I use this sc

Re: [R] NetCDF, open *.nc

2011-07-11 Thread kokavolchkov
Well, if I use this script: library(ncdf) link <- "http://ibis.grdl.noaa.gov/SAT/SeaLevelRise/slr/slr_sla_gbl_free_all_66.nc"; dest <- "C:/temp/slr_sla_gbl_free_all_66.nc" mode="wb": AFAIK download.file(url=link,destfile=dest) nc1 <- open.ncdf(dest) compiler prints: Error in R_nc_open: Inva

Re: [R] NetCDF, open *.nc

2011-07-11 Thread Prof Brian Ripley
On Mon, 11 Jul 2011, kokavolchkov wrote: *Good day!* I'm using Vista(x64) and R 2.13.0(x64) (with ncdf and RnetCDF packs) *I have a problem:* I'm trying to open **.nc* file and I use this script (http://r.789695.n4.nabble.com/Problem-downloading-and-opening-netcdf-file-td3046897.html#a3046965)

[R] NetCDF, open *.nc

2011-07-11 Thread kokavolchkov
*Good day!* I'm using Vista(x64) and R 2.13.0(x64) (with ncdf and RnetCDF packs) *I have a problem:* I'm trying to open **.nc* file and I use this script (http://r.789695.n4.nabble.com/Problem-downloading-and-opening-netcdf-file-td3046897.html#a3046965) library(ncdf) link <- "http://ibis.grdl.

[R] NetCDF - rolling means and StdDev

2011-03-26 Thread Steve Friedman
Hello, I am trying to come up with a routine to calculate a rolling mean and standard deviation for three parameters stored in a NetCDF file. The NetCDF file contains 10 years of daily records for each of the three parameters, and I need the statistics for each of the three parameters. Below I i

Re: [R] NetCDF file: adding a variable

2010-09-23 Thread David Pierce
Hi Gennadi, I think this is fixed in the latest version of the ncdf package, which you can access by going to CRAN, then 'packages', then 'ncdf', and clicking on 'URL'. Or here is a direct link: http://cirrus.ucsd.edu/~pierce/ncdf Give that a try and let me know if you still have a problem, --

[R] NetCDF file: adding a variable

2010-09-23 Thread Gennadi Lessin
I am trying to create a NetCDF file with bathymetry (a matrix) and then to add a grid type (an integer) as variables. This is the relevant part of the code: library(ncdf) wfile="my_file.nc" msv=-10 grdtp=2 # Dimensions d1=dim.def.ncdf("lon","degrees",as.double(lon)) d2=dim.def.ncdf("lat","degrees

[R] NetCDF output in R

2009-11-13 Thread nana
Dear Users, I have corrected the errors. Many thanks. For this error, > [1] "put.var.ncdf: warning: you asked to write 1440 values, but the passed > data array has 37440 entries!" I added start= c(1,1,1), count=c(length(lons),length(lats),length(nt)) in the put.var.ncdf function. so put.var.n

Re: [R] NetCDF output in R

2009-11-10 Thread tlumley
On Tue, 10 Nov 2009, nana wrote: I will be glad if someone can point out what I am doing wrong or not doing at all in this. Sending the same message to both r-help and r-devel is one thing you are doing wrong. I am trying to write out netcdf file in R. I have 26 time step but only the fir

[R] NetCDF output in R

2009-11-10 Thread nana
Dear R users, I will be glad if someone can point out what I am doing wrong or not doing at all in this. I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(path

[R] NetCDF output in R

2009-11-10 Thread nana
Dear CSAG R users, I will be glad if someone can point out what I am doing wrong or not doing at all in this. I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(

Re: [R] NetCDF within R: installation assistance

2008-12-23 Thread Prof Brian Ripley
On Tue, 23 Dec 2008, Ken Schmidt wrote: Greetings. I am attempting to add NetCDF libraries within R, and have failed. We have R version 2.8, and are running on a 64-bit Redhat Linux 2.6.18 kernel: Red Hat Enterprise Linux Client release 5.2 (Tikanga) Linux halfmoon.ncdc.noaa.gov 2.6.18-92.1

[R] NetCDF within R: installation assistance

2008-12-23 Thread Ken Schmidt
Greetings. I am attempting to add NetCDF libraries within R, and have failed. We have R version 2.8, and are running on a 64-bit Redhat Linux 2.6.18 kernel: Red Hat Enterprise Linux Client release 5.2 (Tikanga) Linux halfmoon.ncdc.noaa.gov 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5 09:28:22 EST 200

Re: [R] netCDF to TIFF

2008-07-09 Thread Yasir Kaheil
the function is there in grDevices http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/png.html type ? png if tiff() is not listed, you need to update R to get the new base with new grDevices. thanks y Daniel Steinberg wrote: > > Greetings R users! > > I am working with the ENSEM

[R] netCDF to TIFF

2008-07-09 Thread Daniel Steinberg
Greetings R users! I am working with the ENSEMBLE climate data (10 min resolution daily temperatures images for all of Europe 1950-2006). The data comes packaged in a single netCDF file. I would like to read the data in and export a subset (2002-2006) as geotiffs (one image per day). So far, I can