def test_pressure_axis_given_time_pressure_lon_lat_dimensions(self): with netCDF4.Dataset(self.path, "w") as dataset: um = tutorial.UM(dataset) dims = ("time_1", "pressure_0", "longitude", "latitude") for dim in dims: dataset.createDimension(dim, 1) var = um.relative_humidity(dims) result = disk.pressure_axis(self.path, "relative_humidity") expect = 1 self.assertEqual(expect, result)
def test_pressure_axis_given_dim0_format(self): coordinates = "forecast_period_1 forecast_reference_time pressure time" with netCDF4.Dataset(self.path, "w") as dataset: um = tutorial.UM(dataset) dims = ("dim0", "longitude", "latitude") for dim in dims: dataset.createDimension(dim, 1) var = um.relative_humidity(dims, coordinates=coordinates) result = disk.pressure_axis(self.path, "relative_humidity") expect = 0 self.assertEqual(expect, result)