MTgeophysics / mtpy

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

modem visualisation #21

Closed alkirkby closed 5 years ago

alkirkby commented 6 years ago

I’ve just noticed there are four python scripts in mtpy to deal with reading, writing and visualising each of phase tensors and slices from modem:

imaging/modem_phase_tensor_maps.py imaging2/modem_ptensors (in branch imaging2) modeling/modem_data_to_phase_tensor.py modeling/modem/plot_pt_maps.py

imaging2/modem_slice.py (in branch imaging2) modeling/modem_output_to_views.py modeling/modem/plot_depth_slice.py modeling/modem/plot_slices.py

I am thinking that we need to try and consolidate some of these as it appears to me that they have similar functionality. I wondered if we should think about putting together a new module in imaging or imaging2 called modem (similar to the modem module in modeling)? Or we could put it all in the existing modem module? We might need to look at the code itself too, to see if there is any duplicated functionality.

geojunky commented 6 years ago

I agree, we need to create a new branch for a proper refactoring; perhaps after merging imaging2 to develop?

alkirkby commented 6 years ago

Sounds good to me.

alkirkby commented 6 years ago

Some additional modules with duplicated functionality:

modeling/modem/plot_response.py & imaging/plot_response.py

geojunky commented 6 years ago

I've started working on consolidating functionality in the following files:

1. imaging/modem_phase_tensor_maps.py () This is the longest file with the most recent updates and I am thinking of refactoring the flexible functionality in 2 into this file

2. imaging2/modem_ptensors (in branch imaging2) Could be deleted altogether once functionality is refactored into 1

3. modeling/modem/plot_pt_maps.py This file is shorted than 1, which has 3 more functions, but it contains changes brought over from the AK branch, which is presumably not the case with 1

4. modeling/modem_data_to_phase_tensor.py This is a small driver file that calls the Data class and can be moved to legacy

We need to have a chat about whether this would be a reasonable way forward.

geojunky commented 6 years ago

Created a new branch consolidate_modem_vis

geojunky commented 6 years ago

Completed consolidating functionalities related to visualization of phase tensors and ModEM slices.

snapshot1