def do_regrid(q, lat, lon, lat2, lon2, order=1, mdi=-999999999): """ This function has been moved to the ocw/dataset_processor module """ from ocw import dataset_processor q2 = dataset_processor._rcmes_spatial_regrid(q, lat, lon, lat2, lon2, order=1) return q2
def test_return_array_shape(self): spatial_values = np.ones([90,180]) spatial_values = ma.array(spatial_values) lat_range = ma.array(range(-89, 90, 2)) lon_range = ma.array(range(-179, 180, 2)) lons, lats = np.meshgrid(lon_range, lat_range) # Convert these to masked arrays lats = ma.array(lats) lons = ma.array(lons) lat2_range = np.array(range(-89, 90, 4)) lon2_range = np.array(range(-179, 180, 4)) lons2, lats2 = np.meshgrid(lon2_range, lat2_range) # Convert to masked arrays lats2 = ma.array(lats2) lons2 = ma.array(lons2) regridded_values = dp._rcmes_spatial_regrid(spatial_values, lats, lons, lats2, lons2) self.assertEqual(regridded_values.shape, lats2.shape) self.assertEqual(regridded_values.shape, lons2.shape)