本文整理汇总了Python中nansat.domain.Domain.shape方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.shape方法的具体用法?Python Domain.shape怎么用?Python Domain.shape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.domain.Domain
的用法示例。
在下文中一共展示了Domain.shape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_init_lonlat
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import shape [as 别名]
def test_init_lonlat(self):
lat, lon = np.mgrid[-90:90:0.5, -180:180:0.5]
with warnings.catch_warnings(record=True) as recorded_warnings:
d = Domain(lon=lon, lat=lat)
nansat_warning_raised = False
for rw in recorded_warnings:
if rw.category == NansatFutureWarning:
nansat_warning_raised = True
self.assertTrue(nansat_warning_raised)
self.assertEqual(type(d), Domain)
self.assertEqual(d.shape(), lat.shape)
示例2: test_init_from_lonlat
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import shape [as 别名]
def test_init_from_lonlat(self):
lat, lon = np.mgrid[-90:90:0.5, -180:180:0.5]
d = Domain(lon=lon, lat=lat)
self.assertEqual(type(d), Domain)
self.assertEqual(d.shape(), lat.shape)
示例3: test_shape
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import shape [as 别名]
def test_shape(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
shape = d.shape()
self.assertEqual(shape, (500, 500))