MTgeophysics / mtpy

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

Duplicated functionality in ModEM model class #60

Closed alkirkby closed 6 years ago

alkirkby commented 6 years ago

I'm looking through the ModEM model class to try and remove some redundant/duplicated functionality.

The first duplication I have found is in make_z_mesh. There are 3 functions: make_z_mesh make_z_mesh_exp make_z_mesh_new I use make_z_mesh_new, please let me know if you are using one of the others. Otherwise I will shift the other two to legacy.

The second duplication is in adding topography to models. I use the following functions: add_topography_to_model2 interpolate_elevation2 assign_resistivity_from_surfacedata project_stations_on_topography (in data class)

Here are the functions I don't use. Is anyone else using these? add_topography_to_mesh add_topography_to_model add_topography project_surface old_assign_resistivity_from_surfacedata plot_topograph read_dem_ascii interpolate_elevation make_elevation_model

If none of these are used I will move them to legacy.

kujaku11 commented 6 years ago

The ones that I use are make_z_mesh and plot_topography.

alkirkby commented 6 years ago

Okay great, thanks, I will move the rest to legacy. We can always get them out again if they are needed.

alkirkby commented 6 years ago

Okay, I have moved the following functions to a new file in legacy - legacy/modeling/modem/model.py:

make_z_mesh_exp add_topography_to_mesh add_topography project_surface old_assign_resistivity_from_surfacedata project_stations_on_topography (model class - this duplicates functionality in data class) read_dem_ascii interpolate_elevation make_elevation_model add_topography_to_model

Happy to move any of these back so let me know if this causes issues for anyone.