Skip to contents

cube_inspect() returns a compact structural and diagnostic summary. It complements cube_validate() by describing dimensions, ranges, resolution, estimated size, missing values, and safe provenance metadata.

Usage

cube_inspect(x, missing = c("auto", "none", "full"))

Arguments

x

A valid <ocean_cube> using the memory or NetCDF backend.

missing

Missing-value policy. "auto" computes metrics for memory cubes but not NetCDF cubes; "none" never computes them; and "full" computes them for either backend. For NetCDF, "full" warns before materializing the complete cube.

Value

A list with class ocean_cube_inspection containing structural, coordinate, storage, missing-value, validation, and provenance summaries. time_summary reports class, count, range, timezone, calendar, duplicate and ordering flags, regularity, and minimum/median/maximum positive intervals. Legacy duplicate or unsorted axes can be diagnosed without being reordered or repaired.

Examples

values <- array(c(1, NA, 3, 4), dim = c(2, 2, 1, 1, 1))
cube <- ocean_cube(
  lon = c(-80, -79), lat = c(-12, -11), depth = 0,
  time = as.Date("2020-01-01"), data = values, vars = "temperature"
)
cube_inspect(cube)
#> <ocean_cube_inspection>
#>   backend     : memory
#>   dimensions  : 2 x 2 x 1 x 1 x 1 [lon x lat x depth x time x var]
#>   longitude   : -80 to -79
#>   latitude    : -12 to -11
#>   variables   : temperature [NA]
#>   time        : 2020-01-01 to 2020-01-01 (single value)
#>   time class  : Date; calendar=proleptic_gregorian; increasing=TRUE; duplicates=FALSE
#>   depth       : 0 to 0 (single value)
#>   est. bytes  : 32
#>   missing     : computed (1/4)
#>   validation  : PASS 31, WARN 0, FAIL 0