What an error bound actually guarantees
“Lossy” worries scientists for good reason. Here’s what a hard error bound promises, how we check it on every file, and why it beats “looks fine”.
In short
- An error bound is a promise about every value, not an average.
- Compress checks the bound on every file it writes and reports it.
- Loosen the bound a little and files get much smaller.
Ask a climate scientist whether they’d accept lossy compression on their archive and most will say no. They’ve seen JPEG artefacts and they know what averaging does to extremes. That instinct is right, and it’s the reason Compress is built around a hard error bound rather than a quality slider.
The worry about lossy
Most lossy codecs were made for eyes and ears. They spend their bits where people notice and throw away what people don’t. Science doesn’t work like that: the value in one cell at one hour can be the whole result.
“Looks fine” is a judgement. An error bound is a number you can put in a methods section.
What a bound promises
Set an absolute bound of 0.01 K on temperature and every decoded value is within 0.01 K of the original. Not on average, not 99% of them: every one. A relative bound does the same as a fraction of each value, which suits fields like precipitation that span orders of magnitude.
Times smaller than raw, by error bound
Lossless
0.001 K
0.01 K
0.05 K
0.1 K
0.5 K
How we check it
After writing each file, Compress decodes it and compares it with the input. If any value breaks the bound, that chunk is stored losslessly instead. Every file carries a short verification report with the largest error it found, so the check is on record, not just in our marketing.
Choosing a bound
- Start from your instrument or model precision: there’s no point keeping digits that were never real.
- Set bounds per variable. Pressure, wind and humidity need different ones.
- Keep the variables you can’t risk lossless. Compress still shrinks them, just less.
