World Ocean Database single-cast profile: 1D in depth, not a raster
One World Ocean Database cast (CF featureType = "Profile"): a single position and time with 12 depth levels of temperature, salinity, oxygen and phosphate. GDAL’s raster open fails on the file, and opening a variable directly gives a 12 x 1 strip with depth as x. Read it as a profile.
| canonical_path | sha256 | size |
|---|---|---|
| extdata/1D/test.nc | 5e5e6e71163d | 10776 |
| data-raw/1D-readme | 754b2204cf37 | 105 |
What’s wrong
lat,lon,timeare 0-d scalars: lon 14.56667, lat -32.66667, 1963-10-11 04:00 (time 70774.1667 days since 1770-01-01; agrees withdate = 19631011,GMT_time = 4).- Measurements are
Temperature(z)etc., z = 0 to 989 m (12 levels). - GDAL 3.14:
gdalinfo test.ncreports “not recognized as being in a supported file format”;ogrinfofails too.gdalinfo NETCDF:"test.nc":Temperaturegives a 12 x 1 raster, no georeferencing. zsaysstandard_name = "altitude"butpositive = "down"andlong_name = "depth_below_sea_level"; the values are depths.
How to read it
Verified with the GDAL 3.14 Python multidimensional API, 2026-11-06:
from osgeo import gdal
gdal.UseExceptions()
rg = gdal.OpenEx("test.nc", gdal.OF_MULTIDIM_RASTER).GetRootGroup()
get = lambda n: rg.OpenMDArray(n).ReadAsArray()
lon, lat, t = get("lon"), get("lat"), get("time") # scalars
z = get("z") # m, positive down
temp = get("Temperature") # 16.84 at 0 m ... 3.41 at 989 mHistory
- 2018-12-17, commit 6f0f436 “1D example from a user report” (message paraphrased): added
data-raw/1D-readme, a one-line Rdownload.file()of the cast from a user’s GitHub release, saved astest.nc. The file’s owndate_createdis 2018-11-06. - Shipped in weird.tar.gz in release v0.0.12.
Links
None recorded.