{ "info": { "author": "Abdulelah Bin Mahfoodh", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: GIS", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Utilities" ], "description": "\n\nzmapio: reading and writing ZMAP Plus Grid files\n------------------------------------------------\n\nTo install:\n===========\n\n.. code:: bash\n\n $ pip install zmapio\n\n\nBasic usage of zmapio\n=====================\n\n\n.. code:: python\n\n import matplotlib.pyplot as plt\n import numpy as np\n from zmapio import ZMAPGrid\n\n.. code:: python\n\n %matplotlib inline\n\nReading a ZMAP file:\n\n.. code:: python\n\n z_file = ZMAPGrid('./examples/NSLCU.dat')\n\nAccessing the comments header:\n\n.. code:: python\n\n for c in z_file.comments:\n print(c)\n\n\n.. parsed-literal::\n\n Landmark Zmap grid file name: .\\DATA\\NSLCU.dat\n Created/converted by Oasis Montaj, Geosoft Inc.\n\n\nPlotting the grid data:\n\n.. code:: python\n\n z_file.plot()\n\n\n\n\n.. image:: https://raw.githubusercontent.com/abduhbm/zmapio/master/_static/output_9_1.png\n\n\nCounts for rows and columns:\n\n.. code:: python\n\n z_file.no_cols, z_file.no_rows\n\n\n\n\n.. parsed-literal::\n\n (435, 208)\n\n\n\nShape for z-values:\n\n.. code:: python\n\n z_file.z_values.shape\n\n\n\n\n.. parsed-literal::\n\n (208, 435)\n\n\n\nExporting to CSV file:\n\n.. code:: python\n\n z_file.to_csv('./output/output.csv')\n\n.. code:: bash\n\n head ./output/output.csv\n\n\n.. parsed-literal::\n\n -630000.0,2621000.0,-16481.9570313\n -630000.0,2618000.0,-16283.9033203\n -630000.0,2615000.0,-16081.5751953\n -630000.0,2612000.0,-15856.7861328\n -630000.0,2609000.0,-15583.7167969\n -630000.0,2606000.0,-15255.734375\n -630000.0,2603000.0,-14869.3769531\n -630000.0,2600000.0,-14426.1513672\n -630000.0,2597000.0,-13915.8769531\n -630000.0,2594000.0,-13340.4677734\n\n\nExporting to WKT file:\n\n.. code:: python\n\n z_file.to_wkt('./output/output.wkt')\n\nExporting to GeoJSON file:\n\n.. code:: python\n\n z_file.to_geojson('./output/output.json')\n\nExporting to Pandas Dataframe:\n\n.. code:: python\n\n df = z_file.to_dataframe()\n\n\n.. code:: python\n\n df.Z.describe()\n\n\n\n\n.. parsed-literal::\n\n count 90480.000000\n mean -5244.434235\n std 4692.845490\n min -16691.371094\n 25% -10250.590088\n 50% -4003.433105\n 75% -1320.896881\n max 2084.417969\n Name: Z, dtype: float64\n\n\n\nWrite a new ZMAP file as 3 nodes per line format:\n\n.. code:: python\n\n z_file.write('./output/test.zmap', nodes_per_line=3)\n\n.. code:: bash\n\n head ./output/test.zmap\n\n\n.. parsed-literal::\n\n ! Landmark Zmap grid file name: .\\DATA\\NSLCU.dat\n ! Created/converted by Oasis Montaj, Geosoft Inc.\n @.\\DATA\\NSLCU.dat, GRID, 3\n 20, 1e+30, , 7, 1\n 208, 435, -630000.0, 672000.0, 2000000.0, 2621000.0\n 0.0, 0.0, 0.0\n @\n -16481.9570313 -16283.9033203 -16081.5751953\n -15856.7861328 -15583.7167969 -15255.7343750\n -14869.3769531 -14426.1513672 -13915.8769531\n\n\nCreating a ZMAP object from string:\n\n.. code:: python\n\n z_text = \"\"\"\n !\n ! File created by DMBTools2.GridFileFormats.ZmapPlusFile\n !\n @GRID FILE, GRID, 4\n 20, -9999.0000000, , 7, 1\n 6, 4, 0, 200, 0, 300\n 0.0, 0.0, 0.0\n @\n -9999.0000000 -9999.0000000 3.0000000 32.0000000\n 88.0000000 13.0000000\n -9999.0000000 20.0000000 8.0000000 42.0000000\n 75.0000000 5.0000000\n 5.0000000 100.0000000 35.0000000 50.0000000\n 27.0000000 1.0000000\n 2.0000000 36.0000000 10.0000000 6.0000000\n 9.0000000 -9999.0000000\n \"\"\"\n z_t = ZMAPGrid(z_text)\n z_t.plot()\n\n\n\n\n.. image:: https://raw.githubusercontent.com/abduhbm/zmapio/master/_static/output_28_1.png\n\n\nAdding colorbar and colormap using matplotlib:\n\n.. code:: python\n\n z_obj = ZMAPGrid('./examples/NStopo.dat')\n fig=plt.figure(figsize=(12, 6))\n z_obj.plot(cmap='jet')\n plt.colorbar()\n\n\n\n\n.. image:: https://raw.githubusercontent.com/abduhbm/zmapio/master/_static/output_30_1.png\n\n\nCreating a new ZMAP object from 2D-Numpy array with shape (no_cols,\nno_rows):\n\n.. code:: python\n\n z_val = z_obj.z_values.swapaxes(0, 1)\n print('Z-values shape: ', z_val.shape)\n new_zgrid = ZMAPGrid(z_values=z_val, min_x=-630000.0000, max_x=672000.0000, \n min_y=2000000.0000, max_y=2621000.0000)\n\n\n.. parsed-literal::\n\n Z-values shape: (435, 208)\n\n\n.. code:: python\n\n new_zgrid.plot(cmap='gist_earth')\n\n\n\n\n.. image:: https://raw.githubusercontent.com/abduhbm/zmapio/master/_static/output_33_1.png\n\n\nCustomize writing a ZMAP file:\n\n.. code:: python\n\n new_zgrid.comments = ['this is', 'a test']\n new_zgrid.nodes_per_line = 4\n new_zgrid.field_width = 15\n new_zgrid.decimal_places = 3\n new_zgrid.name = 'test'\n new_zgrid.write('./output/new_z.dat')\n\n.. code:: bash\n\n head ./output/new_z.dat\n\n\n.. parsed-literal::\n\n !this is\n !a test\n @test, GRID, 4\n 15, 1e+30, , 3, 1\n 208, 435, -630000.0, 672000.0, 2000000.0, 2621000.0\n 0.0, 0.0, 0.0\n @\n -67.214 -67.570 -67.147 -69.081\n -73.181 -74.308 -72.766 -72.034\n -70.514 -68.555 -66.195 -62.776\n\n\nReferences\n==========\n* https://lists.osgeo.org/pipermail/gdal-dev/2011-June/029173.html\n* https://gist.github.com/wassname/526d5fde3f3cbeb67da8\n* Saltus, R.W. and Bird, K.J., 2003. Digital depth horizon compilations of the Alaskan North Slope and adjacent arctic regions. U.S. Geological Survey data release: https://doi.org/10.3133/ofr03230\n\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/abduhbm/zmapio", "keywords": "ZMAP Plus Grid format", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zmapio", "package_url": "https://pypi.org/project/zmapio/", "platform": "", "project_url": "https://pypi.org/project/zmapio/", "project_urls": { "Homepage": "https://github.com/abduhbm/zmapio" }, "release_url": "https://pypi.org/project/zmapio/0.3/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Python library for reading and writing map gridded data using ZMAP Plus ASCII Grid format", "version": "0.3" }, "last_serial": 4972580, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "63338fbc90b3bff7ec23797f8ee93b98", "sha256": "822a2bf311ec96f2bf1285127a3e8a4def57b36529640a9cb5dc33da43dee502" }, "downloads": -1, "filename": "zmapio-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "63338fbc90b3bff7ec23797f8ee93b98", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7176, "upload_time": "2019-03-22T12:10:24", "url": "https://files.pythonhosted.org/packages/f4/7e/3fdc2db472b57e73c3548e3271b005ca1e8a21e5d8b4cd21aa1755eb8fdf/zmapio-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "359c3e8fe018920a9dc99a5984739331", "sha256": "ee68cfdca76067c8359094dd278360287e8c59db1c28bf010ae86f5699d4d94f" }, "downloads": -1, "filename": "zmapio-0.2.tar.gz", "has_sig": false, "md5_digest": "359c3e8fe018920a9dc99a5984739331", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7210, "upload_time": "2019-03-22T12:10:27", "url": "https://files.pythonhosted.org/packages/00/83/9358e4789ceb2db401d03ac9664657ee1cf42b6eab73a9261c5dd257a175/zmapio-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "53038361a63adb9d99121a314ce06bf0", "sha256": "038e76dd7fc920b0345374e88dcc677cdb777860d43c786803de14e86bb1658b" }, "downloads": -1, "filename": "zmapio-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "53038361a63adb9d99121a314ce06bf0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7195, "upload_time": "2019-03-22T12:14:35", "url": "https://files.pythonhosted.org/packages/d6/fd/1287a1296aab287baca306f12a239c84bbdbd2ed99362389a1fda903fb1f/zmapio-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4af97a90af4cfed56fe4e14a9820819b", "sha256": "adc98447c8fc4ee55afb498914f749a8a7457a682b437221c0a42048803d3b7d" }, "downloads": -1, "filename": "zmapio-0.3.tar.gz", "has_sig": false, "md5_digest": "4af97a90af4cfed56fe4e14a9820819b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7227, "upload_time": "2019-03-22T12:14:36", "url": "https://files.pythonhosted.org/packages/fb/33/0db2f83e17ec3a9d08bded268fedd78b9edb884b3d580add3aa33ad09d51/zmapio-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "53038361a63adb9d99121a314ce06bf0", "sha256": "038e76dd7fc920b0345374e88dcc677cdb777860d43c786803de14e86bb1658b" }, "downloads": -1, "filename": "zmapio-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "53038361a63adb9d99121a314ce06bf0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7195, "upload_time": "2019-03-22T12:14:35", "url": "https://files.pythonhosted.org/packages/d6/fd/1287a1296aab287baca306f12a239c84bbdbd2ed99362389a1fda903fb1f/zmapio-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4af97a90af4cfed56fe4e14a9820819b", "sha256": "adc98447c8fc4ee55afb498914f749a8a7457a682b437221c0a42048803d3b7d" }, "downloads": -1, "filename": "zmapio-0.3.tar.gz", "has_sig": false, "md5_digest": "4af97a90af4cfed56fe4e14a9820819b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7227, "upload_time": "2019-03-22T12:14:36", "url": "https://files.pythonhosted.org/packages/fb/33/0db2f83e17ec3a9d08bded268fedd78b9edb884b3d580add3aa33ad09d51/zmapio-0.3.tar.gz" } ] }