本文整理汇总了Python中nansat.domain.Domain.get_border方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.get_border方法的具体用法?Python Domain.get_border怎么用?Python Domain.get_border使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.domain.Domain
的用法示例。
在下文中一共展示了Domain.get_border方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_border_dateline
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import get_border [as 别名]
def test_get_border_dateline(self):
dom = Domain('+proj=stere +datum=WGS84 +ellps=WGS84 +lat_0=0 +lon_0=-179 +no_defs',
'-te -1000000 -1000 1000000 1000 -ts 10 10')
brd = dom.get_border()
self.assertTrue(np.all(brd[0] > 0))
brd = dom.get_border(fix_lon=False)
self.assertTrue(brd[0].min() < 0)
示例2: test_get_border
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import get_border [as 别名]
def test_get_border(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
lon, lat = d.get_border()
self.assertEqual(type(lon), np.ndarray)
self.assertEqual(type(lat), np.ndarray)
self.assertEqual(len(lat), 44)
self.assertEqual(lat[0], lat[-1])
self.assertEqual(lon[0], lon[-1])
示例3: test_write_domain_map
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import get_border [as 别名]
def test_write_domain_map(self):
plt.switch_backend('Agg')
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
border = d.get_border()
tmpfilename = os.path.join(ntd.tmp_data_path, 'domain_write_map.png')
write_domain_map(border, tmpfilename, labels=['Patch1'])
self.assertTrue(os.path.exists(tmpfilename))
i = Image.open(tmpfilename)
i.verify()
self.assertEqual(i.info['dpi'], (50, 50))
示例4: test_write_domain_map_labels
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import get_border [as 别名]
def test_write_domain_map_labels(self):
plt.switch_backend('Agg')
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
border = d.get_border()
tmpfilename = os.path.join(ntd.tmp_data_path,
'domain_write_map_labels.png')
write_domain_map(border, tmpfilename,
mer_labels=[False, False, False, True],
par_labels=[True, False, False, False])
self.assertTrue(os.path.exists(tmpfilename))
i = Image.open(tmpfilename)
i.verify()