Skip to content

OPeNDAP access / OPeNDAP subsetting with R

7 messages · Debasish Pai Mazumder, Roy Mendelssohn - NOAA Federal, Michael Sumner

#
#
Look at the package ncdf4.  You can use an OPeNDAP URL in place of the file name to perform subsets.,

-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 address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov 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.
#
Hi Roy,
Thanks for your response. I have tried according your suggestion but it
doesn't work.
the OPeNDAP link of the data
http://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cfsv2_
forecast_ts_9mon/2014/201404/20140403/2014040312/

datafile:
tmax.01.2014040312.daily.grb2

Thanks
-Deb

On Tue, Sep 27, 2016 at 11:51 AM, Roy Mendelssohn - NOAA Federal <
roy.mendelssohn at noaa.gov> wrote:

            

  
  
#
Please post the code of what you tried, as I have no idea otherwise what did or did not work for you.

-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 address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov 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.
#
Opendap won't work on Windows CRAN build of ncdf4, though the rgdal build
does work directly on grib.

Summary: download the files wholus for use on Windows, or set your own
system on Linux.

Building ncdf4 on Windows is not too hard if you know about doing that.

Cheers, Mike

On Wed, 28 Sep 2016, 06:49 Roy Mendelssohn - NOAA Federal <
roy.mendelssohn at noaa.gov> wrote:

            
2 days later
#
Hi
Now I am using netcdfSubset and I am able to download the file but not sure
how to read the files. here my scripts
library("ncdf4")

gribfile<-"
http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Pacific_40km/best/dataset.html
"
download.file(gribfile,basename(gribfile),mode = "wb")
x<-nc_open(gribfile)

gribfile<-"
http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p5deg/best?north=47.0126&west=-114.841&east=-112.641&south=44.8534&time_start=present&time_duration=PT3H&accept=netcdf&var=v-component_of_wind_height_above_ground,u-component_of_wind_height_above_ground"

download.file(gribfile,basename(gribfile),mode = "wb")
x<-nc_open(gribfile)


nc_open doesn't work.

which command should I use?

with regards
-Deb
On Tue, Sep 27, 2016 at 9:30 PM, Michael Sumner <mdsumner at gmail.com> wrote:

            

  
  
#
Hi Deb:
<snip>

I cut off the rest as that is not important for your question.

HTH,

-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 address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov 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.