Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modem updates #136

Open
wants to merge 60 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a29cc6f
copied over modem changes from metadata
kujaku11 Feb 11, 2021
e5efe0a
cleaning up files to comply with develop
kujaku11 Feb 11, 2021
741dde9
updated mtcolors to have terrain colormap
kujaku11 Feb 11, 2021
dfcc624
fixed bug in station finding center
kujaku11 Feb 11, 2021
d10d17a
updated the format of rotation angle to be .3g to comply with older m…
kujaku11 Feb 11, 2021
9771e19
updated test_model and tests.__init__ to use Path
kujaku11 Feb 11, 2021
830e7b6
updated test_model and tests.__init__ to use Path
kujaku11 Feb 11, 2021
5f59526
updated test_model to use path and EDI_DATA_LIST
kujaku11 Feb 11, 2021
8d746fd
update test_data to use Path and EDI_DATA_LIST
kujaku11 Feb 11, 2021
828d767
updated how center point elevation is estimate, should be a negative …
kujaku11 Feb 11, 2021
3d44965
fixed how center elevation is passed
kujaku11 Feb 11, 2021
e070d44
updated mesh_tools with functions for rounding, and shifting a surface
kujaku11 Feb 11, 2021
cc815d1
updated documentation on mesh_tools.get_rounding
kujaku11 Feb 11, 2021
c665913
updated documentation in data file
kujaku11 Feb 11, 2021
b737af3
updated documentation in modem.Data
kujaku11 Feb 12, 2021
8f4e0ad
added ability to write vtk stations in z+ or z- coordinate system
kujaku11 Feb 12, 2021
ed03b0a
added check for ocean bottom sensor for issue #133
kujaku11 Feb 12, 2021
8b1c955
added check for ocean bottom sensor for issue #133
kujaku11 Feb 12, 2021
708733f
updated documentation and import of evtk to pyevtk
kujaku11 Feb 12, 2021
6ee7378
updated documentation and import of evtk to pyevtk
kujaku11 Feb 12, 2021
9d30740
updated documentation of model
kujaku11 Feb 12, 2021
a89cfbc
updated modem guis
kujaku11 Feb 12, 2021
b081a3e
updating test_data_object
kujaku11 Feb 12, 2021
fcc250f
updating gui/modem_*
kujaku11 Feb 12, 2021
fe9fd79
updated modem_gui
kujaku11 Feb 16, 2021
ed93238
fixed plot_rms_maps assuming 'all' is meant to be a summarization of …
kujaku11 Feb 16, 2021
1584eef
fixed plot_rms_maps assuming 'all' is meant to be a summarization of …
kujaku11 Feb 16, 2021
4b6b092
updated ModEM_build_inputsfiles to use Path and directory variables f…
kujaku11 Feb 16, 2021
89041d7
updated ModEM_build_inputfiles_edi_elevation.py to use Path and impor…
kujaku11 Feb 16, 2021
66bcb50
updated C:\Users\jpeacock\Documents\GitHub\mtpy\examples\scripts\ModE…
kujaku11 Feb 16, 2021
e7cf200
update examples\scripts\ModEM_DepthSlice_to_gmt.py to use Path and im…
kujaku11 Feb 16, 2021
4a4feea
update examples\scripts\ModEM_plot_slice_on_profile.py to use Path an…
kujaku11 Feb 16, 2021
0109747
fixed test_mare2dem to skip comparing lines with more than one '-'
kujaku11 Feb 16, 2021
509b613
updated tests, they all pass now.
kujaku11 Feb 16, 2021
ef76b53
updated tests, they all pass now. Ran black
kujaku11 Feb 16, 2021
030142f
updated tests, they all pass on local machine
kujaku11 Feb 16, 2021
20de854
updated tests, they all pass on local machine
kujaku11 Feb 16, 2021
b8a44d4
added response_plot_settings
kujaku11 Feb 16, 2021
31122f1
updated plot_stations to have a nice looking station label
kujaku11 Feb 17, 2021
12c5189
updated plotRMS and tests to follow alisons comment
kujaku11 Feb 17, 2021
bd5ac87
updated plotRMS and tests to follow alisons comment
kujaku11 Feb 17, 2021
410e9a9
updated plotRMS and tests to follow alisons comment
kujaku11 Feb 17, 2021
0455552
updated occam2d to remove some of the warnings
kujaku11 Feb 17, 2021
cb7f6ae
updated mare2d tests and fixed some of the warnings for occam2d
kujaku11 Feb 17, 2021
c31df1a
trying a new commit to rerun travisCL
kujaku11 Feb 17, 2021
8715726
trying a new commit to rerun travixcl
kujaku11 Feb 18, 2021
c26ed6d
added print statements in station to help debug
kujaku11 Feb 24, 2021
cdad224
added print statements in station to help debug
kujaku11 Feb 24, 2021
a55def8
added print statements in station to help debug
kujaku11 Feb 24, 2021
88e8113
updated station to explicitly set center_point[0]
kujaku11 Feb 25, 2021
fa2c7c8
Merge branch 'develop' into modem_updates
kujaku11 Feb 26, 2021
f7846d3
updated calculator to be same as develop branch
kujaku11 Feb 26, 2021
8733960
added __str__ and __repr__ to modem.Model
kujaku11 Mar 2, 2021
924fbc1
added to_csv, to_shp for modem.Station
kujaku11 Mar 3, 2021
a89e24e
updated examples/scripts/ModEM_plot_slices_on_basemap.py to use relat…
kujaku11 Mar 3, 2021
ed31a62
added an MT jet like color scale
kujaku11 Mar 5, 2021
4d792e5
Merge branch 'develop' into modem_updates
kujaku11 Mar 5, 2021
1ce10ac
added function to plot conductance as a raster in array2raster
kujaku11 Mar 24, 2021
436dbf8
added ability to plot conductance to the shape files
kujaku11 Mar 31, 2021
c7095aa
Merge branch 'modem_updates' of https:/MTgeophysics/mtpy …
kujaku11 Mar 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
90 changes: 45 additions & 45 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../..'))

sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../.."))
print(sys.path)

os.environ['GDAL_DATA'] ='/tmp'
os.environ["GDAL_DATA"] = "/tmp"

# -- Project information -----------------------------------------------------

project = u'mtpy'
copyright = u'2018, Geoscience Australia'
author = u'Alison Kirkby, Fei Zhang, Jared Peacock, Rakib Hassan, Jingming Duan'
project = u"mtpy"
copyright = u"2018, Geoscience Australia"
author = u"Alison Kirkby, Fei Zhang, Jared Peacock, Rakib Hassan, Jingming Duan"

# The short X.Y version
version = u'1.01'
version = u"1.01"
# The full version, including alpha/beta/rc tags
release = u'1.01.01'
release = u"1.01.01"


# -- General configuration ---------------------------------------------------
Expand All @@ -43,36 +44,36 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.viewcode',
'numpydoc',
'sphinx.ext.autosummary',
'sphinx.ext.githubpages',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.imgmath",
"sphinx.ext.viewcode",
"numpydoc",
"sphinx.ext.autosummary",
"sphinx.ext.githubpages",
]

extensions += [
#'matplotlib.sphinxext.only_directives',
#'matplotlib.sphinxext.plot_directive',
# 'matplotlib.sphinxext.ipython_directive',
# 'matplotlib.sphinxext.ipython_console_highlighting'
]
]


# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
templates_path = ["templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
#master_doc = 'master_doc'
master_doc = "index"
# master_doc = 'master_doc'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -87,7 +88,7 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------
Expand All @@ -96,7 +97,7 @@
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = 'classic'
html_theme = "classic"


# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -108,7 +109,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['static']
html_static_path = ["static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -124,7 +125,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'mtpydoc'
htmlhelp_basename = "mtpydoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -133,15 +134,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -151,19 +149,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'mtpy.tex', u'MTPy Documentation',
author, 'manual'),
(master_doc, "mtpy.tex", u"MTPy Documentation", author, "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'mtpy', u'mtpy Documentation',
[author], 1)
]
man_pages = [(master_doc, "mtpy", u"mtpy Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -172,9 +166,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'mtpy', u'mtpy Documentation',
author, 'mtpy', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"mtpy",
u"mtpy Documentation",
author,
"mtpy",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -196,7 +196,7 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
Expand All @@ -207,12 +207,12 @@
# mod = __import__(extname, None, None, ['setup'])
# RuntimeError: sys.path must be a list of directory names
# See: http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
#NATIVE_MODULES = [
# NATIVE_MODULES = [
MOCK_MODULES = [
'osgeo',
'osgeo.ogr',
'osgeo.gdal',
'osgeo.osr',
"osgeo",
"osgeo.ogr",
"osgeo.gdal",
"osgeo.osr",
]

import mock
Expand All @@ -221,7 +221,7 @@
sys.modules[mod_name] = mock.Mock()


#sys.modules.update([(mod_name, Mock()) for mod_name in NATIVE_MODULES])
# sys.modules.update([(mod_name, Mock()) for mod_name in NATIVE_MODULES])
# sys.modules['rasterio.coords'].BoundingBox = Mock
# sphinx\registry.py", line 315, in load_extension
# mod = __import__(extname, None, None, ['setup'])
Expand Down
104 changes: 59 additions & 45 deletions examples/cmdline/build_ModEM_inputfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def build_modem_inputfiles(edi_path, output_path):
start_period = 0.002
stop_period = 2000
periods_per_decade = 4
period_list = get_period_list(start_period, stop_period, periods_per_decade,
include_outside_range=True)
period_list = get_period_list(
start_period, stop_period, periods_per_decade, include_outside_range=True
)

## an example to use the periods from a particular edi file
# edifile_periods = op.join(edipath,'Synth00.edi')
Expand All @@ -62,56 +63,65 @@ def build_modem_inputfiles(edi_path, output_path):
workdir = output_path
edipath = edi_path
# list of edi files, search for all files ending with '.edi'
edi_list = [op.join(edipath, ff) for ff in os.listdir(edipath) if (ff.endswith('.edi'))]
edi_list = [
op.join(edipath, ff) for ff in os.listdir(edipath) if (ff.endswith(".edi"))
]

# make the save path if it doesn't exist
if not op.exists(workdir):
os.mkdir(workdir)

do = Data(edi_list=edi_list,
inv_mode='1',
save_path=workdir,
period_list=period_list,
period_buffer=2, # factor to stretch interpolation by. For example: if period_buffer=2
# then interpolated data points will only be included if they are
# within a factor of 2 of a true data point
error_type_z=np.array([['floor_percent', 'floor_egbert'],
# error type, options are 'egbert', 'percent', 'mean_od', 'eigen', 'median', 'off_diagonals'
['floor_egbert', 'percent']]), # add floor to apply it as an error floor
# can supply a 2 x 2 array for each component or a single value
error_value_z=np.array([[20., 5.], # error floor value in percent
[5., 20.]]), # can supply a 2 x 2 array for each component or a single value
error_type_tipper='floor_abs', # type of error to set in tipper,
# floor_abs is an absolute value set as a floor
error_value_tipper=.03,
model_epsg=28354 # model epsg, currently set to utm zone 54.
# See http://spatialreference.org/ to find the epsg code for your projection
)
do = Data(
edi_list=edi_list,
inv_mode="1",
save_path=workdir,
period_list=period_list,
period_buffer=2, # factor to stretch interpolation by. For example: if period_buffer=2
# then interpolated data points will only be included if they are
# within a factor of 2 of a true data point
error_type_z=np.array(
[
["floor_percent", "floor_egbert"],
# error type, options are 'egbert', 'percent', 'mean_od', 'eigen', 'median', 'off_diagonals'
["floor_egbert", "percent"],
]
), # add floor to apply it as an error floor
# can supply a 2 x 2 array for each component or a single value
error_value_z=np.array(
[[20.0, 5.0], [5.0, 20.0]] # error floor value in percent
), # can supply a 2 x 2 array for each component or a single value
error_type_tipper="floor_abs", # type of error to set in tipper,
# floor_abs is an absolute value set as a floor
error_value_tipper=0.03,
model_epsg=28354 # model epsg, currently set to utm zone 54.
# See http://spatialreference.org/ to find the epsg code for your projection
)
do.write_data_file()

# set elevations to zero as we need to ensure the stations are on the topography
do.data_array['elev'] = 0.
do.data_array["elev"] = 0.0
do.write_data_file(fill=False)

# create model file
mo = Model(station_locations=do.station_locations,
cell_size_east=8000,
cell_size_north=8000,
pad_north=7, # number of padding cells in each of the north and south directions
pad_east=7, # number of east and west padding cells
pad_z=6, # number of vertical padding cells
pad_stretch_v=1.6, # factor to increase by in padding cells (vertical)
pad_stretch_h=1.4, # factor to increase by in padding cells (horizontal)
pad_num=3, # number of constant-width cells to add to outside of model before padding cells start
# this number is currently multiplied by 1.5 internally
n_air_layers=10, # number of air layers, set to 0 to incorporate bathymetry only
res_model=100, # halfspace resistivity value for reference model
n_layers=100, # total number of z layers, including air
z1_layer=10, # first layer thickness
pad_method='stretch', # method for calculating padding
z_mesh_method='new',
z_target_depth=120000 # depth to bottom of core model (padding after this depth)
)
mo = Model(
station_locations=do.station_locations,
cell_size_east=8000,
cell_size_north=8000,
pad_north=7, # number of padding cells in each of the north and south directions
pad_east=7, # number of east and west padding cells
pad_z=6, # number of vertical padding cells
pad_stretch_v=1.6, # factor to increase by in padding cells (vertical)
pad_stretch_h=1.4, # factor to increase by in padding cells (horizontal)
pad_num=3, # number of constant-width cells to add to outside of model before padding cells start
# this number is currently multiplied by 1.5 internally
n_air_layers=10, # number of air layers, set to 0 to incorporate bathymetry only
res_model=100, # halfspace resistivity value for reference model
n_layers=100, # total number of z layers, including air
z1_layer=10, # first layer thickness
pad_method="stretch", # method for calculating padding
z_mesh_method="new",
z_target_depth=120000, # depth to bottom of core model (padding after this depth)
)

mo.make_mesh()
mo.write_model_file(save_path=workdir)
Expand All @@ -120,7 +130,9 @@ def build_modem_inputfiles(edi_path, output_path):
# if the number of air layers is zero - bathymetry only will be added.
# if the number of air layers is nonzero - topography will be added, discretised into that number of cells
# mo.add_topography_to_model2(r'C:\mtpywin\mtpy\examples\data\AussieContinent_etopo1.asc')
mo.add_topography_to_model2(r'C:\Githubz\mtpy\examples\data\AussieContinent_etopo1.asc')
mo.add_topography_to_model2(
r"C:\Githubz\mtpy\examples\data\AussieContinent_etopo1.asc"
)
mo.write_model_file(save_path=workdir)

# update data elevations
Expand All @@ -143,9 +155,11 @@ def build_modem_inputfiles(edi_path, output_path):
# ====================================================================================================
if __name__ == "__main__":

USAGE = "\n********************************************\n " \
"Usage: python %s edi_dir_path output_dir_path " \
"\n********************************************\n " % sys.argv[0]
USAGE = (
"\n********************************************\n "
"Usage: python %s edi_dir_path output_dir_path "
"\n********************************************\n " % sys.argv[0]
)

if len(sys.argv) < 3:
print(USAGE)
Expand Down
Loading