NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer)

NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer), a VS Code extension by Zovo

A NetCDF viewer and HDF5 viewer for climate and lab scientists who keep data in .nc or .h5 files. It shows the variables, their CF metadata, the values and a map inside VS Code. No Python, no NCL, nothing to set up.

Install in VS CodeOpen the Marketplace page

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.hdf5-netcdf-explorer, version 0.4.0.

New in 0.4.0: coastlines on latitude-longitude maps, a Play button that steps through time, NetCDF CDF-5 (64-bit data) files, and full plots of grids over 1 million cells, such as a 0.25 degree global field (721 x 1440).

NetCDF viewer in VS Code: NOAA OISST daily sea surface temperature for 2023 (a 450 MB NetCDF-4 file, 365 x 720 x 1440) drawn as a map with coastlines on 1 August 2023, and below it the series of the clicked point at 30.6 S, 135.6 W over the whole year

A real VS Code window running version 0.4.0 on sst.day.mean.2023.nc from NOAA PSL (OISST v2 high resolution, daily, 2023). The map is sampled to every 3rd latitude and longitude, so it keeps its 2:1 shape, and drew in about 0.1 s. A click on the map plotted that point over 365 days.

Play along time: the same map stepping through August 2023 at 2x speed, with the colour range held at the first frame's range

Play (▶ next to the time slider) on the same 450 MB file, recorded frame by frame in VS Code.

Quick start

  1. Install the extension.
  2. Click a .nc or .h5 file in the Explorer. Pick a variable on the left.
A click on the .nc file shows the file overview. A click on t2m draws a heatmap, the time slider steps through 3 time steps, and the Table tab shows the values with latitude and longitude headers

Recorded in the same window. The white arrow is drawn in to show where each click lands.

Questions people ask

Is NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer) free?

Yes. NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer) is free and MIT licensed.

How do I install NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer)?

Click "Install in VS Code" above, or search for zovo.hdf5-netcdf-explorer in the Extensions view.

What you can do

An ERA5-style NetCDF-4 file in VS Code. The t2m variable is selected, with units, packing, chunks and compression, a time slider and a heatmap of 2 metre temperature
The same variable as a paged table with latitude and longitude as headers

Supported files

FormatHow it is read
NetCDF-4 and NetCDF-4 classic (.nc, .nc4)h5wasm (HDF5 2.0 compiled to WebAssembly)
HDF5 (.h5, .hdf5, .he5, .hdf, .nxs, .h5ad)h5wasm
Compressed HDF5: deflate (gzip), shuffle, szip, fletcher32, n-bit, scale-offset, and the plugin filters LZF, Blosc, Blosc2, bitshuffle, LZ4, Zstd, bzip2 and ZFP (what h5py and hdf5plugin write)h5wasm with the h5wasm-plugins libraries
HDF5-based formats (.jld2, .loom, .h5mu, .hf5, .h5oina, .h5ebsd, .edaxh5, .oh5, .dream3d, .geoh5, .nde, .cxi)h5wasm, the same way as .h5
MATLAB 7.3 (.mat), or an HDF5 file with any other nameh5wasm. Right-click the file and pick "Open in HDF5 NetCDF Explorer", or use "Reopen Editor With…"
NetCDF-3 classic and 64-bit offset (.nc, .cdf)netcdfjs parses the header, values are read by byte offset
NetCDF CDF-5, 64-bit data (.nc from PnetCDF, WRF, E3SM or nccopy -k cdf5), with the unsigned and 64-bit integer typesOur own header parser, values are read by byte offset

The format is detected from the first bytes of the file, not from the extension, so a 512-byte user block (JLD2 and MATLAB 7.3 files have one) is fine. HDF4, NASA CDF and older MATLAB v5 .mat files get a clear message instead of an error. So does an HDF5 or NetCDF-4 file that was cut off during a copy or download: the message says how many bytes are missing.

Settings

SettingDefaultMeaning
hdf5NetcdfExplorer.maxReadValues1000000Largest number of values one read may return
hdf5NetcdfExplorer.maxFileSizeMB0Refuse files above this size, 0 means no limit
hdf5NetcdfExplorer.readTimeoutSeconds20Stop a read that takes longer and restart the reader
hdf5NetcdfExplorer.colormapviridisColour map a heatmap starts with: viridis, cividis, magma, inferno, plasma, turbo, gray or coolwarm
hdf5NetcdfExplorer.askForRatingtrueAsk for a Marketplace rating after 3 files opened without an error on 2 different days. "Later" asks one more time after 7 days, "No thanks" never again. It never asks after an error. Turn it off with false.

Privacy and safety

The extension makes no network calls and has no telemetry. It never runs code from a file. Values go to the view as plain JSON and are drawn as text or canvas pixels, under a strict Content Security Policy with no remote scripts.

Known limits

Credits

Coastlines: Natural Earth 1:110m, public domain. Compression filters: h5wasm-plugins (the HDF Group plugins built to WebAssembly). HDF5 reading uses h5wasm by the National Institute of Standards and Technology, which bundles the HDF5 library by The HDF Group. NetCDF-3 headers are parsed with netcdfjs (MIT). See THIRD-PARTY-NOTICES.txt.

License

MIT

Guides

Install NetCDF Viewer & HDF5 Viewer (NC Viewer, H5 Viewer)

Click the button to open VS Code and install it, or press Ctrl+P (Cmd+P on macOS) in VS Code and run ext install zovo.hdf5-netcdf-explorer.

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.hdf5-netcdf-explorer, version 0.4.0.

Source code and issues are on GitHub.

All our VS Code extensions

Support this work

If this extension saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.