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

Feat/stream threshold #91

Merged
merged 3 commits into from
Mar 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[bumpversion]
current_version = 0.1.17
current_version = 0.1.18
files = setup.py discretize/__init__.py docs/conf.py

16 changes: 12 additions & 4 deletions discretize/View.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def plotSlice(
pcolorOpts=None,
streamOpts=None,
gridOpts=None,
range_x=None, range_y=None
range_x=None, range_y=None,
stream_threshold=None
):

"""
Expand Down Expand Up @@ -228,7 +229,14 @@ def plotSlice(
fig, axs = plt.subplots(1, len(vType))
out = []
for vTypeI, ax in zip(vType, axs):
out += [self.plotSlice(v, vType=vTypeI, normal=normal, ind=ind, grid=grid, view=view, ax=ax, clim=clim, showIt=False, pcolorOpts=pcolorOpts, streamOpts=streamOpts, gridOpts=gridOpts)]
out += [
self.plotSlice(
v, vType=vTypeI, normal=normal, ind=ind, grid=grid,
view=view, ax=ax, clim=clim, showIt=False,
pcolorOpts=pcolorOpts, streamOpts=streamOpts,
gridOpts=gridOpts, stream_threshold=stream_threshold
)
]
return out
viewOpts = ['real', 'imag', 'abs', 'vec']
normalOpts = ['X', 'Y', 'Z']
Expand Down Expand Up @@ -307,7 +315,7 @@ def doSlice(v):
grid=grid, view=view,
ax=ax, clim=clim, showIt=showIt,
pcolorOpts=pcolorOpts, streamOpts=streamOpts,
gridOpts=gridOpts
gridOpts=gridOpts, stream_threshold=stream_threshold
)

ax.set_xlabel('y' if normal == 'X' else 'x')
Expand Down Expand Up @@ -431,7 +439,7 @@ def _plotImage2D(
V = Vi

if stream_threshold is not None:
mask_me = np.sqrt(U**2 + V**2) <= stream_threshold
mask_me = np.sqrt(Ui**2 + Vi**2) <= stream_threshold
Ui = np.ma.masked_where(mask_me, Ui)
Vi = np.ma.masked_where(mask_me, Vi)

Expand Down
2 changes: 1 addition & 1 deletion discretize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""
)

__version__ = '0.1.17'
__version__ = '0.1.18'
__author__ = 'SimPEG Team'
__license__ = 'MIT'
__copyright__ = '2013 - 2017, SimPEG Developers, http://simpeg.xyz'
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = '0.1.17'
version = '0.1.18'
# The full version, including alpha/beta/rc tags.
release = '0.1.17'
release = '0.1.18'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def configuration(parent_package='', top_path=None):

setup(
name="discretize",
version="0.1.17",
version="0.1.18",
install_requires=[
'numpy>=1.7',
'scipy>=0.13',
Expand Down