For this you should clone MTpy metadata
branch: https://github.com/MTgeophysics/mtpy/tree/metadata
If you cd
into the folder containing the cloned branch you can use pip install -e .
or just link your PYTHONPATH
to the folder.
from mtpy.modeling.modem import Model, Data
GDAL_DATA environment variable is not set Please see https://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#HowtosetGDAL_DATAvariable 2022-03-31 14:27:15,759 [line 133] error.get_mtpy_logger - INFO: Logging file can be found C:\Users\jpeacock\Documents\GitHub\mtpy\logs\mtpy_error.log 2022-03-31 14:27:15,759 [line 133] matplotlib.get_mtpy_logger - INFO: Logging file can be found C:\Users\jpeacock\Documents\GitHub\mtpy\logs\matplotlib_warn.log
Ignore GDAL as it is not working. Will use pyproj 2022-03-31T14:27:15 [line 157] numexpr.utils._init_num_threads - INFO: NumExpr defaulting to 8 threads.
C:\Users\jpeacock\Anaconda3\envs\mt\lib\_collections_abc.py:720: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API. yield from self._mapping C:\Users\jpeacock\Documents\GitHub\mtpy\mtpy\imaging\mtcolors.py:283: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API. cmapdict.update(cm.cmap_d)
d = Data()
d.read_data_file(r"c:\Users\jpeacock\OneDrive - DOI\Geysers\modem_inv\inv03\gz_data_err03_tec_edit.dat")
This will convert to UTM coordinates in a coordinate systems with x=North, y=East, z +downward. If you want geographic coordinates you can set the keyword geographic=True
. If you want relative coordinates you can leave the shift keywords set to 0. Be careful with the shift_elev
and shift_z
because the model center is relative to an elevation ceiling, which I think is set to 1100m. Might need to play around with this value to make the elevations relative to sea level.
d.write_vtk_station_file(
vtk_fn_basename="geysers_stations_utm",
shift_north=d.center_point.north[0],
shift_east=d.center_point.east[0],
shift_elev=d.center_point.elev[0]
)
2022-03-31 14:30:30,033 [line 2012] mtpy.modeling.modem.data.Data.write_vtk_station_file - INFO: Wrote station VTK file to c:\Users\jpeacock\OneDrive - DOI\Geysers\modem_inv\inv03\geysers_stations_utm
WindowsPath('c:/Users/jpeacock/OneDrive - DOI/Geysers/modem_inv/inv03/geysers_stations_utm')
m = Model()
m.read_model_file(r"c:\Users\jpeacock\OneDrive - DOI\Geysers\modem_inv\inv03\gz_err03_cov02_NLCG_057.rho")
m.write_vtk_file(
vtk_fn_basename="geysers_model_utm",
shift_north=d.center_point.north[0],
shift_east=d.center_point.east[0],
shift_z=d.center_point.elev[0]
)
2022-03-31T14:35:51 [line 1517] Model.write_vtk_file - INFO: Wrote model file to c:\Users\jpeacock\OneDrive - DOI\Geysers\modem_inv\inv03\geysers_model_utm ========================== model dimensions = (70, 81, 70) * north 70 * east 81 * depth 70 ==========================
from mtpy.modeling.modem import ControlFwd, ControlInv
cfwd = ControlFwd()
cfwd.write_control_file("control.fwd")
cfwd = ControlInv()
cfwd.write_control_file("control.inv")
Wrote ModEM control file to control.fwd Wrote ModEM control file to control.inv