Skip to content

Commit c685380

Browse files
authored
Merge pull request #78 from GeoscienceAustralia/dev
Dev
2 parents a485a03 + 89033bd commit c685380

File tree

8 files changed

+213
-82
lines changed

8 files changed

+213
-82
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HiQGA"
22
uuid = "01574e87-63b6-4466-925a-334cf7e21b6b"
33
authors = ["richardt94 <29562583+richardt94@users.noreply.github.com>"]
4-
version = "0.4.11"
4+
version = "0.4.12"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

src/AEMnoNuisanceMcMCInversionTools.jl

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,23 @@ function makeAEMoperatorandoptions(sounding::Sounding;
293293
showgeomplot = false,
294294
plotfield = false,
295295
useML = false,
296-
modelprimary = false
296+
modelprimary = false,
297+
isdIdt = nothing,
298+
rampchoice = nothing,
297299
)
298-
aem, zall, znall, = makeoperator(sounding;
299-
zfixed, ρfixed, zstart, extendfrac,
300-
dz = dz, ρbg, nlayers, ntimesperdecade,
301-
nfreqsperdecade, useML, showgeomplot,
302-
modelprimary, plotfield)
303-
300+
if isnothing(isdIdt) # call VTEM or SkyTEM
301+
aem, zall, znall, = makeoperator(sounding;
302+
zfixed, ρfixed, zstart, extendfrac,
303+
dz = dz, ρbg, nlayers, ntimesperdecade,
304+
nfreqsperdecade, useML, showgeomplot,
305+
modelprimary, plotfield)
306+
else # call VTEM for dIdt defined
307+
aem, zall, znall, = makeoperator(sounding; isdIdt, rampchoice,
308+
zfixed, ρfixed, zstart, extendfrac,
309+
dz = dz, ρbg, nlayers, ntimesperdecade,
310+
nfreqsperdecade, useML, showgeomplot,
311+
modelprimary, plotfield)
312+
end
304313
opt = make_tdgp_opt(znall = znall,
305314
fileprefix = sounding.sounding_string,
306315
nmin = nmin,
@@ -357,7 +366,7 @@ function loopacrossAEMsoundings(soundings::Array{S, 1}, aem_in::Operator1D, opt_
357366
dt = time() - t2 #seconds
358367
catlocallogs(nparallelsoundings, nchainspersounding, batchstr)
359368
writetogloballog("done $iter out of $nsequentialiters at $(Dates.now()) in $dt sec"; fname)
360-
GC.gc()
369+
# GC.gc()
361370
end
362371
end
363372

src/AEMwithNuisanceMcMCInversionTools.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function loopacrossAEMsoundings(soundings::Array{S, 1}, aem_in::Operator1D, opt_
194194
dt = time() - t2 #seconds
195195
catlocallogs(nparallelsoundings, nchainspersounding, batchstr)
196196
writetogloballog("done $iter out of $nsequentialiters at $(Dates.now()) in $dt sec"; fname)
197-
GC.gc()
197+
# GC.gc()
198198
end
199199
end
200200

src/CommonToAll.jl

Lines changed: 178 additions & 64 deletions
Large diffs are not rendered by default.

src/MCMC_Driver.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ function main(opt_in ::OptionsStat,
439439

440440
close_history.([wp, wpns, wpn])
441441
d_closeall()
442-
explicit_gc(master_pid, chainprocs)
442+
# explicit_gc(master_pid, chainprocs)
443443
nothing
444444
end
445445

@@ -557,7 +557,7 @@ function main(opt_in ::OptionsStat,
557557

558558
close_history.([wp, wpns])
559559
d_closeall()
560-
explicit_gc(master_pid, chainprocs)
560+
# explicit_gc(master_pid, chainprocs)
561561
nothing
562562
end
563563

@@ -673,7 +673,7 @@ function main(opt_in ::OptionsStat,
673673

674674
close_history.([wp, wpn])
675675
d_closeall()
676-
explicit_gc(master_pid, chainprocs)
676+
# explicit_gc(master_pid, chainprocs)
677677
nothing
678678
end
679679

@@ -768,7 +768,7 @@ function main(opt_in ::OptionsStat,
768768

769769
close_history(wp)
770770
d_closeall()
771-
explicit_gc(master_pid, chainprocs)
771+
# explicit_gc(master_pid, chainprocs)
772772
nothing
773773
end
774774

src/SkyTEM1DInversion.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ function read_survey_files(;
202202
startfrom = 1,
203203
skipevery = 1,
204204
multnoise = 0.03,
205+
multnoise_LM = nothing,
206+
multnoise_HM = nothing,
205207
datacutoff_LM = nothing,
206208
datacutoff_HM = nothing,
207209
X = -1,
@@ -228,6 +230,12 @@ function read_survey_files(;
228230
@assert Z > 0
229231
@assert linenum > 0
230232
@assert fid > 0
233+
if !isnothing(multnoise_LM) | !isnothing(multnoise_HM)
234+
@assert isnothing(multnoise) "set multnoise to nothing to be consistent!"
235+
else
236+
multnoise_LM = multnoise
237+
multnoise_HM = multnoise
238+
end
231239
if forceML
232240
@assert !isnothing(datacutoff_LM)
233241
@assert !isnothing(datacutoff_HM)
@@ -277,8 +285,8 @@ function read_survey_files(;
277285
if !relerror
278286
@assert size(d_LM, 2) == length(LM_noise)
279287
@assert size(d_HM, 2) == length(HM_noise)
280-
σ_LM = sqrt.((multnoise*d_LM).^2 .+ (LM_noise').^2)
281-
σ_HM = sqrt.((multnoise*d_HM).^2 .+ (HM_noise').^2)
288+
σ_LM = sqrt.((multnoise_LM*d_LM).^2 .+ (LM_noise').^2)
289+
σ_HM = sqrt.((multnoise_HM*d_HM).^2 .+ (HM_noise').^2)
282290
if !isempty(noise_scalevec)
283291
@assert length(noise_scalevec) == length(LM_times)+length(HM_times)
284292
σ_LM = σ_LM.*(noise_scalevec[1:length(LM_times)])'

src/VTEM1DInversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ function makeoperator(sounding::VTEMsoundingData;
409409
calcjacobian = false,
410410
plotfield = false,
411411
isdIdt = false,
412-
rampchoice = :mid,
412+
rampchoice = :next,
413413
)
414414

415415
zall, znall, zboundaries = setupz(zstart, extendfrac, dz=dz, n=nlayers, showplot=showgeomplot)

zz_portalcurtains/testdraw.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ x, y = RDP.smoothline(XY1b, λ²=10000, finefactor=1000, regtype=:R2, fname="bas
2222
x, y = [[xy[i] for xy in RDP.readpoints(["base_menindee.txt", "base_1_menindee.txt", "base_2a_menindee.txt", "base_2b_menindee.txt",
2323
"base_3a_menindee.txt", "base_3b_menindee.txt"])] for i in 1:2]
2424
map(axp) do ax
25-
for a in ax[1:6]
25+
for a in ax[1:8]
2626
for (xx, yy) in zip(x, y)
2727
a.plot(xx, yy, "--k", linewidth=0.5)
2828
end

0 commit comments

Comments
 (0)