MTgeophysics / mtpy

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

Add EDI to Mare2DEM conversion script #121

Closed brenmous closed 4 years ago

brenmous commented 4 years ago

This is a refactoring and clean up of a script used to convert EDI data to a Mare2D profile (via Occam2D). Note this doesn't do a mesh or .poly file, just the data at the moment.

I've committed the original script to the legacy directory as reference here.

The outputs are a Mare2DEM data file, a plot showing the profile against elevation and an elevation file that can be loaded into Mamba2D.

Examples of the plot and data file output based on the synthetic EDI data in examples/data/edi_files_2:

m2d_plot

mare2dem_test.txt

The output needs to be confirmed by an expert (I also haven't been able to get my hands on the Mare2D software). I've sent it to Jingming for testing and if anyone else with access to the Mare2D software could try it out that would be great.

brenmous commented 4 years ago

Will look into the failing test tomorrow. Passes locally but not on Travis, need to implement a proper file diff.

brenmous commented 4 years ago

Fixed a bug that was causing the profile and stations to be misaligned and also changed elevation interp to be against original profile/site locations, rather than the projected locations.

brenmous commented 4 years ago

Looks like matplotlib has pushed an update which deprecates '_png' so an imaging test broke - will push a fix.

Strange as I've had this issue before with another test module and fixed it. Error wasn't tripping on 3.2.1 or 3.2.2 but happens on 3.3.0, so I must've downgraded my mpl at some point or they reintroduced it then deprecated again.

brenmous commented 4 years ago

Looks like more matplotlib internals causing issues, will check it out Monday