def test_map_to_points(reek_map): """Get the list of the coordinates""" px = Points() surf = RegularSurface(ftop1) assert isinstance(surf, RegularSurface) tsetup.assert_almostequal(surf.values.mean(), 0.5755830099, 0.001) px.from_surface(surf) # convert to a Points instance px = Points(reek_map) # or # px.from_surface(...) outf = os.path.join(td, 'points_from_surf_reek.poi') px.to_file(outf) assert px.dataframe['X_UTME'].min() == 456719.75 tsetup.assert_almostequal(px.dataframe['Z_TVDSS'].mean(), 0.57558, 0.001) # read the output for comparison pxx = Points(outf) tsetup.assert_almostequal(px.dataframe['Z_TVDSS'].mean(), pxx.dataframe['Z_TVDSS'].mean(), 0.00001)
def test_map_plot_with_points(): """Test as simple map plot with underlying points.""" mysurf = RegularSurface() mysurf.from_file(SFILE1) mypoints = Points() mypoints.from_surface(mysurf) df = mypoints.dataframe.copy() df = df[::20] mypoints.dataframe = df # just make the instance, with a lot of defaults behind the scene myplot = Map() myplot.canvas(title="My o my") myplot.colormap = "gist_ncar" myplot.plot_surface(mysurf) myplot.plot_points(mypoints) myplot.savefig("TMP/map_with_points.png")