From 78bc109bd9ef8d96b9496d95c90cff5a5d8e9552 Mon Sep 17 00:00:00 2001 From: Anandaroop Ray Date: Tue, 26 Nov 2024 12:08:23 +1100 Subject: [PATCH] phase02 scripts --- .../copy_all_vtk_sgrids_xyz_images_phase02.jl | 26 +++++++++++++++++ ...probabilistic_earthsci_phase_02_TEMPEST.jl | 28 +++++++++++++++++++ .../makevtk_from_all_xyzrho_phase_02.jl | 13 +++++++++ 3 files changed, 67 insertions(+) create mode 100644 zz_portalcurtains/copy_all_vtk_sgrids_xyz_images_phase02.jl create mode 100644 zz_portalcurtains/makecurtains_all_probabilistic_earthsci_phase_02_TEMPEST.jl create mode 100644 zz_portalcurtains/makevtk_from_all_xyzrho_phase_02.jl diff --git a/zz_portalcurtains/copy_all_vtk_sgrids_xyz_images_phase02.jl b/zz_portalcurtains/copy_all_vtk_sgrids_xyz_images_phase02.jl new file mode 100644 index 0000000..d72baeb --- /dev/null +++ b/zz_portalcurtains/copy_all_vtk_sgrids_xyz_images_phase02.jl @@ -0,0 +1,26 @@ +using Glob +## multiple surveys +items = [item for item in walkdir("/g/data/z67/ar0754/largeaem/production")] +idx_summary = [basename(it[1]) == "summary" for it in items] +src_dir = [it[1] for it in items[idx_summary]] +src_epsg = [28351, 28351, 28351, 28350, 28350, 28351, 28351, 28350] +rootdir = "/scratch/ns59/ar0754/probabilistic_AEM_phase_02_products" +map(zip(src_dir, src_epsg)) do (sdir, epsg) + prefix = split(sdir, "/")[end-2]*"_"*basename(dirname(sdir))*"_" + containingdir = dirname(sdir) + map(zip(["images", "sgrids", "vtk", "xyzlog10rho"],["pngs", "sgrids", "vtk", "summary"])) do (dstname, srcname) + sd_use = joinpath(containingdir, srcname) + dst_dir = joinpath(rootdir, dstname, prefix[1:end-1]) + isdir(dst_dir) || mkpath(dst_dir) + if srcname == "summary" + fn = readdir(glob"*_summary_xyzrho.txt", sd_use) + cp.(fn, joinpath.(dst_dir, basename.(fn))) + else + cp(sd_use, dst_dir; force=true) + end + ioproj = open(joinpath(dst_dir, "0000_projection.txt"), "w") + write(ioproj, "EPSG: $epsg") + close(ioproj) + end + @info "done $sdir" +end \ No newline at end of file diff --git a/zz_portalcurtains/makecurtains_all_probabilistic_earthsci_phase_02_TEMPEST.jl b/zz_portalcurtains/makecurtains_all_probabilistic_earthsci_phase_02_TEMPEST.jl new file mode 100644 index 0000000..a9bd492 --- /dev/null +++ b/zz_portalcurtains/makecurtains_all_probabilistic_earthsci_phase_02_TEMPEST.jl @@ -0,0 +1,28 @@ +using HiQGA, PyPlot +includet("RDP.jl") +## +nlayers = 52 +dr = 200 +dz = 2 +dpi = 400 +fnamebar = "colorbar.jpg" +cmap = "turbo" +writegeom = true +vmin, vmax = -2.5, 0.5 +ϵfrac = 0.001 +barfigsize = (0.4, 1.2) +shrink = 8000 +VE = 30 +rootdir = "/scratch/ns59/ar0754/final_02_TEMPEST" +## multiple surveys +items = [item for item in walkdir("/home/547/ar0754/z67/ar0754/largeaem/production")] +idx_summary = [basename(it[1]) == "summary" for it in items] +src_dir = [it[1] for it in items[idx_summary]] +src_epsg = [28351, 28351, 28351, 28351, 28351] +map(zip(src_dir, src_epsg)) do (sdir, epsg) + prefix = split(sdir, "/")[end-2]*"_"*basename(dirname(sdir))*"_" + dst_dir = joinpath(rootdir, prefix[1:end-1]) # drop the ending underscore + RDP.doallcurtaintriads.(;src_dir=sdir, dst_dir, nlayers, dr, dz, ϵfrac, src_epsg=epsg, + barfigsize, dpi, cmap, fnamebar, shrink, VE, prefix, + vmin, vmax, writegeom) +end \ No newline at end of file diff --git a/zz_portalcurtains/makevtk_from_all_xyzrho_phase_02.jl b/zz_portalcurtains/makevtk_from_all_xyzrho_phase_02.jl new file mode 100644 index 0000000..e6c097f --- /dev/null +++ b/zz_portalcurtains/makevtk_from_all_xyzrho_phase_02.jl @@ -0,0 +1,13 @@ +using HiQGA, PyPlot +includet("RDP.jl") +nlayers = 52 +vmin, vmax = -2.5, 0.5 +outputrootdir = "/scratch/ns59/ar0754/probabilistic_AEM_phase_02_products" +items = [item for item in walkdir("/g/data/z67/ar0754/largeaem/production")] +idx_summary = [basename(it[1]) == "summary" for it in items] +src_dir = [it[1] for it in items[idx_summary]] +src_epsg = [28351, 28351, 28351, 28350, 28350, 28351, 28351, 28350] +map(zip(src_dir, src_epsg)) do (dir, epsg) + @show dst_dir = joinpath(outputrootdir, "GDA94_vtk", split(dir,"/")[end-1]) + RDP.writevtkfromxyzrhodir(nlayers; src_dir=dir, dst_dir, src_epsg=epsg, vmin, vmax) +end \ No newline at end of file