Skip to content

Lat/Lon Small NetCDF

netcdfNetCDFEPSG:4326tinybundled

A minimal CF-compliant NetCDF file with latitude/longitude dimensions and a single data variable. Baseline for xarray-based loading and coordinate inspection.

Property Value
Case ID latlon_small
Category netcdf
Format NetCDF
CRS EPSG:4326
Location Global grid (synthetic)
Test tier unit
Size class tiny
Storage class bundled
Redistributable yes
Loader xarray
Status validated

Use this case

import pytest


@pytest.mark.geocase_case("latlon_small")
def test_latlon_small(geocase_case) -> None:
    data = geocase_case.load()
    assert data is not None

Use GeoCase in your tests

Install the complete set of vector, raster, and NetCDF dependencies:

pip install "geocase[all]"

View GeoCase on PyPI.

What this case checks

Verify that latitude/longitude dimensions are correctly identified, fill values are masked, and basic slicing works.

Risk types covered

Expected behavior

Assertion Expected
expect_loadable yes
expect_nodata yes

Notes

Purpose

Minimal CF-style NetCDF baseline with latitude/longitude dimensions and one primary data variable (temperature).

What to expect

  • Loads via xarray without decoding failures.
  • Coordinate dimensions include latitude and longitude.
  • Fill value (-9999.0) is present for masking workflows.

Typical checks

  • Dataset opens and variable exists (temperature).
  • Dimension sizes are non-zero and consistent.
  • Fill value is detected via encoding/attrs.
  • Basic slicing over lat/lon returns expected shapes.

Common failure modes

  • Fill value ignored during analysis.
  • Inconsistent coordinate metadata handling.

History

The primary file was replaced in plan 34 (2026-08-29). The original latlon_sample.nc arrived in a single commit carrying unseeded random temperature values, which made it the only fixture in the repository that could not be regenerated — 400 seed and distribution combinations were searched without recovering them. Since every NetCDF gate depends on comparing the committed bytes against a fresh build, the file is now emitted by scripts/generate_netcdf_fixtures.py from a deterministic ramp.

Shape (5, 8), float64, _FillValue = -9999.0 and both fill positions (row 0 column 0, row 3 column 5) are preserved exactly, so every assertion the case declared still holds. Only the temperature values differ. Anyone who pinned an earlier release and asserted against specific temperatures will see a change; nothing in this repository does, because the case's own assertions are structural.

Three declarations were also removed as undemonstrable:

  • coordinate_order and dimension_mismatch risk types — this is conventional (latitude, longitude) rectilinear data, which exercises neither.
  • expect_crs / expected_epsg — the file has no grid_mapping attribute and no crs variable, so there is nothing in the bytes for a CRS check to read.

The dimension-ordering risk is carried instead by cf_time_ordering_netcdf, against a file whose dimensions are genuinely non-conventional.

Required capabilities

  • load
  • coordinate-inspection
  • nodata-check

Files

Browse this case on GitHub

Source and license

  • Source: geocase-curated
  • License: MIT

Tags

cf-conventions latlon masking netcdf nodata