Skip to content
Snippets Groups Projects
Select Git revision
  • 9c17498b4971a43ce57b94629ff0bb1d66e179a8
  • master default protected
  • darwin/gear_chemistry_fluxes
  • reyz/gear_preSN_feedback
  • fstasys/VEP_Fm2
  • MHD_canvas protected
  • sidm_merge protected
  • beyond-mesh-pair-removal
  • darwin/gear_preSN_fbk_merge
  • fewer_gpart_comms
  • zoom_merge protected
  • MAGMA2_matthieu
  • forcing_boundary_particles
  • melion/BalsaraKim
  • darwin/sink_mpi_physics
  • darwin/gear_mechanical_feedback
  • FS_VP_m2_allGrad
  • improve-snap-to-ic
  • karapiperis/Bcomoving_as_a2_Bphysical
  • split-space-split
  • reyz/debug
  • v2025.10 protected
  • v2025.04 protected
  • v2025.01 protected
  • v1.0.0 protected
  • v0.9.0 protected
  • v0.8.5 protected
  • v0.8.4 protected
  • v0.8.3 protected
  • v0.8.2 protected
  • v0.8.1 protected
  • v0.8.0 protected
  • v0.7.0 protected
  • v0.6.0 protected
  • v0.5.0 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0-pre protected
  • v0.1 protected
  • v0.0 protected
41 results

plot_EAGLE_SF_EOS.py

Blame
  • Mladen Ivkovic's avatar
    Mladen Ivkovic authored and Matthieu Schaller committed
    a7054910
    History
    plot_EAGLE_SF_EOS.py 1.87 KiB
    import os
    
    if os.path.exists("EAGLE_SF_EOS.png"):
        # do not generate plot again
        exit()
    
    import matplotlib
    
    matplotlib.use("Agg")
    from pylab import *
    from scipy import stats
    
    # Plot parameters
    params = {
        "axes.labelsize": 10,
        "axes.titlesize": 10,
        "font.size": 9,
        "font.sans-serif": [
            "Computer Modern",
            "Computer Modern Roman",
            "CMU Serif",
            "cmunrm",
            "DejaVu Sans",
        ],
        "mathtext.fontset": "cm",
        "legend.fontsize": 9,
        "xtick.labelsize": 10,
        "ytick.labelsize": 10,
        "text.usetex": False,
        "figure.figsize": (3.15, 3.15),
        "lines.markersize": 6,
        "figure.subplot.left": 0.15,
        "figure.subplot.right": 0.99,
        "figure.subplot.bottom": 0.13,
        "figure.subplot.top": 0.99,
        "figure.subplot.wspace": 0.15,
        "figure.subplot.hspace": 0.12,
        "lines.linewidth": 2.0,
    }
    
    rcParams.update(params)
    
    # Equations of state
    eos_SF_rho = np.logspace(-10, 5, 1000)
    eos_SF_T = (eos_SF_rho / 10 ** (-1)) ** (1.0 / 3.0) * 8000.0
    
    # Plot the phase space diagram
    figure()
    subplot(111, xscale="log", yscale="log")
    plot(eos_SF_rho, eos_SF_T, "k-", lw=1.0)
    
    plot([1e-10, 1e-1], [8000, 8000], "k:", lw=0.6)
    plot([1e-1, 1e-1], [20, 8000], "k:", lw=0.6)
    plot([1e-1, 1e1], [20000.0, 20000.0 * 10.0 ** (2.0 / 3.0)], "k--", lw=0.6)
    text(
        0.5e-1,
        200000,
        "$n_{\\rm H}$^EOS_gamma_effective",
        va="top",
        rotation=43,
        fontsize=6.5,
        family="monospace",
    )
    text(
        0.95e-1,
        25,
        "EOS_density_norm_H_p_cm3",
        rotation=90,
        va="bottom",
        ha="right",
        fontsize=7,
        family="monospace",
    )
    text(5e-8, 8400, "EOS_temperature_norm_K", va="bottom", fontsize=7, family="monospace")
    
    scatter([1e-1], [8000], s=4, color="k")
    
    xlabel("Hydrogen number density $n_{\\rm H}$ [cm$^{-3}$]", labelpad=0)
    ylabel("Temperature $T$ [K]", labelpad=2)
    xlim(3e-8, 3e3)
    ylim(20.0, 2e5)
    
    
    savefig("EAGLE_SF_EOS.png", dpi=200)