eliocamp / metR

Tools for Easier Analysis of Meteorological Fields
https://eliocamp.github.io/metR/
140 stars 22 forks source link

Adding scale and offset when reading a variable #115

Closed paocorrales closed 3 years ago

paocorrales commented 4 years ago

I just found out that the NetCDF library automatically read the scale and offset attributes of a variable and applied them to the variable along the reading process.

It would be great if ReadNetCDF() had this feature!

eliocamp commented 4 years ago

Thanks! The current development version now supports this feature. You need to wrap the variable name you want to scale in an auto_scale() call (e.g. ReadNetCDF(file, vars = auto_scale("variable"))).