Convenience functions
These functions are pre-made recipes for specific plots.
They are also examples of how to use the more configurable, but much more complicated, pipeline functions.
All these functions are exported.
GalaxyInspector.atomicMolecularTransition
— MethodatomicMolecularTransition(
simulation_paths::Vector{String},
slice::IndexType,
ranges::Vector{<:Tuple{<:Real,<:Real}};
<keyword arguments>
)::Nothing
Plot the atomic gas to molecular gas transition for a set of metallicity ranges.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.ranges::Vector{<:Tuple{<:Real,<:Real}}
: Metallicity (as in the fractional mass of metals) ranges.plot_type::Symbol=:heatmap
: Type of plot. The options are::heatmap
-> Heatmap. One figure per range will be produced.:scatter
-> Scatter plot. A single figure with every range will be produced.
output_path::String="."
: Path to the output folder.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.clumpingFactor
— MethodclumpingFactor(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol;
<keyword arguments>
)::Nothing
Plot the clumping factor of quantity
for different volume scales.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: The number density of which quantity will be used. The options are::gas
-> Gas number density.:molecular
-> Molecular hydrogen number density.:br_molecular
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic
-> Atomic hydrogen number density.:ionized
-> Ionized hydrogen number density.:neutral
-> Neutral hydrogen number density.
nn::Int=32
: Number of neighbors.smooth::Int=0
: The result will be average out usingsmooth
bins for the volume. Set it to 0 if you want no smoothing.x_trim::NTuple{2,<:Real}=(-Inf, Inf)
: The data will be trim down so the x coordinates fit withinx_trim
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
da_ff::Function=filterNothing
: A function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.compareFeldmann2020
— MethodcompareFeldmann2020(
simulation_paths::Vector{String},
x_quantity::Symbol,
y_quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a time series plus the corresponding experimental results from Feldmann (2020).
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.x_quantity::Symbol
: Quantity for the x axis. The options are::stellar_mass
-> Stellar mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:sfr
-> Star formation rate of the lastAGE_RESOLUTION
.
y_quantity::Symbol
: Quantity for the y axis. The options are::stellar_mass
-> Stellar mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:sfr
-> Star formation rate of the lastAGE_RESOLUTION
.
slice::IndexType=(:)
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.scatter::Bool=false
: If the data will be presented as a line plot with error bands (default), or alternatively, a scatter plot.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
R. Feldmann (2020). The link between star formation and gas in nearby galaxies. Communications Physics 3(226). doi:10.1038/s42005-020-00493-0
GalaxyInspector.compareMolla2015
— MethodcompareMolla2015(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a Milky Way profile plus the corresponding experimental results from Mollá et al. (2015).
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: Quantity for the y axis. The options are::stellar_area_density
-> Stellar area mass density.:molecular_area_density
-> Molecular mass surface density.:br_molecular_area_density
-> Molecular mass surface density, computed using the pressure relation in Blitz et al. (2006).:atomic_area_density
-> Atomic hydrogen area mass density.:sfr_area_density
-> Star formation rate area density, for the lastAGE_RESOLUTION
.:O_stellar_abundance
-> Stellar abundance of oxygen, as $12 + \log_{10}(\mathrm{O \, / \, H})$.:N_stellar_abundance
-> Stellar abundance of nitrogen, as $12 + \log_{10}(\mathrm{N \, / \, H})$.:C_stellar_abundance
-> Stellar abundance of carbon, as $12 + \log_{10}(\mathrm{C \, / \, H})$.
output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
M. Mollá et al. (2015). Galactic chemical evolution: stellar yields and the initial mass function. Monthly Notices of the Royal Astronomical Society 451(4), 3693–3708. doi:10.1093/mnras/stv1102
GalaxyInspector.cpuTXT
— MethodcpuTXT(
simulation_paths::Vector{String},
target::String,
x_quantity::Symbol,
y_quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a time series of the data in the cpu.txt
file.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.target::String
: Target process.x_quantity::Symbol
: Quantity for the x axis. The options are::time_step
-> Time step.:physical_time
-> Physical time since the Big Bang.:clock_time_s
-> Clock time duration of the time step in seconds.:clock_time_percent
-> Clock time duration of the time step as a percentage.:tot_clock_time_s
-> Total clock time in seconds.:tot_clock_time_percent
-> Total clock time as a percentage.
y_quantity::Symbol
: Quantity for the y axis. The options are::time_step
-> Time step.:physical_time
-> Physical time since the Big Bang.:clock_time_s
-> Clock time duration of the time step in seconds.:clock_time_percent
-> Clock time duration of the time step as a percentage.:tot_clock_time_s
-> Total clock time in seconds.:tot_clock_time_percent
-> Total clock time as a percentage.
smooth::Int=0
: The result will be smoothed out usingsmooth
bins. Set it to 0 if you want no smoothing.yscale::Function=identity
: Scaling function for the y axis. The options are the scaling functions accepted by Makie: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.x_trim::NTuple{2,<:Real}=(-Inf, Inf)
: The data will be trim down so the x coordinates fit withinx_trim
.y_trim::NTuple{2,<:Real}=(-Inf, Inf)
: The data will be trim down so the y coordinates fit withiny_trim
. This option does not affect histograms.output_path::String="."
: Path to the output folder.sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.densityMap
— MethoddensityMap(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot a 2D histogram of the density.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. If set to 0, an animation using every snapshots will be made.quantities::Vector{Symbol}=[:gas_mass]
: Quantities for which the density will be calculated. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.
types::Vector{Symbol}=[:cells]
: List of component types for the density fields, each element can be either:particles
or Voronoi:cells
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
projection_planes::Vector{Symbol}=[:xy]
: Projection planes. The options are:xy
,:xz
, and:yz
. The disk is generally oriented to have its axis of rotation parallel to the z axis.box_size::Unitful.Length=100u"kpc"
: Physical side length of the plot window.pixel_length::Unitful.Length=0.1u"kpc"
: Pixel (bin of the 2D histogram) side length.reduce_factor::Int=1
: Factor by which the resolution of the result will be reduced. This will be applied after the density projection, averaging the value of neighboring pixels. It has to divide the size ofgrid
exactly.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
annotation::AbstractString=""
: Text to be added into the top left corner of the plot. If left empty, nothing is printed.colorbar::Bool=false
: If a colorbar will be added.colorrange::Union{Nothing,Tuple{<:Real,<:Real}}=nothing
: Sets the start and end points of the colormap. Usenothing
to use the extrema of the values to be plotted.da_ff::Function=filterNothing
: Filter function for the data analysis function. It must be a function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.densityMapVelField
— MethoddensityMapVelField(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot a 2D histogram of the density, with the velocity field.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. If set to 0, an animation using every snapshots will be made.quantities::Vector{Symbol}=[:gas_mass]
: Quantities for which the density will be calculated. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.
types::Vector{Symbol}=[:cells]
: List of component types for the density fields, each element can be either:particles
or Voronoi:cells
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
projection_planes::Vector{Symbol}=[:xy]
: Projection planes. The options are:xy
,:xz
, and:yz
. The disk is generally oriented to have its axis of rotation parallel to the z axis.box_size::Unitful.Length=100u"kpc"
: Physical side length of the plot window.pixel_length::Unitful.Length=0.1u"kpc"
: Pixel (bin of the 2D histogram) side length.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
annotation::AbstractString=""
: Text to be added into the top left corner of the plot. If left empty, nothing is printed.colorbar::Bool=false
: If a colorbar will be added.colorrange::Union{Nothing,Tuple{<:Real,<:Real}}=nothing
: Sets the start and end points of the colormap. Usenothing
to use the extrema of the values to be plotted.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.densityProfile
— MethoddensityProfile(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a density profile.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantities::Vector{Symbol}
: Quantities for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.
cumulative::Bool=false
: If the profile will be accumulated or not.yscale::Function=identity
: Scaling function for the y axis. The options are the scaling functions accepted by Makie: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.radius::Unitful.Length=DISK_R
: Radius of the profile.n_bins::Int=100
: Number of bins.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.densityProfile
— MethoddensityProfile(
simulation_paths::Vector{String},
slice::IndexType,
quantities::Vector{Symbol};
<keyword arguments>
)::Nothing
Plot a density profile.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantities::Vector{Symbol}
: Quantities for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.
cumulative::Bool=false
: If the profile will be accumulated or not.yscale::Function=identity
: Scaling function for the y axis. The options are the scaling functions accepted by Makie: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.radius::Unitful.Length=DISK_R
: Radius of the profile.n_bins::Int=100
: Number of bins.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=string.(quantities)
: Labels for the plot legend, one per quantity. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.discAccretionEvolution
— MethoddiscAccretionEvolution(
simulation_paths::Vector{String};
<keyword arguments>
)::Nothing
Plot a time series of the accreted mass into the disc.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType=(:)
: Slice of the simulations, i.e. which snapshots will be plotted. It can be vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.max_r::Unitful.Length=DISK_R
: Radius of the cylinder.max_z::Unitful.Length=5.0u"kpc"
: Half height of the cylinder.smooth::Int=0
: The time series will be smoothed out usingsmooth
bins. Set it to 0 if you want no smoothing.output_path::String="."
: Path to the output folder.sim_labels::Union{Vector{<:AbstractString},Nothing}=nothing
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.fitVSFLaw
— MethodfitVSFLaw(
simulation_path::String,
slice::IndexType;
<keyword arguments>
)::Nothing
Plot the resolved volumetric star formation (VSF) law with an optional linear fit.
Only stars younger than AGE_RESOLUTION
are considered. The star formation surface density is just the stellar mass surface density divided by AGE_RESOLUTION
.
Arguments
simulation_path::String
: Path to the simulation directory, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: Quantity for the x axis. The options are::gas_mass
-> Gas density.:hydrogen_mass
-> Hydrogen density.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) density.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) density, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) density.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) density.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) density.
type::Symbol=:cells
: If the gas surface density will be calculated assuming the gas is in:particles
or in Voronoi:cells
.fit::Bool=true
: If a fit of the plotted values will be added on top of the scatter plot.box_size::Unitful.Length=BOX_L
: Physical side length for the gridsx_range::NTuple{2,<:Real}=(-Inf, Inf)
: Only the data withing this range (for the x coordinates) will be fitted.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_label::Union{String,Nothing}=basename(simulation_path)
: Label for the scatter plot. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.gasBarPlot
— MethodgasBarPlot(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol,
edges::Vector{<:Number};
<keyword arguments>
)::Nothing
Plot a bar plot of the gas fractions, where the bins are a given gas quantity
.
Only for gas cells that have entered our routine.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: Target quantity. The possibilities are::gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:gas_radial_distance
-> Distance of every gas cell to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
edges::Vector{<:Number}
: A sorted list of bin edges forquantity
.axis_label::Union{AbstractString,Nothing}=nothing
: Label for the axis. It can contain the stringauto_label
, which will be replaced by the default label:var_name
/ 10^exp_factor
unit
. If set tonothing
a label will be assigned automaticaly.exp_ticks::Bool=false
: If the axis ticks will be the $\log_{10}$ ofedges
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.gasEvolution
— MethodgasEvolution(
simulation_paths::Vector{String};
<keyword arguments>
)::Nothing
Plot a time series of the gas components. Either their masses or their fractions.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.fractions::Bool=true
: If the fractions (default), or the masses, will be plotted.slice::IndexType=(:)
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
extra_filter::Function=filterNothing
: Filter function that will be applied after the one given byfilter_mode
.ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theextra_filter
filter function.filename::Union{String,Nothing}=nothing
: Name for the output file. If left asnothing
, the filename will be chosen automaticaly.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.gasSFRMap
— MethodgasSFRMap(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot a 2D map of the gas SFR.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. If set to 0, an animation using every snapshots will be made.types::Symbol=:cells
: Gas type for the SFR fields. It can be either:particles
or Voronoi:cells
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
projection_planes::Vector{Symbol}=[:xy]
: Projection planes. The options are:xy
,:xz
, and:yz
. The disk is generally oriented to have its axis of rotation parallel to the z axis.box_size::Unitful.Length=100u"kpc"
: Physical side length of the plot window.pixel_length::Unitful.Length=0.1u"kpc"
: Pixel (bin of the 2D histogram) side length.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
annotation::AbstractString=""
: Text to be added into the top left corner of the plot. If left empty, nothing is printed.colorbar::Bool=false
: If a colorbar will be added.colorrange::Union{Nothing,Tuple{<:Real,<:Real}}=nothing
: Sets the start and end points of the colormap. Usenothing
to use the extrema of the values to be plotted.da_ff::Function=filterNothing
: Filter function for the data analysis function. It must be a function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.
GalaxyInspector.gasVelocityCubes
— MethodgasVelocityCubes(
simulation_paths::Vector{String},
slice::ReducedIndexType;
<keyword arguments>
)::Nothing
Create a HDF5 file with the position, gas mass, velocity, and velocity dispersion of each voxel in a rectangular 3D grid.
The metadata for each snapshot in the HDF5 file includes the physical time in Gyr, the scale factor, and the redshift of that snapshot.
By default, the grid is centered at coordinates (0, 0, 0), has 300x300x300 voxels, and has a side length of BOX_L
. There are as many rows as there are voxels (27000000 by default).
The quantities in the HDF5 file for each voxel are:
Column 01: x coordinate [l_unit
] Column 02: y coordinate [l_unit
] Column 03: z coordinate [l_unit
] Column 04: Molecular mass [m_unit
] Column 05: Atomic mass [m_unit
] Column 06: Ionized mass [m_unit
] Column 07: Velocity in the x direction [v_unit
] Column 08: Velocity in the y direction [v_unit
] Column 09: Velocity in the z direction [v_unit
] Column 10: Velocity dispersion in the x direction [v_unit
] Column 11: Velocity dispersion in the y direction [v_unit
] Column 12: Velocity dispersion in the z direction [v_unit
]
For gas represented by Voronoi cells (e.g. Arepo):
The mass is the mass of molecular, atomic or ionized gas intersecting the voxel, so it only considers the cell that is closest to the voxel. The velocity is given by the weighted mean of the velocities of the n_neighbors
nearest cells. And the velocity dispersion, by the weighted standard deviation.
Notice that for Voronoi cells, the mass will be sample at a sub-cell resolution (as long as voxel size < cell size), while the velocities are sample at a locally lower-than-cell resolution (as long as n_neighbors
> 1). The weights are given by the distance (in kpc) to each neighbor, using a Gaussian kernel.
For gas represented by particles (e.g. SPH codes):
The mass is the accumulated mass of the particles within each voxel. The velocity is the mean of the velocities of those particles, and the velocity dispersion is the standard deviation.
If there are no particles, the mass is 0, and the velocity and velocity dispersion are NaN. If there is only one particle, the mass and velocity are the ones from that particle, and the velocity dispersion is NaN.
By default (filter_mode
= :subhalo) we use the following reference system:
- The origin is in the position of the particle/cell at the potential minimum of the main subhalo.
- The x, y, and z axis form a right-handed cartesian reference system (x × y = z), where the z axis has the orientation of the stellar angular momentum, and the x and y axis are roughly in the direction of the corresponding principal axis.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::ReducedIndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13) or anStepRange
(e.g. 5:2:13). Starts at 1.type::Symbol=:cells
: If the gas density will be calculated assuming the gas is in:particles
or in Voronoi:cells
.n_neighbors::Int=32
: Number of neighbors for the mean and standard deviation of the velocity. Setting this value to 1 maximizes the resolution for the velocity, and sets the standard deviation (columns 8, 9, and 10) to NaN. This is only relevant for simulations where gas is represented by Voronoi cells (type
= :cells).grid::CubicGrid=CubicGrid(BOX_L, 300)
: Cubic grid.row_major_order::Bool=true
: Store the results in row-major order (C and Python) instead of column-major order (Julia, Fortran, and MATLAB). See Row- and column-major order.m_unit::Unitful.Units=u"Msun"
: Mass unitl_unit::Unitful.Units=u"kpc"
: Length unit.v_unit::Unitful.Units=u"km * s^-1"
: Velocity unit.output_file::String="./gas_velocity_cube.hdf5"
: Path to the output HDF5 file. This file will be created, and the full path to it too, if it doesn't exist.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:subhalo
: Which cells/particles will be consider, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
show_progress::Bool=true
: If a progress bar will be shown.
GalaxyInspector.kennicuttSchmidtLaw
— MethodkennicuttSchmidtLaw(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot the Kennicutt-Schmidt law.
Only stars younger than AGE_RESOLUTION
are considered. The star formation surface density is the stellar mass surface density divided by AGE_RESOLUTION
.
This function uses physical units regardless of the PHYSICAL_UNITS
global setting.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
. All the simulations will be plotted together.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. All the selected snapshots will be plotted together.quantity::Symbol=:molecular_mass
: Quantity for the x axis. The options are::gas_mass
-> Total gas mass surface density.:molecular_mass
-> Molecular mass surface density. This one can be plotted with the results of Bigiel et al. (2008) and Sun et al. (2023).:br_molecular_mass
-> Molecular mass surface density, computed using the pressure relation in Blitz et al. (2006). This one can be plotted with the results of Bigiel et al. (2008) and Sun et al. (2023).:neutral_mass
-> Neutral mass surface density. This one can be plotted with the results of Bigiel et al. (2008), and Kennicutt (1998).
gas_type::Symbol=:cells
: If the gas surface density will be calculated assuming the gas is in :particles or in Voronoi :cells.reduce_grid::Symbol=:square
: Grid for the density projection. The options are::square
-> The gas and stellar distributions will be projected into a regular cubic grid first and then into a flat square one, to emulate the way the surface densities are measured in observations.:circular
-> The gas and stellar distributions will be projected into a regular cubic grid first, then into a flat square one, and finally into a flat circular grid, formed by a series of concentric rings. This emulates the traditional way the Kennicutt-Schmidt law is measured in simulations.
grid_size::Unitful.Length=BOX_L
: Physical side length of the cubic and square grids, and diameter of the circular grid (ifreduce_grid
= :circular). As a reference, Bigiel et al. (2008) uses measurements up to the optical radius r25 (where the B-band magnitude drops below 25 mag arcsec^−2). This limits which cells/particles will be consider.bin_size::Unitful.Length=BIGIEL_PX_SIZE
: Target bin size for the grids. Ifreduce_grid
= :square, it is the physical side length of the pixels in the final square grid. Ifreduce_grid
= :circular, it is the ring width for the final circular grid. In both cases ofreduce_grid
, the result will only be exact ifbin_size
dividesgrid_size
exactly, otherwisegrid_size
will take priority and the final sizes will only approximatebin_size
. For the cubic grids a default value of 200 pc is always used.plot_type::Symbol=:scatter
: If the plot will be a :scatter plot or a :heatmap. Heatmaps will not show legends, experimental measurements or several simulations at once.integrated::Bool=false
: If the integrated (one point per galaxy) or resolved (several point per galaxy) Kennicutt-Schmidt law will be plotted.integrated
= true only works withplot_type
= :scatter. The central value is the weighted median and the error bars are the median absolute deviations.sfr_density::Bool=true
: If the quantity for the y axis will be the SFR surface density or, if set to false, the stellar mass surface density.gas_weights::Union{Symbol,Nothing}=nothing
: Ifplot_type
= :scatter, each point (a bin in the 2D grid) can be weighted by a gas quantity. Ifintegrated
= true, the median will be computed with these weights in mind. Ifintegrated
= false, each point will have a color given by the weight. The posible weights are::gas_mass_density
-> Gas mass surface density of each bin. See the documentation for the functiondaDensity2DProjection
.:gas_sfr
-> The total gas SFR of the column associated with each bin. See the documentation for the functiondaGasSFR2DProjection
.:gas_metallicity
-> The total metallicity of the column associated with each bin. See the documentation for the functiondaMetallicity2DProjection
.:temperature
-> The median gas temperature of the column associated with each bin. See the documentation for the functiondaTemperature2DProjection
.
measurements::Bool=true
: If the experimental measurements from Kennicutt (1998), Bigiel et al. (2008) or Bigiel et al. (2010) will be plotted alongside the simulation results.measurement_type::Union{String,Symbol}=:fits
: Type of measurement to plot, only valid ifmeasurement
= true. The option are::fits
: Fits from Bigiel et al. (2008) and/or Kennicutt (1998) depending on the quantity in the x axis. The fits will be plotted as lines with uncertanty bands."NGC XXX"
: Plot the resolved data of the given galaxy as a scatter plot. Uses the data from Sun et al. (2023). See the documentation ofppSun2023!
for options.:main
: Plot the data of the main galaxy distribution in Sun et al. (2023), as a scatter plot.:all
: Plot the data of every galaxy in Sun et al. (2023), as a scatter plot.
fit::Bool=false
: If the simulation data law will be fitted with a power law. The fit will be plotted as a line. This option is only valid ifintegrated
= false andplot_type
= :scatter, otherwise it will be ignored.x_range::Union{NTuple{2,<:Number},Nothing}=nothing
: x axis range for the heatmap grid. If set tonothing
, the extrema of the x values will be used. Only relevant ifplot_type
= :heatmap.y_range::Union{NTuple{2,<:Number},Nothing}=nothing
: y axis range for the heatmap grid. If set tonothing
, the extrema of the y values will be used. Only relevant ifplot_type
= :heatmap.n_bins::Int=100
: Number of bins per side of the heatmap grid. Only relevant ifplot_type
= :heatmap.colorbar::Bool=false
: If a colorbar will be added.output_file::String="./kennicutt_schmidt_law.png"
: Path to the output file.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Selects which cells/particles will be consider, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
R. C. Kennicutt (1998). The Global Schmidt Law in Star-forming Galaxies. The Astrophysical Journal, 498(2), 541-552. doi:10.1086/305588
F. Bigiel et al. (2008). THE STAR FORMATION LAW IN NEARBY GALAXIES ON SUB-KPC SCALES. The Astrophysical Journal, 136(6), 2846. doi:10.1088/0004-6256/136/6/2846
J. Sun et al. (2023). Star Formation Laws and Efficiencies across 80 Nearby Galaxies. The Astrophysical Journal Letters, 945(2), L19. doi:10.3847/2041-8213/acbd9c
GalaxyInspector.lineHistogram
— MethodlineHistogram(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol,
type::Symbol,
range::NTuple{2,<:Number};
<keyword arguments>
)::Nothing
Plot a histogram of quantity
.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: The possibilities are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
type::Symbol
: Type of cell/particle.range::NTuple{2,<:Number}
: Range of values for the histogram.n_bins::Int=100
: Number of bins.log::Bool=false
: If the bins will be logarithmic.norm::Int=0
: Number of count that will be use to normalize the histogram. If left as 0, the histogram will be normalize with the maximum bin count.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
extra_filter::Function=filterNothing
: Filter function that will be applied after the one given byfilter_mode
.ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theextra_filter
filter function.sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.massMetallicityRelation
— MethodmassMetallicityRelation(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot the resolved mass-metallicity relation. This method plots the M-Z relation at a fix moment in time.
Only stars younger than AGE_RESOLUTION
and gas cells/particles within a sphere of radius DISK_R
are considered.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.element::Symbol=:all
: Which metallicity to use. The options are::all
-> Metallicity considering all elements, as $Z / Z_\odot$.:X
-> Element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.
mass::Bool=true
: If the x axis will be the stellar mass density or the SFR density.reduce_factor::Int=1
: Factor by which the resolution of the result will be reduced. This will be applied after the density projection, averaging the value of neighboring pixels. It has to divide the size ofgrid
exactly.output_path::String="./resolvedKSLawZScatter"
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.massProfile
— MethodmassProfile(
simulation_paths::Vector{String},
slice::IndexType,
quantities::Vector{Symbol};
<keyword arguments>
)::Nothing
Plot a mass profile.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantities::Vector{Symbol}
: Quantities for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:dust_mass
-> Dust mass.
cumulative::Bool=false
: If the profile will be accumulated or not.yscale::Function=identity
: Scaling function for the y axis. The options are the scaling functions accepted by Makie: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.radius::Unitful.Length=DISK_R
: Radius of the profile.n_bins::Int=100
: Number of bins.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=string.(quantities)
: Labels for the plot legend, one per quantity. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.metallicityMap
— MethodmetallicityMap(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot a 2D histogram of the metallicity.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. If set to 0, an animation using every snapshots will be made.components::Vector{Symbol}=[:gas]
: Target component. It can be either:stars
or:gas
.types::Vector{Symbol}=[:cells]
: List of component types for the metallicity fields, each element can be either:particles
or Voronoi:cells
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
projection_planes::Vector{Symbol}=[:xy]
: Projection planes. The options are:xy
,:xz
, and:yz
. The disk is generally oriented to have its axis of rotation parallel to the z axis.box_size::Unitful.Length=100u"kpc"
: Physical side length of the plot window.pixel_length::Unitful.Length=0.1u"kpc"
: Pixel (bin of the 2D histogram) side length.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
annotation::AbstractString=""
: Text to be added into the top left corner of the plot. If left empty, nothing is printed.colorbar::Bool=false
: If a colorbar will be added.colorrange::Union{Nothing,Tuple{<:Real,<:Real}}=nothing
: Sets the start and end points of the colormap. Usenothing
to use the extrema of the values to be plotted.da_ff::Function=filterNothing
: Filter function for the data analysis function. It must be a function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.
GalaxyInspector.rotationCurve
— MethodrotationCurve(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot the galaxy rotation curve of a set of simulations.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.radius::Unitful.Length=DISK_R
: Maximum radial distance for the rotation curve.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.scatterDensityMap
— MethodscatterDensityMap(
simulation_paths::Vector{String},
slice::IndexType,
x_quantity::Symbol,
y_quantity::Symbol,
z_quantity::Symbol,
z_unit::Unitful.Units;
<keyword arguments>
)::Nothing
Plot two quantities as a density scatter plot (2D histogram), weighted by z_quantity
.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.x_quantity::Symbol
: Quantity for the x axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
y_quantity::Symbol
: Quantity for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
z_quantity::Symbol
: Quantity for the z axis (weights). The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
z_unit::Unitful.Units
: Target unit for the z axis.x_range::Union{NTuple{2,<:Number},Nothing}=nothing
: x axis range. If set tonothing
, the extrema of the values will be used.y_range::Union{NTuple{2,<:Number},Nothing}=nothing
: y axis range. If set tonothing
, the extrema of the values will be used.xlog::Bool=false
: If true, sets everything so the x axis is log10(x_quantity
).ylog::Bool=false
: If true, sets everything so the y axis is log10(y_quantity
).total::Bool=true
: If the sum (default) or the mean ofz_quantity
will be used as the value of each pixel.n_bins::Int=100
: Number of bins per side of the square grid.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
da_ff::Function=filterNothing
: A function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
colorbar::Bool=false
: If a colorbar will be added.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.scatterPlot
— MethodscatterPlot(
simulation_paths::Vector{String},
slice::IndexType,
x_quantity::Symbol,
y_quantity::Symbol;
<keyword arguments>
)::Nothing
Plot two quantities as a scatter plot, one marker for every cell/particle.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.x_quantity::Symbol
: Quantity for the x axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
y_quantity::Symbol
: Quantity for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:gas_mass_density
-> Gas mass density.:hydrogen_mass_density
-> Hydrogen mass density.:gas_number_density
-> Gas number density.:molecular_number_density
-> Molecular hydrogen number density.:br_molecular_number_density
-> Molecular hydrogen number density, computed using the pressure relation in Blitz et al. (2006).:atomic_number_density
-> Atomic hydrogen number density.:ionized_number_density
-> Ionized hydrogen number density.:neutral_number_density
-> Neutral hydrogen number density.:gas_td
-> Total gas depletion time.:molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> Atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> Ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> Neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_radial_distance
-> Distance of every stellar particle to the origin.:gas_radial_distance
-> Distance of every gas cell to the origin.:dm_radial_distance
-> Distance of every dark matter particle to the origin.:stellar_xy_distance
-> Projected distance of every stellar particle to the origin.:gas_xy_distance
-> Projected distance of every gas cell to the origin.:dm_xy_distance
-> Projected distance of every dark matter particle to the origin.:gas_sfr
-> SFR associated to each gas particle/cell within the code.:stellar_circularity
-> Stellar circularity.:stellar_vcirc
-> Stellar circular velocity.:stellar_vradial
-> Stellar radial speed.:stellar_vtangential
-> Stellar tangential speed.:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.:stellar_age
-> Stellar age.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:temperature
-> Gas temperature, as $\log_{10}(T \, / \, \mathrm{K})$.:pressure
-> Gas pressure.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
xlog::Bool=false
: If true, sets everything so the x axis is log10(x_quantity
).ylog::Bool=false
: If true, sets everything so the y axis is log10(y_quantity
).output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
da_ff::Function=filterNothing
: A function with the signature:da_ff(data_dict) -> indices
where
data_dict::Dict
: A dictionary with the following shape::sim_data
-> ::Simulation (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theda_ff
filter function.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.sfrTXT
— MethodsfrTXT(
simulation_paths::Vector{String},
x_quantity::Symbol,
y_quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a time series of the data in the sfr.txt
file.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.x_quantity::Symbol
: Quantity for the x axis. The options are::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor.:redshift
-> Redshift.
y_quantity::Symbol
: Quantity for the y axis. The options are::stellar_mass
-> Stellar mass.:sfr
-> Star formation rate.
smooth::Int=0
: The result will be smoothed out usingsmooth
bins. Set it to 0 if you want no smoothing.output_path::String="."
: Path to the output folder.sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.simulationReport
— MethodsimulationReport(
simulation_paths::Vector{String};
<keyword arguments>
)::Nothing
Write a text file with information about a given simulation
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
. One text file will be printed for each simulation.output_path::String="."
: Path to the output folder.
GalaxyInspector.snapshotReport
— MethodsnapshotReport(
simulation_paths::Vector{String},
slices::Vector{Int};
<keyword arguments>
)::Nothing
Write a text file with information about a given snapshot.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
. One text file will be printed for each simulation.slices::Vector{Int}
: Selects which snapshots to plot for each simulation, starts at 1 and is independent of the number in the file name. If every snapshot is present, the relation isslice_n
= (number in filename) + 1.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be considered in the "filtered" section of the report. The options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
halo_idx::Int=1
: Index of the target halo (FoF group) for the corresponding section. Starts at 1.subhalo_rel_idx::Int=1
: Index of the target subhalo (subfind), relative to the target halo, for the corresponding section. Starts at 1.
GalaxyInspector.stellarBirthHalos
— MethodstellarBirthHalos(
simulation_path::String,
slice_n::Int;
<keyword arguments>
)::Nothing
Write, to a pair of CSV files, in which halo and subhalo every star in snapshot slice_n
was born.
Arguments
simulation_paths::String
: Path to the simulation directory, set in the code variableOutputDir
.slice_n::Int
: Selects the target snapshot. Starts at 1 and is independent of the number in the file name. If every snapshot is present, the relation isslice_n
= (number in filename) + 1.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
GalaxyInspector.stellarHistory
— MethodstellarHistory(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol;
<keyword arguments>
)::Nothing
Plot the evolution of a given stellar quantity
using the stellar ages at a given instant in time.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Snapshot at which the stellar ages will be read. If set to several snapshots, one plot per snapshot will be done. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.quantity::Symbol
: Quantity for the y axis. The options are::sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:stellar_mass
-> Stellar mass.:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).
y_log::Bool=true
: If the y axis is will have a log10 scale.n_bins::Int=20
: Number of bins (time intervals).output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.backup_results::Bool=false
: If the values to be plotted will be backup in a JLD2 file.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.stellarVelocityCubes
— MethodstellarVelocityCubes(
simulation_paths::Vector{String},
slice::ReducedIndexType;
<keyword arguments>
)::Nothing
Create a HDF5 file with the position, stellar mass, velocity, and velocity dispersion of each voxel in a rectangular 3D grid.
The metadata for each snapshot in the HDF5 file includes the physical time in Gyr, the scale factor, and the redshift of that snapshot.
By default, the grid is centered at coordinates (0, 0, 0), has 100x100x100 voxels, and has a side length of BOX_L
. There are as many rows as there are voxels (1000000 by default).
The quantities in the HDF5 file for each voxel are:
Column 01: x coordinate [l_unit
] Column 02: y coordinate [l_unit
] Column 03: z coordinate [l_unit
] Column 04: Stellar mass [m_unit
] Column 05: Velocity in the x direction [v_unit
] Column 06: Velocity in the y direction [v_unit
] Column 07: Velocity in the z direction [v_unit
] Column 08: Velocity dispersion in the x direction [v_unit
] Column 09: Velocity dispersion in the y direction [v_unit
] Column 10: Velocity dispersion in the z direction [v_unit
]
The mass is the accumulated mass of the particles within each voxel. The velocity is the mean of the velocities of those particles, and the velocity dispersion is the standard deviation.
If there are no particles, the mass is 0, and the velocity and velocity dispersion are NaN. If there is only one particle, the mass and velocity are the ones from that particle, and the velocity dispersion is NaN.
By default (filter_mode
= :subhalo) we use the following reference system:
- The origin is in the position of the particle/cell at the potential minimum of the main subhalo.
- The x, y, and z axis form a right-handed cartesian reference system (x × y = z), where the z axis has the orientation of the stellar angular momentum, and the x and y axis are roughly in the direction of the corresponding principal axis.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::ReducedIndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13) or anStepRange
(e.g. 5:2:13). Starts at 1.grid::CubicGrid=CubicGrid(BOX_L, 100)
: Cubic grid.row_major_order::Bool=true
: Store the results in row-major order (C and Python) instead of column-major order (Julia, Fortran, and MATLAB). See Row- and column-major order.m_unit::Unitful.Units=u"Msun"
: Mass unitl_unit::Unitful.Units=u"kpc"
: Length unit.v_unit::Unitful.Units=u"km * s^-1"
: Velocity unit.output_file::String="./stellar_velocity_cube.hdf5"
: Path to the output HDF5 file. This file will be created, and the full path to it too, if it doesn't exist.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:subhalo
: Which cells/particles will be consider, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
show_progress::Bool=true
: If a progress bar will be shown.
GalaxyInspector.temperatureMap
— MethodtemperatureMap(
simulation_paths::Vector{String},
slice::IndexType;
<keyword arguments>
)::Nothing
Plot a 2D histogram of the temperature.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored. If set to 0, an animation using every snapshots will be made.type::Symbol=:cells
: If the gas will be assumed to be in:particles
or in Voronoi:cells
.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
projection_planes::Vector{Symbol}=[:xy]
: Projection planes. The options are:xy
,:xz
, and:yz
. The disk is generally oriented to have its axis of rotation parallel to the z axis.box_size::Unitful.Length=100u"kpc"
: Physical side length of the plot window.pixel_length::Unitful.Length=0.1u"kpc"
: Pixel (bin of the 2D histogram) side length.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.title::Union{Symbol,<:AbstractString}=""
: Title for the figure. If left empty, no title is printed. It can also be set to one of the following options::physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:scale_factor
-> Scale factor (only relevant for cosmological simulations).:redshift
-> Redshift (only relevant for cosmological simulations).
annotation::AbstractString=""
: Text to be added into the top left corner of the plot. If left empty, nothing is printed.colorbar::Bool=false
: If a colorbar will be added.colorrange::Union{Nothing,Tuple{<:Real,<:Real}}=nothing
: Sets the start and end points of the colormap. Usenothing
to use the extrema of the values to be plotted.
GalaxyInspector.timeSeries
— MethodtimeSeries(
simulation_paths::Vector{String},
x_quantity::Symbol,
y_quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a time series.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.x_quantity::Symbol
: Quantity for the x axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:stellar_number
-> Number of stellar particles.:gas_number
-> Number of gas cells.:dm_number
-> Number of dark matter particles.:bh_number
-> Number of black hole particles.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:gas_mass_density
-> Mean gas mass density.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:stellar_area_density
-> Stellar area mass density, for a radius ofDISK_R
.:gas_area_density
-> Gas mass surface density, for a radius ofDISK_R
.:molecular_area_density
-> Molecular mass surface density, for a radius ofDISK_R
.:br_molecular_area_density
-> Molecular mass surface density, for a radius ofDISK_R
, computed using the pressure relation in Blitz et al. (2006).:atomic_area_density
-> Atomic hydrogen area mass density, for a radius ofDISK_R
.:ionized_area_density
-> Ionized hydrogen area mass density, for a radius ofDISK_R
.:neutral_area_density
-> Neutral mass surface density, for a radius ofDISK_R
.:sfr_area_density
-> Star formation rate area density, for the lastAGE_RESOLUTION
and a radius ofDISK_R
.:gas_td
-> Gas depletion time.:molecular_td
-> The molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> The Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> The atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> The ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> The neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_specific_am
-> Norm of the stellar specific angular momentum.:gas_specific_am
-> Norm of the gas specific angular momentum.:dm_specific_am
-> Norm of the dark matter specific angular momentum.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:scale_factor
-> Scale factor.:redshift
-> Redshift.:physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
y_quantity::Symbol
: Quantity for the y axis. The options are::stellar_mass
-> Stellar mass.:gas_mass
-> Gas mass.:hydrogen_mass
-> Hydrogen mass.:dm_mass
-> Dark matter mass.:bh_mass
-> Black hole mass.:molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular_mass
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic_mass
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized_mass
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral_mass
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar_gas_mass
-> Stellar gas mass (according to our SF model).:ode_metal_mass
-> Metal mass (according to our SF model).:ode_metallicity
-> Metallicity (according to our SF model).:dust_mass
-> Dust mass.:stellar_number
-> Number of stellar particles.:gas_number
-> Number of gas cells.:dm_number
-> Number of dark matter particles.:bh_number
-> Number of black hole particles.:molecular_fraction
-> Gas mass fraction of molecular hydrogen.:br_molecular_fraction
-> Gas mass fraction of molecular hydrogen, computed using the pressure relation in Blitz et al. (2006).:atomic_fraction
-> Gas mass fraction of atomic hydrogen.:ionized_fraction
-> Gas mass fraction of ionized hydrogen.:neutral_fraction
-> Gas mass fraction of neutral hydrogen.:molecular_neutral_fraction
-> Fraction of molecular hydrogen in the neutral gas.:ionized_neutral_fraction
-> Fraction of ionized gas to neutral gas.:gas_mass_density
-> Mean gas mass density.:stellar_gas_fraction
-> Stellar gas fraction (according to our SF model).:metal_gas_fraction
-> Metallicity (according to our SF model).:dust_fraction
-> Dust mass fraction.:stellar_area_density
-> Stellar area mass density, for a radius ofDISK_R
.:gas_area_density
-> Gas mass surface density, for a radius ofDISK_R
.:molecular_area_density
-> Molecular mass surface density, for a radius ofDISK_R
.:br_molecular_area_density
-> Molecular mass surface density, for a radius ofDISK_R
, computed using the pressure relation in Blitz et al. (2006).:atomic_area_density
-> Atomic hydrogen area mass density, for a radius ofDISK_R
.:ionized_area_density
-> Ionized hydrogen area mass density, for a radius ofDISK_R
.:neutral_area_density
-> Neutral mass surface density, for a radius ofDISK_R
.:sfr_area_density
-> Star formation rate area density, for the lastAGE_RESOLUTION
and a radius ofDISK_R
.:gas_td
-> Gas depletion time.:molecular_td
-> The molecular hydrogen ($\mathrm{H_2}$) depletion time.:br_molecular_td
-> The Molecular hydrogen ($\mathrm{H_2}$) depletion time, computed using the pressure relation in Blitz et al. (2006).:atomic_td
-> The atomic hydrogen ($\mathrm{HI}$) depletion time.:ionized_td
-> The ionized hydrogen ($\mathrm{HII}$) depletion time.:neutral_td
-> The neutral hydrogen ($\mathrm{HI + H_2}$) depletion time.:gas_metallicity
-> Mass fraction of all elements above He in the gas (solar units).:stellar_metallicity
-> Mass fraction of all elements above He in the stars (solar units).:X_gas_abundance
-> Gas abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:X_stellar_abundance
-> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys ofELEMENT_INDEX
.:stellar_specific_am
-> Norm of the stellar specific angular momentum.:gas_specific_am
-> Norm of the gas specific angular momentum.:dm_specific_am
-> Norm of the dark matter specific angular momentum.:sfr
-> Star formation rate.:ssfr
-> The specific star formation rate.:observational_sfr
-> Star formation rate of the lastAGE_RESOLUTION
.:observational_ssfr
-> The specific star formation rate of the lastAGE_RESOLUTION
.:stellar_eff
-> Star formation efficiency per free-fall time for the gas that has turn into stars.:gas_eff
-> Star formation efficiency per free-fall time for the gas.:molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas.:br_molecular_eff
-> Star formation efficiency per free-fall time for the molecular hydrogen ($\mathrm{H_2}$) gas, computed using the pressure relation in Blitz et al. (2006).:atomic_eff
-> Star formation efficiency per free-fall time for the atomic hydrogen ($\mathrm{HI}$) gas.:ionized_eff
-> Star formation efficiency per free-fall time for the ionized hydrogen ($\mathrm{HII}$) gas.:neutral_eff
-> Star formation efficiency per free-fall time for the neutral hydrogen ($\mathrm{HI + H_2}$) gas.:scale_factor
-> Scale factor.:redshift
-> Redshift.:physical_time
-> Physical time since the Big Bang.:lookback_time
-> Physical time left to reach the last snapshot.:ode_gas_it
-> Integration time.:ode_gas_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$.:ode_gas_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$.:ode_gas_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$.:ode_gas_r
-> Mass recycling parameter, $R$.:ode_gas_cold_mf
-> Cold gas mass fraction.:ode_stellar_it
-> Integration time, for the gas that form the stars.:ode_stellar_tau_s
-> Star formation time scale, $\tau_\mathrm{S}$, for the gas that form the stars.:ode_stellar_eta_d
-> Photodissociation efficiency, $\eta_\mathrm{diss}$, for the gas that form the stars.:ode_stellar_eta_i
-> Photoionization efficiency, $\eta_\mathrm{ion}$, for the gas that form the stars.:ode_stellar_r
-> Mass recycling parameter, $R$, for the gas that form the stars.:ode_stellar_cold_mf
-> Cold gas mass fraction, for the gas that form the stars.:ode_stellar_gas_rho
-> Gas mass density, for the gas that form the stars.:ode_stellar_gas_Z
-> Gas metallicity, for the gas that form the stars (solar units).:ode_stellar_gas_mass
-> Cell mass, for the gas that form the stars.:ode_stellar_gas_sfr
-> SFR associated to the gas particles/cells within the code, for the gas that form the stars.:ode_stellar_gas_P
-> Gas pressure, for the gas that form the stars.
y_log::Bool=true
: If the y axis is will have a log10 scale. Only works iffraction
= false.cumulative::Bool=false
: If they_quantity
will be accumulated or not.fraction::Bool=false
: If they_quantity
will be represented as a fraction of the last value. Ifcumulative
= true, this will apply to the accumulated values.slice::IndexType=(:)
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
extra_filter::Function=filterNothing
: Filter function that will be applied after the one given byfilter_mode
.ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}()
: Request dictionary for theextra_filter
filter function.sim_labels::Union{Vector{<:AbstractString},Nothing}=nothing
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.backup_results::Bool=false
: If the values to be plotted will be backup in a JLD2 file.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
References
L. Blitz et al. (2006). The Role of Pressure in GMC Formation II: The H2-Pressure Relation. The Astrophysical Journal, 650(2), 933. doi:10.1086/505417
GalaxyInspector.velocityProfile
— MethodvelocityProfile(
simulation_paths::Vector{String},
slice::IndexType,
quantity::Symbol;
<keyword arguments>
)::Nothing
Plot a velocity profile.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType
: Slice of the simulations, i.e. which snapshots will be plotted. It can be an integer (a single snapshot), a vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.component::Symbol
: Which component will be calculated. The options are::stellar_vradial
-> Stellar radial speed ($v_r$).:stellar_vtangential
-> Stellar tangential speed ($v_\theta$).:stellar_vzstar
-> Stellar speed in the z direction, computed as $v_z \, \mathrm{sign}(z)$.
yscale::Function=identity
: Scaling function for the y axis. The options are the scaling functions accepted by Makie: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.output_path::String="."
: Path to the output folder.filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all
: Which cells/particles will be plotted, the options are::all
-> Consider every cell/particle within the simulation box.:halo
-> Consider only the cells/particles that belong to the main halo.:subhalo
-> Consider only the cells/particles that belong to the main subhalo.:sphere
-> Consider only the cell/particle inside a sphere with radiusDISK_R
(see./src/constants/globals.jl
).:stellar_subhalo
-> Consider only the cells/particles that belong to the main subhalo.:all_subhalo
-> Plot every cell/particle centered around the main subhalo.A dictionary with three entries:
:filter_function
-> The filter function.:translation
-> Translation for the simulation box. The possibilities are::zero
-> No translation is applied.:global_cm
-> Selects the center of mass of the whole system as the new origin.:{component}
-> Sets the center of mass of the given component (e.g. :stars, :gas, :halo, etc, after filtering) as the new origin. It can be any of the keys ofPARTICLE_INDEX
.(halo_idx, subhalo_rel_idx)
-> Sets the position of the potential minimum for thesubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo) as the new origin.(halo_idx, 0)
-> Sets the center of mass of thehalo_idx::Int
halo as the new origin.subhalo_abs_idx
-> Sets the center of mass of thesubhalo_abs_idx::Int
as the new origin.
:rotation
-> Rotation for the simulation box. The possibilities are::zero
-> No rotation is applied.:global_am
-> Sets the angular momentum of the whole system as the new z axis.:stellar_am
-> Sets the stellar angular momentum as the new z axis.:stellar_pa
-> Sets the stellar principal axis as the new coordinate system.:stellar_subhalo_pa
-> Sets the principal axis of the stars in the main subhalo as the new coordinate system.(halo_idx, subhalo_rel_idx)
-> Sets the principal axis of the stars insubhalo_rel_idx::Int
subhalo (of thehalo_idx::Int
halo), as the new coordinate system.(halo_idx, 0)
-> Sets the principal axis of the stars in thehalo_idx::Int
halo, as the new coordinate system.subhalo_abs_idx
-> Sets the principal axis of the stars in thesubhalo_abs_idx::Int
subhalo as the new coordinate system.
sim_labels::Union{Vector{<:AbstractString},Nothing}=basename.(simulation_paths)
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.
GalaxyInspector.virialAccretionEvolution
— MethodvirialAccretionEvolution(
simulation_paths::Vector{String};
<keyword arguments>
)::Nothing
Plot a time series of the accreted mass into the virial radius.
Arguments
simulation_paths::Vector{String}
: Paths to the simulation directories, set in the code variableOutputDir
.slice::IndexType=(:)
: Slice of the simulations, i.e. which snapshots will be plotted. It can be vector of integers (several snapshots), anUnitRange
(e.g. 5:13), anStepRange
(e.g. 5:2:13) or (:) (all snapshots). Starts at 1 and out of bounds indices are ignored.halo_idx::Int=1
: Index of the target halo (FoF group). Starts at 1.tracers::Bool=false
: If tracers will be use to compute the mass accretion.smooth::Int=0
: The time series will be smoothed out usingsmooth
bins. Set it to 0 if you want no smoothing.output_path::String="."
: Path to the output folder.sim_labels::Union{Vector{<:AbstractString},Nothing}=nothing
: Labels for the plot legend, one per simulation. Set it tonothing
if you don't want a legend.theme::Attributes=Theme()
: Plot theme that will take precedence overDEFAULT_THEME
.