[R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-21 Thread Frederico Faleiro
Dear list, I am using some netCDF files from the CMIP5 climate models in raster package, but I am having some issues with one model. The netCDF file from the GFDL-ESM2G model (e.g. http://aims3.llnl.gov/thredds/fileServer/css03_data/cmip5/output1/NOAA-GFDL/GFDL-ESM2G/rcp45/mon/atmos/Amon/r1i1p1/v

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-21 Thread Edzer Pebesma
I would be happy to look into this, but the file you point to requires authentification. On 8/22/19 5:52 AM, Frederico Faleiro wrote: > Dear list, > > I am using some netCDF files from the CMIP5 climate models in raster > package, but I am having some issues with one model. > The netCDF file fro

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Michael Sumner
raster does the wrong thing here in my opinion, the right outcome is to give a grid in index-extent (0, ncol, 0, nrow) and with no projection metadata (crs). There will be coordinate arrays in this file, and they need to be handled as though they are data (with local, x*y dependent values in every

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Frederico Faleiro
Dear list, sorry about the file. The files from the CMIP5 are public, but need a registration first. You can access the same file in any of these links: https://www.sendspace.com/file/famgz3 and https://drive.google.com/file/d/1L1T03iQ6LU1yYRYeRypxwMB3E7fLjkJI/view?usp=sharing . In this meantime I

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Edzer Pebesma
Thanks! stars::read_stars (GDAL) won't read coordinates or coordinate reference system from this file, confirmed by running gdalinfo on it. stars::read_ncdf (installing stars from github) reads it like this: library(stars) # Loading required package: abind # Loading required package: sf # Linkin

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Frederico Faleiro
Dear list, I do not understand why only this model have this issue. I can open many other files from other models without any issue in raster package. *Roy*, I test with different model (i.e GFDL-CM3) from NOAA ( https://drive.google.com/file/d/1GrfvbRSH_FpDmlRrqNGXqn6Tz13fjhB6/view?usp=sharing)

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Roy Mendelssohn - NOAA Federal via R-sig-Geo
Hi Frederico: There are two separate issues here from my point of view. The first is are both files CF compliant, and as far as I can tell they both are, and applications like Panoply or ncdf4 that understand CF compliant files read them just fine. The second issue is why can't raster or st

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Frederico Faleiro
I agree with you Roy. The problem is that the ncdf4 package is focused in read and write netCDF files, but apparently it is difficult "communicate" with the other packages. Could you share an example code of your approach described in the last paragraph? Best regards, Frederico On Thu, Aug 22,

Re: [R-sig-Geo] Error in netCDF file: cells are not equally spaced

2019-08-22 Thread Roy Mendelssohn - NOAA Federal via R-sig-Geo
If you do: ?raster for example (or ?brick) you will see both commands are for want of a better term "overloaded" and have methods for objects of type matrix or type array, with optionally the coordinates given. Extract the data and coordinate using ncdf4, pass to raster() or brick(). I