Pipeline functions

GADGETPlotting.birth_histogram_pipelineMethod
birth_histogram_pipeline(
    base_name::String,
    source_path::String; 
    <keyword arguments>
)::Nothing

Save the results of the birth_histogram_plot function as one image per snapshot, if there are stars present.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • output_path::String = "birth_histogram": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.cmdf_pipelineMethod
cmdf_pipeline(
    base_name::String,
    source_path::String; 
    <keyword arguments>
)::Nothing

Save the results of the cmdf_plot function as one image per snapshot, if there are stars present.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • output_path::String = "CMDF": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • x_norm::Bool = false: If the x axis will be normalized to its maximum value.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the time stamps, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.cmdf_pipelineMethod
cmdf_pipeline(
    base_name::Vector{String},
    source_path::Vector{String},
    labels::Array{String, 2}; 
    <keyword arguments>
)::Nothing

Save the results of the cmdf_plot function for several simulations as one image per snapshot, if there are stars present.

Arguments

  • base_name::Vector{String}: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::Vector{String}: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • labels::Array{String, 2}: Labels for the different simulations.

  • output_path::String = "CMDF": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the ordinal of the frame. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • x_norm::Bool = false: If the x axis will be normalized to its maximum value.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the time stamps, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.compare_simulations_pipelineMethod
compare_simulations_pipeline(
    base_name::Vector{String},
    source_path::Vector{String},
    labels::Array{String, 2},
    fig_name::String,
    x_quantity::String,
    y_quantity::String; 
    <keyword arguments>
)::Nothing

Make a figure comparing y_quantity vs. x_quantity for several simulations.

x_quantity and y_quantity can be any magnitude used in the get_time_evolution function, namely:

  • "scale_factor"
  • "redshift"
  • "clock_time" (Physical time)
  • "sfr" (SFR)
  • "sfr_prob" (SFR probability - Not normalized)
  • "gas_number" (Gas particle number)
  • "dm_number" (Dark matter particle number)
  • "star_number" (Star number)
  • "gas_mass" (Total gas mass)
  • "dm_mass" (Total dark matter mass)
  • "star_mass" (Total star mass)
  • "gas_density" (Total gas density)
  • "gas_frac" (Gas fraction)
  • "dm_frac" (Dark matter fraction)
  • "star_frac" (Star fraction)
  • "gas_bar_frac" (Baryonic gas fraction)
  • "star_bar_frac" (Baryonic star fraction)

The numeric values of a quantity can also be saved as a text files for the simulations. One column per simulation, one row per sanpshot.

Arguments

  • base_name::Vector{String}: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::Vector{String}: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • labels::Array{String, 2}: Labels for the different simulations, e.g. [label1 label2 ...].

  • fig_name::String: Base name for the figure. The file will be named fig_name`yquantity_vs_x_quantityformat`.

  • x_quantity::String: Physical magnitude for the x axis.

  • y_quantity::String: Physical magnitude for the y axis.

  • output_path::String = "compare_simulations": Path to the output directory. The images will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • title::String = "": Title for the figure. If an empty string is given, no title is printed.

  • x_factor::Int64 = 0: Numerical exponent to scale the x_quantity, e.g. if x_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.

  • y_factor::Int64 = 0: Numerical exponent to scale the y_quantity, e.g. if y_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.

  • scale::NTuple{2, Symbol} = (:identity, :identity): Scaling to be used for the x and y axes. The two options are:

    • :identity ⟹ no scaling.
    • :log10 ⟹ logarithmic scaling.
  • smooth_data::Bool = false: If true a smoothing window with no weighs is applied to the y data. If false (the default) no transformation occurs.

  • bins::Int64 = 0: Number of subdivisions for the smoothing of the data, only relevant if smooth_data = true.

  • legend_pos::Symbol = :bottomright: Position of the legend, e.g. :topleft.

  • text_quantity::String = "": Name of the quantity to be saved in a text file. Any magnitude used in the get_time_evolution function can be used. If left empty no text file will be produced.

  • file_name::String = "results": Name of the .dat file that will be generated if text_quantity is not an empty string.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used, e.g. UnitfulAstro.Msun.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used, e.g. UnitfulAstro.Myr.

  • sfr_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.yr: Unit of mass/time to be used in the output, all available time and mass units in Unitful and UnitfulAstro can be used, e.g. UnitfulAstro.Msun/UnitfulAstro.yr.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in UnitfulAstro.jl and UnitfulAstro.jl can be used.

  • density_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.kpc^3: Unit of density to be used in the output, all available density units in UnitfulAstro.jl and UnitfulAstro.jl can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.cpu_txt_pipelineMethod
cpu_txt_pipeline(
    source_path::Vector{String},
    target::String,
    labels::Array{String, 2}; 
    <keyword arguments>
)::Nothing

Save the result of the cpu_txt_plot function, comparing the CPU usage of one process among several simulations.

Arguments

  • source_path::Vector{String}: Paths to the directories containing the cpu.txt files, set in the GADGET variable OutputDir.
  • target::String: Target process.
  • labels::Array{String, 2}: Labels for the different simulations.
  • step::Int64 = 1: Step used to traverse the CPU cycles, i.e. one every step cycles is used for the output plot.
  • output_path::String = "cpu_txt": Path to the output directory.
  • title::String = "": Title for the figure. If an empty string is given no title is printed, which is the default.
  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".
source
GADGETPlotting.cpu_txt_pipelineMethod
cpu_txt_pipeline(
    source_path::Vector{String},
    targets::Vector{String}; 
    <keyword arguments>
)::Nothing

Save the result of the cpu_txt_plot function as one image per simulation.

Arguments

  • source_path::Vector{String}: Paths to the directories containing the cpu.txt files, set in the GADGET variable OutputDir.
  • targets::Vector{String}: Target processes to be plotted for each simulation.
  • step::Int64 = 1: Step used to traverse the CPU cycles, i.e. one every step cycles is used for the output plot.
  • output_path::String = "cpu_txt": Path to the output directory.
  • title::Vector{String} = String[]: Titles for the figures. If an empty string is given no title is printed, which is the default.
  • names::Vector{String} = String[]: Names for the files. If an empty string is given, the images will be assigned a number, starting from 0.
  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".
source
GADGETPlotting.density_histogram_pipelineMethod
density_histogram_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the density_histogram_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Vertical lines with personalized positions and ticks can be added to the plot. By default none are drawn.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "density_histogram": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • flags::Union{Tuple{Vector{<:Real}, Vector{<:AbstractString}}, Nothing} = nothing: The first vector in the Tuple has the positions of the vetical lines. The second has the corresponding labels. The positions should be in the correct units of density and take into account factor.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • factor::Int64 = 0: Numerical exponent to scale the density, e.g. if factor = 10 the x axis will be scaled by $10^{10}$. The default is no scaling.

  • y_scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • density_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.kpc^3: Unit of density to be used in the output, all available density units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.density_map_pipelineMethod
density_map_pipeline(
    base_name::String,
    source_path::String,
    z_quantity::Union{String, Nothing},
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the density_map_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base name of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Path to the directory containing the snapshot files, set in the GADGET variable OutputDir.

  • z_quantity::Union{String, Nothing}: Quantity to be mapped. The options are:

    • "Z": The metallicity (relative to solar metallicity).
    • "fmol": The fraction of molecular gas.
    • "fatom": The fraction of atomic gas.
    • nothing: The density itself will be mapped.
  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "density_map": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • plane::String = "All": Indicates which plane will be plotted.

    • "XY" ⟶ x-y plane alone.
    • "XZ" ⟶ x-z plane alone.
    • "YZ" ⟶ y-z plane alone.
    • "All" ⟶ The three planes in a single 1x3 figure.
  • axes::Bool = false: If true, the axes passing through (0, 0) are drawn. If false, no axes are drawn.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".ps", ".svg" and ".png".

source
GADGETPlotting.density_profile_pipelineMethod
density_profile_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64,
    type::String; 
    <keyword arguments>
)::Nothing

Save the results of the density_profile_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • output_path::String = "density_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • factor::Int64 = 0: Numerical exponent to scale the density, e.g. if factor = 10 the y axis will be scaled by $10^{10}$. The default is no scaling.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.density_profile_pipelineMethod
density_profile_pipeline(
    base_name::Vector{String},
    source_path::Vector{String},
    anim_name::String,
    frame_rate::Int64,
    type::String,
    labels::Array{String, 2}; 
    <keyword arguments>
)::Nothing

Save the results of the density_profile_plot function for several simulations as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::Vector{String}: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::Vector{String}: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • labels::Array{String, 2}: Labels for the different simulations.

  • output_path::String = "density_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named frame_XXXformat where XXX is the ordinal of the frame. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • factor::Int64 = 0: Numerical exponent to scale the density, e.g. if factor = 10 the y axis will be scaled by $10^{10}$. The default is no scaling.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.evolution_summary_pipelineMethod
evolution_summary_pipeline(
    base_name::String,
    source_path::String,
    fig_name::String; 
    <keyword arguments>
)::Nothing

Produce up to three figures summarizing the time evolution of the simulation.

The plotted parameters are the number of particles, the total mass, the baryonic fractional mass and the star formation rate (SFR), the first three for gas and stars. If the simulation is Newtonian, only one figure is produced (parameters vs. time), but if the simulation is cosmological, three figures are produced (parameters vs. time, parameters vs. scale factor and parameters vs. redshift).

Args:

  • base_name::String: Base name of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Path to the directory containing the snapshot files, set in the GADGET variable OutputDir.

  • fig_name::String: Base name for the figures. The images will be named fig_name_vs_XXXformat where XXX is 'time', 'redshift' or 'scale_factor'.

  • output_path::String = "evolution_summary": Path to the output directory. The images will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • mass_factor::Int64 = 0: Numerical exponent to scale the mass, e.g. if mass_factor = 10 the corresponding axis will be scaled by $10^{10}$.

  • number_factor::Int64 = 0: Numerical exponent to scale the number of particles, e.g. if number_factor = 4 the corresponding axis will be scaled by $10^4$.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • sfr_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.yr: Unit of mass/time to be used in the output, all available time and mass units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.fatom_rho_pipelineMethod
fatom_rho_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the fatom_rho_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "fatom_vs_rho"": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.fmol_Z_pipelineMethod
fmol_Z_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the fatom_rho_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "fmol_vs_Z"": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.fmol_fatom_pipelineMethod
fmol_fatom_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the fmol_fatom_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "fmol_vs_ftom": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.fraction_histogram_pipelineMethod
fraction_histogram_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64,
    fraction::String; 
    <keyword arguments>
)::Nothing

Save the results of the fraction_histogram_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Vertical lines with personalized positions and ticks can be added to the plot. By default none are drawn.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • fraction::String: Which fraction to plot against the temperature. The options are

    • "atomic": Atomic fraction.
    • "molecular": Molecular fraction.
  • output_path::String = "density_histogram": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • flags::Union{Tuple{Vector{<:Real}, Vector{<:AbstractString}}, Nothing} = nothing: The first vector in the Tuple has the positions of the vetical lines. The second has the corresponding labels. The positions should be in the correct units of density and take into account factor.

  • bins::Int64 = 20: Number of subdivisions used for the histogram.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • y_scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.fraction_temp_pipelineMethod
fraction_temp_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64,
    fraction::String; 
    <keyword arguments>
)::Nothing

Save the results of the fraction_temp_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • fraction::String: Which fraction to plot against the temperature. The options are

    • "atomic": Atomic fraction.
    • "molecular": Molecular fraction.
  • output_path::String = "rho_vs_temp": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • temp_unit::Unitful.FreeUnits = Unitful.K: Unit of temperature to be used in the output, all available temperature units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.gas_star_evolution_pipelineMethod
gas_star_evolution_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of gas_star_evolution_plot function for the last snapshot as one image and generate a GIF and a video animating the whole evolution for all snapshots.

Arguments

  • base_name::String: Base name of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Path to the directory containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "gas_star_evolution": Path to the output directory. The image will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the last snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • sfr_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.yr: Unit of mass/time to be used in the output, all available time and mass units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".ps", ".svg" and ".png".

source
GADGETPlotting.kennicutt_schmidt_pipelineMethod
kennicutt_schmidt_pipeline(
    base_name::String,
    source_path::String; 
    <keyword arguments>
)::Nothing

Save the results of the kennicutt_schmidt_plot function as one image per snapshot.

It will produce output only for the snapshots that have enough young stars to produce at least five data points for the linear fitting.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • output_path::String = "Kennicutt_Schmidt": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • temp_filter::Unitful.Quantity = Inf * Unitful.K: Maximum temperature allowed for the gas particles.

  • age_filter::Unitful.Quantity = 20.0UnitfulAstro.Myr: Maximum star age allowed for the calculation of the SFR.

  • max_r::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Maximum distance up to which the parameters will be calculated, with units.

  • bins::Int64 = 50: Number of subdivisions of [0, max_r] to be used. It has to be at least 5.

  • error_formating::String = "std_error": What to print as error values. The options are:

    • "std_error" ⟹ mean ± standard_error.
    • "conf_interval" ⟹ mean ± max(upper_95% - mean, mean - lower_95%).
  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.mass_profile_pipelineMethod
mass_profile_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64,
    type::String; 
    <keyword arguments>
)::Nothing

Save the results of the mass_profile_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • output_path::String = "mass_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • factor::Int64 = 0: Numerical exponent to scale the mass, e.g. if factor = 10 the y axis will be scaled by $10^{10}$. The default is no scaling.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.mass_profile_pipelineMethod
mass_profile_pipeline(
    base_name::Vector{String},
    source_path::Vector{String},
    anim_name::String,
    frame_rate::Int64,
    type::String,
    labels::Array{String, 2}; 
    <keyword arguments>
)::Nothing

Save the results of the mass_profile_plot function for several simulations as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::Vector{String}: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::Vector{String}: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • labels::Array{String, 2}: Labels for the different simulations.

  • output_path::String = "mass_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named frame_XXXformat where XXX is the ordinal of the frame. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • factor::Int64 = 0: Numerical exponent to scale the mass, e.g. if factor = 10 the y axis will be scaled by $10^{10}$. The default is no scaling.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.metallicity_profile_pipelineMethod
metallicity_profile_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64,
    type::String; 
    <keyword arguments>
)::Nothing

Save the results of the metallicity_profile_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • output_path::String = "metallicity_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.metallicity_profile_pipelineMethod
metallicity_profile_pipeline(
    base_name::Vector{String},
    source_path::Vector{String},
    anim_name::String,
    frame_rate::Int64,
    type::String,
    labels::Array{String, 2}; 
    <keyword arguments>
)::Nothing

Save the results of the metallicity_profile_plot function for several simulations as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::Vector{String}: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::Vector{String}: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • type::String: Particle type.

    • "gas" ⟶ Gas particle.
    • "dark_matter" ⟶ Dark matter particle.
    • "stars" ⟶ Star particle.
  • labels::Array{String,2}: Labels for the different simulations.

  • output_path::String = "metallicity_profile": Path to the output directory. The images will be stored in output_path/images/ and will be named frame_XXXformat where XXX is the ordinal of the frame. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • scale::Symbol = :identity: Scaling to be used for the y axis. The two options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • bins::Int64 = 100: Number of subdivisions of the region to be used for the profile.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.quantities_2D_pipelineMethod
quantities_2D_pipeline(
    base_name::String,
    source_path::String; 
    <keyword arguments>
)

Save the results of the quantities_2D_plot function as one folder per snapshot.

It will produce output only for snapshots that have stars.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • output_path::String = "Kennicutt_Schmidt": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • title::String = "": Title for the figure. If an empty string is given no title is printed, which is the default.

  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • temp_filter::Unitful.Quantity = Inf * Unitful.K: Maximum temperature allowed for the gas particles.

  • age_filter::Unitful.Quantity = 20.0UnitfulAstro.Myr: Maximum star age allowed for the calculation of the SFR.

  • max_r::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Maximum distance up to which the parameters will be calculated, with units.

  • bins::Int64 = 50: Number of subdivisions of [0, max_r] to be used. It has to be at least 5.

  • scale::NTuple{2, Symbol} = (:identity, :identity): Scaling to be used for the x and y axes. It will apply equally to every figure produced. The options are:

    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • x_factor::Int64 = 0: Numerical exponent to scale the x_quantity, e.g. if x_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.

  • y_factor::Int64 = 0: Numerical exponent to scale the y_quantity, e.g. if y_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.

  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.

  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.rho_temp_pipelineMethod
rho_temp_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the rho_temp_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "rho_vs_temp": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • temp_unit::Unitful.FreeUnits = Unitful.K: Unit of temperature to be used in the output, all available temperature units in Unitful and UnitfulAstro can be used.

  • density_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.kpc^3: Unit of density to be used in the output, all available density units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source
GADGETPlotting.scatter_grid_pipelineMethod
scatter_grid_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the scatter_grid_plot function as one image per snapshot, and then generate a GIF and video animating the images.

Arguments

  • base_name::String: Base name of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Path to the directory containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "scatter_grid": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".ps", ".svg" and ".png".

source
GADGETPlotting.sfr_txt_pipelineMethod
sfr_txt_pipeline(
    snapshots::Vector{String},
    source_path::Vector{String},
    x_axis::Int64,
    y_axis::Vector{Int64}; 
    <keyword arguments>
)::Nothing

Save the results of the sfr_txt_plot function as one image per simulation or one image per column depending on comparison_type.

Warning

This function takes a modified version of sfr.txt which is produced by a private version of GADGET3. GADGET4 produces a sfr.txt, but it is not compatible with this function.

Arguments

  • snapshots::Vector{String}: Path to the snapshot files, to get its headers.
  • source_path::Vector{String}: Paths to the directories containing the sfr.txt files, set in the GADGET variable OutputDir.
  • x_axis::Int64: Column number for the x axis.
  • y_axis::Vector{Int64}: Column numbers for the y axis.
  • output_path::String = "sfr_txt": Path to the output directory.
  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:
    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • comparison_type::Int64 = 0: Selects which parameters (columns or simulations) will be compared:
    • 0 ⟶ Different columns are compared, for a single simulation (one plot per simulation).
    • 1 ⟶ Different simulations are compared, using the same column (one plot per column).
  • titles::Vector{String} = String[]: Titles for the figures. If an empty string is given, no title is printed.
  • names::Vector{String} = String[]: Names for the files. If an empty string is given, the images will be assigned a number given by the order of source_path.
  • labels::Union{Nothing, Array{String, 2}} = nothing: Labels for the different simulations. Only relevant if comparison_type = 1.
  • bins::Int64 = 0: Number of subdivisions for the smoothing of the data. The default is no smoothing. It will apply equally to every figure produced.
  • scale::NTuple{2, Symbol} = (:identity, :identity): Scaling to be used for the x and y axes. It will apply equally to every figure produced. The options are:
    • :identity ⟶ no scaling.
    • :log10 ⟶ logarithmic scaling.
  • x_factor::Int64 = 0: Numerical exponent to scale the x_quantity, e.g. if x_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.
  • y_factor::Int64 = 0: Numerical exponent to scale the y_quantity, e.g. if y_factor = 10 the corresponding axis will be scaled by $10^{10}$. The default is no scaling.
  • min_filter::NTuple{2, Float64} = (-Inf, -Inf): Value filter for the x and y axes. It will apply equally to every figure produced. If a value of the x data is lower than min_filter[1], then it is deleted. Equivalently with the y axis and min_filter[2]. The default is -Inf for both, i.e. no filtering.
  • mass_unit::Unitful.FreeUnits = UnitfulAstro.Msun: Unit of mass to be used in the output, all available mass units in Unitful and UnitfulAstro can be used.
  • time_unit::Unitful.FreeUnits = UnitfulAstro.Myr: Unit of time to be used in the output, all available time units in Unitful and UnitfulAstro can be used.
  • sfr_unit::Unitful.FreeUnits = UnitfulAstro.Msun / UnitfulAstro.yr: Unit of mass/time to be used in the output, all available time and mass units in Unitful and UnitfulAstro can be used.
  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".
source
GADGETPlotting.star_map_pipelineMethod
star_map_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the star_map_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base name of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Path to the directory containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "star_map": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • plane::String = "All": Indicates which plane will be plotted.

    • "XY" ⟶ x-y plane alone.
    • "XZ" ⟶ x-z plane alone.
    • "YZ" ⟶ y-z plane alone.
    • "All" ⟶ The three planes in a single 1x3 figure.
  • box_size::Unitful.Quantity = 1000.0UnitfulAstro.kpc: Size of the plotting region if vacuum boundary conditions were used. Its unit doesn't have to be the same as length_unit.

  • box_factor::Float64 = 1.0: Multiplicative factor for the plotting region. It will scale positions["box_size"] if vacuum boundary conditions were used, and it will scale positions["box_size"] / 2 if periodic boundary conditions were used.

  • axes::Bool = false: If true, the axes passing through (0, 0) are drawn. If false, no axes are drawn.

  • length_unit::Unitful.FreeUnits = UnitfulAstro.kpc: Unit of length to be used in the output, all available length units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".ps", ".svg" and ".png".

source
GADGETPlotting.temperature_histogram_pipelineMethod
temperature_histogram_pipeline(
    base_name::String,
    source_path::String,
    anim_name::String,
    frame_rate::Int64; 
    <keyword arguments>
)::Nothing

Save the results of the temperature_histogram_plot function as one image per snapshot, and then generate a GIF and a video animating the images.

Arguments

  • base_name::String: Base names of the snapshot files, set in the GADGET variable SnapshotFileBase.

  • source_path::String: Paths to the directories containing the snapshot files, set in the GADGET variable OutputDir.

  • anim_name::String: File name of the generated video and GIF, without the extension.

  • frame_rate::Int64: Frame rate of the output video and GIF.

  • output_path::String = "temperature_histogram": Path to the output directory. The images will be stored in output_path/images/ and will be named base_name_XXXformat where XXX is the number of the snapshot. The GIF and the video will be stored in output_path.

  • sim_cosmo::Int64 = 0: Value of the GADGET variable ComovingIntegrationOn:

    • 0 ⟶ Newtonian simulation (static universe).
    • 1 ⟶ Cosmological simulation (expanding universe).
  • filter_function::Function = pass_all: A function with the signature:

    foo(snap_file::String, type::String)::Vector{Int64}

    See the function pass_all for an example. By default, no particles are filtered.

  • step::Int64 = 1: Step used to traverse the list of snapshots. By default all snapshots will be plotted.

  • temp_unit::Unitful.FreeUnits = Unitful.K: Unit of temperature to be used in the output, all available temperature units in Unitful and UnitfulAstro can be used.

  • format::String = ".png": File format of the output figure. All formats supported by the GR backend can be used, namely ".pdf", ".svg" and ".png".

source