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

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

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
Hi Frede, Thanks so much for your reply! I've tried what you said but I get the following error: Error in spTransform(rasterDF1, crs("+init=epsg:21781")) : load package rgdal for spTransform methods I've checked search() and rgdal is before sp. >search() [1] ".GlobalEnv""package:

Re: [R] netCDF to raster and spatial projection

2014-04-16 Thread Frede Aakmann Tøgersen
Hi Beatriz Try to skip this step > # Reprojecting into CH1903_LV03 > # First, change the coordinate reference system (crs) > proj4string(rasterDF1) <- "+init=epsg:21781" And just do this > # Second, reproject the raster > rasterDF1.CH <- spTransform(rasterDF1, crs("+in

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

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

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)

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, --

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

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

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