Exemple #1
0
 def test_greg(self):
     cube = _vector_cube(iris.unit.CALENDAR_GREGORIAN)
     constraint = TimeRangeConstraint(day_of_year=[(8, 29), (3, 2)])
     result = constraint.extract(cube)
     self.assertArrayEqual(result.coord('time').points, [0, 60, 240, 300])
Exemple #2
0
 def test_360(self):
     cube = _vector_cube_leap(iris.unit.CALENDAR_360_DAY)
     constraint = TimeRangeConstraint(day_of_year=[(9, 1), (3, 1)])
     result = constraint.extract(cube)
     self.assertArrayEqual(result.coord('time').points, [0, 60, 240, 300])
Exemple #3
0
 def test_greg_leap_in(self):
     cube = _vector_cube_leap(iris.unit.CALENDAR_GREGORIAN)
     constraint = TimeRangeConstraint(day_of_year=[(3, 1), (8, 28)])
     result = constraint.extract(cube)
     self.assertArrayEqual(result.coord('time').points, [60, 120, 180, 240])