Skip to content

climate data, Netcdf

2 messages · Amen, Roy Mendelssohn - NOAA Federal

#
I am a PhD student working on global scale. I am working at INRA in France.I
am new to R

I downloaded a netcdf file           cruncep_tair_2010.nc.gz   from
http://dods.extra.cea.fr/data/p529viov/cruncep/t2m/

in this file, temperature was measured every 6 hours for 2010, I want to
convert to daily and then calculate the max ,min ,average daily temperature
I will appreciate it very much if you kindly help me. 

 How can I see the data using R, just to look at the table and then
manipulate it

I am attaching the tem for one location  45 .13 (log,lat) .(I extracted it
using GIS but I don't know if I extracted them correctly)
As you can see:

time  is from 1 to 1460, 1 means they the measure tem for the globe at 
the first 6 hours , 2=after 12 hours .....; and so on 1460 *6 = 8760 
hours which equals 1 year

first of all I want to convert from kelvin to degree

1
2
3
4   ------     1  (min,max,averag)day        one map(file) for the globe
5
6
7
8  ------     2                            second map(file) 
for the
.
;
;
;
1460 ------- 365 days


so in the end will develop       365  file   for            daily min Tem
                                 365  file for            daily max   Tem
                                365  file   for        average  daily Tem

Thanks in advance

--
View this message in context: http://r.789695.n4.nabble.com/climate-data-Netcdf-tp4474329p4474329.html
Sent from the R help mailing list archive at Nabble.com.
#
Hi Amen:
On Mar 15, 2012, at 2:19 AM, Amen wrote:

            
First, install the package "ncdf4". How you do that will depend on the operating system you are using.  On Mac OS and Linux, the normal package manager will work, for Windows it is available from the developers site.

Second, assuming tat you have unzipped the file, do the following  commands to get yourself started:

library(ncdf4)
cruncepFile<-nc_open(' cruncep_tair_2010.nc')
cruncepFile
?ncdf4

Since you want to use R, it would be worth your while at that point to read through the R documentation to learn to do basic manipulations of data that is in your workspace.

HTH,

-Roy M.


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn at noaa.gov (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.