Coder Social home page Coder Social logo

em_examples's People

Contributors

dccowan avatar fourndo avatar lheagy avatar micmitch avatar sgkang avatar thast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

em_examples's Issues

examples of DC underground

We need a couple images and a synthetic example to demonstrate DC resistivity underground.

  • @sdevriese, @micmitch : do you have a couple examples of images / data that can demonstrate this?

For the synthetic example, a single example showing the non-uniqueness of it the target is above (eg. at location a) or below (eg. at location b) in a line of data. @micmitch : do you have an example showing this?

image

Simulations: FDEM; VMD; 1D earth

Using the SimPEG cyl code, simulate a VMD over a layered earth

Parameters

  • height of the loop (above, on or in earth)
  • freq
  • 3 layers
    • h1
    • h2
    • log(sigma_1)
    • log(sigma_2)
    • log(sigma_3)

Plot

  • currents
  • fields
  • line of data (vertical or horizontal)

InteractiveDipoleDecay - Waveform

I see the keyword "Waveform" in this function, but it does not appear to do anything? @sgkang, can you confirm? If it does not do anything, we should remove the toggle buttons to remove confusion.

image

app check prior to next DISC

@dougoldenburg and @sgkang leave this weekend to present the DISC in Taiwan, Korea and Japan! To make sure things are running smoothly with the updated code, we need authors to open up their apps on azure notebooks and make sure that

(a) The notebook is up to date - ping me on slack if not
(b) The app runs without errors
(c) interactions with the apps work as expected (no duplicating plots etc).

Once you have checked an app, please edit this issue by putting a tick in the box below to give it your green-light

  • DC_Building_Pseudosections.ipynb
  • DC_Cylinder_2D.ipynb
  • DC_Inversions.ipynb
  • DC_Layer_Cylinder_2D.ipynb
  • DC_Layer_Cylinder_2_5D.ipynb
  • DC_LayeredEarth.ipynb
  • DC_Overburden_2_5D.ipynb
  • DC_Plate2_5D.ipynb
  • DC_Plate_2D.ipynb
  • DC_Sphere_Constant_E.ipynb
  • FDEM_ElectricDipole_Wholespace.ipynb
  • FDEM_Inductive_Sphere.ipynb
  • FDEM_MagneticDipole_Wholespace.ipynb
  • FDEM_Planewave_Reflection.ipynb
  • FDEM_Planewave_Wholespace.ipynb
  • FDEM_VMD_LayeredEarth.ipynb
  • InductionRLcircuit_Harmonic.ipynb
  • InductionRLcircuit_Transient.ipynb
  • MarineCSEM_LayeredEarth.ipynb
  • MT_LayeredEarth.ipynb
  • PhyProp_ColeCole.ipynb
  • TDEM_ElectricDipole_Wholespace.ipynb
  • TDEM_HorizontalLoop_LayeredEarth.ipynb
  • TDEM_MagneticDipole_Wholespace.ipynb
  • TDEM_Planewave_Wholespace.ipynb

cc @thast, @dccowan, @sgkang, @micmitch

em_example path in the binder

To load em_examples in binder I had to add

git+git://github.com/ubcgif/em_examples.git

in requirements.txt, which is fine, but actually annoying when making pull request ..
Is there a better way that we can add path for em_examples when loading to binder? @lheagy @rowanc1?

TODOs for dipole widgets

All the recent update is in master branch

  • Find all singular points where we are having errors, and make em-geosci figure with a proper error message

  • Restructuring of notebook format, and add some guiding questions (note that we have four notebooks: FD_ED, FD_MD, TD_ED, TD_MD)

  • Modularize current analytic functions for dipoles

DC Sensitivity function plots

For each of

  • pole-dipole
  • dipole-dipole
  • pole-pole

plot the sensitivity function for a single datum in a 2D simulation of a half-space

DipoleWidget.py

  • add an if __name__ == '__main__': at the end so that the script can be run as-is (then we can add testing to it eg. if it runs, it passes, similar to SimPEG Examples)
  • could you add some comments / minimal docstrings to give a bit more insight as to what each method is doing and what some of the important parameters are? (eg. it is not immediately evident what the first x, y, z are... are they source location?, measurement location?)
  • some of the title matching, function matching could be better handled with dictionaries instead of a series of if statements (not as high of priority as the other 2)

Coincident loop EM example

Two loops - outer we drive a time-varying current, inner is the target and we observe currents

image
Parameters

  • time-harmonic waveform - ability to vary frequency
  • step-off waveforms
  • target loop has inductance, resistance (can vary these)

Plots

  • Plot 1: show transmitter current and currents in target as a function of time
  • Plot 2: show real part and quadrature part of induced current

image

cc @sgkang

DC Plate App

Based on the 2D cylinder app, we need a plate app! The main impact here is examining the impact of shape on the charges and sensitivity

image

Parameters:

  • inclination
  • sigma1
  • sigma2
  • dx
  • dz
  • center
  • A, B electrode locations

x is the reference

To view:

  • currents
  • charges
  • potentials
  • potential along a line at the surface (similar to the DC layered earth app)

Also want to integrate the charges along the surface to get a total charge for each face of the plate

use `interactive` instead of `interact`

ipywidgets.interact does not give you any control over layout of the widgets. Since we have so many widgets hooked up, we should specify the layout so that we are not affected by updates in defaults (like a change from vertical layout to horizontal!)

image

We should be doing something along the lines of:

%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import FloatSlider, interact, VBox, interactive, fixed
from IPython.display import display
def plotMe(a, b, c, d, e, f, g):
    fig, ax = plt.subplots(1,1)
    x = np.linspace(0, 1, 50)
    y = a + b*x + c*x**2 + d*x**3 + e*x**4 + f*x**5 + g*x**6
    ax.plot(x, y)
    plt.show()
    return ax
iplot = interactive(
    plotMe,
    a=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    b=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    c=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    d=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    e=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    f=FloatSlider(min=-1.,max=1., value=0, step=0.1 ),
    g=FloatSlider(min=-1.,max=1., value=0, step=0.1 )
)
f = plotMe
w = VBox(iplot.children)
f.widget = w
defaults=dict([(child.description, child.value) for child in iplot.children])
iplot.on_displayed(plotMe(**defaults))
display(w)

output_4_0

<matplotlib.axes._subplots.AxesSubplot at 0x10f8fd310>

Issues on All DC apps

  • We should use continuous_update=False for all slider bars
  • mapping should be changed to sigmaMap
  • Too many python files having basically same functions (e.g. DCXXX.py; organize!)

TDEM plane app signs!

The analytic solution in the notebook has the opposite sign as the analytic solution in EM GeoSci. Also, the signs of Ex and Hy in the app plots support a wave which should be propagating upwards not downwards. Please fix the signs.

HMD over a layered earth

Using the SimPEG 3D code simulate a HMD over a layered earth

Parameters

  • height of the loop (above, on or in earth)
  • freq
  • 3 layers
    • h1
    • h2
    • log(sigma_1)
    • log(sigma_2)
    • log(sigma_3)

Plot

  • currents
  • fields
  • line of data (vertical or horizontal)

(may require computing and storing results)

separating code and notebooks

for distribution and ease of deployment, we need to separate the code from the notebooks so each exists in its own repository. First, we should merge in all of the existing work

Todos: Cylinder app

  • add surface potential profile (use faked app res. calculation as we did in pseudo-section app)
    temp

  • add center location of the cylinder

temp

  • fix color bar issue

Viz_Dipoles.ipynb corrupted

It looks like the file:
em_examples/notebooks/maxwell1_fundamentals/Viz_Dipoles.ipynb
is corrupted (it is no longer json). Perhaps someone did a merge on the notebook?

(see lines 438 of the travis log
image
)

I would suggest going back in the git history and finding a previous version of this notebook that works.

testing

Add travisCI testing to notebooks

Base.py does not allow anymore manual update to the plot and duplicate figures

  • "__manual = True" is no longer an argument in widget to specify a manual update to the plot
  • instead there is a full function "interact_manual" similar to former "interact(__manual=True)"
  • manual updates are useful for slow function (DC 2.5D for example)
  • widgetify create an independent figure that is not overwritten by the widget. The result is that we end up with 2 figures: the updated one and the very first one.

#74 implements an update to Base.py to deal with these 2 things: include a manual option and avoid duplicated figures.

The main drawback that I was not able to fix is that now, when you load the widget for the first time, there is no figure at all. You have to run it at least one to see the figure appears.

Another drawback (inconsistency due to the difference between interact and interactive functions):
app with manual = False are created and displayed through:"app = auto_app(); display(app)"
app with manual = True are created and displayed through:"app = manual_app()" only (display would duplicate it)

doc: ###http://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html

python3

Currently, the tests are failing on python 3: https://travis-ci.org/geoscixyz/em_examples (I have made these "allowed failures" for now). The apps should be upgraded to python 3

  • it is going to mostly be print statements that need to be updated.
print "Hello World"

should be

print("Hello World")

Once we have a passing version on python 3, we can ensure that all future additions also pass on python 3.

@dccowan: could you take a crack at this? Don't hesitate to ping on slack with questions :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.