예제 #1
0
def plot_reionmod(HaloMass, FilterMass, Redshift, fb):

    plot_redshift = [10, 9, 8, 7, 6]

    fig1 = plt.figure()
    ax1 = fig1.add_subplot(111)
    PlotScripts.Set_Params_Plot()

    for count, z in enumerate(plot_redshift):
        z_idx = np.abs(Redshift - z).argmin()

        reionmod = 1 / pow(1 + 0.26 * pow(10, FilterMass[z_idx] - HaloMass),
                           3.0)

        label = "z = {0:d}".format(z)
        ax1.plot(HaloMass,
                 reionmod,
                 color=PlotScripts.colors[count],
                 label=label)

    ax1.set_xlim([7.0, 12.0])
    ax1.set_ylim([0.0, 1.05])

    ax1.set_xlabel(r'$\mathbf{log_{10} \: M_{vir} \:[M_{\odot}]}$',
                   fontsize=PlotScripts.global_labelsize)
    ax1.set_ylabel(r'$\mathbf{ReionMod}$',
                   fontsize=PlotScripts.global_labelsize)

    leg = ax1.legend(loc='lower right', numpoints=1, labelspacing=0.1)
    leg.draw_frame(False)  # Don't want a box frame
    for t in leg.get_texts():  # Reduce the size of the text
        t.set_fontsize(PlotScripts.global_legendsize)

    outputFile1 = "./gnedin.png"
    fig1.savefig(outputFile1, bbox_inches='tight')  # Save the figure
    print('Saved file to {0}'.format(outputFile1))
    plt.close(fig1)
예제 #2
0
        t.set_fontsize(PlotScripts.global_legendsize - 2)

    plt.tight_layout()
    plt.subplots_adjust(wspace=0.0, hspace=0.0)

    outputFile = OutputDir + output_tag + output_format
    plt.savefig(outputFile)  # Save the figure
    print('Saved file to {0}'.format(outputFile))
    plt.close()


if __name__ == '__main__':

    ###########################

    PlotScripts.Set_Params_Plot()

    model_tags = [
        r"$\mathbf{f_{esc} = 0.35}$",
        r"$\mathbf{f_{esc} \: \propto \: M_H^{-1}}$",
        r"$\mathbf{f_{esc} \: \propto \: M_H}$",
        r"$\mathbf{f_{esc} \: \propto \: f_ej}$",
        r"$\mathbf{f_\mathrm{esc} = 0.35, photHI2}$"
    ]
    #r"$\mathbf{f_{esc} \: \propto \: SFR}$"]

    output_tags = ["Constant", "MH_Neg", "MH_Pos", "Ejected", "SFR"]

    number_models = 5

    model = 'new_paper_MC'
예제 #3
0
import numpy as np
from mpi4py import MPI

comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()

output_format = "png"


if __name__ == "__main__":

    av.Set_Constants()

    # Set label sizes, colours etc.
    ps.rsage_paper_plot_params()

    # Directory name where we want the plots to be saved.
    output_directory = "./jan_paper"

    # Format all plots are saved as.
    output_format = "png"

    # Plotting is driven entirely through specifying the .ini files.
    # For this reason, the directories specified by the .ini files (e.g.,
    # `OutputDir`)  **MUST** be absolute paths, **NOT** relative.

    # All .ini files included in this array will be plotted.
    paper_models        = 1
    no_const            = 0
    higher_tau          = 0