Skip to content

Gridding a daily time series in R

3 messages · Cristo Facundo Pérez, Sarah Goslee, Roy Mendelssohn - NOAA Federal

#
Dear community,

I have a daily time series of precipitation, which I intend to transform it
into a single NetCDF file of daily precipitation. So, first, I would like
to explore the best way to impute missing values, grid the daily values of
the different available weather stations and get daily raster files into a
.nc format. I have read about different climate/hydrological packages such
as "hyfo",  "meteoland", "gstat" and "hydroTMS". However, I haven't found a
 way to do it. I am a beginner in spatial/temporal analysis with R. So, my
question is *does anybody have experience/document in developing a similar
task so I can get some ideas?*

My database contains id, date, cod, lon, lat, elev, and precipitation value
of 41 climate stations for the period 1980-2018. I have NAs values in the
database. I organised my database in two datasets:

1. where the first column presents date and the other 50 columns present a
climate station, while rows present the values/NAs [14245 observations of
42 variables].

2. where the name, long, lat, and elev, are presented in the columns. 4
columns presenting information of 41 weather stations.

I would appreciate any input, idea or suggestion to find a way out to grid
the daily time series and get the ".nc" file.

Thank you,

Cristo Facundo P?rez
#
Hi,

Creating the NetCDF file is easy - there are multiple packages to do that.

Everything else you ask about is hard, and not really R questions.

You need to know:

What is the best way to impute missing precipitation data to fit my needs?

What is the best way to grid point-based precipitation data to fit my needs?

Both of these are very complex, and questions better suited to experts
in the field. At the very least, you need to review the copious
existing statistical literature on those topics. Once you have the
theoretical questions answered, the question of "How do I do this in
R?" might be suitable for the list.

But honestly, you are probably better off finding extant gridded data
for your region, rather than trying to do it yourself.

Sarah
On Thu, Sep 12, 2019 at 11:21 AM Cristo Facundo P?rez <crifep at gmail.com> wrote:

  
    
#
Can I  just gently amend this statement.  Writing an arbitrary netCDF file is easy,  writing a useful netCDF file is hard. The difference is the first just pretty much dumps the data,  while the second has files with all the proper metadata and naming conventions and units that follow one of the conventions,  say the CF conventions and names  (http://cfconventions.org).  I strongly urge anyone creating netCDF files to take the time to learn how to create a file that will be really useful for others down the line.

-Roy


**********************
"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
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: https://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.