`inspect_ereefs_data()` gives a lightweight overview of an eReefs or CSIRO-EMS NetCDF dataset before extracting large arrays. It is intended for interactive exploration, especially when a user is deciding which variables, dates, or grid product to use.

inspect_ereefs_data(
  input_file = "catalog",
  recurse_catalog = FALSE,
  include_files = TRUE,
  max_files = 50
)

Arguments

input_file

NetCDF file path, OPeNDAP URL, THREDDS catalog URI, or a legacy shortcut such as `"catalog"`, `"menu"`, or `"nci"`.

recurse_catalog

Logical; whether to recurse into child catalogs when `input_file` is a THREDDS catalog. Defaults to `FALSE` for speed. If a catalog has no direct NetCDF entries, the function automatically tries a recursive lookup.

include_files

Logical; whether to include the catalog/file table in the returned object when available.

max_files

Maximum number of catalog/file rows to include in the returned `files` tibble. The summary still reports the full count.

Value

An object of class `"ereefs_data_inspection"`, which is a named list containing:

summary

A one-row tibble with source, grid, spatial, temporal, and variable-count information.

variables

A tibble of NetCDF variables with names, units, long names, standard names, dimension names, dimension roles, and an `is_data_variable` flag.

dimensions

A tibble of NetCDF dimensions and inferred roles.

files

A tibble of catalog/file entries when available and `include_files = TRUE`.

Details

The function reads NetCDF metadata, coordinate variables, and time coordinates, but it does not read the full data arrays for model variables. When `input_file` is a THREDDS catalog, the catalog is used to summarize the available files and the first matching NetCDF file is used as a representative source for variable and dimension metadata.

Examples

inspect_ereefs_data("notebooks/demo_data/regular_demo_2020-01.nc")
#> eReefs data inspection
#> # A tibble: 1 × 19
#>   requested_input  inspected_source source_type file_count file_start file_end  
#>   <chr>            <chr>            <chr>            <int> <date>     <date>    
#> 1 notebooks/demo_… notebooks/demo_… netcdf               1 2020-01-01 2020-01-01
#> # ℹ 13 more variables: time_start <dttm>, time_end <dttm>, time_step <chr>,
#> #   longitude_min <dbl>, longitude_max <dbl>, latitude_min <dbl>,
#> #   latitude_max <dbl>, grid_type <chr>, i_count <int>, j_count <int>,
#> #   k_count <int>, variable_count <int>, data_variable_count <int>
#> 
#> Variables:
#> # A tibble: 0 × 8
#> # ℹ 8 variables: variable <chr>, units <chr>, long_name <chr>,
#> #   standard_name <chr>, dimensions <chr>, dimension_roles <chr>,
#> #   n_dimensions <int>, is_data_variable <lgl>
#> 
#> Files:
#> # A tibble: 1 × 5
#>   name                    url_path opendap_url         file_date  date_precision
#>   <chr>                   <chr>    <chr>               <date>     <chr>         
#> 1 regular_demo_2020-01.nc NA       notebooks/demo_dat… 2020-01-01 month         
if (FALSE) { # \dontrun{
inspect_ereefs_data(
  "https://thredds.nci.org.au/thredds/catalog/fx3/gbr4_H4p0_ABARRAr2_OBRAN2020_FG2Gv3_Dhnd/catalog.xml"
)
} # }