return to catalog
Dataset: Hydrodynamic model - 4km grid (gbr4_v4) - stats-daily
Catalog: eReefs NetCDF catalogue - GBR 4 v4
featureTypeGrid
idgbr4_v4-stats-daily
Access
Preview

Access:

ServiceTypeDescription
OPeNDAP Data Access Access dataset through OPeNDAP using the DAP2 protocol.
WMS Data Access Supports access to georegistered map images from geoscience datasets.
CdmRemote Data Access Provides index subsetting on remote CDM datasets, using ncstream.

Viewers:

ViewerTypeDescription
Godiva3 Browser
default_viewer.ipynb Jupyter Notebook The TDS default viewer attempts to plot any Variable contained in the Dataset.
Note on occasional timeouts:

Programmatic requests (OPeNDAP, CdmRemote, HTTP download) may occasionally time out (e.g. HTTP 504) due to internal THREDDS server issues. A simple immediate second attempt usually succeeds.

Recommended pattern: try once; if you get a timeout or a transient 5xx error, wait a second and try again. If it still fails, surface the error instead of looping indefinitely.

Most users access data with higher-level libraries which internally use these HTTP services. Common choices: Python: xarray (with engine="netcdf4" or pydap), netCDF4, siphon; R: ncdf4, tidync, stars. You can wrap the initial open call in a single retry just like a raw request.

Python xarray open (two tries)

import time, xarray as xr

URL = "https://thredds.ereefs.aims.gov.au/thredds/dodsC/path/to/file.nc"

def open_dataset_with_retry(url: str):
    for attempt in (1, 2):
        try:
            return xr.open_dataset(url)  # xarray will lazy-load metadata via OPeNDAP
        except OSError as e:  # includes many network / timeout style errors from underlying libs
            if attempt == 1:
                time.sleep(1)
                continue
            raise e

ds = open_dataset_with_retry(URL)
print(ds.data_vars)
R ncdf4 open (two tries)

library(ncdf4)

url <- "https://thredds.ereefs.aims.gov.au/thredds/dodsC/path/to/file.nc"

open_nc_with_retry <- function(u) {
    for (attempt in 1:2) {
        nc <- try(nc_open(u), silent = TRUE)
        if (!inherits(nc, "try-error")) return(nc)
        if (attempt == 1) Sys.sleep(1) else stop(nc)
    }
}

nc <- open_nc_with_retry(url)
print(names(nc$var))
nc_close(nc)
Python example (two tries)

import time, requests

URL = "https://thredds.ereefs.aims.gov.au/thredds/dodsC/path/to/file.nc"

def fetch_with_single_retry(url: str):
    for attempt in (1, 2):
        try:
            r = requests.get(url)
            if r.status_code == 200:
                return r.content  # or stream/process
            if r.status_code in (500, 502, 503, 504) and attempt == 1:
                time.sleep(1)
                continue
            r.raise_for_status()
            return r.content
        except (requests.Timeout, requests.ConnectionError) as e:
            if attempt == 1:
                time.sleep(1)
                continue
            raise e

data = fetch_with_single_retry(URL)
R example (two tries)

library(httr2)

url <- "https://thredds.ereefs.aims.gov.au/thredds/dodsC/path/to/file.nc"

fetch_with_single_retry <- function(u) {
    for (attempt in 1:2) {
        req <- request(u) |>
            req_timeout(30)
        resp <- try(req_perform(req), silent = TRUE)
        transient <- function(x) {
            inherits(x, "httr2_http_error") && x$status_code %in% c(500,502,503,504)
        }
        if (inherits(resp, "httr2_response")) {
            if (resp_status(resp) == 200) return(resp_body_raw(resp))
            if (resp_status(resp) %in% c(500,502,503,504) && attempt == 1) {
                Sys.sleep(1)
                next
            }
            stop("Request failed with status ", resp_status(resp))
        } else if ((inherits(resp, "try-error") || transient(resp)) && attempt == 1) {
            Sys.sleep(1)
            next
        } else if (inherits(resp, "try-error")) {
            stop(resp)
        }
    }
}

data <- fetch_with_single_retry(url)

For bulk workflows, record which steps succeeded so you can resume if a retry still fails.

Note on missing services:

The NetCDF Subset Service (NCSS) and Web Coverage Service (WCS) are currently disabled due to a known THREDDS limitation. Please use other services for data access, such as OPeNDAP. If you were previously using NCSS or WCS, and this affects your workflow, please contact us so we can prioritise a fix. We apologise for the inconvenience.

Documentation

Description:

return to catalog