[R] HIRHAM netcdf files

Ana rrasterr at gmail.com
Fri Jul 29 17:03:33 CEST 2011


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 at ucsd.edu> wrote:
> On Fri, Jul 29, 2011 at 7:44 AM, Ana <rrasterr at 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 at ucsd.edu
>
>



More information about the R-help mailing list