本文整理汇总了Python中cis.data_io.ungridded_data.UngriddedData.add_history方法的典型用法代码示例。如果您正苦于以下问题:Python UngriddedData.add_history方法的具体用法?Python UngriddedData.add_history怎么用?Python UngriddedData.add_history使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cis.data_io.ungridded_data.UngriddedData
的用法示例。
在下文中一共展示了UngriddedData.add_history方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_can_add_history
# 需要导入模块: from cis.data_io.ungridded_data import UngriddedData [as 别名]
# 或者: from cis.data_io.ungridded_data.UngriddedData import add_history [as 别名]
def test_can_add_history(self):
x_points = np.arange(-10, 11, 5)
y_points = np.arange(-5, 6, 5)
y, x = np.meshgrid(y_points, x_points)
x = Coord(x, Metadata(standard_name='latitude', units='degrees'))
y = Coord(y, Metadata(standard_name='longitude', units='degrees'))
data = np.reshape(np.arange(15) + 1.0, (5, 3))
coords = CoordList([x, y])
ug = UngriddedData(data, Metadata(standard_name='rain', long_name="TOTAL RAINFALL RATE: LS+CONV KG/M2/S",
units="kg m-2 s-1", missing_value=-999), coords)
new_history = 'This is a new history entry.'
ug.add_history(new_history)
assert(ug.metadata.history.find(new_history) >= 0)