-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BitInformation for data previously reduced in precision #46
Comments
Do you know whether they rounded in decimal or in binary? Because while rounding in one base also quantizes in the other it doesn't round (as in make the trailing digits/bits shorter/simpler, the actual idea of rounding) in the other. Example: julia> a = randn(Float32,5)
5-element Vector{Float32}:
-0.35390654
1.223104
-0.04762434
-1.5507344
0.89877653
julia> b = round.(a,digits=3)
5-element Vector{Float32}:
-0.354
1.223
-0.048
-1.551
0.899
julia> bitstring.(b,:split)
5-element Vector{String}:
"1 01111101 01101010011111101111101"
"0 01111111 00111001000101101000100"
"1 01111010 10001001001101110100110"
"1 01111111 10001101000011100101011"
"0 01111110 11001100010010011011101" While the mantissa bits aren't all zero after some mantissa bits, the resulting array may still be more compressible as the number of possible mantissa bitpatterns still have been greatly reduced. But to actually answer your question, you can (roughly) translate between significant digits and bits via nsb(nsd::Integer) = Integer(ceil(log(10)/log(2)*nsd)) which just arises from the idea that with In your case this means that if you already know that your dataset contains only
without losing any information. And in fact, you probably want to because if there's real information in the mantissa bits past those it's artificial from the quantization. |
In fact, we already discussed that here nco/nco#250 |
@pnorton-usgs and I checked, and these variables were processed with NCO using args like So a few values look like this:
|
Just checked what Charlie means by NSD vs DSD, but the former is a relative error vs the latter is an absolute error. Great that you used nco's That gives you an upper bound for the bitinformation, but I'd still just run it over and see what the bitinformation analysis says? |
Will do @milankl !! Thanks for the great rounding examples also. I feel like I'm starting to understand this stuff! :) |
We have a large dataset from WRF, where the providers already reduced precision on some variables before passing to us. For example:
Can we use this knowledge somehow to create an alternate algorithm for calculating the appropriate keepbits?
The text was updated successfully, but these errors were encountered: