NetCDF中scale_factor和add_offset的使用
来源:互联网 发布:云计算大数据什么意思 编辑:程序博客网 时间:2024/06/15 16:22
参考连接:http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html
- scale_factor - If present for a variable, the data are to be multiplied by this factor after the data are read by the application that accesses the data. (see further discussion under the add_offset attribute)
- add_offset - If present for a variable, this number is to be added to the data after it is read by the application that accesses the data. If both scale_factor and add_offset attributes are present, the data are first scaled before the offset is added. The attributes scale_factor and add_offset can be used together to provide simple data compression to store low-resolution floating-point data as small integers in a netCDF file. When scaled data are written, the application should first subtract the offset and then divide by the scale factor.
The NOAA cooperative standard is more restrictive than the netCDF Users Guide with respect to the use of the scale_factor and add_offset attributes; ambiguities and precision problems related to data type conversions are resolved by these restrictions. If the scale_factor and add_offset attributes are of the same data type as the associated variable no restrictions apply; the unpacked data is assumed to be of the same data type as the packed data. However, if the scale_factor and add_offset attributes are of a different data type than the associated variable (containing the packed data) then in files adhering to this standard the associated variable may only be of type byte, short, or long. The attributes scale_factor and add_offset (which must match in data type) must be of type float or double. The data type of the attributes should match the intended type of the unpacked data. (It is not advised to unpack a long into a float as there is a potential precision loss.)
将对应开关打开后,这两个属性就会生效。(开关默认是打开的,python中对开开关的语法是:***.set_auto_maskandscale(True) )
千万注意:写入的值跟读取的值完全一致。不用自己计算。
实验中发现调整不同的scale_fator和add_offset,数据文件的大小会不同,数据由于压缩会损失精度。
0 0
- NetCDF中scale_factor和add_offset的使用
- windows下VS2010中使用netcdf的C++接口实现.nc文件的读写
- 从NetCDF数据集格式的数据文件中提取数据
- NetCDF-C++ 4.4.2 中 NcException 的Bug
- NetCDF文件的读取
- Netcdf
- netcdf
- NC文件的处理【netcdf】
- 安装好netcdf hdf5 后 在lib中make的错误 怎么办
- GDAL使用插件方式编译HDF4、HDF5以及NetCDF的bug修改
- 使用NetCDF库时提示无法链接错误"error LNK2001: 无法解析的外部符号 nc_create"
- matlab中NetCDF文件相关函数
- fortran使用netcdf 读写NC文件
- 编译 Windows 版的 netCDF 4.3.0
- 如何patch Netcdf的jar包
- python关于netcdf文件的读写
- netcdf源码在windows上的编译
- vs2013+NetCDF二维数据的读取方法
- ios全景图片浏览App
- c#之枚举
- 使用终端安装 TeXLive
- 从头认识Spring-1.4 怎样通过构造器注入Bean?
- 类与对象的关系 局部变量 成员变量
- NetCDF中scale_factor和add_offset的使用
- CentOS 安装 nignx
- 看图识“字”(1)-看数据条知大小
- android屏幕适配之dimens适配
- NSString 中包含中文字符时转换为NSURL
- 修改记事本默认编码为UTF-8
- 快速掌握一个语言最常用的50%
- Android Retrofit 2.0框架 GET和POST的实现方式(配合RxJava)
- leetcode笔记:Reverse Bits