Closed danielboros1990 closed 1 year ago
We don't apply scale_factor
and add_offset
and this is up to the user to account for
@mulimoen is it possible to read them from the file?
You should be able to read them using var.attribute()
@mulimoen thanks for your help. One question is left, is it possible to convert this value into f32
, I couldn't find the Into trait implementation for AttrValue?
The following should work
fn convert(a: &AttrValue) -> Option<f64> {
use AttrValue::*;
Some(match a {
Uchar(x) => *x as f64,
Schar(x) => *x as f64,
Short(x) => *x as f64,
Ushort(x) => *x as f64,
Uint(x) => *x as f64,
Int(x) => *x as f64,
Ulonglong(x) => *x as f64,
Longlong(x) => *x as f64,
Float(x) => *x as f64,
Double(x) => *x as f64,
_ => return None
})
}
Future improvement/note to self: Might be worth including such code in this library
I really appreciate your help.
Hi guys,
I try to fetch the variables from the a .nc file but I got totally different values instead of the expected. Do you have any idea how can I solve?
This is the data structure of the netcdf file:
This is what I get from the fetch:
This is the expectation: