def test_fill_row_borders(self): lons = np.arange(20).reshape((4, 5), order="F") lats = np.arange(20).reshape((4, 5), order="C") lines = np.array([2, 7, 12, 17]) cols = np.array([2, 7, 12, 17, 22]) hlines = np.arange(20) hcols = np.arange(24) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols)) satint._fill_row_borders() self.assertTrue(np.allclose(satint.tie_data[0], np.array([[ 6381081.08333225, 6371519.34066148, 6328950.00792935, 6253610.69157758, 6145946.19489936], [ 6370997. , 6354509.6014956 , 6305151.62592155, 6223234.99818839, 6109277.14889072], [ 6345786.79166939, 6311985.2535809 , 6245655.67090206, 6147295.76471541, 6017604.5338691 ], [ 6270385.16249031, 6219684.08214232, 6137100.75832981, 6023313.2794414 , 5879194.72399075], [ 6145476.82098957, 6078546.55734877, 5980676.23854351, 5852716.72120069, 5695705.57359808], [ 6095513.48438928, 6022091.54743135, 5918106.430629 , 5784478.09790441, 5622309.91344102]]))) self.assertTrue(np.allclose(satint.row_indices, np.array([ 0, 2, 7, 12, 17, 19]))) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols), chunk_size=10) satint._fill_row_borders() self.assertTrue(np.allclose(satint.tie_data[0], np.array([[ 6381081.08333225, 6371519.34066148, 6328950.00792935, 6253610.69157758, 6145946.19489936], [ 6370997. , 6354509.6014956 , 6305151.62592155, 6223234.99818839, 6109277.14889072], [ 6345786.79166939, 6311985.2535809 , 6245655.67090206, 6147295.76471541, 6017604.5338691 ], [ 6335702.70833714, 6294975.51441502, 6221857.28889426, 6116920.07132621, 5980935.48786045], [ 6320348.4990906 , 6276139.09205974, 6199670.56624433, 6091551.90273768, 5952590.38414781], [ 6270385.16249031, 6219684.08214232, 6137100.75832981, 6023313.2794414 , 5879194.72399075], [ 6145476.82098957, 6078546.55734877, 5980676.23854351, 5852716.72120069, 5695705.57359808], [ 6095513.48438928, 6022091.54743135, 5918106.430629 , 5784478.09790441, 5622309.91344102]]))) self.assertTrue(np.allclose(satint.row_indices, np.array([ 0, 2, 7, 9, 10, 12, 17, 19])))
def test_fill_row_borders(self): lons = np.arange(20).reshape((4, 5), order="F") lats = np.arange(20).reshape((4, 5), order="C") lines = np.array([2, 7, 12, 17]) / 5.0 cols = np.array([2, 7, 12, 17, 22]) hlines = np.arange(20) / 5.0 hcols = np.arange(24) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols)) satint._fill_row_borders() np.testing.assert_allclose(satint.tie_data[0], TIES_EXP5) np.testing.assert_allclose(satint.row_indices, np.array([0, 2, 7, 12, 17, 19]) / 5.0) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols), chunk_size=10) satint._fill_row_borders() np.testing.assert_allclose(satint.tie_data[0], TIES_EXP6) np.testing.assert_allclose( satint.row_indices, np.array([0, 2, 7, 9, 10, 12, 17, 19]) / 5.0)
def test_fill_row_borders(self): lons = np.arange(20).reshape((4, 5), order="F") lats = np.arange(20).reshape((4, 5), order="C") lines = np.array([2, 7, 12, 17]) / 5.0 cols = np.array([2, 7, 12, 17, 22]) hlines = np.arange(20) / 5.0 hcols = np.arange(24) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols)) satint._fill_row_borders() np.testing.assert_allclose(satint.tie_data[0], TIES_EXP5) np.testing.assert_allclose(satint.row_indices, np.array([0, 2, 7, 12, 17, 19]) / 5.0) satint = GeoInterpolator((lons, lats), (lines, cols), (hlines, hcols), chunk_size=10) satint._fill_row_borders() np.testing.assert_allclose(satint.tie_data[0], TIES_EXP6) np.testing.assert_allclose(satint.row_indices, np.array([0, 2, 7, 9, 10, 12, 17, 19]) / 5.0)