Skip to content

Commit

Permalink
new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanushika committed Jan 8, 2025
1 parent 183d765 commit a901df8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
1 change: 0 additions & 1 deletion JuliaVisualisation/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
Expand Down
2 changes: 1 addition & 1 deletion JuliaVisualisation/T_Select_Markers_MD7.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function main()

file_select_start = 0 # First time step - Select marker coordinates from here
file_select_end = 3000 # Last time step - Select marker coordinates from here
target_coords = (-40e3, -30e3, -15e3, -10e3) # Coordinate bounds (min(x), max(x), min(y), max(y))
target_coords = (-70e4, -69e4, -81.5e3, -79e3) # Coordinate bounds (min(x), max(x), min(y), max(y))

# Select field to visualise
field = :Phases
Expand Down
35 changes: 35 additions & 0 deletions JuliaVisualisation/read_bin.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using CairoMakie

function main_func()
fname = "/home/thanushika/software/MDOODZ7.0/IMPORT/Hydrated_Pdt.dat"
# = 793; // Resolution for temperature (MANTLE) []
# model.PDMnP[pid] = 793; // Resolution for pressure (MANTLE) []
# model.PDMTmin[pid] = 373.0/scaling.T; // Minimum temperature (MANTLE) [K]
# model.PDMTmax[pid] = 1373.0/scaling.T; // Maximum temperature (MANTLE) [K]
# model.PDMPmin[pid] = 10.13e6/scaling.S; // Minimum pressure (MANTLE) [Pa]
# model.PDMPmax[pid] = 5.5816e9 /scaling.S; // Maximum pressure (MANTLE) [Pa]
# model.PDMrho[pid] = ReadBin(model.import_files_dir, "Hydrated_Pdt.dat", model.PDMnT[pid], model.PDMnP

nT = 793
nP = 793
rho = Array{Float64}(undef, nT*nP)
rho_2D = read!(fname, rho) |> x -> reshape(x, nT, nP)

T = collect(LinRange(373.0, 1373.0, nT))
P = collect(LinRange(10.13e6, 5.5816e9, nP))

fig = Figure(size = (500, 500), fontsize = 18)
ax1 = Axis(
fig[1, 1][1, 1],
aspect = 1.0,
xlabel = L"$T$ [°C]",
ylabel = L"$P$ [kbar]"
)
hm = heatmap!(ax1, T .- 273.15, P ./ 1e8, rho_2D)
Colorbar(fig[1,1][1,2], hm, label = L"$\rho$ [kg.m$^{-1}$]")
rowsize!(fig.layout, 1, Fixed(300))
display(fig)
end

main_func();
save("heatmap_output.png", fig)

0 comments on commit a901df8

Please sign in to comment.