Example #1
0
 def test_building_cube(self):
     """Test that a cube is built as expected."""
     plugin = SpotExtraction()
     spot_values = np.array([0, 0, 12, 12])
     result = plugin.build_diagnostic_cube(
         self.neighbour_cube, self.diagnostic_cube_xy, spot_values
     )
     self.assertArrayEqual(result.coord("latitude").points, self.latitudes)
     self.assertArrayEqual(result.coord("longitude").points, self.longitudes)
     self.assertArrayEqual(result.data, spot_values)
Example #2
0
 def test_building_cube(self):
     """Test that a cube is built as expected."""
     plugin = SpotExtraction()
     spot_values = np.array([0, 0, 12, 12])
     result = plugin.build_diagnostic_cube(
         self.neighbour_cube,
         self.diagnostic_cube_2d_time,
         spot_values,
         unique_site_id=self.unique_site_id,
         unique_site_id_key=self.unique_site_id_key,
         auxiliary_coords=[self.expected_spot_time_coord],
     )
     self.assertArrayEqual(result.coord("latitude").points, self.latitudes)
     self.assertArrayEqual(
         result.coord("longitude").points, self.longitudes)
     self.assertArrayEqual(result.coord("altitude").points, self.altitudes)
     self.assertArrayEqual(result.coord("wmo_id").points, self.wmo_ids)
     self.assertArrayEqual(
         result.coord(self.unique_site_id_key).points, self.unique_site_id)
     self.assertArrayEqual(
         result.coord("time").points, self.expected_spot_time_coord.points)
     self.assertArrayEqual(result.data, spot_values)