[R] HIRHAM netcdf files

2011-07-29 Thread Ana
Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space and in time and I also know the area that this file should cover,

Re: [R] HIRHAM netcdf files

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 10:44 AM, Ana wrote: Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space and in time and I

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
I am not familiar with the HIRHAM netcdf files. Do you have the netcdf library installed and can you print the output of the ncdump -h command on one of the files? -Roy On Jul 29, 2011, at 7:44 AM, Ana wrote: Can someone help me out with a small problem? I've started using netcdf files

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Jannis
This problem may be more related to netcdf files than to RAnd the answer to your question very much depends on which netcdf convention the AWI folks who created your data followed. Additionally it depends on the Software you use to read these ncdf files. Regarding the grid locations

Re: [R] HIRHAM netcdf files

2011-07-29 Thread David William Pierce
On Fri, Jul 29, 2011 at 7:44 AM, Ana rrast...@gmail.com wrote: Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Ana
Hi Roy and David, My main problem is how to interpret the coordinate system. If I try to open it directly in a GIS software that supports necdf format, the location is far away from where it should be (plots rlong,rlat). All I want to do is to get a data.frame with a column for long, another for

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
Hi Ana: On Jul 29, 2011, at 8:03 AM, Ana wrote: netcdf precip.DMI.HS1 { dimensions: rlat = 84 ; rlon = 90 ; time = 10800 ; time_bnds = 2 ; variables: float lat(rlat, rlon) ; lat:standard_name = latitude ; lat:long_name = latitude

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Jannis
Well, the CF ncdf convention (for example) suggests to use variables with identical names as the dimensions as coordinate variables. In your case the dimensions are called rlat/rlong so the software uses these rotated axes. In your file you however also have variables lat and long and they

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Barry Rowlingson
       float lat(rlat, rlon) ;                lat:standard_name = latitude ;                lat:long_name = latitude ;                lat:units = degrees_north ;        float lon(rlat, rlon) ;                lon:standard_name = longitude ;                lon:long_name = longitude ;        

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
The rlat and rlon variables are the grid coordinate system, which appears to be some non-standard conical projection. Climate scientists! Actually this file, as it contents state, follow the CF convention, which is widely used in climate science, oceanography and atmospheric science

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Ana
Hi! Thank you all. I finally understood the way to solve the problem from Barry's mail. From the file created with coordinates(Lat,Long) using fan, everything looks ok (wgs84). I will now try Bryan's approach in R. Ana On Fri, Jul 29, 2011 at 4:22 PM, Barry Rowlingson

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Barry Rowlingson
On Fri, Jul 29, 2011 at 4:32 PM, Roy Mendelssohn roy.mendelss...@noaa.gov wrote: Actually this file, as it contents state, follow the CF convention, which is widely used in climate science, oceanography and atmospheric science  (see http://cf-pcmdi.llnl.gov/documents/cf-conventions).  The