Skip to content
Testaroo
nc1.2 KB

NetCDF Packed int16 with scale_factor / add_offset (.nc)

The same temperature field stored as int16 and recovered through the CF packing attributes scale_factor and add_offset. This is the failure that parses cleanly and is silently wrong: a reader that ignores the attributes returns values around -2000 instead of 260-292 K.

Preview: schema + first 7 rowsnc
FieldValue
Stored dtypeint16
scale_factor0.01
add_offset280.0
Unpack rulevalue = stored * scale_factor + add_offset
Stored[0,0,0]-1000
Unpacked[0,0,0]270.0000 K
_FillValue-32768 (applies to the STORED value, before unpacking)
A reader that ignores scale_factor/add_offset returns integers near -2000, not kelvin.

Specifications

Format
NetCDF-3 classic
Stored Type
int16
Scale Factor
0.01
Add Offset
280
Unpacked Type
float64
Packed Range
-1750 to 1250
Quantisation Step
0.01 K

Testing contract

Expected to pass
Scenario
Read the tas variable and apply the CF packing convention, then compare against the paired unpacked CSV.
Expected result
Unpacked values land within 0.005 K of the CSV's original_kelvin column; a reader that skips packing returns raw integers between -2000 and 1200 instead.

What is a .nc file?

NetCDF (.nc, Network Common Data Form) is a binary, self-describing format for array-oriented scientific data. It stores multidimensional variables (like temperature over latitude, longitude, and time) with named dimensions, units, and metadata attributes, and is a standard in climate, ocean, and geoscience.

How to use this file

Use an example .nc file to test NetCDF readers (netCDF4, xarray, Panoply), CF-convention validators, and gridded-data pipelines, or to verify dimension and variable extraction.

How to use this file for testing

“NetCDF Packed int16 with scale_factor / add_offset (.nc)” is a deterministic Testaroo fixture for Scientific data, Serialization testing. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS), for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: NetCDF-3 classic. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic, no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required, license.