Skip to content

Commit

Permalink
Grav & Mag functions to solve the direct/inverse problem via the Park…
Browse files Browse the repository at this point in the history
…er FFT method.
  • Loading branch information
joa-quim committed Feb 13, 2025
1 parent 76f7326 commit 5570c5b
Show file tree
Hide file tree
Showing 3 changed files with 848 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/GMTParkerFFTExt/GMTParkerFFTExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module GMTParkerFFTExt
using GMT, FFTW, PrecompileTools

include("parker.jl")

@setup_workload begin
m = zeros(Float32, 64,64); m[32:40,32:40] .= 10; h = fill(-2.0f0, 64,64);
Gm = GMT.mat2grid(m, hdr=[30., 30.32, 30., 30.32]);
Gh = GMT.mat2grid(h, hdr=[30., 30.32, 30., 30.32]);
f3d = parkermag(Gm, Gh, "dir", year=2000, thickness=1, pct=0);
m3d = parkermag(f3d, Gh, "inv", year=2000, thickness=1, pct=0);

Gbat = gmtread(GMT.TESTSDIR * "/assets/model_interface_4parker.grd");
Ggrv = parkergrav(Gbat, rho=400, nterms=10);
Gbat_inv = parkergrav(Ggrv, "inv", rho=400, depth=20.0, pct=50);
end

end
Loading

0 comments on commit 5570c5b

Please sign in to comment.