Open ashiklom opened 6 years ago
That's an interesting use case. I haven't tried password protected OpenDAP sites myself.
Behind the scenes, RNetCDF simply passes your URL to the NetCDF C library, which creates the connection to OpenDAP. If your data source works with ncdump
, it should work with RNetCDF.
I found some documentation for setting up passwords for ncdump
at http://docs.opendap.org/index.php/DAP_Clients_-_Authentication#ncdump. Would you mind trying these instructions to see if they work for you with RNetCDF?
OpenDAP is a great way to remotely access large NetCDF datasets.
The current version of RNetCDF works with OpenDAP links for un-authenticated URLs. For example, for GHCN CAMS data from the IRI Data Library, this just works:
However, some URLs, including those of the UCAR Research Data Archive (RDA) or the NASA GES DISC are password protected. Currently, my approach for accessing these services is to manually build the subset URL, then download the resulting NetCDF file and read it from disc. For example, for some MERRA outputs:
...or, using the
crul
package...However, it would be great if there was a way to more directly access the NetCDF file and subset it through R in a way analogous to the non-password-protected services like the first example.
The underlying issue here is that
RNetCDF::open.nc
only supports simple URLs as connections. However, if it could be modified to work with full HTTP requests generated bycurl
orcrul
, I think everything else should work the same.