Plot meshes

Cube

using PhysicalMeshes
using AstroPlot

c = Cube(PVector(0.0,0.0,0.0), PVector(1.0,1.0,1.0))
fig = plot_makie(c, nothing)

Static Cartesian Mesh

julia> using AstroIO
julia> h, d = read_gadget2("plummer_unitless.gadget2", nothing, uGadget2)(Gadget2 Header: Particle Info : | Type | Amount, Mass |-----------|------------------------- | Gas | 0, 0.0 M⊙ | Halo | 0, 0.0 M⊙ | Disk | 0, 0.0 M⊙ | Bulge | 0, 0.0 M⊙ | Star | 100, 0.0 M⊙ | BlackHole | 0, 0.0 M⊙ (If zero, mass would be read from file) Start time: 0.0 Redshift: 0.0 , AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}[AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.018116068f0, -0.002995486f0, -0.003841817f0), PVector{Float32}(-0.1766156f0, -4.981215f0, -0.4980064f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 1, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.000483942f0, 0.0045860214f0, -0.0031794517f0), PVector{Float32}(-3.397467f0, 0.9761771f0, -1.2260543f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 2, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.0086854845f0, 0.021862451f0, 0.010802523f0), PVector{Float32}(-1.2945563f0, 1.3512454f0, -2.5573983f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 3, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.030656638f0, 0.0004911633f0, -0.014515802f0), PVector{Float32}(1.1390071f0, 1.2557516f0, 0.8175034f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 4, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.0021881962f0, 0.0014127743f0, 0.0007256684f0), PVector{Float32}(3.735173f0, -1.205803f0, 3.1528828f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 5, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.007905946f0, -0.0027042762f0, 0.00766914f0), PVector{Float32}(1.8182553f0, 1.1975417f0, -4.7673016f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 6, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.00048796216f0, 0.0010470708f0, 0.004809997f0), PVector{Float32}(1.3983527f0, -1.1229693f0, -0.5656157f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 7, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.00859782f0, 0.00042934544f0, -0.014892419f0), PVector{Float32}(-0.29751727f0, -3.721505f0, 0.35212857f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 8, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.004831487f0, 0.026611447f0, -0.0011752367f0), PVector{Float32}(0.9106881f0, 2.3375604f0, 1.1741828f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 9, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.018516235f0, -0.00030308487f0, -0.0018278124f0), PVector{Float32}(-0.3983491f0, 0.403225f0, 1.592631f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 10, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0) … AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.020883566f0, 0.001556014f0, -0.018395409f0), PVector{Float32}(1.5565017f0, -0.6537367f0, 1.9456834f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 91, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.00048439112f0, -0.0030938564f0, 0.008268017f0), PVector{Float32}(-1.734781f0, 4.0783234f0, 3.3155468f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 92, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.011732532f0, -0.0075976243f0, -0.009694448f0), PVector{Float32}(-2.1463637f0, -0.50867844f0, -2.705008f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 93, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.0009925003f0, 0.0020394607f0, -0.0010552981f0), PVector{Float32}(-3.3935099f0, 3.139379f0, -4.4945574f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 94, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(2.2915245f-5, -0.00065396616f0, -0.008911974f0), PVector{Float32}(-0.653264f0, 2.4841425f0, 2.463619f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 95, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(-0.03274037f0, -0.005069943f0, -0.019472176f0), PVector{Float32}(0.8711982f0, 2.490375f0, 0.34540552f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 96, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.0017776936f0, 0.005210458f0, 0.001851911f0), PVector{Float32}(0.5430894f0, -0.496971f0, 1.145205f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 97, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.021070514f0, -0.00025025586f0, 0.009437409f0), PVector{Float32}(0.18750715f0, 0.73428106f0, 2.7907732f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 98, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.0041523655f0, -0.0023303295f0, 0.0080279475f0), PVector{Float32}(0.9725515f0, 0.8625397f0, -1.4203246f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 99, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0), AstroIO.Gadget2Particle{Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Float32, Int32}(PVector{Float32}(0.0023307756f0, 0.0044413623f0, 3.3231772f-5), PVector{Float32}(2.2774978f0, 1.5512863f0, 0.5366767f0), PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 1000.0f0, 100, STAR, 0, 0, 0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0, PVector{Float32}(0.0f0, 0.0f0, 0.0f0), 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0, 0.0f0)])
julia> m = MeshCartesianStatic(d)Static Cartesian Mesh Mesh config: dim: 3 mode: VertexMode() assignment method: CIC() Boundary Condition: Periodic() enlarge: 1.0 gpu: false units: nothing Number of Cells: [10, 10, 10] Number of ghost points: 1 Min: [-0.06580814257264136, -0.03895728081464767, -0.08115969881415366] Max: [0.04765924405306577, 0.05348900914192199, 0.0823094855993986] Δ: [0.011346738662570712, 0.009244628995656968, 0.016346918441355225] Assigned field names: (:data, :pos, :vel, :acc, :e, :rho, :phi)
julia> unicode_projection_density(m) Projection ┌─────────────┐ 1e¹⁰ 0.0463778 │▄▄▄▄▄▄▄▄▄▄▄▄▄│ ┌──┐ │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│ │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│ y │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│ ρ │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│ │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│ -0.0389573 │▄▄▄▄▄▄▄▄▄▄▄▄▄│ └──┘ └─────────────┘ 0 -0.06580810.038931 x
projection_density(m)
julia> unicode_slice(m, :rho, 5)                ┌─────────────┐300 000 000
      0.0463778 │▄▄▄▄▄▄▄▄▄▄▄▄▄│ ┌──┐
                │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│
                │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│
   y            │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│
                │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│
                │▄▄▄▄▄▄▄▄▄▄▄▄▄│ │▄▄│
     -0.0389573 │▄▄▄▄▄▄▄▄▄▄▄▄▄│ └──┘
                └─────────────┘  0
                 -0.06580810.038931
                       x
plot_slice(m, :pos, 5)