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 seem to be "normal" geographical coordinates. Just extract them 
and you should have your grid.

A really quick and dirty hack would be to use ncrename to rename the 
dimensions into lat/long....




Jannis


P.S. I always wondered why the following made it into the posting guide:

When responding to a very simple question, use the following algorithm:

 1. compose your response
 2. type |4*runif(1)| at the R prompt, and wait this many hours
 3. check for new posts to R-help; if no similar suggestion, post your
    response

After reading our 4 responses to your first post, I know why ;-)


On 07/29/2011 05:03 PM, Ana wrote:
> 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 lat. However I have no clue what lat or what long I should
> use.
>
> Here is the ncdump:
>
> 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" ;
> 		lat:units = "degrees_north" ;
> 	float lon(rlat, rlon) ;
> 		lon:standard_name = "longitude" ;
> 		lon:long_name = "longitude" ;
> 		lon:units = "degrees_east" ;
> 	float precip(time, rlat, rlon) ;
> 		precip:units = "kg m-2 day-1" ;
> 		precip:standard_name = "precipitation_amount" ;
> 		precip:long_name = "Precipitation" ;
> 		precip:cell_methods = "time: mean" ;
> 	float rlat(rlat) ;
> 		rlat:axis = "Y" ;
> 		rlat:standard_name = "rotated_latitude" ;
> 		rlat:long_name = "rotated latitude" ;
> 		rlat:units = "degrees" ;
> 	float rlon(rlon) ;
> 		rlon:axis = "X" ;
> 		rlon:standard_name = "rotated_longitude" ;
> 		rlon:long_name = "rotated longitude" ;
> 		rlon:units = "degrees" ;
> 	float time(time) ;
> 		time:axis = "T" ;
> 		time:calendar = "360_day" ;
> 		time:long_name = "time" ;
> 		time:bounds = "time_bnds" ;
> 		time:units = "days since 2071-01-01 00:00:00.0" ;
> 	float time_bnds(time, time_bnds) ;
> 	char rotated_pole ;
> 		rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ;
> 		rotated_pole:grid_north_pole_latitude = 37.f ;
> 		rotated_pole:grid_north_pole_longitude = -153.f ;
>
> // global attributes:
> 		:Conventions = "CF1.0" ;
> 		:source = "HIRHAM" ;
> 		:experiment = "HS1" ;
> 		:institution = "DMI" ;
> }
>
>
> On Fri, Jul 29, 2011 at 3:57 PM, David William Pierce<dpierce@ucsd.edu>  wrote:
>> On Fri, Jul 29, 2011 at 7:44 AM, Ana<rrasterr@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 and in time and I
>>> also know the area that this file should cover, however I have no idea
>>> regarding the reference for both LAT/LON and RLAT/RLON.
>>>
>>> I tried already tried is ArcGIS to give the Lambert Conformal Conic
>>> projection as the spatial reference, by default arcgis gets the rlat and
>>> rlon for coordinates. however the resulting raster is displaced from were
>>> it
>>> should be.
>>>
>>> Can someone help me with this?
>> Hello,
>>
>> I can't tell if you're asking:
>>
>> * How to tell what information is in your netcdf file,
>>
>> * How to get the data you need out of your netcdf file,
>>
>> * How to interpret the data you are getting from the netcdf file.
>>
>> Perhaps you could be a bit clearer?
>>
>> As a suggestion, try "ncdump -h<filename.nc>" and look to see what
>> information is in your file. Is it what you expected&  need?
>>
>> Regards,
>>
>> --Dave
>>
>>
>> --
>> David W. Pierce
>> Division of Climate, Atmospheric Science, and Physical Oceanography
>> Scripps Institution of Oceanography
>> (858) 534-8276 (voice)  /  (858) 534-8561 (fax)    dpierce@ucsd.edu
>>
>>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


	[[alternative HTML version deleted]]

