diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c86e45b91..4fd08d66e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,26 +166,6 @@ jobs: pip install xmipy pip install . --use-feature=in-tree-build - - name: Setup symbolic link to gfortran on Linux - if: runner.os == 'Linux' - run: | - sudo ln -fs /usr/bin/gfortran-10 /usr/local/bin/gfortran - sudo ln -fs /usr/bin/gcc-10 /usr/local/bin/gcc - sudo ln -fs /usr/bin/g++-10 /usr/local/bin/g++ - - - name: Setup symbolic link to gfortran on macOS - if: runner.os == 'macOS' - run: | - sudo ln -fs /usr/local/bin/gfortran-10 /usr/local/bin/gfortran - sudo ln -fs /usr/local/bin/gcc-10 /usr/local/bin/gcc - sudo ln -fs /usr/local/bin/g++-10 /usr/local/bin/g++ - - - name: Print GNU compiler versions - run: | - gfortran --version - gcc --version - g++ --version - - name: Download executables needed for tests run: | cd autotest diff --git a/autotest/t007_test.py b/autotest/t007_test.py index db2016c686..904b1f55b8 100644 --- a/autotest/t007_test.py +++ b/autotest/t007_test.py @@ -7,7 +7,6 @@ import os import shutil import numpy as np -import warnings import flopy pth = os.path.join("..", "examples", "data", "mf2005_test") @@ -238,7 +237,7 @@ def test_freyberg_export(): assert os.path.exists(outshp) remove_shp(outshp) m.modelgrid = StructuredGrid( - delc=m.dis.delc.array, delr=m.dis.delr.array, epsg=5070 + delc=m.dis.delc.array, delr=m.dis.delr.array, epsg=3070 ) # test export with an sr, regardless of whether or not wkt was found m.drn.stress_period_data.export(outshp, sparse=True) @@ -254,15 +253,19 @@ def test_freyberg_export(): assert m.drn.stress_period_data.mg.yoffset == m.modelgrid.yoffset assert m.drn.stress_period_data.mg.angrot == m.modelgrid.angrot + # get wkt text was fetched from spatialreference.org + wkt = flopy.export.shapefile_utils.CRS.get_spatialreference( + m.modelgrid.epsg + ) # if wkt text was fetched from spatialreference.org - if m.sr.wkt is not None: + if wkt is not None: # test default package export outshp = os.path.join(spth, namfile[:-4] + "_dis.shp") m.dis.export(outshp) prjfile = outshp.replace(".shp", ".prj") with open(prjfile) as src: prjtxt = src.read() - assert prjtxt == m.sr.wkt + assert prjtxt == wkt remove_shp(outshp) # test default package export to higher level dir @@ -271,7 +274,7 @@ def test_freyberg_export(): prjfile = outshp.replace(".shp", ".prj") with open(prjfile) as src: prjtxt = src.read() - assert prjtxt == m.sr.wkt + assert prjtxt == wkt remove_shp(outshp) # test sparse package export @@ -281,7 +284,7 @@ def test_freyberg_export(): assert os.path.exists(prjfile) with open(prjfile) as src: prjtxt = src.read() - assert prjtxt == m.sr.wkt + assert prjtxt == wkt remove_shp(outshp) @@ -436,8 +439,7 @@ def test_export_array(): rot_cellsize = ( np.cos(np.radians(m.modelgrid.angrot)) * m.modelgrid.delr[0] - ) # * m.sr.length_multiplier - # assert np.abs(val - rot_cellsize) < 1e-6 + ) break rotate = False rasterio = None @@ -643,15 +645,14 @@ def test_sr(): proj4_str="test test test", ) flopy.modflow.ModflowDis(m, 10, 10, 10) - m.sr.xll = 12345 - m.sr.yll = 12345 m.write_input() mm = flopy.modflow.Modflow.load("test.nam", model_ws="./temp") - if mm.sr.xul != 12345: + extents = mm.modelgrid.extent + if extents[2] != 12345: raise AssertionError() - if mm.sr.yul != 12355: + if extents[3] != 12355: raise AssertionError() - if mm.sr.proj4_str != "test test test": + if mm.modelgrid.proj4 != "test test test": raise AssertionError() @@ -681,11 +682,6 @@ def test_dis_sr(): proj4_str="epsg:2243", ) - # SpatialReference has been deprecated - # if abs(dis.sr.xul - xul) > 0.01: - # raise AssertionError() - # if abs(dis.sr.yul - yul) > 0.01: - # raise AssertionError() # Use StructuredGrid instead x, y = bg.modelgrid.get_coords(0, delc * nrow) np.testing.assert_almost_equal(x, xul) @@ -745,8 +741,6 @@ def test_mg(): dis.delc.array, dis.delr.array, xoff=1, yoff=1 ) - # txt = 'yul does not approximately equal 100 - ' + \ - # '(xul, yul) = ({}, {})'.format( ms.sr.yul, ms.sr.yul) assert abs(ms.modelgrid.extent[-1] - Ly) < 1e-3 # , txt ms.modelgrid.set_coord_info(xoff=111, yoff=0) assert ms.modelgrid.xoffset == 111 @@ -795,7 +789,6 @@ def test_mg(): assert str(ms1.modelgrid) == str(ms.modelgrid) assert ms1.start_datetime == ms.start_datetime assert ms1.modelgrid.lenuni == ms.modelgrid.lenuni - # assert ms1.sr.lenuni != sr.lenuni def test_epsgs(): @@ -838,156 +831,29 @@ def test_dynamic_xll_yll(): dis = flopy.modflow.ModflowDis( ms2, nlay=nlay, nrow=nrow, ncol=ncol, delr=delr, delc=delc ) - sr1 = flopy.utils.reference.SpatialReference( - delr=ms2.dis.delr.array, - delc=ms2.dis.delc.array, - lenuni=2, - xll=xll, - yll=yll, - rotation=30, - ) - xul, yul = sr1.xul, sr1.yul - sr1.length_multiplier = 1.0 / 3.281 - - msg = "sr1.xll ({}) is not equal to {}".format(sr1.xll, xll) - assert sr1.xll == xll, msg - - msg = "sr1.yll ({}) is not equal to {}".format(sr1.yll, yll) - assert sr1.yll == yll, msg - - sr2 = flopy.utils.reference.SpatialReference( - delr=ms2.dis.delr.array, - delc=ms2.dis.delc.array, - lenuni=2, - xul=xul, - yul=yul, - rotation=30, - ) - sr2.length_multiplier = 1.0 / 3.281 - msg = "sr2.xul ({}) is not equal to {}".format(sr2.xul, xul) - assert sr2.xul == xul, msg + ms2.modelgrid.set_coord_info(xoff=xll, yoff=yll, angrot=30.0) + xll1, yll1 = ms2.modelgrid.xoffset, ms2.modelgrid.yoffset - msg = "sr2.yul ({}) is not equal to {}".format(sr2.yul, yul) - assert sr2.yul == yul, msg - - # test resetting of attributes - sr3 = flopy.utils.reference.SpatialReference( - delr=ms2.dis.delr.array, - delc=ms2.dis.delc.array, - lenuni=2, - xll=xll, - yll=yll, - rotation=30, + assert xll1 == xll, "modelgrid.xoffset ({}) is not equal to {}".format( + xll1, xll ) - # check that xul, yul and xll, yll are being recomputed - sr3.xll += 10.0 - sr3.yll += 21.0 - - t_value = np.abs(sr3.xul - (xul + 10.0)) - msg = "xul is not being recomputed correctly ({})".format(t_value) - assert t_value < 1e-6, msg - - t_value = np.abs(sr3.yul - (yul + 21.0)) - msg = "yul is not being recomputed correctly ({})".format(t_value) - assert t_value < 1e-6, msg - - sr4 = flopy.utils.reference.SpatialReference( - delr=ms2.dis.delr.array, - delc=ms2.dis.delc.array, - lenuni=2, - xul=xul, - yul=yul, - rotation=30, + assert yll1 == yll, "modelgrid.yoffset ({}) is not equal to {}".format( + yll1, yll ) - assert sr4.origin_loc == "ul" - sr4.xul += 10.0 - sr4.yul += 21.0 - - t_value = np.abs(sr4.xll - (xll + 10.0)) - msg = "xll is not being recomputed correctly ({})".format(t_value) - assert t_value < 1e-6, msg - - t_value = np.abs(sr4.yll - (yll + 21.0)) - msg = "yll is not being recomputed correctly ({})".format(t_value) - assert t_value < 1e-6, msg - - sr4.rotation = 0.0 - # these shouldn't move because ul has priority - t_value = np.abs(sr4.xul - (xul + 10.0)) - msg = "rotation should not affect xul ({})".format(t_value) - assert t_value < 1e-6, msg + # check that xll, yll are being recomputed + xll += 10.0 + yll += 21.0 + ms2.modelgrid.set_coord_info(xoff=xll, yoff=yll, angrot=30.0) + xll1, yll1 = ms2.modelgrid.xoffset, ms2.modelgrid.yoffset - t_value = np.abs(sr4.yul - (yul + 21.0)) - msg = "rotation should not affect yul ({})".format(t_value) - assert t_value < 1e-6, msg - - t_value = np.abs(sr4.xll - sr4.xul) - msg = "rotation should not affect xul and xll ({})".format(t_value) - assert t_value < 1e-6, msg - - t_value = np.abs(sr4.yll - (sr4.yul - sr4.yedge[0])) - msg = "rotation should not affect yul and yll ({})".format(t_value) - assert t_value < 1e-6, msg - - sr4.xll = 0.0 - sr4.yll = 10.0 - assert sr4.origin_loc == "ll", "origin_loc is not 'll'" - - assert sr4.xul == 0.0, "xul is not 0 ({})".format(sr4.xul) - - t_value = sr4.yedge[0] + 10.0 - msg = "yul ({}) is not {}".format(sr4.yul, t_value) - assert sr4.yul == t_value, msg - - sr4.xul = xul - sr4.yul = yul - assert sr4.origin_loc == "ul", "origin_loc is not 'ul'" - - sr4.rotation = 30.0 - - t_value = np.abs(sr4.xll - xll) - msg = "sr4.xll ({}) does not equal {}".format(sr4.xll, xll) - assert t_value < 1e-6, msg - - t_value = np.abs(sr4.yll - yll) - msg = "sr4.yll ({}) does not equal {}".format(sr4.yll, yll) - assert t_value < 1e-6, msg - - sr5 = flopy.utils.reference.SpatialReference( - delr=ms2.dis.delr.array, - delc=ms2.dis.delc.array, - lenuni=2, - xll=xll, - yll=yll, - rotation=0, - epsg=26915, + assert xll1 == xll, "modelgrid.xoffset ({}) is not equal to {}".format( + xll1, xll ) - sr5.lenuni = 1 - assert ( - sr5.length_multiplier == 0.3048 - ), "sr5 length multiplier is not .3048" - - assert sr5.yul == sr5.yll + sr5.yedge[0] * sr5.length_multiplier - - sr5.lenuni = 2 - msg = "sr5.length_multiplier ({}) is not 1.".format(sr5.length_multiplier) - assert sr5.length_multiplier == 1.0, msg - - t_value = sr5.yll + sr5.yedge[0] - msg = "sr4.yul ({}) does not equal {}".format(sr5.yul, t_value) - assert sr5.yul == t_value, msg - - sr5.proj4_str = "+proj=utm +zone=16 +datum=NAD83 +units=us-ft +no_defs" - msg = "sr5 units ({}) is not 'feet'".format(sr5.units) - assert sr5.units == "feet", msg - - t_value = 1 / 0.3048 - msg = "sr5 length_multiplier ({}) is not {}".format( - sr5.length_multiplier, t_value + assert yll1 == yll, "modelgrid.yoffset ({}) is not equal to {}".format( + yll1, yll ) - assert sr5.length_multiplier == t_value, msg def test_namfile_readwrite(): @@ -1202,11 +1068,19 @@ def check_vertices(): # Model domain and grid definition dis = flopy.modflow.ModflowDis( - mf, nlay=1, nrow=10, ncol=20, delr=1.0, delc=1.0, xul=100, yul=210 + mf, + nlay=1, + nrow=10, + ncol=20, + delr=1.0, + delc=1.0, + ) + xul, yul = 100.0, 210.0 + mg = mf.modelgrid + mf.modelgrid.set_coord_info( + xoff=mg._xul_to_xll(xul, 0.0), yoff=mg._yul_to_yll(yul, 0.0) ) - verts = [[101.0, 201.0], [119.0, 209.0]] - mf.modelgrid.set_coord_info(xoff=mf.dis.sr.xll, yoff=mf.dis.sr.yll) modelxsect = flopy.plot.PlotCrossSection(model=mf, line={"line": verts}) patchcollection = modelxsect.plot_grid() plt.close() @@ -1420,7 +1294,6 @@ def test_tricontour_NaN(): def test_get_vertices(): - from flopy.utils.reference import SpatialReference from flopy.discretization import StructuredGrid m = flopy.modflow.Modflow(rotation=20.0) @@ -1428,16 +1301,14 @@ def test_get_vertices(): dis = flopy.modflow.ModflowDis( m, nlay=1, nrow=nrow, ncol=ncol, delr=250.0, delc=250.0, top=10, botm=0 ) + mmg = m.modelgrid xul, yul = 500000, 2934000 - sr = SpatialReference( - delc=m.dis.delc.array, xul=xul, yul=yul, rotation=45.0 - ) mg = StructuredGrid( delc=m.dis.delc.array, delr=m.dis.delr.array, - xoff=sr.xll, - yoff=sr.yll, - angrot=sr.rotation, + xoff=mmg._xul_to_xll(xul, 45.0), + yoff=mmg._yul_to_yll(xul, 45.0), + angrot=45.0, ) xgrid = mg.xvertices @@ -1796,7 +1667,7 @@ def main(): # test_mbase_modelgrid() # test_mt_modelgrid() # test_rotation() - test_model_dot_plot() + # test_model_dot_plot() # test_get_lrc_get_node() # test_vertex_model_dot_plot() # test_sr_with_Map() @@ -1810,7 +1681,7 @@ def main(): # test_get_vertices() # test_export_output() # for namfile in namfiles: - # test_freyberg_export() + test_freyberg_export() # test_export_array() # test_write_shapefile() # test_wkt_parse() @@ -1819,7 +1690,7 @@ def main(): # test_export_array_contours() # test_tricontour_NaN() # test_export_contourf() - # test_sr() + test_sr() # test_shapefile_polygon_closed() # test_mapview_plot_bc() # test_crosssection_plot_bc() diff --git a/autotest/t009_test.py b/autotest/t009_test.py index 28ea2bd729..43cec8c64c 100644 --- a/autotest/t009_test.py +++ b/autotest/t009_test.py @@ -24,7 +24,6 @@ fm = flopy.modflow from flopy.utils.sfroutputfile import SfrFile from flopy.discretization import StructuredGrid -from flopy.utils.reference import SpatialReference path = os.path.join("..", "examples", "data", "mf2005_test") path2 = os.path.join("..", "examples", "data", "sfr_test") diff --git a/autotest/t031_test.py b/autotest/t031_test.py index 0e287054e9..4618ad2bd4 100644 --- a/autotest/t031_test.py +++ b/autotest/t031_test.py @@ -12,7 +12,6 @@ from flopy.discretization import StructuredGrid from flopy.utils.modpathfile import EndpointFile, PathlineFile from flopy.utils.recarray_utils import ra_slice -from flopy.utils.reference import SpatialReference from flopy.modpath.mp6sim import StartingLocationsFile try: @@ -135,7 +134,6 @@ def test_get_destination_data(): ) # test deprecation - sr2 = SpatialReference(xll=mg.xoffset, yll=mg.yoffset, rotation=-30) if shapefile: m.dis.export(path + "/dis.shp") @@ -204,7 +202,7 @@ def test_get_destination_data(): well_pthld, one_per_particle=True, direction="starting", - sr=sr2, + mg=mg, shpname=fpth, ) fpth = os.path.join(path, "pathlines.shp") @@ -262,9 +260,7 @@ def test_get_destination_data(): # arbitrary spatial reference with ll specified instead of ul ra = shp2recarray(os.path.join(path, "pathlines_1per2_ll.shp")) p3_2 = ra.geometry[ra.particleid == 4][0] - # sr3 = SpatialReference(xll=sr.xll, yll=sr.yll, rotation=-30, - # delc=list(m.dis.delc)) - mg.set_coord_info(xoff=mg.xoffset, yoff=mg.yoffset, angrot=-30.0) + mg.set_coord_info(xoff=mg.xoffset, yoff=mg.yoffset, angrot=30.0) assert ( np.abs( p3_2.x[0] diff --git a/docs/notebook_examples.md b/docs/notebook_examples.md index ce3eac95a7..6d5f782572 100644 --- a/docs/notebook_examples.md +++ b/docs/notebook_examples.md @@ -19,8 +19,6 @@ The following jupyter Notebooks contain examples for using FloPy pre- and post-p + An overview of how FloPy handles external files for numeric arrays written by FloPy to MODFLOW-based input files is given in the [flopy3_external_file_handling](../examples/Notebooks/flopy3_external_file_handling.ipynb) Notebook. -+ An overview of FloPy functionality in the ```SpatialReference``` class for locating the model in a "real world" coordinate reference system is given in the [flopy3_SpatialReference_demo](../examples/Notebooks/flopy3_SpatialReference_demo.ipynb) Notebook. - + An overview of FloPy capabilities to load a SFR2 file and evaluate data contained in the file is given in the [flopy3_SFR2_load](../examples/Notebooks/flopy3_SFR2_load.ipynb) Notebook. + An overview of FloPy capabilities to create a SFR2 file and evaluate data contained in the file is given in the [flopy3_sfrpackage_example](../examples/Notebooks/flopy3_sfrpackage_example.ipynb) Notebook. This example also shows how to read SFR water balance output into a pandas dataframe for additional postprocessing. diff --git a/examples/Notebooks/flopy3_SpatialReference_demo.ipynb b/examples/Notebooks/flopy3_SpatialReference_demo.ipynb deleted file mode 100644 index a5012ccbf7..0000000000 --- a/examples/Notebooks/flopy3_SpatialReference_demo.ipynb +++ /dev/null @@ -1,1408 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# FloPy \n", - "\n", - "### `SpatialReference` demo\n", - "\n", - "A short demonstration of functionality in the `SpatialReference` class for locating the model in a \"real world\" coordinate reference system" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "3.8.6 | packaged by conda-forge | (default, Oct 7 2020, 18:42:56) \n", - "[Clang 10.0.1 ]\n", - "numpy version: 1.18.5\n", - "matplotlib version: 3.2.2\n", - "flopy version: 3.3.3\n" - ] - } - ], - "source": [ - "import sys\n", - "import os\n", - "import shutil\n", - "import numpy as np\n", - "import matplotlib as mpl\n", - "import matplotlib.pyplot as plt\n", - "\n", - "# run installed version of flopy or add local path\n", - "try:\n", - " import flopy\n", - "except:\n", - " fpth = os.path.abspath(os.path.join('..', '..'))\n", - " sys.path.append(fpth)\n", - " import flopy\n", - " \n", - "from flopy.utils.reference import SpatialReference\n", - "import flopy.utils.binaryfile as bf\n", - "\n", - "print(sys.version)\n", - "print('numpy version: {}'.format(np.__version__))\n", - "print('matplotlib version: {}'.format(mpl.__version__))\n", - "print('flopy version: {}'.format(flopy.__version__))" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "outpath = 'data'\n", - "if os.path.isdir(outpath):\n", - " shutil.rmtree(outpath)\n", - "os.mkdir(outpath)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Description\n", - "\n", - "`SpatialReference` is a stand-alone option that describes the location of the model grid in a real-world coordinate reference system. It can be created with some basic information about the model's location." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "nrow, ncol = 10, 10\n", - "xll, yll = 617822.3, 5114820.7 # origin of the model (lower left corner)\n", - "dxdy = 250 # grid spacing (in model units)\n", - "rot = 29 # rotation (positive counterclockwise)\n", - "\n", - "# epsg code specifying coordinate reference system\n", - "# (https://www.epsg-registry.org/)\n", - "# in this case, UTM zone 16 N, NAD83\n", - "# https://spatialreference.org/ref/epsg/nad83-utm-zone-16n/\n", - "model_epsg = 26915\n", - "\n", - "# alternatively, a proj4 string can be supplied\n", - "model_proj4 = 'https://spatialreference.org/ref/epsg/nad83-utm-zone-16n/proj4/'\n", - "\n", - "# row and column spacings\n", - "# (note that delc is column spacings along a row; delr the row spacings along a column)\n", - "delc = np.ones(nrow, dtype=float) * dxdy\n", - "delr = np.ones(ncol, dtype=float) * dxdy\n", - "\n", - "sr = SpatialReference(delr=delr, delc=delc, xll=xll, yll=yll, rotation=rot, epsg=model_epsg)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### `SpatialReference` makes many calculations internally, so you don't have to\n", - "\n", - "calling the sr object prints the important parameters. Note that the upper right corner of the model, which is often used to specify the origin, has been calculated. A proj4 string has also been fetched from using the supplied epsg code." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "xul:616610.2759; yul:5117007.249; rotation:29; proj4_str:+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ; units:meters; lenuni:2; length_multiplier:1.0" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Note the length parameters\n", - "**units**: Length units for real world coordinate system (typically meters; feet are also supported). This attribute is inferred from the epsg code or proj4 string, but can also be supplied. \n", - "**lenuni**: MODFLOW length unit ([see documentation]()) (default is 2, meters). \n", - "**length_multiplier**: multiplier for scaling grid from MODFLOW units to real world crs units. This parameter is inferred from the above units, or can be supplied directly. \n", - "\n", - "#### `SpatialReference` parameters can be updated dynamically" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# switch the MODFLOW units to feet\n", - "sr.lenuni = 1" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "xul:617452.8751; yul:5115487.16; rotation:29; proj4_str:+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs ; units:meters; lenuni:1; length_multiplier:0.3048" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Note that the length multiplier and xul, yul changed\n", - "the lower left corner was maintained because it was specified. If xul, yul had been specified instead, that would have been preserved." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(617822.3, 5114820.7)" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.xll, sr.yll" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### information about the grid coordinates\n", - "\n", - "#### cell centroids" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(array([[617504.66932675, 617571.31534843, 617637.96137011,\n", - " 617704.6073918 , 617771.25341348, 617837.89943517,\n", - " 617904.54545685, 617971.19147853, 618037.83750022,\n", - " 618104.4835219 ],\n", - " [617541.61181981, 617608.25784149, 617674.90386318,\n", - " 617741.54988486, 617808.19590654, 617874.84192823,\n", - " 617941.48794991, 618008.1339716 , 618074.77999328,\n", - " 618141.42601496],\n", - " [617578.55431287, 617645.20033456, 617711.84635624,\n", - " 617778.49237792, 617845.13839961, 617911.78442129,\n", - " 617978.43044298, 618045.07646466, 618111.72248634,\n", - " 618178.36850803],\n", - " [617615.49680593, 617682.14282762, 617748.7888493 ,\n", - " 617815.43487099, 617882.08089267, 617948.72691435,\n", - " 618015.37293604, 618082.01895772, 618148.66497941,\n", - " 618215.31100109],\n", - " [617652.439299 , 617719.08532068, 617785.73134237,\n", - " 617852.37736405, 617919.02338573, 617985.66940742,\n", - " 618052.3154291 , 618118.96145079, 618185.60747247,\n", - " 618252.25349415],\n", - " [617689.38179206, 617756.02781374, 617822.67383543,\n", - " 617889.31985711, 617955.9658788 , 618022.61190048,\n", - " 618089.25792216, 618155.90394385, 618222.54996553,\n", - " 618289.19598722],\n", - " [617726.32428512, 617792.97030681, 617859.61632849,\n", - " 617926.26235017, 617992.90837186, 618059.55439354,\n", - " 618126.20041523, 618192.84643691, 618259.49245859,\n", - " 618326.13848028],\n", - " [617763.26677819, 617829.91279987, 617896.55882155,\n", - " 617963.20484324, 618029.85086492, 618096.49688661,\n", - " 618163.14290829, 618229.78892997, 618296.43495166,\n", - " 618363.08097334],\n", - " [617800.20927125, 617866.85529293, 617933.50131462,\n", - " 618000.1473363 , 618066.79335798, 618133.43937967,\n", - " 618200.08540135, 618266.73142304, 618333.37744472,\n", - " 618400.0234664 ],\n", - " [617837.15176431, 617903.79778599, 617970.44380768,\n", - " 618037.08982936, 618103.73585105, 618170.38187273,\n", - " 618237.02789441, 618303.6739161 , 618370.31993778,\n", - " 618436.96595947]]),\n", - " array([[5115472.30845253, 5115509.25094559, 5115546.19343866,\n", - " 5115583.13593172, 5115620.07842478, 5115657.02091784,\n", - " 5115693.96341091, 5115730.90590397, 5115767.84839703,\n", - " 5115804.79089009],\n", - " [5115405.66243085, 5115442.60492391, 5115479.54741697,\n", - " 5115516.48991003, 5115553.4324031 , 5115590.37489616,\n", - " 5115627.31738922, 5115664.25988229, 5115701.20237535,\n", - " 5115738.14486841],\n", - " [5115339.01640916, 5115375.95890222, 5115412.90139529,\n", - " 5115449.84388835, 5115486.78638141, 5115523.72887448,\n", - " 5115560.67136754, 5115597.6138606 , 5115634.55635366,\n", - " 5115671.49884673],\n", - " [5115272.37038748, 5115309.31288054, 5115346.2553736 ,\n", - " 5115383.19786667, 5115420.14035973, 5115457.08285279,\n", - " 5115494.02534585, 5115530.96783892, 5115567.91033198,\n", - " 5115604.85282504],\n", - " [5115205.72436579, 5115242.66685886, 5115279.60935192,\n", - " 5115316.55184498, 5115353.49433804, 5115390.43683111,\n", - " 5115427.37932417, 5115464.32181723, 5115501.2643103 ,\n", - " 5115538.20680336],\n", - " [5115139.07834411, 5115176.02083717, 5115212.96333024,\n", - " 5115249.9058233 , 5115286.84831636, 5115323.79080942,\n", - " 5115360.73330249, 5115397.67579555, 5115434.61828861,\n", - " 5115471.56078167],\n", - " [5115072.43232243, 5115109.37481549, 5115146.31730855,\n", - " 5115183.25980161, 5115220.20229468, 5115257.14478774,\n", - " 5115294.0872808 , 5115331.02977386, 5115367.97226693,\n", - " 5115404.91475999],\n", - " [5115005.78630074, 5115042.7287938 , 5115079.67128687,\n", - " 5115116.61377993, 5115153.55627299, 5115190.49876606,\n", - " 5115227.44125912, 5115264.38375218, 5115301.32624524,\n", - " 5115338.26873831],\n", - " [5114939.14027906, 5114976.08277212, 5115013.02526518,\n", - " 5115049.96775825, 5115086.91025131, 5115123.85274437,\n", - " 5115160.79523743, 5115197.7377305 , 5115234.68022356,\n", - " 5115271.62271662],\n", - " [5114872.49425737, 5114909.43675044, 5114946.3792435 ,\n", - " 5114983.32173656, 5115020.26422962, 5115057.20672269,\n", - " 5115094.14921575, 5115131.09170881, 5115168.03420188,\n", - " 5115204.97669494]]))" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.xcentergrid, sr.ycentergrid" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### cell vertices" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[[[617452.8750693724, 5115487.16021684],\n", - " [617489.8175624352, 5115420.514195156],\n", - " [617556.4635841191, 5115457.456688219],\n", - " [617519.5210910563, 5115524.102709902],\n", - " [617452.8750693724, 5115487.16021684]],\n", - " [[617519.5210910563, 5115524.102709902],\n", - " [617556.4635841191, 5115457.456688219],\n", - " [617623.1096058033, 5115494.399181282],\n", - " [617586.1671127405, 5115561.045202966],\n", - " [617519.5210910563, 5115524.102709902]],\n", - " [[617586.1671127405, 5115561.045202966],\n", - " [617623.1096058033, 5115494.399181282],\n", - " [617689.7556274872, 5115531.341674345],\n", - " [617652.8131344244, 5115597.987696028],\n", - " [617586.1671127405, 5115561.045202966]],\n", - " [[617652.8131344244, 5115597.987696028],\n", - " [617689.7556274872, 5115531.341674345],\n", - " [617756.4016491713, 5115568.284167407],\n", - " [617719.4591561084, 5115634.930189091],\n", - " [617652.8131344244, 5115597.987696028]],\n", - " [[617719.4591561084, 5115634.930189091],\n", - " [617756.4016491713, 5115568.284167407],\n", - " [617823.0476708553, 5115605.2266604705],\n", - " [617786.1051777925, 5115671.872682154],\n", - " [617719.4591561084, 5115634.930189091]],\n", - " [[617786.1051777925, 5115671.872682154],\n", - " [617823.0476708553, 5115605.2266604705],\n", - " [617889.6936925392, 5115642.169153533],\n", - " [617852.7511994764, 5115708.815175217],\n", - " [617786.1051777925, 5115671.872682154]],\n", - " [[617852.7511994764, 5115708.815175217],\n", - " [617889.6936925392, 5115642.169153533],\n", - " [617956.3397142234, 5115679.111646595],\n", - " [617919.3972211606, 5115745.757668279],\n", - " [617852.7511994764, 5115708.815175217]],\n", - " [[617919.3972211606, 5115745.757668279],\n", - " [617956.3397142234, 5115679.111646595],\n", - " [618022.9857359073, 5115716.054139659],\n", - " [617986.0432428445, 5115782.7001613425],\n", - " [617919.3972211606, 5115745.757668279]],\n", - " [[617986.0432428445, 5115782.7001613425],\n", - " [618022.9857359073, 5115716.054139659],\n", - " [618089.6317575914, 5115752.996632721],\n", - " [618052.6892645286, 5115819.642654405],\n", - " [617986.0432428445, 5115782.7001613425]],\n", - " [[618052.6892645286, 5115819.642654405],\n", - " [618089.6317575914, 5115752.996632721],\n", - " [618156.2777792754, 5115789.939125784],\n", - " [618119.3352862126, 5115856.585147467],\n", - " [618052.6892645286, 5115819.642654405]],\n", - " [[617489.8175624352, 5115420.514195156],\n", - " [617526.7600554981, 5115353.868173472],\n", - " [617593.406077182, 5115390.810666534],\n", - " [617556.4635841191, 5115457.456688219],\n", - " [617489.8175624352, 5115420.514195156]],\n", - " [[617556.4635841191, 5115457.456688219],\n", - " [617593.406077182, 5115390.810666534],\n", - " [617660.0520988662, 5115427.7531595975],\n", - " [617623.1096058033, 5115494.399181282],\n", - " [617556.4635841191, 5115457.456688219]],\n", - " [[617623.1096058033, 5115494.399181282],\n", - " [617660.0520988662, 5115427.7531595975],\n", - " [617726.6981205501, 5115464.69565266],\n", - " [617689.7556274872, 5115531.341674345],\n", - " [617623.1096058033, 5115494.399181282]],\n", - " [[617689.7556274872, 5115531.341674345],\n", - " [617726.6981205501, 5115464.69565266],\n", - " [617793.3441422342, 5115501.638145722],\n", - " [617756.4016491713, 5115568.284167407],\n", - " [617689.7556274872, 5115531.341674345]],\n", - " [[617756.4016491713, 5115568.284167407],\n", - " [617793.3441422342, 5115501.638145722],\n", - " [617859.9901639182, 5115538.580638786],\n", - " [617823.0476708553, 5115605.2266604705],\n", - " [617756.4016491713, 5115568.284167407]],\n", - " [[617823.0476708553, 5115605.2266604705],\n", - " [617859.9901639182, 5115538.580638786],\n", - " [617926.6361856022, 5115575.523131848],\n", - " [617889.6936925392, 5115642.169153533],\n", - " [617823.0476708553, 5115605.2266604705]],\n", - " [[617889.6936925392, 5115642.169153533],\n", - " [617926.6361856022, 5115575.523131848],\n", - " [617993.2822072863, 5115612.465624911],\n", - " [617956.3397142234, 5115679.111646595],\n", - " [617889.6936925392, 5115642.169153533]],\n", - " [[617956.3397142234, 5115679.111646595],\n", - " [617993.2822072863, 5115612.465624911],\n", - " [618059.9282289703, 5115649.408117974],\n", - " [618022.9857359073, 5115716.054139659],\n", - " [617956.3397142234, 5115679.111646595]],\n", - " [[618022.9857359073, 5115716.054139659],\n", - " [618059.9282289703, 5115649.408117974],\n", - " [618126.5742506543, 5115686.350611037],\n", - " [618089.6317575914, 5115752.996632721],\n", - " [618022.9857359073, 5115716.054139659]],\n", - " [[618089.6317575914, 5115752.996632721],\n", - " [618126.5742506543, 5115686.350611037],\n", - " [618193.2202723384, 5115723.293104099],\n", - " [618156.2777792754, 5115789.939125784],\n", - " [618089.6317575914, 5115752.996632721]],\n", - " [[617526.7600554981, 5115353.868173472],\n", - " [617563.7025485605, 5115287.222151789],\n", - " [617630.3485702444, 5115324.164644851],\n", - " [617593.406077182, 5115390.810666534],\n", - " [617526.7600554981, 5115353.868173472]],\n", - " [[617593.406077182, 5115390.810666534],\n", - " [617630.3485702444, 5115324.164644851],\n", - " [617696.9945919286, 5115361.107137915],\n", - " [617660.0520988662, 5115427.7531595975],\n", - " [617593.406077182, 5115390.810666534]],\n", - " [[617660.0520988662, 5115427.7531595975],\n", - " [617696.9945919286, 5115361.107137915],\n", - " [617763.6406136125, 5115398.049630977],\n", - " [617726.6981205501, 5115464.69565266],\n", - " [617660.0520988662, 5115427.7531595975]],\n", - " [[617726.6981205501, 5115464.69565266],\n", - " [617763.6406136125, 5115398.049630977],\n", - " [617830.2866352965, 5115434.99212404],\n", - " [617793.3441422342, 5115501.638145722],\n", - " [617726.6981205501, 5115464.69565266]],\n", - " [[617793.3441422342, 5115501.638145722],\n", - " [617830.2866352965, 5115434.99212404],\n", - " [617896.9326569806, 5115471.934617103],\n", - " [617859.9901639182, 5115538.580638786],\n", - " [617793.3441422342, 5115501.638145722]],\n", - " [[617859.9901639182, 5115538.580638786],\n", - " [617896.9326569806, 5115471.934617103],\n", - " [617963.5786786645, 5115508.877110166],\n", - " [617926.6361856022, 5115575.523131848],\n", - " [617859.9901639182, 5115538.580638786]],\n", - " [[617926.6361856022, 5115575.523131848],\n", - " [617963.5786786645, 5115508.877110166],\n", - " [618030.2247003487, 5115545.819603228],\n", - " [617993.2822072863, 5115612.465624911],\n", - " [617926.6361856022, 5115575.523131848]],\n", - " [[617993.2822072863, 5115612.465624911],\n", - " [618030.2247003487, 5115545.819603228],\n", - " [618096.8707220326, 5115582.762096291],\n", - " [618059.9282289703, 5115649.408117974],\n", - " [617993.2822072863, 5115612.465624911]],\n", - " [[618059.9282289703, 5115649.408117974],\n", - " [618096.8707220326, 5115582.762096291],\n", - " [618163.5167437167, 5115619.704589354],\n", - " [618126.5742506543, 5115686.350611037],\n", - " [618059.9282289703, 5115649.408117974]],\n", - " [[618126.5742506543, 5115686.350611037],\n", - " [618163.5167437167, 5115619.704589354],\n", - " [618230.1627654007, 5115656.647082416],\n", - " [618193.2202723384, 5115723.293104099],\n", - " [618126.5742506543, 5115686.350611037]],\n", - " [[617563.7025485605, 5115287.222151789],\n", - " [617600.6450416234, 5115220.576130104],\n", - " [617667.2910633073, 5115257.518623167],\n", - " [617630.3485702444, 5115324.164644851],\n", - " [617563.7025485605, 5115287.222151789]],\n", - " [[617630.3485702444, 5115324.164644851],\n", - " [617667.2910633073, 5115257.518623167],\n", - " [617733.9370849915, 5115294.46111623],\n", - " [617696.9945919286, 5115361.107137915],\n", - " [617630.3485702444, 5115324.164644851]],\n", - " [[617696.9945919286, 5115361.107137915],\n", - " [617733.9370849915, 5115294.46111623],\n", - " [617800.5831066754, 5115331.403609293],\n", - " [617763.6406136125, 5115398.049630977],\n", - " [617696.9945919286, 5115361.107137915]],\n", - " [[617763.6406136125, 5115398.049630977],\n", - " [617800.5831066754, 5115331.403609293],\n", - " [617867.2291283595, 5115368.346102355],\n", - " [617830.2866352965, 5115434.99212404],\n", - " [617763.6406136125, 5115398.049630977]],\n", - " [[617830.2866352965, 5115434.99212404],\n", - " [617867.2291283595, 5115368.346102355],\n", - " [617933.8751500435, 5115405.288595418],\n", - " [617896.9326569806, 5115471.934617103],\n", - " [617830.2866352965, 5115434.99212404]],\n", - " [[617896.9326569806, 5115471.934617103],\n", - " [617933.8751500435, 5115405.288595418],\n", - " [618000.5211717275, 5115442.231088481],\n", - " [617963.5786786645, 5115508.877110166],\n", - " [617896.9326569806, 5115471.934617103]],\n", - " [[617963.5786786645, 5115508.877110166],\n", - " [618000.5211717275, 5115442.231088481],\n", - " [618067.1671934116, 5115479.173581543],\n", - " [618030.2247003487, 5115545.819603228],\n", - " [617963.5786786645, 5115508.877110166]],\n", - " [[618030.2247003487, 5115545.819603228],\n", - " [618067.1671934116, 5115479.173581543],\n", - " [618133.8132150955, 5115516.116074607],\n", - " [618096.8707220326, 5115582.762096291],\n", - " [618030.2247003487, 5115545.819603228]],\n", - " [[618096.8707220326, 5115582.762096291],\n", - " [618133.8132150955, 5115516.116074607],\n", - " [618200.4592367796, 5115553.058567669],\n", - " [618163.5167437167, 5115619.704589354],\n", - " [618096.8707220326, 5115582.762096291]],\n", - " [[618163.5167437167, 5115619.704589354],\n", - " [618200.4592367796, 5115553.058567669],\n", - " [618267.1052584636, 5115590.001060732],\n", - " [618230.1627654007, 5115656.647082416],\n", - " [618163.5167437167, 5115619.704589354]],\n", - " [[617600.6450416234, 5115220.576130104],\n", - " [617637.5875346862, 5115153.930108421],\n", - " [617704.2335563701, 5115190.872601483],\n", - " [617667.2910633073, 5115257.518623167],\n", - " [617600.6450416234, 5115220.576130104]],\n", - " [[617667.2910633073, 5115257.518623167],\n", - " [617704.2335563701, 5115190.872601483],\n", - " [617770.8795780543, 5115227.815094546],\n", - " [617733.9370849915, 5115294.46111623],\n", - " [617667.2910633073, 5115257.518623167]],\n", - " [[617733.9370849915, 5115294.46111623],\n", - " [617770.8795780543, 5115227.815094546],\n", - " [617837.5255997382, 5115264.757587609],\n", - " [617800.5831066754, 5115331.403609293],\n", - " [617733.9370849915, 5115294.46111623]],\n", - " [[617800.5831066754, 5115331.403609293],\n", - " [617837.5255997382, 5115264.757587609],\n", - " [617904.1716214223, 5115301.700080671],\n", - " [617867.2291283595, 5115368.346102355],\n", - " [617800.5831066754, 5115331.403609293]],\n", - " [[617867.2291283595, 5115368.346102355],\n", - " [617904.1716214223, 5115301.700080671],\n", - " [617970.8176431063, 5115338.642573735],\n", - " [617933.8751500435, 5115405.288595418],\n", - " [617867.2291283595, 5115368.346102355]],\n", - " [[617933.8751500435, 5115405.288595418],\n", - " [617970.8176431063, 5115338.642573735],\n", - " [618037.4636647903, 5115375.585066797],\n", - " [618000.5211717275, 5115442.231088481],\n", - " [617933.8751500435, 5115405.288595418]],\n", - " [[618000.5211717275, 5115442.231088481],\n", - " [618037.4636647903, 5115375.585066797],\n", - " [618104.1096864744, 5115412.52755986],\n", - " [618067.1671934116, 5115479.173581543],\n", - " [618000.5211717275, 5115442.231088481]],\n", - " [[618067.1671934116, 5115479.173581543],\n", - " [618104.1096864744, 5115412.52755986],\n", - " [618170.7557081584, 5115449.470052923],\n", - " [618133.8132150955, 5115516.116074607],\n", - " [618067.1671934116, 5115479.173581543]],\n", - " [[618133.8132150955, 5115516.116074607],\n", - " [618170.7557081584, 5115449.470052923],\n", - " [618237.4017298424, 5115486.412545986],\n", - " [618200.4592367796, 5115553.058567669],\n", - " [618133.8132150955, 5115516.116074607]],\n", - " [[618200.4592367796, 5115553.058567669],\n", - " [618237.4017298424, 5115486.412545986],\n", - " [618304.0477515265, 5115523.355039048],\n", - " [618267.1052584636, 5115590.001060732],\n", - " [618200.4592367796, 5115553.058567669]],\n", - " [[617637.5875346862, 5115153.930108421],\n", - " [617674.530027749, 5115087.284086736],\n", - " [617741.176049433, 5115124.226579798],\n", - " [617704.2335563701, 5115190.872601483],\n", - " [617637.5875346862, 5115153.930108421]],\n", - " [[617704.2335563701, 5115190.872601483],\n", - " [617741.176049433, 5115124.226579798],\n", - " [617807.8220711171, 5115161.169072862],\n", - " [617770.8795780543, 5115227.815094546],\n", - " [617704.2335563701, 5115190.872601483]],\n", - " [[617770.8795780543, 5115227.815094546],\n", - " [617807.8220711171, 5115161.169072862],\n", - " [617874.468092801, 5115198.111565924],\n", - " [617837.5255997382, 5115264.757587609],\n", - " [617770.8795780543, 5115227.815094546]],\n", - " [[617837.5255997382, 5115264.757587609],\n", - " [617874.468092801, 5115198.111565924],\n", - " [617941.1141144851, 5115235.054058987],\n", - " [617904.1716214223, 5115301.700080671],\n", - " [617837.5255997382, 5115264.757587609]],\n", - " [[617904.1716214223, 5115301.700080671],\n", - " [617941.1141144851, 5115235.054058987],\n", - " [618007.7601361691, 5115271.99655205],\n", - " [617970.8176431063, 5115338.642573735],\n", - " [617904.1716214223, 5115301.700080671]],\n", - " [[617970.8176431063, 5115338.642573735],\n", - " [618007.7601361691, 5115271.99655205],\n", - " [618074.4061578531, 5115308.939045113],\n", - " [618037.4636647903, 5115375.585066797],\n", - " [617970.8176431063, 5115338.642573735]],\n", - " [[618037.4636647903, 5115375.585066797],\n", - " [618074.4061578531, 5115308.939045113],\n", - " [618141.0521795372, 5115345.881538175],\n", - " [618104.1096864744, 5115412.52755986],\n", - " [618037.4636647903, 5115375.585066797]],\n", - " [[618104.1096864744, 5115412.52755986],\n", - " [618141.0521795372, 5115345.881538175],\n", - " [618207.6982012212, 5115382.824031238],\n", - " [618170.7557081584, 5115449.470052923],\n", - " [618104.1096864744, 5115412.52755986]],\n", - " [[618170.7557081584, 5115449.470052923],\n", - " [618207.6982012212, 5115382.824031238],\n", - " [618274.3442229052, 5115419.766524301],\n", - " [618237.4017298424, 5115486.412545986],\n", - " [618170.7557081584, 5115449.470052923]],\n", - " [[618237.4017298424, 5115486.412545986],\n", - " [618274.3442229052, 5115419.766524301],\n", - " [618340.9902445893, 5115456.709017363],\n", - " [618304.0477515265, 5115523.355039048],\n", - " [618237.4017298424, 5115486.412545986]],\n", - " [[617674.530027749, 5115087.284086736],\n", - " [617711.472520812, 5115020.638065052],\n", - " [617778.1185424959, 5115057.580558115],\n", - " [617741.176049433, 5115124.226579798],\n", - " [617674.530027749, 5115087.284086736]],\n", - " [[617741.176049433, 5115124.226579798],\n", - " [617778.1185424959, 5115057.580558115],\n", - " [617844.76456418, 5115094.523051178],\n", - " [617807.8220711171, 5115161.169072862],\n", - " [617741.176049433, 5115124.226579798]],\n", - " [[617807.8220711171, 5115161.169072862],\n", - " [617844.76456418, 5115094.523051178],\n", - " [617911.410585864, 5115131.465544241],\n", - " [617874.468092801, 5115198.111565924],\n", - " [617807.8220711171, 5115161.169072862]],\n", - " [[617874.468092801, 5115198.111565924],\n", - " [617911.410585864, 5115131.465544241],\n", - " [617978.056607548, 5115168.408037303],\n", - " [617941.1141144851, 5115235.054058987],\n", - " [617874.468092801, 5115198.111565924]],\n", - " [[617941.1141144851, 5115235.054058987],\n", - " [617978.056607548, 5115168.408037303],\n", - " [618044.7026292321, 5115205.350530366],\n", - " [618007.7601361691, 5115271.99655205],\n", - " [617941.1141144851, 5115235.054058987]],\n", - " [[618007.7601361691, 5115271.99655205],\n", - " [618044.7026292321, 5115205.350530366],\n", - " [618111.348650916, 5115242.293023429],\n", - " [618074.4061578531, 5115308.939045113],\n", - " [618007.7601361691, 5115271.99655205]],\n", - " [[618074.4061578531, 5115308.939045113],\n", - " [618111.348650916, 5115242.293023429],\n", - " [618177.9946726002, 5115279.235516491],\n", - " [618141.0521795372, 5115345.881538175],\n", - " [618074.4061578531, 5115308.939045113]],\n", - " [[618141.0521795372, 5115345.881538175],\n", - " [618177.9946726002, 5115279.235516491],\n", - " [618244.6406942841, 5115316.178009555],\n", - " [618207.6982012212, 5115382.824031238],\n", - " [618141.0521795372, 5115345.881538175]],\n", - " [[618207.6982012212, 5115382.824031238],\n", - " [618244.6406942841, 5115316.178009555],\n", - " [618311.2867159682, 5115353.120502617],\n", - " [618274.3442229052, 5115419.766524301],\n", - " [618207.6982012212, 5115382.824031238]],\n", - " [[618274.3442229052, 5115419.766524301],\n", - " [618311.2867159682, 5115353.120502617],\n", - " [618377.9327376522, 5115390.06299568],\n", - " [618340.9902445893, 5115456.709017363],\n", - " [618274.3442229052, 5115419.766524301]],\n", - " [[617711.472520812, 5115020.638065052],\n", - " [617748.4150138743, 5114953.9920433685],\n", - " [617815.0610355582, 5114990.934536431],\n", - " [617778.1185424959, 5115057.580558115],\n", - " [617711.472520812, 5115020.638065052]],\n", - " [[617778.1185424959, 5115057.580558115],\n", - " [617815.0610355582, 5114990.934536431],\n", - " [617881.7070572424, 5115027.877029494],\n", - " [617844.76456418, 5115094.523051178],\n", - " [617778.1185424959, 5115057.580558115]],\n", - " [[617844.76456418, 5115094.523051178],\n", - " [617881.7070572424, 5115027.877029494],\n", - " [617948.3530789263, 5115064.819522557],\n", - " [617911.410585864, 5115131.465544241],\n", - " [617844.76456418, 5115094.523051178]],\n", - " [[617911.410585864, 5115131.465544241],\n", - " [617948.3530789263, 5115064.819522557],\n", - " [618014.9991006104, 5115101.762015619],\n", - " [617978.056607548, 5115168.408037303],\n", - " [617911.410585864, 5115131.465544241]],\n", - " [[617978.056607548, 5115168.408037303],\n", - " [618014.9991006104, 5115101.762015619],\n", - " [618081.6451222944, 5115138.704508683],\n", - " [618044.7026292321, 5115205.350530366],\n", - " [617978.056607548, 5115168.408037303]],\n", - " [[618044.7026292321, 5115205.350530366],\n", - " [618081.6451222944, 5115138.704508683],\n", - " [618148.2911439784, 5115175.647001745],\n", - " [618111.348650916, 5115242.293023429],\n", - " [618044.7026292321, 5115205.350530366]],\n", - " [[618111.348650916, 5115242.293023429],\n", - " [618148.2911439784, 5115175.647001745],\n", - " [618214.9371656625, 5115212.589494808],\n", - " [618177.9946726002, 5115279.235516491],\n", - " [618111.348650916, 5115242.293023429]],\n", - " [[618177.9946726002, 5115279.235516491],\n", - " [618214.9371656625, 5115212.589494808],\n", - " [618281.5831873465, 5115249.531987871],\n", - " [618244.6406942841, 5115316.178009555],\n", - " [618177.9946726002, 5115279.235516491]],\n", - " [[618244.6406942841, 5115316.178009555],\n", - " [618281.5831873465, 5115249.531987871],\n", - " [618348.2292090305, 5115286.4744809335],\n", - " [618311.2867159682, 5115353.120502617],\n", - " [618244.6406942841, 5115316.178009555]],\n", - " [[618311.2867159682, 5115353.120502617],\n", - " [618348.2292090305, 5115286.4744809335],\n", - " [618414.8752307146, 5115323.416973996],\n", - " [618377.9327376522, 5115390.06299568],\n", - " [618311.2867159682, 5115353.120502617]],\n", - " [[617748.4150138743, 5114953.9920433685],\n", - " [617785.3575069372, 5114887.346021685],\n", - " [617852.0035286212, 5114924.288514747],\n", - " [617815.0610355582, 5114990.934536431],\n", - " [617748.4150138743, 5114953.9920433685]],\n", - " [[617815.0610355582, 5114990.934536431],\n", - " [617852.0035286212, 5114924.288514747],\n", - " [617918.6495503053, 5114961.231007811],\n", - " [617881.7070572424, 5115027.877029494],\n", - " [617815.0610355582, 5114990.934536431]],\n", - " [[617881.7070572424, 5115027.877029494],\n", - " [617918.6495503053, 5114961.231007811],\n", - " [617985.2955719893, 5114998.173500873],\n", - " [617948.3530789263, 5115064.819522557],\n", - " [617881.7070572424, 5115027.877029494]],\n", - " [[617948.3530789263, 5115064.819522557],\n", - " [617985.2955719893, 5114998.173500873],\n", - " [618051.9415936733, 5115035.115993936],\n", - " [618014.9991006104, 5115101.762015619],\n", - " [617948.3530789263, 5115064.819522557]],\n", - " [[618014.9991006104, 5115101.762015619],\n", - " [618051.9415936733, 5115035.115993936],\n", - " [618118.5876153574, 5115072.058486999],\n", - " [618081.6451222944, 5115138.704508683],\n", - " [618014.9991006104, 5115101.762015619]],\n", - " [[618081.6451222944, 5115138.704508683],\n", - " [618118.5876153574, 5115072.058486999],\n", - " [618185.2336370413, 5115109.0009800615],\n", - " [618148.2911439784, 5115175.647001745],\n", - " [618081.6451222944, 5115138.704508683]],\n", - " [[618148.2911439784, 5115175.647001745],\n", - " [618185.2336370413, 5115109.0009800615],\n", - " [618251.8796587255, 5115145.943473124],\n", - " [618214.9371656625, 5115212.589494808],\n", - " [618148.2911439784, 5115175.647001745]],\n", - " [[618214.9371656625, 5115212.589494808],\n", - " [618251.8796587255, 5115145.943473124],\n", - " [618318.5256804094, 5115182.885966187],\n", - " [618281.5831873465, 5115249.531987871],\n", - " [618214.9371656625, 5115212.589494808]],\n", - " [[618281.5831873465, 5115249.531987871],\n", - " [618318.5256804094, 5115182.885966187],\n", - " [618385.1717020934, 5115219.82845925],\n", - " [618348.2292090305, 5115286.4744809335],\n", - " [618281.5831873465, 5115249.531987871]],\n", - " [[618348.2292090305, 5115286.4744809335],\n", - " [618385.1717020934, 5115219.82845925],\n", - " [618451.8177237775, 5115256.770952312],\n", - " [618414.8752307146, 5115323.416973996],\n", - " [618348.2292090305, 5115286.4744809335]],\n", - " [[617785.3575069372, 5114887.346021685],\n", - " [617822.3, 5114820.7],\n", - " [617888.946021684, 5114857.642493063],\n", - " [617852.0035286212, 5114924.288514747],\n", - " [617785.3575069372, 5114887.346021685]],\n", - " [[617852.0035286212, 5114924.288514747],\n", - " [617888.946021684, 5114857.642493063],\n", - " [617955.5920433681, 5114894.584986126],\n", - " [617918.6495503053, 5114961.231007811],\n", - " [617852.0035286212, 5114924.288514747]],\n", - " [[617918.6495503053, 5114961.231007811],\n", - " [617955.5920433681, 5114894.584986126],\n", - " [618022.2380650521, 5114931.5274791885],\n", - " [617985.2955719893, 5114998.173500873],\n", - " [617918.6495503053, 5114961.231007811]],\n", - " [[617985.2955719893, 5114998.173500873],\n", - " [618022.2380650521, 5114931.5274791885],\n", - " [618088.8840867361, 5114968.469972251],\n", - " [618051.9415936733, 5115035.115993936],\n", - " [617985.2955719893, 5114998.173500873]],\n", - " [[618051.9415936733, 5115035.115993936],\n", - " [618088.8840867361, 5114968.469972251],\n", - " [618155.5301084202, 5115005.412465314],\n", - " [618118.5876153574, 5115072.058486999],\n", - " [618051.9415936733, 5115035.115993936]],\n", - " [[618118.5876153574, 5115072.058486999],\n", - " [618155.5301084202, 5115005.412465314],\n", - " [618222.1761301041, 5115042.354958377],\n", - " [618185.2336370413, 5115109.0009800615],\n", - " [618118.5876153574, 5115072.058486999]],\n", - " [[618185.2336370413, 5115109.0009800615],\n", - " [618222.1761301041, 5115042.354958377],\n", - " [618288.8221517883, 5115079.297451439],\n", - " [618251.8796587255, 5115145.943473124],\n", - " [618185.2336370413, 5115109.0009800615]],\n", - " [[618251.8796587255, 5115145.943473124],\n", - " [618288.8221517883, 5115079.297451439],\n", - " [618355.4681734722, 5115116.239944503],\n", - " [618318.5256804094, 5115182.885966187],\n", - " [618251.8796587255, 5115145.943473124]],\n", - " [[618318.5256804094, 5115182.885966187],\n", - " [618355.4681734722, 5115116.239944503],\n", - " [618422.1141951563, 5115153.182437565],\n", - " [618385.1717020934, 5115219.82845925],\n", - " [618318.5256804094, 5115182.885966187]],\n", - " [[618385.1717020934, 5115219.82845925],\n", - " [618422.1141951563, 5115153.182437565],\n", - " [618488.7602168403, 5115190.124930628],\n", - " [618451.8177237775, 5115256.770952312],\n", - " [618385.1717020934, 5115219.82845925]]]" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.vertices" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Transformations\n", - "\n", - "#### model coordinates to real-world coordinates\n", - "e.g., for working with MODPATH output" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(array([617822.3 , 617824.59641594]),\n", - " array([5114820.7 , 5114822.84415994]))" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.transform(np.array([0, 10.]), np.array([0, 2.5]))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### real-word coordinates to model coordinates\n", - "e.g., for specifying observations for Hydmod" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(9.97497282274192, 2.4982681834038707)" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.transform(617824.59, 5114822.84, inverse=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### model row, column for real-world coordinate" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(9, 9)" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.get_ij(671900., 618000.)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Grid bounds" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(617452.8750693724, 5114820.7, 618488.7602168403, 5115856.585147467)" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sr.bounds" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Shapefile of grid" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "wrote data/grid.shp\n" - ] - } - ], - "source": [ - "sr.write_shapefile(os.path.join(outpath, 'grid.shp'))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### grid spec file\n", - "(for PEST)" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [], - "source": [ - "sr.write_gridSpec(os.path.join(outpath, 'grid.spc'))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Loading `SpatialReference`\n", - "\n", - "`SpatialReference` is included in flopy models at the model level; \n", - "with `model.write()` the basic parameters are written to the comment header of the Name file." - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['# Name file for mf2005; generated by Flopy.\\n', '#xul:619653; yul:3353277; rotation:15; proj4_str:+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs; start_datetime:1/1/2015\\n']\n" - ] - } - ], - "source": [ - "# load an existing model\n", - "model_ws = os.path.join(\"..\", \"data\", \"freyberg_multilayer_transient\")\n", - "with open(model_ws + '/freyberg.nam') as input:\n", - " print(input.readlines()[0:2])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### on load\n", - "`SpatialReference` info is read from \n", - "1) **usgs.model.reference**, if it exists (https://water.usgs.gov/ogw/policy/gw-model/modelers-setup.html) \n", - "2) otherwise, the Name file \n", - "\n", - "if no spatial reference information is found, a default sr object is created" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [], - "source": [ - "ml = flopy.modflow.Modflow.load(\"freyberg.nam\", model_ws=model_ws, verbose=False,\n", - " check=False, exe_name=\"mfnwt\")" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "xul:619653; yul:3353277; rotation:15; proj4_str:+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs; units:meters; lenuni:2; length_multiplier:1.0" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ml.sr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Adding/modifying `SpatialReference` for a model" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "xul:150000; yul:30000; rotation:25; proj4_str:+proj=utm +zone=15 +ellps=clrk66 +datum=NAD27 +units=m +no_defs ; units:meters; lenuni:2; length_multiplier:1.0" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ml.sr = SpatialReference(delr=ml.dis.delr, delc=ml.dis.delc, \n", - " xul=150000, yul=30000, rotation=25, epsg=26715)\n", - "ml.sr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### individual parameters can also be updated" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "xul:150000; yul:30000; rotation:25; proj4_str:+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs; units:meters; lenuni:2; length_multiplier:1.0" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ml.sr.proj4_str = \"+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +no_defs\"\n", - "ml.sr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### note that the epsg code was cleared when the proj4 string was updated" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [], - "source": [ - "ml.sr.epsg" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### interpolation between cells\n", - "(e.g. for head values at point locations)\n", - "\n", - "#### read in some head results" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMAAAAD6CAYAAAD3PUjMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYQUlEQVR4nO2dfbBd1VXAf+ve95WEEAgJmBJaWqBVhmlTzdCpnbG0UE1pR8AWBW0n1c6kTgenOlab2k5bHR2ZsZU604qTaiRqP8Aqgh0EYhQ7HftB0iJCgZJh0vJITAihQL7eux/LP8558PLO2u+de8/HPfee9cucue+u7LPPvufedfZea6+9tqgqjlNXGoNugOMMElcAp9a4Aji1xhXAqTWuAE6tcQVwak0mBRCRTSLymIjsFZGteTXKccpC+p0HEJEm8APgbcA0cD9wvap+P3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+GH8dg1wuLSLl8eofa5XqGrfCZ1E5G6ie5KGw6q6qd9r9UOpCnDKhUV2L7b+c1gZ1c81qlQgaYzjDA5XAKfWDFIBti1dZCgZ1c81kgzMBnCcKuBDIKfWlK4AIrJJRB4Tkb0isrXs6+dJvDHIIRF5aJ5stYjsFJHH41ffOKTClKoAcYbpzwNvBy4GrheRi8tsQ87cAiz0W28FdqnqRcCu+L1TUcruAS4F9qrqE6o6C3wFuKrkNuSGqn4dOLJAfBWwI/57B3B1qY1yeqJsBTgXeHLe++lYNkqco6oHAOLXswfcHmcRylYAKxje3VDOwChbAaaB8+a9Xw/sL7kNRXNwbvuo+PXQgNvjLELZCnA/cJGIvFJEJoDrgDtLbkPR3Alsjv/eDNwxwLY4S1D6RJiIXAl8FmgC21W15FTF+SEiXwYuI4p2PAh8EvgX4Dbg5cCPgGtVdaGh7FQEnwl2ao3PBDu1xhXAqTWuAE6tcQVwao0rgFNrXAGcWuMK4NQaVwCn1vw/utqpko4V1sMAAAAASUVORK5CYII=\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "hdsobj = bf.HeadFile(model_ws + '/freyberg.hds')\n", - "hds = hdsobj.get_data()\n", - "hds[hds < -999] = np.nan\n", - "plt.imshow(hds[0])\n", - "plt.colorbar();" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(150000.0, 20936.9221296335, 158757.72155259026, 32113.0913087035)" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ml.sr.bounds" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### get interpolated head at some points\n", - "uses `scipy.interpolate.gridddata` to interpolate values between cell centers" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([1.2041737, 4.218045 ], dtype=float32)" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ml.sr.interpolate(hds[0], ([157000, 160000], [30000, 27000]))" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": {}, - "outputs": [], - "source": [ - "ml.sr.xll = 0\n", - "ml.sr.yll = 0\n", - "ml.sr.rotation = 0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Rasterizing features\n", - "\n", - "requires the `rasterio` and `fiona` modules, available via **conda-forge** (mac or windows), or the **Unofficial Python Binaries** website (windows)\n", - "\n", - "#### create a geoJSON-style geometry\n", - "(this could be easily read in from a shapefile" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [], - "source": [ - "try:\n", - " import fiona\n", - "except:\n", - " fiona = None\n", - " print('fiona is not available')\n", - "try:\n", - " from rasterio.features import rasterize\n", - " from rasterio import Affine\n", - "except:\n", - " rasterize = None\n", - " Affine = None\n", - " print('rasterio is not available')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### read in a shapefile" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [], - "source": [ - "if fiona is not None:\n", - " shpname = '../data/freyberg/gis/bedrock_outcrop_hole.shp'\n", - " with fiona.open(shpname) as src:\n", - " records = [r for r in src]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### list the feature geometries and attributes" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [], - "source": [ - "if fiona is not None:\n", - " geoms = [r['geometry'] for r in records]\n", - " attr = [r['properties'] for r in records]\n", - " attr" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### select an attribute to map onto the model grid" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": {}, - "outputs": [], - "source": [ - "if fiona is not None:\n", - " geoms = [(g, attr[i]['OBJECTID']) for i, g in enumerate(geoms)]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### make an `rasterio.Affine` object using info from the sr" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": {}, - "outputs": [], - "source": [ - "if rasterize is not None:\n", - " dx = ml.dis.delr.array[0]\n", - " dy = ml.dis.delc.array[0]\n", - " trans = Affine(dx, ml.sr.rotation, ml.sr.xul, \n", - " ml.sr.rotation, -dy, ml.sr.yul)\n", - " trans" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### rasterize the features, applying the attribute values to cells intersecting each one\n", - "In this case, the cells with zeros are those that don't intersect a feature" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "metadata": {}, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAANoAAAD8CAYAAAAR6LrwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAY3klEQVR4nO3df7BV5X3v8fcnoKgoCYZIuf5ISMO0wUxtlEG8Zpo43kakJtiZ2MGmkZsxQ68192rv7Q9oZ9K/mEmTO53UsTEyiVdoYyhjtGEy+IPSpGkbUdEYFdF4AlYpXKmaq5g0KOd87h/r2bjOPvvHOuesvdnPOd8Xs2av/axfD8z+sp71rGd9l2wTQuittx3vCoQwHUSghdAHEWgh9EEEWgh9EIEWQh9EoIXQB10DTdJtkg5JerJUdrqk7ZKeTZ9zS8vWSRqS9Iyky0rlF0h6Ii27SZJS+SxJf5vKH5T0nnr/iiGMJelsSd+RtEfSbkk3tFhH6bc6JOlxSeeXli1Pv/EhSWu7HtB2xwn4NeB84MlS2ReAtWl+LfDnaX4x8ENgFrAQ+DEwIy17CLgIEHAPcHkq/z3gK2l+FfC33eoUU0yTnYAFwPlp/jTgR8DipnVWpN+qgGXAg6l8Rvptvxc4Mf3mF3c6Xtczmu3vAa80Fa8ENqb5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E1tJJ0F/AbF+5gbBrKuU1GOgdZuWMxxI+k9wAeBB4H5Lu61kD7PSKt1Gs6zv0V53b4E/BGjX7U+qHWdcnIMtHEPf+klSacC3wRutP1ap1VblE1oOM94SboCOGT7kaqbtCjrS12nqoG4YT1OAzNcS9IJFEH2ddt3peIXJS2wfTA1tQ6l8nb13p/mm8vrdDHwcUkrgJOAOZL+ZkDrOjUd74vE8U4U/znspbhIb3SGnHsc6iGKa5QvNZV/kdEdDF9I8+cyuoNhL291MDwMLOOtDoYVPaz3R3irM2Sg6zqVpuNegQn+WFZQ9PL9GPjT41SHD1E0mx4HHkvTCuCdwA7g2fR5emmbP011foZSbx2wBHgyLbuZNGKnR/UuB9pA13UqTTEEK4Q+yLEzJITsRKCF0AcRaCH0QQRaCH0QgRZCH0SghdAHEWgh9MH/B0JvVARzt8NBAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "if rasterize is not None:\n", - " r = rasterize(geoms, out_shape=(ml.nrow, ml.ncol), transform=trans)\n", - "\n", - " fig, ax = plt.subplots()\n", - " qm = ml.sr.plot_array(r, ax=ax)\n", - " ax.set_aspect(1)\n", - " plt.colorbar(qm)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "anaconda-cloud": {}, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.6" - } - }, - "nbformat": 4, - "nbformat_minor": 1 -} diff --git a/examples/groundwater_paper/Notebooks/example_1.ipynb b/examples/groundwater_paper/Notebooks/example_1.ipynb index de213c3e34..c3e8311fec 100644 --- a/examples/groundwater_paper/Notebooks/example_1.ipynb +++ b/examples/groundwater_paper/Notebooks/example_1.ipynb @@ -23,11 +23,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "3.8.10 (default, May 19 2021, 11:01:55) \n", + "3.8.11 (default, Aug 6 2021, 08:56:27) \n", "[Clang 10.0.0 ]\n", "numpy version: 1.19.2\n", "matplotlib version: 3.4.2\n", - "flopy version: 3.3.4\n" + "flopy version: 3.3.5\n" ] } ], @@ -68,9 +68,9 @@ "metadata": {}, "outputs": [], "source": [ - "exe = 'mf2005'\n", - "ws = os.path.join('temp')\n", - "model = fpm.Modflow(modelname='gwexample', exe_name=exe, model_ws=ws)" + "exe = \"mf2005\"\n", + "ws = os.path.join(\"temp\")\n", + "model = fpm.Modflow(modelname=\"gwexample\", exe_name=exe, model_ws=ws)" ] }, { @@ -182,33 +182,32 @@ " >>> m = flopy.modflow.Modflow()\n", " >>> dis = flopy.modflow.ModflowDis(m)\n", "\n", - " _ModflowDis__thickness = ('flopy.utils.util_array.Util3d)\n", - " _name = DIS\n", + " _name = DIS\n", " _parent = MODFLOW 1 layer(s) 1 row(s) 201 column(s) 1 stress period(s) ('flopy.modflow.mf.Modflow)\n", " _totim = None ('NoneType)\n", " acceptable_dtypes (list, items = 3)\n", " allowDuplicates = False ('bool)\n", - " botm = ('flopy.utils.util_array.Util3d)\n", - " delc = ('flopy.utils.util_array.Util2d)\n", - " delr = ('flopy.utils.util_array.Util2d)\n", + " botm = ('flopy.utils.util_array.Util3d)\n", + " delc = ('flopy.utils.util_array.Util2d)\n", + " delr = ('flopy.utils.util_array.Util2d)\n", " extra = \n", " file_name = gwexample.dis\n", " fn_path = temp/gwexample.dis ('str)\n", " itmuni = 4 ('int)\n", " itmuni_dict = {0: 'undefined', 1: 'seconds', 2: 'minutes', 3: 'hours', 4: 'days', 5: 'years'} ('dict)\n", - " laycbd = ('flopy.utils.util_array.Util2d)\n", + " laycbd = ('flopy.utils.util_array.Util2d)\n", " lenuni = 2 ('int)\n", " ncol = 201 ('int)\n", " nlay = 1 ('int)\n", " nper = 1 ('int)\n", " nrow = 1 ('int)\n", - " nstp = ('flopy.utils.util_array.Util2d)\n", - " perlen = ('flopy.utils.util_array.Util2d)\n", + " nstp = ('flopy.utils.util_array.Util2d)\n", + " perlen = ('flopy.utils.util_array.Util2d)\n", " start_datetime = 1-1-1970 ('str)\n", - " steady = ('flopy.utils.util_array.Util2d)\n", - " top = ('flopy.utils.util_array.Util2d)\n", - " tr = ('flopy.utils.reference.TemporalReference)\n", - " tsmult = ('flopy.utils.util_array.Util2d)\n", + " steady = ('flopy.utils.util_array.Util2d)\n", + " top = ('flopy.utils.util_array.Util2d)\n", + " tr = ('flopy.utils.reference.TemporalReference)\n", + " tsmult = ('flopy.utils.util_array.Util2d)\n", " unit_number = 11" ] }, @@ -308,12 +307,12 @@ " file_name = gwexample.bas\n", " fn_path = temp/gwexample.bas ('str)\n", " hnoflo = -999.99 ('float)\n", - " ibound = ('flopy.utils.util_array.Util3d)\n", + " ibound = ('flopy.utils.util_array.Util3d)\n", " ichflg = False ('bool)\n", " ixsec = False ('bool)\n", " options = ('str)\n", " stoper = None ('NoneType)\n", - " strt = ('flopy.utils.util_array.Util3d)\n", + " strt = ('flopy.utils.util_array.Util3d)\n", " unit_number = 13" ] }, @@ -507,29 +506,29 @@ " _parent = MODFLOW 1 layer(s) 1 row(s) 201 column(s) 1 stress period(s) ('flopy.modflow.mf.Modflow)\n", " acceptable_dtypes (list, items = 3)\n", " allowDuplicates = False ('bool)\n", - " chani = ('flopy.utils.util_array.Util2d)\n", + " chani = ('flopy.utils.util_array.Util2d)\n", " extra = \n", " file_name = gwexample.lpf\n", " fn_path = temp/gwexample.lpf ('str)\n", - " hani = ('flopy.utils.util_array.Util3d)\n", + " hani = ('flopy.utils.util_array.Util3d)\n", " hdry = -1e+30 ('float)\n", - " hk = ('flopy.utils.util_array.Util3d)\n", + " hk = ('flopy.utils.util_array.Util3d)\n", " ihdwet = 0 ('int)\n", " ikcflag = 0 ('int)\n", " ipakcb = 0 ('int)\n", " iwetit = 1 ('int)\n", - " layavg = ('flopy.utils.util_array.Util2d)\n", - " laytyp = ('flopy.utils.util_array.Util2d)\n", - " layvka = ('flopy.utils.util_array.Util2d)\n", - " laywet = ('flopy.utils.util_array.Util2d)\n", + " layavg = ('flopy.utils.util_array.Util2d)\n", + " laytyp = ('flopy.utils.util_array.Util2d)\n", + " layvka = ('flopy.utils.util_array.Util2d)\n", + " laywet = ('flopy.utils.util_array.Util2d)\n", " nplpf = 0 ('int)\n", " options = ('str)\n", - " ss = ('flopy.utils.util_array.Util3d)\n", - " sy = ('flopy.utils.util_array.Util3d)\n", + " ss = ('flopy.utils.util_array.Util3d)\n", + " sy = ('flopy.utils.util_array.Util3d)\n", " unit_number = 15\n", - " vka = ('flopy.utils.util_array.Util3d)\n", - " vkcb = ('flopy.utils.util_array.Util3d)\n", - " wetdry = ('flopy.utils.util_array.Util3d)\n", + " vka = ('flopy.utils.util_array.Util3d)\n", + " vkcb = ('flopy.utils.util_array.Util3d)\n", + " wetdry = ('flopy.utils.util_array.Util3d)\n", " wetfct = 0.1 ('float)" ] }, @@ -661,7 +660,7 @@ " options (list, items = 0)\n", " phiramp = None ('NoneType)\n", " specify = False ('bool)\n", - " stress_period_data = ('flopy.utils.util_list.MfList)\n", + " stress_period_data = ('flopy.utils.util_list.MfList)\n", " unit_number = 20" ] }, @@ -998,11 +997,11 @@ " Version 1.12.00 2/3/2017 \n", "\n", " Using NAME file: gwexample.nam \n", - " Run start date and time (yyyy/mm/dd hh:mm:ss): 2021/08/06 16:46:35\n", + " Run start date and time (yyyy/mm/dd hh:mm:ss): 2021/08/18 17:44:47\n", "\n", " Solving: Stress period: 1 Time step: 1 Ground-Water Flow Eqn.\n", - " Run end date and time (yyyy/mm/dd hh:mm:ss): 2021/08/06 16:46:35\n", - " Elapsed run time: 0.012 Seconds\n", + " Run end date and time (yyyy/mm/dd hh:mm:ss): 2021/08/18 17:44:47\n", + " Elapsed run time: 0.006 Seconds\n", "\n", " Normal termination of simulation\n" ] @@ -1036,7 +1035,7 @@ "metadata": {}, "outputs": [], "source": [ - "fpth = os.path.join(ws, 'gwexample.hds')\n", + "fpth = os.path.join(ws, \"gwexample.hds\")\n", "hfile = fpu.HeadFile(fpth)\n", "h = hfile.get_data(totim=1.0)" ] @@ -1053,20 +1052,6 @@ "execution_count": 11, "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/jdhughes/Documents/Development/flopy_git/flopy_fork/flopy/modflow/mfdis.py:298: DeprecationWarning: SpatialReference has been deprecated. Use Grid instead.\n", - " warnings.warn(\n", - "/Users/jdhughes/Documents/Development/flopy_git/flopy_fork/flopy/utils/reference.py:147: DeprecationWarning: SpatialReference has been deprecated and will be removed in version 3.3.5. Use StructuredGrid instead.\n", - " warnings.warn(\n", - "/Users/jdhughes/Documents/Development/flopy_git/flopy_fork/flopy/utils/reference.py:2074: DeprecationWarning: crs has been deprecated and will be removed in version 3.3.5. Use CRS in shapefile_utils instead.\n", - " warnings.warn(\n", - "/Users/jdhughes/Documents/Development/flopy_git/flopy_fork/flopy/utils/reference.py:2074: DeprecationWarning: crs has been deprecated and will be removed in version 3.3.5. Use CRS in shapefile_utils instead.\n", - " warnings.warn(\n" - ] - }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEGCAYAAABCa2PoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAA+K0lEQVR4nO3dd3hU55nw/+89qqh3gYSEJECiV1ENGDeMe9w2JmWdtWMn78+bddYbJ87rbMq+qetsEifZXcdxTcNpdmJcwN240LsAUdR7b6iX5/fHjLAMEqjMzJlyf65Ll0ZH58zcOnpm7nOeKsYYlFJKqYmyWR2AUkop36AJRSmllFNoQlFKKeUUmlCUUko5hSYUpZRSThFodQDOlJCQYDIyMqwOQymlvMa+ffvqjTGJzngun0oo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RtCV8olAq0OQCkv9x/Y55PrAv4FWAHUnbPP28a+LkWbiLQAWxzbjwALhuxXC6S4NlylXEcTilITEwdEAEFAKNDp+D7U0LuVgSE/D/Dx9+Dg8Up5Ja3yUmpiHgf+HfuaIj/CPklpxjifK5uPZtVVyuvoHYpS4yQi/wj0GWP+4Jiq/EPsVV4FIjLDGHN6DM8VBMwA9romWqVcT2cbVsrJRORmYKkx5htjPGaJMebfXReZUq6ldyhKOZkx5gURiR/jYYF8tMytUl5J71CUUko5hTbKK6WUcgpNKEoppZxCE4pSSimn0ISilFLKKTShKKWUcor/H5h2lOxJiQmaAAAAAElFTkSuQmCC\n", @@ -1083,9 +1068,9 @@ "source": [ "import matplotlib.pyplot as plt\n", "ax = plt.subplot(111)\n", - "x = model.dis.sr.xcentergrid[0]\n", - "ax.plot(x,h[0,0,:])\n", - "ax.set_xlim(0,x.max())\n", + "x = model.modelgrid.xcellcenters[0]\n", + "ax.plot(x, h[0,0,:])\n", + "ax.set_xlim(0, x.max())\n", "ax.set_xlabel(\"x(m)\")\n", "ax.set_ylabel(\"head(m)\")\n", "plt.show()" @@ -1115,9 +1100,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.8.11" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/flopy/export/shapefile_utils.py b/flopy/export/shapefile_utils.py index 1db9dd0d5f..825e2e311a 100755 --- a/flopy/export/shapefile_utils.py +++ b/flopy/export/shapefile_utils.py @@ -916,24 +916,27 @@ def get_spatialreference(epsg, text="esriwkt"): """ from flopy.utils.flopy_io import get_url_text - epsg_categories = ["epsg", "esri"] + epsg_categories = ( + "epsg", + "esri", + ) + urls = [] for cat in epsg_categories: - url = "{}/ref/".format(srefhttp) + "{}/{}/{}/".format( - cat, epsg, text - ) + url = "{}/ref/{}/{}/{}/".format(srefhttp, cat, epsg, text) + urls.append(url) result = get_url_text(url) if result is not None: break if result is not None: return result.replace("\n", "") elif result is None and text != "epsg": - for cat in epsg_categories: - error_msg = ( - "No internet connection or epsg code {} ".format(epsg) - + "not found at {}/ref/".format(srefhttp) - + "{}/{}/{}".format(cat, epsg, text) - ) - print(error_msg) + error_msg = ( + "No internet connection or " + "epsg code {} not found at:\n".format(epsg) + ) + for idx, url in enumerate(urls): + error_msg += " {:>2d}: {}\n".format(idx + 1, url) + print(error_msg) # epsg code not listed on spatialreference.org # may still work with pyproj elif text == "epsg": diff --git a/flopy/mbase.py b/flopy/mbase.py index f346de15f1..b282da299c 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -19,7 +19,6 @@ import numpy as np from flopy import utils, discretization from .version import __version__ -from .discretization.modeltime import ModelTime from .discretization.grid import Grid ## Global variables @@ -360,7 +359,10 @@ def __init__( # build model discretization objects self._modelgrid = Grid( - proj4=self._proj4_str, xoff=xll, yoff=yll, angrot=self._rotation + proj4=self._proj4_str, + xoff=xll, + yoff=yll, + angrot=self._rotation, ) self._modeltime = None @@ -644,16 +646,12 @@ def __getattr__(self, item): if item == "output_packages" or not hasattr(self, "output_packages"): raise AttributeError(item) - if item == "sr": - if self.dis is not None: - return self.dis.sr - else: - return None if item == "tr": if self.dis is not None: return self.dis.tr else: return None + if item == "start_datetime": if self.dis is not None: return self.dis.start_datetime diff --git a/flopy/mf6/utils/binarygrid_util.py b/flopy/mf6/utils/binarygrid_util.py index 8111e390a3..165cdc1868 100644 --- a/flopy/mf6/utils/binarygrid_util.py +++ b/flopy/mf6/utils/binarygrid_util.py @@ -261,59 +261,6 @@ def __set_modelgrid(self): return - def __set_spatialreference(self): - """ - Define structured or unstructured spatial reference based on - MODFLOW 6 discretization type. - Returns - ------- - sr : SpatialReference - """ - sr = None - try: - if self._grid_type in ("DISV", "DISU"): - from flopy.utils.reference import SpatialReferenceUnstructured - - try: - vertc = self.xycentroids() - xc = vertc[:, 0] - yc = vertc[:, 1] - sr = SpatialReferenceUnstructured( - xc, - yc, - self.__modelgrid.verts, - self.__modelgrid.iverts, - [xc.shape[0]], - ) - except: - print( - "could not set spatial reference for " - "{} discretization defined in " - "{}".format(self._grid_type, self.file.name) - ) - elif self._grid_type == "DIS": - from flopy.utils.reference import SpatialReference - - delr, delc = self._datadict["DELR"], self._datadict["DELC"] - xorigin, yorigin, rot = ( - self._datadict["XORIGIN"], - self._datadict["YORIGIN"], - self._datadict["ANGROT"], - ) - sr = SpatialReference( - delr=delr, - delc=delc, - xll=xorigin, - yll=yorigin, - rotation=rot, - ) - except: - print( - "could not set spatial reference for {}".format(self.file.name) - ) - - return sr - def __build_vertices_cell2d(self): """ Build the mf6 vertices and cell2d array to generate a VertexGrid @@ -774,20 +721,3 @@ def cell2d(self): else: vertices, cell2d = None, None return vertices, cell2d - - @property - def spatialreference(self): - """ - Spatial reference for model grid. - - Returns - ------- - spatialreference : SpatialReference - """ - warnings.warn( - "SpatialReference has been deprecated and will be " - "removed in version 3.3.5. Use get_modelgrid instead.", - category=DeprecationWarning, - ) - - return self.__set_spatialreference() diff --git a/flopy/modflow/mfdis.py b/flopy/modflow/mfdis.py index 805d5e72f6..1e32bbc5fd 100644 --- a/flopy/modflow/mfdis.py +++ b/flopy/modflow/mfdis.py @@ -287,35 +287,6 @@ def __init__( self.start_datetime = start_datetime self._totim = None - @property - def sr(self): - from ..utils.reference import SpatialReference - - warnings.warn( - "SpatialReference has been deprecated. Use Grid instead.", - DeprecationWarning, - ) - if not hasattr(self, "_sr"): - mg = self.parent.modelgrid - self._sr = SpatialReference( - self.delr, - self.delc, - self.lenuni, - xll=mg.xoffset, - yll=mg.yoffset, - rotation=mg.angrot or 0.0, - proj4_str=mg.proj4, - ) - return self._sr - - @sr.setter - def sr(self, sr): - warnings.warn( - "SpatialReference has been deprecated. Use Grid instead.", - DeprecationWarning, - ) - self._sr = sr - def checklayerthickness(self): """ Check layer thickness. diff --git a/flopy/utils/modpathfile.py b/flopy/utils/modpathfile.py index 5a86077b88..79ffdd98f2 100644 --- a/flopy/utils/modpathfile.py +++ b/flopy/utils/modpathfile.py @@ -9,7 +9,6 @@ import itertools import collections -import warnings import numpy as np from numpy.lib.recfunctions import append_fields, stack_arrays @@ -280,7 +279,6 @@ def write_shapefile( shpname="endpoints.shp", mg=None, epsg=None, - sr=None, **kwargs ): """ @@ -330,20 +328,8 @@ def write_shapefile( series = series.copy() series.sort(order=["particleid", "time"]) - if mg is None and sr.__class__.__name__ == "SpatialReference": - warnings.warn( - "Deprecation warning: SpatialReference is deprecated." - "Use the Grid class instead.", - DeprecationWarning, - ) - mg = StructuredGrid(sr.delc, sr.delr) - mg.set_coord_info( - xoff=sr.xll, - yoff=sr.yll, - angrot=sr.rotation, - epsg=sr.epsg, - proj4=sr.proj4_str, - ) + if mg is None: + raise ValueError("A modelgrid object was not provided.") if epsg is None: epsg = mg.epsg @@ -763,7 +749,6 @@ def write_shapefile( shpname="pathlines.shp", mg=None, epsg=None, - sr=None, **kwargs ): """ @@ -802,7 +787,6 @@ def write_shapefile( shpname=shpname, mg=mg, epsg=epsg, - sr=sr, **kwargs ) @@ -1218,7 +1202,6 @@ def write_shapefile( direction="ending", mg=None, epsg=None, - sr=None, **kwargs ): """ @@ -1260,20 +1243,8 @@ def write_shapefile( 'flopy.map.plot_endpoint direction must be "ending" ' 'or "starting".' ) - if mg is None and sr.__class__.__name__ == "SpatialReference": - warnings.warn( - "Deprecation warning: SpatialReference is deprecated." - "Use the Grid class instead.", - DeprecationWarning, - ) - mg = StructuredGrid(sr.delc, sr.delr) - mg.set_coord_info( - xoff=sr.xll, - yoff=sr.yll, - angrot=sr.rotation, - epsg=sr.epsg, - proj4=sr.proj4_str, - ) + if mg is None: + raise ValueError("A modelgrid object was not provided.") if epsg is None: epsg = mg.epsg @@ -1620,7 +1591,6 @@ def write_shapefile( shpname="pathlines.shp", mg=None, epsg=None, - sr=None, **kwargs ): """ @@ -1659,6 +1629,5 @@ def write_shapefile( shpname=shpname, mg=mg, epsg=epsg, - sr=sr, **kwargs ) diff --git a/flopy/utils/reference.py b/flopy/utils/reference.py index e8fb7227a1..d64fe3d4fd 100755 --- a/flopy/utils/reference.py +++ b/flopy/utils/reference.py @@ -3,7 +3,6 @@ """ import json -import numpy as np import os import warnings @@ -16,1930 +15,6 @@ srefhttp = "https://spatialreference.org" -class SpatialReference: - """ - a class to locate a structured model grid in x-y space - - .. deprecated:: 3.2.11 - This class will be removed in version 3.3.5. Use - :py:class:`flopy.discretization.structuredgrid.StructuredGrid` instead. - - Parameters - ---------- - - delr : numpy ndarray - the model discretization delr vector - (An array of spacings along a row) - delc : numpy ndarray - the model discretization delc vector - (An array of spacings along a column) - lenuni : int - the length units flag from the discretization package - (default 2) - xul : float - the x coordinate of the upper left corner of the grid - Enter either xul and yul or xll and yll. - yul : float - the y coordinate of the upper left corner of the grid - Enter either xul and yul or xll and yll. - xll : float - the x coordinate of the lower left corner of the grid - Enter either xul and yul or xll and yll. - yll : float - the y coordinate of the lower left corner of the grid - Enter either xul and yul or xll and yll. - rotation : float - the counter-clockwise rotation (in degrees) of the grid - - proj4_str: str - a PROJ4 string that identifies the grid in space. warning: case - sensitive! - - units : string - Units for the grid. Must be either feet or meters - - epsg : int - EPSG code that identifies the grid in space. Can be used in lieu of - proj4. PROJ4 attribute will auto-populate if there is an internet - connection(via get_proj4 method). - See https://www.epsg-registry.org/ or spatialreference.org - - length_multiplier : float - multiplier to convert model units to spatial reference units. - delr and delc above will be multiplied by this value. (default=1.) - - Attributes - ---------- - xedge : ndarray - array of column edges - - yedge : ndarray - array of row edges - - xgrid : ndarray - numpy meshgrid of xedges - - ygrid : ndarray - numpy meshgrid of yedges - - xcenter : ndarray - array of column centers - - ycenter : ndarray - array of row centers - - xcentergrid : ndarray - numpy meshgrid of column centers - - ycentergrid : ndarray - numpy meshgrid of row centers - - vertices : 1D array - 1D array of cell vertices for whole grid in C-style (row-major) order - (same as np.ravel()) - - - Notes - ----- - - xul and yul can be explicitly (re)set after SpatialReference - instantiation, but only before any of the other attributes and methods are - accessed - - """ - - xul, yul = None, None - xll, yll = None, None - rotation = 0.0 - length_multiplier = 1.0 - origin_loc = "ul" # or ll - - defaults = { - "xul": None, - "yul": None, - "rotation": 0.0, - "proj4_str": None, - "units": None, - "lenuni": 2, - "length_multiplier": None, - "source": "defaults", - } - - lenuni_values = {"undefined": 0, "feet": 1, "meters": 2, "centimeters": 3} - lenuni_text = {v: k for k, v in lenuni_values.items()} - - def __init__( - self, - delr=np.array([]), - delc=np.array([]), - lenuni=2, - xul=None, - yul=None, - xll=None, - yll=None, - rotation=0.0, - proj4_str=None, - epsg=None, - prj=None, - units=None, - length_multiplier=None, - ): - warnings.warn( - "SpatialReference has been deprecated and will be removed in " - "version 3.3.5. Use StructuredGrid instead.", - category=DeprecationWarning, - ) - - for delrc in [delr, delc]: - if isinstance(delrc, float) or isinstance(delrc, int): - msg = ( - "delr and delcs must be an array or sequences equal in " - "length to the number of rows/columns." - ) - raise TypeError(msg) - - self.delc = np.atleast_1d(np.array(delc)).astype( - np.float64 - ) # * length_multiplier - self.delr = np.atleast_1d(np.array(delr)).astype( - np.float64 - ) # * length_multiplier - - if self.delr.sum() == 0 or self.delc.sum() == 0: - if xll is None or yll is None: - msg = ( - "Warning: no grid spacing or lower-left corner " - "supplied. Setting the offset with xul, yul requires " - "arguments for delr and delc. Origin will be set to " - "zero." - ) - print(msg) - xll, yll = 0, 0 - xul, yul = None, None - - self._lenuni = lenuni - self._proj4_str = proj4_str - - self._epsg = epsg - if epsg is not None: - self._proj4_str = getproj4(self._epsg) - self.prj = prj - self._wkt = None - self.crs = crs(prj=prj, epsg=epsg) - - self.supported_units = ["feet", "meters"] - self._units = units - self._length_multiplier = length_multiplier - self._reset() - self.set_spatialreference(xul, yul, xll, yll, rotation) - - @property - def xll(self): - if self.origin_loc == "ll": - xll = self._xll if self._xll is not None else 0.0 - elif self.origin_loc == "ul": - # calculate coords for lower left corner - xll = self._xul - ( - np.sin(self.theta) * self.yedge[0] * self.length_multiplier - ) - return xll - - @property - def yll(self): - if self.origin_loc == "ll": - yll = self._yll if self._yll is not None else 0.0 - elif self.origin_loc == "ul": - # calculate coords for lower left corner - yll = self._yul - ( - np.cos(self.theta) * self.yedge[0] * self.length_multiplier - ) - return yll - - @property - def xul(self): - if self.origin_loc == "ll": - # calculate coords for upper left corner - xul = self._xll + ( - np.sin(self.theta) * self.yedge[0] * self.length_multiplier - ) - if self.origin_loc == "ul": - # calculate coords for lower left corner - xul = self._xul if self._xul is not None else 0.0 - return xul - - @property - def yul(self): - if self.origin_loc == "ll": - # calculate coords for upper left corner - yul = self._yll + ( - np.cos(self.theta) * self.yedge[0] * self.length_multiplier - ) - - if self.origin_loc == "ul": - # calculate coords for lower left corner - yul = self._yul if self._yul is not None else 0.0 - return yul - - @property - def proj4_str(self): - proj4_str = None - if self._proj4_str is not None: - if "epsg" in self._proj4_str.lower(): - proj4_str = self._proj4_str - # set the epsg if proj4 specifies it - tmp = [ - i for i in self._proj4_str.split() if "epsg" in i.lower() - ] - self._epsg = int(tmp[0].split(":")[1]) - else: - proj4_str = self._proj4_str - elif self.epsg is not None: - proj4_str = "epsg:{}".format(self.epsg) - return proj4_str - - @property - def epsg(self): - # don't reset the proj4 string here - # because proj4 attribute may already be populated - # (with more details than getproj4 would return) - # instead reset proj4 when epsg is set - # (on init or setattr) - return self._epsg - - @property - def wkt(self): - if self._wkt is None: - if self.prj is not None: - with open(self.prj) as src: - wkt = src.read() - elif self.epsg is not None: - wkt = getprj(self.epsg) - else: - return None - return wkt - else: - return self._wkt - - @property - def lenuni(self): - return self._lenuni - - def _parse_units_from_proj4(self): - units = None - try: - # need this because preserve_units doesn't seem to be - # working for complex proj4 strings. So if an - # epsg code was passed, we have no choice, but if a - # proj4 string was passed, we can just parse it - if "EPSG" in self.proj4_str.upper(): - import pyproj - - crs = pyproj.Proj(self.proj4_str, preserve_units=True) - proj_str = crs.srs - else: - proj_str = self.proj4_str - # http://proj4.org/parameters.html#units - # from proj4 source code - # "us-ft", "0.304800609601219", "U.S. Surveyor's Foot", - # "ft", "0.3048", "International Foot", - if "units=m" in proj_str: - units = "meters" - elif ( - "units=ft" in proj_str - or "units=us-ft" in proj_str - or "to_meter=0.3048" in proj_str - ): - units = "feet" - return units - except: - if self.proj4_str is not None: - print( - " could not parse units from {}".format(self.proj4_str) - ) - - @property - def units(self): - if self._units is not None: - units = self._units.lower() - else: - units = self._parse_units_from_proj4() - if units is None: - # print("warning: assuming SpatialReference units are meters") - units = "meters" - assert units in self.supported_units - return units - - @property - def length_multiplier(self): - """ - Attempt to identify multiplier for converting from - model units to sr units, defaulting to 1. - """ - lm = None - if self._length_multiplier is not None: - lm = self._length_multiplier - else: - if self.model_length_units == "feet": - if self.units == "meters": - lm = 0.3048 - elif self.units == "feet": - lm = 1.0 - elif self.model_length_units == "meters": - if self.units == "feet": - lm = 1 / 0.3048 - elif self.units == "meters": - lm = 1.0 - elif self.model_length_units == "centimeters": - if self.units == "meters": - lm = 1 / 100.0 - elif self.units == "feet": - lm = 1 / 30.48 - else: # model units unspecified; default to 1 - lm = 1.0 - return lm - - @property - def model_length_units(self): - return self.lenuni_text[self.lenuni] - - @property - def bounds(self): - """ - Return bounding box in shapely order. - """ - xmin, xmax, ymin, ymax = self.get_extent() - return xmin, ymin, xmax, ymax - - @classmethod - def load(cls, namefile=None, reffile="usgs.model.reference"): - """ - Attempts to load spatial reference information from - the following files (in order): - 1) usgs.model.reference - 2) NAM file (header comment) - 3) SpatialReference.default dictionary - """ - reffile = os.path.join(os.path.split(namefile)[0], reffile) - d = SpatialReference.read_usgs_model_reference_file(reffile) - if d is not None: - return d - d = SpatialReference.attribs_from_namfile_header(namefile) - if d is not None: - return d - else: - return SpatialReference.defaults - - @staticmethod - def attribs_from_namfile_header(namefile): - # check for reference info in the nam file header - d = SpatialReference.defaults.copy() - d["source"] = "namfile" - if namefile is None: - return None - header = [] - with open(namefile, "r") as f: - for line in f: - if not line.startswith("#"): - break - header.extend(line.strip().replace("#", "").split(";")) - - for item in header: - if "xul" in item.lower(): - try: - d["xul"] = float(item.split(":")[1]) - except: - print(" could not parse xul in {}".format(namefile)) - elif "yul" in item.lower(): - try: - d["yul"] = float(item.split(":")[1]) - except: - print(" could not parse yul in {}".format(namefile)) - elif "rotation" in item.lower(): - try: - d["rotation"] = float(item.split(":")[1]) - except: - print(" could not parse rotation in {}".format(namefile)) - elif "proj4_str" in item.lower(): - try: - proj4_str = ":".join(item.split(":")[1:]).strip() - if proj4_str.lower() == "none": - proj4_str = None - d["proj4_str"] = proj4_str - except: - print( - " could not parse proj4_str in {}".format(namefile) - ) - elif "start" in item.lower(): - try: - d["start_datetime"] = item.split(":")[1].strip() - except: - print(" could not parse start in {}".format(namefile)) - - # spatial reference length units - elif "units" in item.lower(): - d["units"] = item.split(":")[1].strip() - # model length units - elif "lenuni" in item.lower(): - d["lenuni"] = int(item.split(":")[1].strip()) - # multiplier for converting from model length units to sr length units - elif "length_multiplier" in item.lower(): - d["length_multiplier"] = float(item.split(":")[1].strip()) - return d - - @staticmethod - def read_usgs_model_reference_file(reffile="usgs.model.reference"): - """ - read spatial reference info from the usgs.model.reference file - https://water.usgs.gov/ogw/policy/gw-model/modelers-setup.html - """ - - ITMUNI = { - 0: "undefined", - 1: "seconds", - 2: "minutes", - 3: "hours", - 4: "days", - 5: "years", - } - itmuni_values = {v: k for k, v in ITMUNI.items()} - - d = SpatialReference.defaults.copy() - d["source"] = "usgs.model.reference" - # discard default to avoid confusion with epsg code if entered - d.pop("proj4_str") - if os.path.exists(reffile): - with open(reffile) as fref: - for line in fref: - if len(line) > 1: - if line.strip()[0] != "#": - info = line.strip().split("#")[0].split() - if len(info) > 1: - d[info[0].lower()] = " ".join(info[1:]) - d["xul"] = float(d["xul"]) - d["yul"] = float(d["yul"]) - d["rotation"] = float(d["rotation"]) - - # convert the model.reference text to a lenuni value - # (these are the model length units) - if "length_units" in d.keys(): - d["lenuni"] = SpatialReference.lenuni_values[d["length_units"]] - if "time_units" in d.keys(): - d["itmuni"] = itmuni_values[d["time_units"]] - if "start_date" in d.keys(): - start_datetime = d.pop("start_date") - if "start_time" in d.keys(): - start_datetime += " {}".format(d.pop("start_time")) - d["start_datetime"] = start_datetime - if "epsg" in d.keys(): - try: - d["epsg"] = int(d["epsg"]) - except Exception as e: - raise Exception( - "error reading epsg code from file:\n" + str(e) - ) - # this prioritizes epsg over proj4 if both are given - # (otherwise 'proj4' entry will be dropped below) - elif "proj4" in d.keys(): - d["proj4_str"] = d["proj4"] - - # drop any other items that aren't used in sr class - d = { - k: v - for k, v in d.items() - if k.lower() in SpatialReference.defaults.keys() - or k.lower() in {"epsg", "start_datetime", "itmuni", "source"} - } - return d - else: - return None - - def __setattr__(self, key, value): - reset = True - if key == "delr": - super().__setattr__("delr", np.atleast_1d(np.array(value))) - elif key == "delc": - super().__setattr__("delc", np.atleast_1d(np.array(value))) - elif key == "xul": - super().__setattr__("_xul", float(value)) - self.origin_loc = "ul" - elif key == "yul": - super().__setattr__("_yul", float(value)) - self.origin_loc = "ul" - elif key == "xll": - super().__setattr__("_xll", float(value)) - self.origin_loc = "ll" - elif key == "yll": - super().__setattr__("_yll", float(value)) - self.origin_loc = "ll" - elif key == "length_multiplier": - super().__setattr__("_length_multiplier", float(value)) - # self.set_origin(xul=self.xul, yul=self.yul, xll=self.xll, - # yll=self.yll) - elif key == "rotation": - super().__setattr__("rotation", float(value)) - # self.set_origin(xul=self.xul, yul=self.yul, xll=self.xll, - # yll=self.yll) - elif key == "lenuni": - super().__setattr__("_lenuni", int(value)) - # self.set_origin(xul=self.xul, yul=self.yul, xll=self.xll, - # yll=self.yll) - elif key == "units": - value = value.lower() - assert value in self.supported_units - super().__setattr__("_units", value) - elif key == "proj4_str": - super().__setattr__("_proj4_str", value) - # reset the units and epsg - units = self._parse_units_from_proj4() - if units is not None: - self._units = units - self._epsg = None - elif key == "epsg": - super().__setattr__("_epsg", value) - # reset the units and proj4 - self._units = None - self._proj4_str = getproj4(self._epsg) - self.crs = crs(epsg=value) - elif key == "prj": - super().__setattr__("prj", value) - # translation to proj4 strings in crs class not robust yet - # leave units and proj4 alone for now. - self.crs = crs(prj=value, epsg=self.epsg) - else: - super().__setattr__(key, value) - reset = False - if reset: - self._reset() - - def reset(self, **kwargs): - for key, value in kwargs.items(): - setattr(self, key, value) - return - - def _reset(self): - self._xgrid = None - self._ygrid = None - self._ycentergrid = None - self._xcentergrid = None - self._vertices = None - return - - @property - def nrow(self): - return self.delc.shape[0] - - @property - def ncol(self): - return self.delr.shape[0] - - def __eq__(self, other): - if not isinstance(other, SpatialReference): - return False - if other.xul != self.xul: - return False - if other.yul != self.yul: - return False - if other.rotation != self.rotation: - return False - if other.proj4_str != self.proj4_str: - return False - return True - - @classmethod - def from_namfile(cls, namefile): - attribs = SpatialReference.attribs_from_namfile_header(namefile) - try: - attribs.pop("start_datetime") - except: - print(" could not remove start_datetime") - - return cls(**attribs) - - @classmethod - def from_gridspec(cls, gridspec_file, lenuni=0): - f = open(gridspec_file, "r") - raw = f.readline().strip().split() - nrow = int(raw[0]) - ncol = int(raw[1]) - raw = f.readline().strip().split() - xul, yul, rot = float(raw[0]), float(raw[1]), float(raw[2]) - delr = [] - j = 0 - while j < ncol: - raw = f.readline().strip().split() - for r in raw: - if "*" in r: - rraw = r.split("*") - for n in range(int(rraw[0])): - delr.append(float(rraw[1])) - j += 1 - else: - delr.append(float(r)) - j += 1 - delc = [] - i = 0 - while i < nrow: - raw = f.readline().strip().split() - for r in raw: - if "*" in r: - rraw = r.split("*") - for n in range(int(rraw[0])): - delc.append(float(rraw[1])) - i += 1 - else: - delc.append(float(r)) - i += 1 - f.close() - return cls( - np.array(delr), - np.array(delc), - lenuni, - xul=xul, - yul=yul, - rotation=rot, - ) - - @property - def attribute_dict(self): - return { - "xul": self.xul, - "yul": self.yul, - "rotation": self.rotation, - "proj4_str": self.proj4_str, - } - - def set_spatialreference( - self, xul=None, yul=None, xll=None, yll=None, rotation=0.0 - ): - """ - set spatial reference - can be called from model instance - - """ - if xul is not None and xll is not None: - msg = ( - "Both xul and xll entered. Please enter either xul, yul or " - "xll, yll." - ) - raise ValueError(msg) - if yul is not None and yll is not None: - msg = ( - "Both yul and yll entered. Please enter either xul, yul or " - "xll, yll." - ) - raise ValueError(msg) - # set the origin priority based on the left corner specified - # (the other left corner will be calculated). If none are specified - # then default to upper left - if xul is None and yul is None and xll is None and yll is None: - self.origin_loc = "ul" - xul = 0.0 - yul = self.delc.sum() - elif xll is not None: - self.origin_loc = "ll" - else: - self.origin_loc = "ul" - - self.rotation = rotation - self._xll = xll if xll is not None else 0.0 - self._yll = yll if yll is not None else 0.0 - self._xul = xul if xul is not None else 0.0 - self._yul = yul if yul is not None else 0.0 - # self.set_origin(xul, yul, xll, yll) - return - - def __repr__(self): - s = "xul:{0:<.10G}; yul:{1:<.10G}; rotation:{2: 0: - inum += 1 - ivertrenum[i] = inum - ivertrenum -= 1 - - # reassign the vertex list using the new vertex numbers - iverts2 = [] - for vlist in iverts: - vlist2 = [] - for iv in vlist: - vlist2.append(ivertrenum[iv]) - iverts2.append(vlist2) - iverts = iverts2 - idx = np.where(ivertrenum >= 0) - verts = verts[idx] - - return verts, iverts - - def get_3d_vertex_connectivity(self, nlay, top, bot, ibound=None): - if ibound is None: - ncells = nlay * self.nrow * self.ncol - ibound = np.ones((nlay, self.nrow, self.ncol), dtype=int) - else: - ncells = (ibound != 0).sum() - npoints = ncells * 8 - verts = np.empty((npoints, 3), dtype=float) - iverts = [] - ipoint = 0 - for k in range(nlay): - for i in range(self.nrow): - for j in range(self.ncol): - if ibound[k, i, j] == 0: - continue - - ivert = [] - pts = self.get_vertices(i, j) - pt0, pt1, pt2, pt3, pt0 = pts - - z = bot[k, i, j] - - verts[ipoint, 0:2] = np.array(pt1) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt2) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt0) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt3) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - z = top[k, i, j] - - verts[ipoint, 0:2] = np.array(pt1) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt2) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt0) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - verts[ipoint, 0:2] = np.array(pt3) - verts[ipoint, 2] = z - ivert.append(ipoint) - ipoint += 1 - - iverts.append(ivert) - - return verts, iverts - - -class SpatialReferenceUnstructured(SpatialReference): - """ - a class to locate an unstructured model grid in x-y space - - .. deprecated:: 3.2.11 - This class will be removed in version 3.3.5. Use - :py:class:`flopy.discretization.vertexgrid.VertexGrid` instead. - - Parameters - ---------- - - verts : ndarray - 2d array of x and y points. - - iverts : list of lists - should be of len(ncells) with a list of vertex numbers for each cell - - ncpl : ndarray - array containing the number of cells per layer. ncpl.sum() must be - equal to the total number of cells in the grid. - - layered : boolean - flag to indicated that the grid is layered. In this case, the vertices - define the grid for single layer, and all layers use this same grid. - In this case the ncpl value for each layer must equal len(iverts). - If not layered, then verts and iverts are specified for all cells and - all layers in the grid. In this case, npcl.sum() must equal - len(iverts). - - lenuni : int - the length units flag from the discretization package - - proj4_str: str - a PROJ4 string that identifies the grid in space. warning: case - sensitive! - - units : string - Units for the grid. Must be either feet or meters - - epsg : int - EPSG code that identifies the grid in space. Can be used in lieu of - proj4. PROJ4 attribute will auto-populate if there is an internet - connection(via get_proj4 method). - See https://www.epsg-registry.org/ or spatialreference.org - - length_multiplier : float - multiplier to convert model units to spatial reference units. - delr and delc above will be multiplied by this value. (default=1.) - - Attributes - ---------- - xcenter : ndarray - array of x cell centers - - ycenter : ndarray - array of y cell centers - - Notes - ----- - - """ - - def __init__( - self, - xc, - yc, - verts, - iverts, - ncpl, - layered=True, - lenuni=1, - proj4_str=None, - epsg=None, - units=None, - length_multiplier=1.0, - ): - warnings.warn( - "SpatialReferenceUnstructured has been deprecated and will be " - "removed in version 3.3.5. Use VertexGrid instead.", - category=DeprecationWarning, - ) - self.xc = xc - self.yc = yc - self.verts = verts - self.iverts = iverts - self.ncpl = ncpl - self.layered = layered - self._lenuni = lenuni - self._proj4_str = proj4_str - self._epsg = epsg - if epsg is not None: - self._proj4_str = getproj4(epsg) - self.supported_units = ["feet", "meters"] - self._units = units - self._length_multiplier = length_multiplier - - # set defaults - self._xul = 0.0 - self._yul = 0.0 - self.rotation = 0.0 - - if self.layered: - assert all([n == len(iverts) for n in ncpl]) - assert self.xc.shape[0] == self.ncpl[0] - assert self.yc.shape[0] == self.ncpl[0] - else: - msg = "Length of iverts must equal ncpl.sum ({} {})".format( - len(iverts), ncpl - ) - assert len(iverts) == ncpl.sum(), msg - assert self.xc.shape[0] == self.ncpl.sum() - assert self.yc.shape[0] == self.ncpl.sum() - return - - @property - def grid_type(self): - return "unstructured" - - def write_shapefile(self, filename="grid.shp"): - """ - Write shapefile of the grid - - Parameters - ---------- - filename : string - filename for shapefile - - Returns - ------- - - """ - raise NotImplementedError() - return - - def write_gridSpec(self, filename): - """ - Write a PEST-style grid specification file - - Parameters - ---------- - filename : string - filename for grid specification file - - Returns - ------- - - """ - raise NotImplementedError() - return - - @classmethod - def from_gridspec(cls, fname): - """ - Create a new SpatialReferenceUnstructured grid from an PEST - grid specification file - - Parameters - ---------- - fname : string - File name for grid specification file - - Returns - ------- - sru : flopy.utils.reference.SpatialReferenceUnstructured - - """ - raise NotImplementedError() - return - - @classmethod - def from_argus_export(cls, fname, nlay=1): - """ - Create a new SpatialReferenceUnstructured grid from an Argus One - Trimesh file - - Parameters - ---------- - fname : string - File name - - nlay : int - Number of layers to create - - Returns - ------- - sru : flopy.utils.reference.SpatialReferenceUnstructured - - """ - from ..utils.geometry import get_polygon_centroid - - f = open(fname, "r") - line = f.readline() - ll = line.split() - ncells, nverts = ll[0:2] - ncells = int(ncells) - nverts = int(nverts) - verts = np.empty((nverts, 2), dtype=float) - xc = np.empty((ncells), dtype=float) - yc = np.empty((ncells), dtype=float) - - # read the vertices - f.readline() - for ivert in range(nverts): - line = f.readline() - ll = line.split() - c, iv, x, y = ll[0:4] - verts[ivert, 0] = x - verts[ivert, 1] = y - - # read the cell information and create iverts, xc, and yc - iverts = [] - for icell in range(ncells): - line = f.readline() - ll = line.split() - ivlist = [] - for ic in ll[2:5]: - ivlist.append(int(ic) - 1) - if ivlist[0] != ivlist[-1]: - ivlist.append(ivlist[0]) - iverts.append(ivlist) - xc[icell], yc[icell] = get_polygon_centroid(verts[ivlist, :]) - - # close file and return spatial reference - f.close() - return cls(xc, yc, verts, iverts, np.array(nlay * [len(iverts)])) - - def __setattr__(self, key, value): - super(SpatialReference, self).__setattr__(key, value) - return - - def get_extent(self): - """ - Get the extent of the grid - - Returns - ------- - extent : tuple - min and max grid coordinates - - """ - xmin = self.verts[:, 0].min() - xmax = self.verts[:, 0].max() - ymin = self.verts[:, 1].min() - ymax = self.verts[:, 1].max() - return (xmin, xmax, ymin, ymax) - - def get_xcenter_array(self): - """ - Return a numpy one-dimensional float array that has the cell center x - coordinate for every cell in the grid in model space - not offset or - rotated. - - """ - return self.xc - - def get_ycenter_array(self): - """ - Return a numpy one-dimensional float array that has the cell center x - coordinate for every cell in the grid in model space - not offset of - rotated. - - """ - return self.yc - - def plot_array(self, a, ax=None): - """ - Create a QuadMesh plot of the specified array using patches - - Parameters - ---------- - a : np.ndarray - - Returns - ------- - pc : matplotlib.collections.PatchCollection - - """ - from ..plot import ModelMap - - pmv = ModelMap(sr=self, ax=ax) - pc = pmv.plot_array(a) - - return pc - - def get_grid_line_collection(self, **kwargs): - """ - Get a patch collection of the grid - - """ - from ..plot import ModelMap - - ax = kwargs.pop("ax", None) - pmv = ModelMap(sr=self, ax=ax) - pc = pmv.plot_grid(**kwargs) - return pc - - def contour_array(self, ax, a, **kwargs): - """ - Create a QuadMesh plot of the specified array using pcolormesh - - Parameters - ---------- - ax : matplotlib.axes.Axes - ax to add the contours - - a : np.ndarray - array to contour - - Returns - ------- - contour_set : ContourSet - - """ - contour_set = ax.tricontour(self.xcenter, self.ycenter, a, **kwargs) - return contour_set - - class TemporalReference: """ For now, just a container to hold start time and time units files