当前位置: 首页>>代码示例>>Python>>正文


Python AuxCoord._discontiguity_in_bounds方法代码示例

本文整理汇总了Python中iris.coords.AuxCoord._discontiguity_in_bounds方法的典型用法代码示例。如果您正苦于以下问题:Python AuxCoord._discontiguity_in_bounds方法的具体用法?Python AuxCoord._discontiguity_in_bounds怎么用?Python AuxCoord._discontiguity_in_bounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iris.coords.AuxCoord的用法示例。


在下文中一共展示了AuxCoord._discontiguity_in_bounds方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_2d_contiguous_both_dirs

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_contiguous_both_dirs(self):
     coord = AuxCoord(self.points_3by3, bounds=self.lon_bounds_3by3)
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertTrue(contiguous)
     self.assertTrue(not diffs_along_x.any())
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:9,代码来源:test_Coord.py

示例2: test_2d_discontiguous_along_y

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_discontiguous_along_y(self):
     coord = AuxCoord(self.points_3by3[::2, :],
                      bounds=self.lat_bounds_3by3[::2, :, :])
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertFalse(contiguous)
     self.assertTrue(not diffs_along_x.any())
     self.assertArrayEqual(diffs_along_y, np.array([[True, True, True]]))
开发者ID:SciTools,项目名称:iris,代码行数:10,代码来源:test_Coord.py

示例3: test_2d_discontiguous_along_x

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_discontiguous_along_x(self):
     coord = AuxCoord(self.points_3by3[:, ::2],
                      bounds=self.lon_bounds_3by3[:, ::2, :])
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertFalse(contiguous)
     self.assertArrayEqual(diffs_along_x,
                           np.array([True, True, True]).reshape(3, 1))
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:11,代码来源:test_Coord.py

示例4: test_2d_one_cell_along_y

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_one_cell_along_y(self):
     # Test a 2D coord with a single cell along the y axis, where the coord
     # has shape (1, 2).
     coord = AuxCoord(self.points_3by3[:1, :],
                      bounds=self.lon_bounds_3by3[:1, :, :])
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertTrue(contiguous)
     self.assertTrue(not diffs_along_x.any())
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:12,代码来源:test_Coord.py

示例5: test_2d_one_cell_along_x

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_one_cell_along_x(self):
     # Test a 2D coord with a single cell along the x axis, where the coord
     # has shape (2, 1).
     coord = AuxCoord(self.points_3by3[:, :1],
                      bounds=self.lat_bounds_3by3[:, :1, :])
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertTrue(contiguous)
     self.assertTrue(not diffs_along_x.any())
     self.assertArrayEqual(diffs_along_y, np.array([0, 0]).reshape(2, 1))
开发者ID:SciTools,项目名称:iris,代码行数:12,代码来源:test_Coord.py

示例6: test_2d_one_cell

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_one_cell(self):
     # Test a 2D coord with a single cell, where the coord has shape (1, 1).
     coord = AuxCoord(self.points_3by3[:1, :1],
                      bounds=self.lon_bounds_3by3[:1, :1, :])
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     expected_diffs = np.array([], dtype=np.int64)
     self.assertTrue(contiguous)
     self.assertArrayEqual(diffs_along_x, expected_diffs.reshape(1, 0))
     self.assertArrayEqual(diffs_along_y, expected_diffs.reshape(0, 1))
开发者ID:SciTools,项目名称:iris,代码行数:12,代码来源:test_Coord.py

示例7: test_2d_contiguous_along_x_atol

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_contiguous_along_x_atol(self):
     coord = AuxCoord(self.points_3by3[:, ::2],
                      bounds=self.lon_bounds_3by3[:, ::2, :])
     # Set a high atol that allows small discontiguities.
     contiguous, diffs = coord._discontiguity_in_bounds(atol=5)
     diffs_along_x, diffs_along_y = diffs
     self.assertTrue(contiguous)
     self.assertArrayEqual(diffs_along_x,
                           np.array([False, False, False]).reshape(3, 1))
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:12,代码来源:test_Coord.py

示例8: test_2d_discontiguous_along_x_and_y

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_discontiguous_along_x_and_y(self):
     coord = AuxCoord(np.array([[1, 5], [3, 5]]),
                      bounds=np.array([[[0, 2, 2, 0], [4, 6, 6, 4]],
                                       [[2, 4, 4, 2], [4, 6, 6, 4]]]))
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     exp_x_diffs = np.array([True, False]).reshape(2, 1)
     exp_y_diffs = np.array([True, False]).reshape(1, 2)
     self.assertFalse(contiguous)
     self.assertArrayEqual(diffs_along_x, exp_x_diffs)
     self.assertArrayEqual(diffs_along_y, exp_y_diffs)
开发者ID:SciTools,项目名称:iris,代码行数:13,代码来源:test_Coord.py

示例9: test_2d_discontiguous_mod_360

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_discontiguous_mod_360(self):
     # Test that longitude coordinates are adjusted by the 360 modulus when
     # calculating the discontiguities in contiguous bounds.
     coord = AuxCoord(
         [[175, -175], [175, -175]], standard_name='longitude',
         bounds=np.array([[[170, 180, 180, 170], [10, 20, 20, 10]],
                          [[170, 180, 180, 170], [10, 20, 20, 10]]]))
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertFalse(contiguous)
     self.assertArrayEqual(diffs_along_x, np.array([[True], [True]]))
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:14,代码来源:test_Coord.py

示例10: test_2d_discontiguous_mod_360_not_longitude

# 需要导入模块: from iris.coords import AuxCoord [as 别名]
# 或者: from iris.coords.AuxCoord import _discontiguity_in_bounds [as 别名]
 def test_2d_discontiguous_mod_360_not_longitude(self):
     # Test that non-longitude coordinates are not adjusted by the 360
     # modulus when calculating the discontiguities in discontiguous bounds.
     coord = AuxCoord(
         [[-150, 350], [-150, 350]], standard_name='height',
         bounds=np.array([[[-400, 100, 100, -400], [200, 600, 600, 200]],
                          [[-400, 100, 100, -400], [200, 600, 600, 200]]])
         )
     contiguous, diffs = coord._discontiguity_in_bounds()
     diffs_along_x, diffs_along_y = diffs
     self.assertFalse(contiguous)
     self.assertArrayEqual(diffs_along_x, np.array([[True], [True]]))
     self.assertTrue(not diffs_along_y.any())
开发者ID:SciTools,项目名称:iris,代码行数:15,代码来源:test_Coord.py


注:本文中的iris.coords.AuxCoord._discontiguity_in_bounds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。