Skip to content
Prev 28907 / 29559 Next

Earthdata CMR access

Well, ncdf4 is a pretty good with OPeNDAP (which is one reason why we
love it!)  Below is an example using your handy testing resource.

Hmmm. In your example using pydap, you establish a (credentialed?)
session, and then open the OPeNDAP resource within that context?  I
don't think I have seen that before in R, at least not for OPeNDAP.
I'll poke around and see if I can find something comparable.


### Start
library(ncdf4)

url <- "https://eosdap.hdfgroup.org:8080/opendap/data/hdf5/grid_1_2d.h5"
x <- nc_open(url)
library(ncdf4)

url <- "https://eosdap.hdfgroup.org:8080/opendap/data/hdf5/grid_1_2d.h5"
x <- nc_open(url)
temp <- ncvar_get(x, varid = "temperature",
                  start = c(2,1),
                  count = c(2,3))
temp
#      [,1] [,2] [,3]
# [1,]   10   11   12
# [2,]   10   11   12
### End
On Wed, Apr 13, 2022 at 10:25 PM Joe Lee <hyoklee at hdfgroup.org> wrote:

  
    
Message-ID: <CALrbzg06hTrQ7VCNqBcMykYgOMHYx66rjG7Rr2LyKW7VajFfUw@mail.gmail.com>
In-Reply-To: <SN6PR17MB2399B4B34C8E8DF5E5728DF6C2EF9@SN6PR17MB2399.namprd17.prod.outlook.com>