astropy.readthedocs.io
Example gallery — Astropy v1.3
http://astropy.readthedocs.io/en/stable/generated/examples/index.html
This gallery of examples shows a variety of relatively small snippets or examples of tasks that can be done with the Astropy core package. Contributions from the community are encouraged! Longer-form tutorials (or tutorials for affiliated packages. Belong at http:/ tutorials.astropy.org. And can be submitted at the associated github repository. General examples of the. Determining and plotting the altitude/azimuth of a celestial object. Create a new coordinate class (for the Sagittarius stream).
pygimli.org
Building a hybrid mesh in 2-D — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_examples_auto/modelling/plot_hybrid-mesh-2d.html
Building a hybrid mesh in 2-D. In some cases, the modelling domain may require flexibility in one region and equidistant structure in another. In this short example, we demonstrate how to accomplish this for a two-dimensional mesh consisting of a region with regularly spaced quadrilaterals and a region with unstructured triangles. We start by importing numpy, matplotlib and pygimli with its required components. We continue by building a regular grid and assign the marker 2 to all cells.
pygimli.org
Modelling — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/modelling/plot_2-mod-fem.html
This is the first step for the modelling tutorial where we actually use finite elements computation. We will not go in deep detail about the finite elements theory here, as this can be found in several books, e.g., [Zie77]. In this modelling tutorial we just want to solve some simple problems to show how the. We start with a simple elliptic partial differential equation and with zero boundary values, but a nonzero right hand side. Let (A=1, ,B=0 , ). And (C = 1 ). We get the simplest Poisson equation:.
pygimli.org
Geoelectric in 2.5D — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_examples_auto/modelling/plot_mod-dc-2d.html
Geoelectric in 2.5D. Geoelectrical modeling example in 2.5D. Let us start with a mathematical formulation . Nabla cdot( sigma nabla u ) = -I delta( vec{r}- vec{r} { text{s} ) in R 3 ]. The source term is 3 dimensional but the distribution of the electrical conductivity ( sigma(x,y) ). Should by 2 dimensional so we need a Fourier-Cosine-Transform from (u(x,y,z) mapsto u(x,y,k) ). With the wavenumber (k ). Nabla cdot( sigma nabla u ) - sigma k 2 u ]. Idelta(vec{r}-vec{r} {text{s} ) in R 2. Print error min ...
pygimli.org
Flexible mesh generation using Gmsh — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_examples_auto/modelling/plot_gmsh-example.html
Flexible mesh generation using Gmsh. In this example, we learn how to define arbitrary geometries, boundaries, and regions using an external mesh generator ( Gmsh. Construct a mesh with arbitrary geometry, boundaries and regions for computations in GIMLi. For complex geometries, mesh construction using the poly tools can be cumbersome and lacks of straightforward visual inspection. This HowTo presents an example using Gmsh [GR09]. We start with the definition of several points to layout the main geometry...
pygimli.org
Mesh interpolation — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/modelling/plot_5-mesh_interpolation.html
In this tutorial, we look at the mesh interpolation options in GIMLi. Although the example shown here is in 2D, the same routines can be applied when converting 3D data to a 2D mesh for instance. Create coarse and fine mesh with data. Create mesh and data. Create mesh and data. Create mesh and data. Interpolate data to different meshes. We define two functions taking the input mesh, the input data and the output mesh as parameters and return the input data interpolated to the output mesh.
pygimli.org
Heat equation in 1D — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/modelling/plot_4-mod-fem-heat-1d.html
Heat equation in 1D. Assume isotropic and homogeneous heat equation in one dimension:. Begin{split} Delta u(t,x) - check(-) frac{ partial u(t,x)}{ partial t} and = f(t,x) u(0,x) and = sin( pi x) in x= Omega u(t,x) and = 0 in x= partial Omega end{split} ]. We will solve this for ( t,x) in [0,1] text{s} times Omega=[0,1] text{m} ). Temporal (k=0.04 text{s} ). Spatial discretization (h=0.1 text{m} ). For this case we have an analytical solution:. U(t,x) = e {- pi 2 t} sin( pi x) ]. T[s] at x =.
pygimli.org
Polyfit — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/inversion/plot-1-polyfit.html
This tutorial shows a flexible inversion with an own forward calculation that includes an own jacobian. We start with fitting a polynomial of degree (P ). F(x) = p 0 p 1 x ldots p P x P = sum limits {i=0} {P} p i x i ]. To given data (y ). The unknown model is the coefficient vector ({ bf m}=[p 0, ldots,p P] ). The vectorized function for a vector ({ bf x}=[x 1, ldots,x N] T ). Can be written as matrix-vector product. We set up the modelling operator, i.e. to return ({ bf f}({ bf x}) ). For given (p i ).
pygimli.org
GIMLi Basics — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/modelling/plot_1-gimli_basics.html
This is the first tutorial where we demonstrate the general use of GIMLi. In Python, i.e., pyGIMLi. The modelling as well as the inversion part of GIMLi. Often requires a spatial discretization for the domain of interest, the so called GIMLI: Mesh. This tutorial shows some basic aspects of handling a mesh. First, the library needs to be imported. To avoid name clashes with other libraries we suggest to. And alias it to the simple abbreviation. Every part of the c namespace GIMLI. You can iterate through ...
pygimli.org
Modelling with Boundary Conditions — GIMLi - Geophysical Inversion and Modelling Library
http://www.pygimli.org/_tutorials_auto/modelling/plot_3-mod-fem-BC.html
Modelling with Boundary Conditions. We use the preceding example (Poisson equation on the unit square) but want to specify different boundary conditions on the four sides. Again, we first import numpy and pygimli, the solver and post processing functionality. We create a 50x50 node grid to solve on. Short test: setting single node dirichlet BC. Return a solution value for coordinate p. Some boundary for the text. Alternatively we can define the gradients of the solution on the boundary, i.e., Neu...Inste...