Using OPeNDAP to Access Data from On-Prem and Earthdata Cloud Archives

Requirements Earthdata Login

  • OPeNDAP (Hyrax Server)
    • On-prem Endpoint - Open
    • On-prem Endpoint - Earthdata Login Authentication
    • Earthdata Cloud Endpoint - Earthdata Login Authentication

Import Packages

import xarray as xr
import dask
import hvplot.xarray

Access On-prem OPeNDAP (Hyrax Server) - Open

opd_sst_url = 'https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2/L4/GLOB/NCEI/AVHRR_OI/v2/1981/244/19810901120000-NCEI-L4_GHRSST-SSTblend-AVHRR_OI-GLOB-v02.0-fv02.0.nc'
opd_sst_ds = xr.open_dataset(opd_sst_url)
opd_sst_ds
<xarray.Dataset>
Dimensions:           (lat: 720, lon: 1440, time: 1, nv: 2)
Coordinates:
  * lat               (lat) float32 -89.88 -89.62 -89.38 ... 89.38 89.62 89.88
  * lon               (lon) float32 -179.9 -179.6 -179.4 ... 179.4 179.6 179.9
  * time              (time) datetime64[ns] 1981-09-01
Dimensions without coordinates: nv
Data variables:
    lat_bnds          (lat, nv) float32 -90.0 -89.75 -89.75 ... 89.75 89.75 90.0
    lon_bnds          (lon, nv) float32 -180.0 -179.8 -179.8 ... 179.8 180.0
    time_bnds         (time, nv) datetime64[ns] 1981-09-01 1981-09-02
    analysed_sst      (time, lat, lon) float32 ...
    analysis_error    (time, lat, lon) float32 ...
    mask              (time, lat, lon) float32 ...
    sea_ice_fraction  (time, lat, lon) float32 ...
Attributes: (12/48)
    product_version:                 Version 2.0
    spatial_resolution:              0.25 degree
    Conventions:                     CF-1.6,ACDD-1.3
    title:                           NCEI global 0.25 deg daily sea surface t...
    references:                      Reynolds, et al.(2009) What is New in Ve...
    institution:                     NCEI
    ...                              ...
    source:                          AVHRR_Pathfinder-NODC-L3C-v5.1,ICOADS_SH...
    summary:                         NOAA's 1/4-degree Daily Optimum Interpol...
    time_coverage_start:             19810901T000000Z
    time_coverage_end:               19810902T000000Z
    uuid:                            39832cc3-d409-438a-820e-2bb1b38ebca8
    DODS_EXTRA.Unlimited_Dimension:  time
opd_sst_ds.analysed_sst.isel(time=0).hvplot.image(cmap='Inferno')
Unable to display output for mime type(s): 

Access On-prem OPeNDAP (Hyrax Server) - Authentication

import opendap_auth
opendap_auth.create_dodsrc()
'.dodsrc file created: /home/jovyan/.dodsrc'

Integrated Multi-satellitE Retrievals for GPM (IMERG) Level 3 IMERG Final Daily 10 x 10 km (GPM_3IMERGDF)

opd_prec_url = 'https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3/GPM_3IMERGDF.06/2021/07/3B-DAY.MS.MRG.3IMERG.20210704-S000000-E235959.V06.nc4' 
opd_prec_ds = xr.open_dataset(opd_prec_url)
opd_prec_ds
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
context: HTTP^ Basic: Access denied.
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
context: HTTP^ Basic: Access denied.
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
context: HTTP^ Basic: Access denied.
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
context: HTTP^ Basic: Access denied.
KeyboardInterrupt: 
opd_prec_ds.precipitationCal.isel(time=0).hvplot.image(cmap='rainbow')

Access Earthdata cloud OPeNDAP (Hyrax Server) - Authentication

edc_odp_ssh_url = 'https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/ECCO%20Sea%20Surface%20Height%20-%20Daily%20Mean%200.5%20Degree%20(Version%204%20Release%204)/granules/SEA_SURFACE_HEIGHT_day_mean_1992-01-01_ECCO_V4r4_latlon_0p50deg.dap.nc'
edc_odp_ssh_ds = xr.open_dataset(edc_odp_ssh_url)
edc_odp_ssh_ds
url = 'https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/GHRSST%20Level%204%20MUR%20Global%20Foundation%20Sea%20Surface%20Temperature%20Analysis%20(v4.1)/granules/20190201090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.dap.nc4'
xr.open_dataset(url)
url = 'https://opendap.earthdata.nasa.gov/collections/C1968980576-POCLOUD/granules/S6A_P4_2__LR_RED__NR_025_001_20210713T162644_20210713T182234_F02.nc4'
xr.open_dataset(url)
url = 'https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/ECCO%20Sea%20Surface%20Height%20-%20Daily%20Mean%200.5%20Degree%20(Version%204%20Release%204)/granules/SEA_SURFACE_HEIGHT_day_mean_1992-01-01_ECCO_V4r4_latlon_0p50deg.dap.nc4'
xr.open_dataset(url)