geoscixyz / geosci-labs

collection of notebook-apps for concepts in applied geophysics
https://geosci.xyz
MIT License
50 stars 35 forks source link

New/re-make magnetic dipole app #17

Open yangdikun opened 5 years ago

yangdikun commented 5 years ago

I am going to make a new magnetic dipole app or re-make Mag_Dipole.ipynb.

Two years ago, I made Mag_Dipole.ipynb as it had some new functionalities: (1) It models the magnetic field of a dipole as superposition of two opposite monopoles, so can be used to model both short dipoles and long dipoles. (2) The orientation of dipole can be arbitrary (not necessarily the inducing geomagnetic direction). (3) It plots the following in 3D: field lines, data grid on surface, coloured map of magnetic data on surface, two profiles in x and y directions.

Reasons of modification: The 3D plots was based on "mpl_toolkits.mplot3d", which didn't work very well (run the notebook to see how ugly and sometimes confusing...).

Goal: (1) Re-organize the codes by following the geosci-labs style (2) Use another plotting package for a better visualization (3) Users can choose what are displayed

image

yangdikun commented 5 years ago

Another issue: Currently look and feel of the geosci-labs notebook is to adjust the parameters using sliders and other interactive objects, but we ran into problems when the desired value is out of range. In Mag_Dipole.ipynb, I let users to specify the parameters in the notebook codes. It's much more flexible but less straightforward compared with the sliders.

What do you think??

thast commented 5 years ago

@yangdikun : I think Sliders are thus best for you. It is possible with Sliders to specify min and max values. You thus fix the range for the user, who then does not need to figure out the acceptable range of values for the app.