Computation of characteristic masses and mass related quantities
These functions are used internally and none are exported.
These functions depend on the particulars of the simulation code (e.g. units).
GalaxyInspector.computeAbundance
— MethodcomputeAbundance(
data_dict::Dict,
component::Symbol,
element::Symbol;
<keyword arguments>
)::Float64
Compute the abundance of a given element in each cell/particle of type component
. The abundance is defined as $n_X / n_H$ where $n_X$ is the number of atoms of element $X$ and $n_H$ the number of hydrogen atoms.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the abundance will be calculated. The possibilities are:stars
and:gas
.element::Symbol
: Target element. The possibilities are the keys ofELEMENT_INDEX
.solar::Bool=false
: If the result will be normalized to the solar abundance or not.
Returns
- The abundance of
element
in each cell/particle of typecomponent
.
GalaxyInspector.computeDiscAccretion
— MethodcomputeDiscAccretion(
present_dd::Dict,
past_dd::Dict;
<keyword arguments>
)::NTuple{3,Unitful.Mass}
Compute the inflow, outflow, and net gain of mass for a given cylinder, between two snapshots.
Arguments
present_dd::Dict
: A dictionary, for the present snapshot, 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
, ...).- ...
past_dd::Dict
: A dictionary, for the past snapshot, 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
, ...).- ...
max_r::Unitful.Length=DISK_R
: Radius of the cylinder.max_z::Unitful.Length=5.0u"kpc"
: Half height of the cylinder.
Returns
A tuple with three elements:
- The net increase in mass.
- The inflow mass.
- The outflow mass.
GalaxyInspector.computeElementMass
— MethodcomputeElementMass(
data_dict::Dict,
component::Symbol,
element::Symbol,
)::Vector{<:Unitful.Mass}
Compute the total mass of element
in each cell/particle.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the mass will be calculated. The possibilities are:stars
and:gas
.element::Symbol
: Target element. The possibilities are the keys ofELEMENT_INDEX
.
Returns
- The total mass of
element
in each cell/particle.
GalaxyInspector.computeFraction
— MethodcomputeFraction(data_dict::Dict, component::Symbol)::Vector{Float64}
Compute the fraction in each cell/particle of a given component
.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the fraction will be calculated. The options are::molecular
-> Molecular hydrogen ($\mathrm{H_2}$) fraction.:br_molecular
-> Molecular hydrogen ($\mathrm{H_2}$) fraction, computed using the pressure relation in Blitz et al. (2006).:atomic
-> Atomic hydrogen ($\mathrm{HI}$) fraction.:ionized
-> Ionized hydrogen ($\mathrm{HII}$) fraction.:neutral
-> Neutral hydrogen ($\mathrm{HI + H_2}$) fraction.:stellar
-> Stellar gas fraction (according to our SF model).:metals
-> Metallicity (according to our SF model).:dust
-> Dust fraction (according to our SF model).
Returns
- The fraction of
component
in each cell/particle.
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.computeGlobalAbundance
— MethodcomputeGlobalAbundance(
data_dict::Dict,
component::Symbol,
element::Symbol;
<keyword arguments>
)::Float64
Compute the total abundance of a given element, as $n_X / n_H$ where $n_X$ is the number of atoms of element $X$ and $n_H$ the number of hydrogen atoms.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the abundance will be calculated. The possibilities are:stars
and:gas
.element::Symbol
: Target element. The possibilities are the keys ofELEMENT_INDEX
.solar::Bool=false
: If the result will be normalized to the solar abundance or not.
Returns
- The total abundance of
element
.
GalaxyInspector.computeMass
— MethodcomputeMass(data_dict::Dict, component::Symbol)::Vector{<:Unitful.Mass}
Compute the mass in each cell/particle of a given component
.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the mass will be calculated. The options are::gas
-> Gas mass.:stars
-> Stellar mass.:hydrogen
-> Hydrogen mass.:helium
-> Helium mass.:dark_matter
-> Dark matter mass.:black_holes
-> Black hole mass.:molecular
-> Molecular hydrogen ($\mathrm{H_2}$) mass.:br_molecular
-> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006).:atomic
-> Atomic hydrogen ($\mathrm{HI}$) mass.:ionized
-> Ionized hydrogen ($\mathrm{HII}$) mass.:neutral
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass.:stellar
-> Stellar gas mass (according to our SF model).:metals
-> Metal mass (according to our SF model).:dust
-> Dust mass.
Returns
- The mass of
component
in each cell/particle.
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.computeMassFraction
— MethodcomputeMassFraction(
quantity::Vector{<:Number},
masses::Vector{<:Unitful.Mass},
qty_limits::Tuple{<:Number,<:Number},
)::Float64
Compute the fraction of the total mass "contained" within given values of quantity
.
Arguments
quantity::Vector{<:Number}
: Target quantity.masses::Vector{<:Unitful.Mass}
: Masses of the cells/particles.qty_limits::Tuple{<:Number,<:Number}
: Limits of the target quantity.
Returns
- The fraction of the total mass "contained" within given values of
quantity
.
GalaxyInspector.computeMassHeight
— MethodcomputeMassHeight(
positions::Matrix{<:Unitful.Length},
masses::Vector{<:Unitful.Mass};
<keyword arguments>
)::Unitful.Length
Compute the total height of a cylinder, of infinite radius, containing percent
% of the total mass.
Arguments
positions::Matrix{<:Unitful.Length}
: Positions of the cells/particles. Each column is a cell/particle and each row a dimension.masses::Vector{<:Unitful.Mass}
: Masses of the cells/particles.percent::Float64=90.0
: Target percentage of the total mass.
Returns
- The height containing
percent
% of the total mass.
GalaxyInspector.computeMassQty
— MethodcomputeMassQty(
quantity::Vector{<:Number},
masses::Vector{<:Unitful.Mass};
<keyword arguments>
)::Number
Compute the maximum value of quantity
that "contains" percent
% of the total mass.
Arguments
quantity::Vector{<:Number}
: Target quantity.masses::Vector{<:Unitful.Mass}
: Masses of the cells/particles.percent::Float64=90.0
: Target percentage of the total mass.
Returns
- The maximum value of
quantity
that "contains"percent
% of the total mass.
GalaxyInspector.computeMassRadius
— MethodcomputeMassRadius(
positions::Matrix{<:Unitful.Length},
masses::Vector{<:Unitful.Mass};
<keyword arguments>
)::Unitful.Length
Compute the radius containing percent
% of the total mass.
Arguments
positions::Matrix{<:Unitful.Length}
: Positions of the cells/particles. Each column is a cell/particle and each row a dimension.masses::Vector{<:Unitful.Mass}
: Masses of the cells/particles.percent::Float64=90.0
: Target percentage of the total mass.
Returns
- The radius containing
percent
% of the total mass.
GalaxyInspector.computeMetalMass
— MethodcomputeMetalMass(data_dict::Dict, component::Symbol)::Vector{<:Unitful.Mass}
Compute the total mass of metals (elements above helium) in each cell/particle.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the mass will be calculated. The possibilities are:stars
and:gas
.
Returns
- The total metal mass in each cell/particle.
GalaxyInspector.computeNumberDensity
— MethodcomputeNumberDensity(data_dict::Dict, component::Symbol)::Vector{<:NumberDensity}
Compute the number density in each cell/particle of a given component
.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the mass will be calculated. The options are::gas
-> Gas number density.:hydrogen
-> Hydrogen number density.:helium
-> Helium number density.:molecular
-> Molecular hydrogen ($\mathrm{H_2}$) number density.:br_molecular
-> Molecular hydrogen ($\mathrm{H_2}$) number density, computed using the pressure relation in Blitz et al. (2006).:atomic
-> Atomic hydrogen ($\mathrm{HI}$) number density.:ionized
-> Ionized hydrogen ($\mathrm{HII}$) number density.:neutral
-> Neutral hydrogen ($\mathrm{HI + H_2}$) number density.
Returns
- The number density of
component
in each cell/particle.
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.computeVirialAccretion
— MethodcomputeVirialAccretion(
present_dd::Dict,
past_dd::Dict;
<keyword arguments>
)::NTuple{3,Unitful.Mass}
Compute the inflow, outflow, and net gain of mass for a given halo virial radius ($R_{200}$), between two snapshots.
Arguments
present_dd::Dict
: A dictionary, for the present snapshot, 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
, ...).- ...
past_dd::Dict
: A dictionary, for the past snapshot, 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
, ...).- ...
halo_idx::Int=1
: Index of the target halo (FoF group). Starts at 1.
Returns
A tuple with three elements:
- The net increase in mass.
- The inflow mass.
- The outflow mass.
GalaxyInspector.computeVolumeDensity
— MethodcomputeVolumeDensity(data_dict::Dict, component::Symbol)::Vector{<:Unitful.Density}
Compute the volume mass density in each cell/particle of a given component
.
Arguments
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
, ...).- ...
component::Symbol
: For which cell/particle type the mass will be calculated. The options are::gas
-> Gas mass density.:hydrogen
-> Hydrogen mass density.:helium
-> Helium mass density.:molecular
-> Molecular hydrogen ($\mathrm{H_2}$) mass density.:br_molecular
-> Molecular hydrogen ($\mathrm{H_2}$) mass density, computed using the pressure relation in Blitz et al. (2006).:atomic
-> Atomic hydrogen ($\mathrm{HI}$) mass density.:ionized
-> Ionized hydrogen ($\mathrm{HII}$) mass density.:neutral
-> Neutral hydrogen ($\mathrm{HI + H_2}$) mass density.:stellar
-> Stellar mass density (according to our SF model).:metals
-> Metal mass density (according to our SF model).:dust
-> Dust mass density.
Returns
- The density of
component
in each cell/particle.
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