MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
147 stars 66 forks source link

bug in plot_mt_response in gui #24

Closed alkirkby closed 6 years ago

alkirkby commented 6 years ago

When trying to plot MT response using the GUI (gui/smartmt/start.py) using the example data (examples/data/edi2) I get an error

image

Expected Behavior

generate plot at a single station

Current Behavior

Plotting Error: mtpy.imaging.plot_mt_response: 'NoneType' object has no attribute 'tipper'

Steps to Reproduce (for bugs)

  1. load gui/smartmt/start.py
  2. load edi folder: mtpy/examples/data/edi2
  3. select top 5 stations and click visualise selected stations
  4. select visualise (MT Response, station 11, defaults)

Your Environment

Installed Python Packages: alabaster 0.7.10 py27_0 conda-forge asn1crypto 0.22.0 py27_0 conda-forge astroid 1.5.3 py27_0 conda-forge babel 2.4.0 py27_0 conda-forge backports 1.0 py27_1 conda-forge backports.functools_lru_cache 1.4 py27_1 conda-forge backports.shutil_get_terminal_size 1.0.0 py27_1 conda-forge backports_abc 0.5 py27_0 conda-forge basemap 1.1.0 py27_3 conda-forge bleach 2.0.0 py27_0 conda-forge ca-certificates 2017.7.27.1 0 conda-forge certifi 2017.7.27.1 py27_0 conda-forge cffi 1.10.0 py27_0 conda-forge chardet 3.0.4 py27_0 conda-forge click 6.7 py27_0 conda-forge click-plugins 1.0.3 py27_0 conda-forge cligj 0.4.0 py27_0 conda-forge colorama 0.3.9 py27_0 conda-forge configparser 3.5.0 py27_0 conda-forge cryptography 2.0.3 py27_0 conda-forge curl 7.55.1 vc9_0 [vc9] conda-forge cycler 0.10.0 py27_0 conda-forge decorator 4.1.2 py27_0 conda-forge descartes 1.1.0 py27_0 conda-forge docutils 0.14 py27_0 conda-forge entrypoints 0.2.3 py27_1 conda-forge enum34 1.1.6 py27_1 conda-forge expat 2.1.0 vc9_3 [vc9] conda-forge fiona 1.7.9 py27_1 conda-forge freetype 2.7 vc9_1 [vc9] conda-forge freexl 1.0.2 vc9_2 [vc9] conda-forge funcsigs 1.0.2 py_2 conda-forge functools32 3.2.3.2 py27_1 conda-forge future 0.16.0 py27_0 conda-forge gdal 2.1.3 py27_vc9_7 [vc9] conda-forge geopandas 0.3.0 py27_0 conda-forge geos 3.6.2 vc9_1 [vc9] conda-forge hdf4 4.2.12 vc9_0 [vc9] conda-forge hdf5 1.10.1 vc9_1 [vc9] conda-forge html5lib 0.999999999 py27_0 conda-forge icu 58.1 vc9_1 [vc9] conda-forge idna 2.5 py27_0 conda-forge imagesize 0.7.1 py27_0 conda-forge ipaddress 1.0.18 py27_0 conda-forge ipykernel 4.6.1 py27_0 conda-forge ipython 5.4.1 py27_0 conda-forge ipython_genutils 0.2.0 py27_0 conda-forge ipywidgets 7.0.5 py27_0 conda-forge isort 4.2.15 py27_0 conda-forge jedi 0.10.2 py27_0 conda-forge jinja2 2.9.6 py27_0 conda-forge jpeg 9b vc9_0 [vc9] conda-forge jsonschema 2.5.1 py27_0 conda-forge jupyter 1.0.0 py27_0 conda-forge jupyter_client 5.1.0 py27_0 conda-forge jupyter_console 5.2.0 py27_0 conda-forge jupyter_core 4.3.0 py27_0 conda-forge kealib 1.4.7 vc9_4 [vc9] conda-forge krb5 1.14.2 vc9_0 [vc9] conda-forge lazy-object-proxy 1.3.1 py27_0 conda-forge libiconv 1.14 vc9_4 [vc9] conda-forge libnetcdf 4.4.1.1 vc9_10 [vc9] conda-forge libpng 1.6.28 vc9_2 [vc9] conda-forge libpq 9.6.3 vc9_0 [vc9] conda-forge libspatialindex 1.8.5 vc9_1 [vc9] conda-forge libspatialite 4.3.0a vc9_18 [vc9] conda-forge libssh2 1.8.0 vc9_2 [vc9] conda-forge libtiff 4.0.6 vc9_7 [vc9] conda-forge libxml2 2.9.3 vc9_9 [vc9] conda-forge libxslt 1.1.29 vc9_5 [vc9] conda-forge lxml 3.8.0 py27_0 conda-forge markupsafe 1.0 py27_0 conda-forge matplotlib 2.0.0 np112py27_2 conda-forge mccabe 0.6.1 py27_0 conda-forge mistune 0.7.4 py27_0 conda-forge mkl 2017.0.3 0 mock 2.0.0 py27_0 conda-forge munch 2.2.0 py27_0 conda-forge nbconvert 5.2.1 py27_1 conda-forge nbformat 4.3.0 py27_0 conda-forge netcdf4 1.3.1 py27_2 conda-forge notebook 5.2.2 py27_1 conda-forge numpy 1.12.1 py27_0 numpydoc 0.7.0 py27_0 conda-forge obspy 1.1.0 py27_1 conda-forge olefile 0.44 py27_0 conda-forge openjpeg 2.1.2 vc9_3 [vc9] conda-forge openssl 1.0.2l vc9_0 [vc9] conda-forge pandas 0.20.3 py27_1 conda-forge pandoc 1.19.2 0 conda-forge pandocfilters 1.4.1 py27_0 conda-forge pathlib2 2.3.0 py27_0 conda-forge pbr 3.1.1 py27_0 conda-forge pcre 8.39 vc9_0 [vc9] conda-forge pep8 1.7.0 py27_0 conda-forge pickleshare 0.7.4 py27_0 conda-forge pillow 4.3.0 py27_1 conda-forge pip 9.0.1 py27_0 conda-forge proj4 4.9.3 vc9_4 [vc9] conda-forge prompt_toolkit 1.0.15 py27_0 conda-forge psutil 5.2.2 py27_0 conda-forge psycopg2 2.7.3 py27_0 conda-forge pycodestyle 2.3.1 py27_0 conda-forge pycparser 2.18 py27_0 conda-forge pyflakes 1.6.0 py27_0 conda-forge pygments 2.2.0 py27_0 conda-forge pylint 1.7.1 py27_0 conda-forge pyopenssl 17.2.0 py27_0 conda-forge pyparsing 2.2.0 py27_0 conda-forge pyproj 1.9.5.1 py27_0 conda-forge pyqt 4.11.4 py27_2 conda-forge pysal 1.13.0 py27_0 conda-forge pyshp 1.2.12 py_0 conda-forge pysocks 1.6.7 py27_0 conda-forge python 2.7.13 1 conda-forge python-dateutil 2.6.1 py27_0 conda-forge pytz 2017.2 py27_0 conda-forge pyyaml 3.12 py27_1 conda-forge pyzmq 16.0.2 py27_2 conda-forge qt 4.8.7 vc9_6 [vc9] conda-forge qtawesome 0.4.4 py27_0 conda-forge qtconsole 4.3.1 py27_0 conda-forge qtpy 1.3.1 py27_0 conda-forge requests 2.18.4 py27_1 conda-forge rope 0.10.7 py27_0 conda-forge rtree 0.8.3 py27_0 conda-forge scandir 1.5 py27_1 conda-forge scipy 0.19.1 np112py27_0 setuptools 36.3.0 py27_0 conda-forge shapely 1.6.3 py27_0 conda-forge simplegeneric 0.8.1 py27_0 conda-forge singledispatch 3.4.0.3 py27_0 conda-forge sip 4.18 py27_1 conda-forge six 1.10.0 py27_1 conda-forge snowballstemmer 1.2.1 py27_0 conda-forge sphinx 1.6.3 py27_0 conda-forge sphinxcontrib-websupport 1.0.1 py27_0 conda-forge spyder 2.3.9 py27_2 conda-forge sqlalchemy 1.1.13 py27_0 conda-forge sqlite 3.13.0 vc9_1 [vc9] conda-forge ssl_match_hostname 3.5.0.1 py27_1 conda-forge testpath 0.3.1 py27_0 conda-forge tornado 4.5.2 py27_0 conda-forge traitlets 4.3.2 py27_0 conda-forge typing 3.6.2 py27_0 conda-forge urllib3 1.22 py27_0 conda-forge vc 9 0 conda-forge vs2008_runtime 9.00.30729.5054 0 wcwidth 0.1.7 py27_0 conda-forge webencodings 0.5 py27_0 conda-forge wheel 0.29.0 py27_0 conda-forge widgetsnbextension 3.0.8 py27_0 conda-forge win_inet_pton 1.0.1 py27_1 conda-forge win_unicode_console 0.5 py27_0 conda-forge wincertstore 0.2 py27_0 conda-forge wrapt 1.10.11 py27_0 conda-forge xerces-c 3.2.0 vc9_0 [vc9] conda-forge yaml 0.1.6 vc9_0 [vc9] conda-forge zlib 1.2.11 vc9_0 [vc9] conda-forge

sudhirJain commented 6 years ago

start gui has been tested on PC using virtual environment, the result as follows;

alkirkby commented 6 years ago

The issue is still there, could someone please look into this. Contact me directly if necessary.

YingzhiGou commented 6 years ago

seems like it is a bug in the MTPY plotting function called by the GUI, where there still are some old MT object syntax being used. I will take a look tonight when I get home.

YingzhiGou commented 6 years ago

@alkirkby this bug is now fixed in the pull request #25 please review and merge the pull request

alkirkby commented 6 years ago

Great, thanks. I've tested and will merge the pull request.