Here we'll add a module called FooPhysics
, which is totally independent of transD_GP
. To couple the physics through a misfit function to transD_GP
we'll use a helper module FooPhysicsInversion
. This helps in code maintenance as the authors of FooPhysics
will not have the time to maintain the integration with transD_GP
. That's our job!
All the inverse (and forward) physics (e.g., CSEM and AEM) as well as regression methods (e.g., Line and Surface regression) have to be included in the src/GeophysOperator.jl
, so this is where I have added FooPhysics.jl
and FooPhysicsInversion.jl
through include
s as follows:
.
.
include("FooPhysics.jl") # example for API
using. FooPhysics # example for API
include("FooPhysicsInversion.jl") # example for API
using .FooPhysicsInversion # example for API
.
.
Have a close look at these two files as they contain all the essential API elements, including descriptive comments for adding your own forward method for transD_GP inference. Note the .using
because it implies loading a module from the current namespace.
This FooPhysicsInversion
module will basically sample the prior, it runs in no time, and does a few plots you need to visualize the sampled posterior (==prior in this case). It will show you how to connect the forward physics, misfit function, data for inference, setting prior options, and plotting the posterior. To run this example, run the scripts in sequence in examples/Foo
All the inferences problems in transD_GP whether 1D, 2D or spatially 3D follow the same recipe -- you don't need to change the sampler code!