Data analysis functions

These functions are used internally and none are exported.

These functions depend on the particulars of the simulation code (e.g. units).

These functions read the data generated by the data acquisition functions, and produce the values that will be plotted.

Signature for the plotSnapshot function

A data analysis functions for plotSnapshot must take a dictionary with the following shape:

  • :sim_data -> ::Simulation (see Simulation).
  • :snap_data -> ::Snapshot (see Snapshot).
  • :gc_data -> ::GroupCatalog (see GroupCatalog).
  • cell/particle type -> (block -> data of block, block -> data of block, ...).
  • cell/particle type -> (block -> data of block, block -> data of block, ...).
  • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
  • groupcat type -> (block -> data of block, block -> data of block, ...).
  • groupcat type -> (block -> data of block, block -> data of block, ...).
  • groupcat type -> (block -> data of block, block -> data of block, ...).
  • ...

and return one or more vectors or matrices with the processed data. It should return nothing if the input data has some problem that prevents computation (e.g. is empty).

Expected signature:

  da_function(data_dict, args...; kwargs...) -> (processed_data, ...)

where:

  • data_dict::Dict
  • processed_data::Union{VecOrMat{<:Number},Nothing}

Signature for the plotTimeSeries function

A data analysis functions for plotTimeSeries must take a Simulation struct, and return two vectors. It should return nothing if the input data has some problem that prevents computation (e.g. is empty).

Expected signature:

  da_function(sim_data, args...; kw_args...) -> (processed_data_x, processed_data_y)

where:

  • sim_data::Simulation, see Simulation
  • processed_data_x::Vector{<:Number}
  • processed_data_y::Vector{<:Number}

GalaxyInspector.daBandProfileMethod
daBandProfile(
    data_dict::Dict,
    quantity::Symbol,
    grid::CircularGrid;
    <keyword arguments>
)::Union{
    Tuple{Vector{<:Unitful.Length},Vector{<:Number},Vector{<:Number},Vector{<:Number}},
    Tuple{Vector{<:Unitful.Length},Vector{<:Number},Vector{<:Number}},
    Nothing,
}

Compute the profile of a mean quantity with error bars or bands.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • quantity::Symbol: Target quantity. 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).
    • :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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • grid::CircularGrid: Circular grid.

  • flat::Bool=true: If the profile will be 2D, using rings, or 3D, using spherical shells.

  • error_bar::Bool=false: If the returned values will be compatible with errorbars! or with band! (default).

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the position of each ring or spherical shells.
    • A vector with the value quantity in each each ring or spherical shells.

    It returns nothing if any of the necessary quantities are missing.

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

source
GalaxyInspector.daCPUtxtMethod
daCPUtxt(
    sim_data::Simulation,
    target::String,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the evolution of a measured quantity in the cpu.txt file, for a given target process.

Arguments

  • sim_data::Simulation: Information about the simulation in a Simulation object.

  • 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 using smooth bins. Set it to 0 if you want no smoothing.

Returns

  • A Tuple with two elements:

    • A Vector with the time series of x_quantity.
    • A Vector with the time series of y_quantity.
source
GalaxyInspector.daClumpingFactorMethod
daClumpingFactor(
    data_dict::Dict,
    quantity::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Volume},Vector{Float64}}

Compute the clumping factor ($C_\rho$), for the number density of quantity, at different volume scales.

\[C_\rho = \frac{\langle n^2 \rangle}{\langle n \rangle^2} \, ,\]

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the volumes.
    • A vector with the clumping factors.

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

source
GalaxyInspector.daClumpingFactorProfileMethod
daClumpingFactorProfile(
    data_dict::Dict,
    quantity::Symbol,
    grid::CircularGrid;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{Float64}}

Compute a clumping factor ($C_\rho$) profile, for the number density of quantity.

\[C_\rho = \frac{\langle n^2 \rangle}{\langle n \rangle^2} \, ,\]

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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.
  • grid::CircularGrid: Circular grid.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the central position of each bin.
    • A vector with the clumping factors.

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

source
GalaxyInspector.daDensity2DProjectionMethod
daDensity2DProjection(
    data_dict::Dict,
    grid::CubicGrid,
    quantity::Symbol,
    field_type::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Length},Union{Matrix{Float64},Vector{Float64}}}

Project a 3D density field into a given plane.

Note

If the source of the field are particles, a simple 2D histogram is used. If they are Voronoi cells instead, the density of the cells that cross the line of sight of each pixel are added up.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • quantity::Symbol: Which density will be calculated. The options are:

    • :stellar_mass -> Stellar density.
    • :gas_mass -> Gas density.
    • :hydrogen_mass -> Hydrogen density.
    • :dm_mass -> Dark matter density.
    • :bh_mass -> Black hole 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.
    • :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.
  • field_type::Symbol: If the source of the field are :particles or Voronoi :cells.

  • reduce_factor::Int=1: Factor by which the resolution of the result will be reduced. This will be applied after the density projection. If reduce_grid = :square, the new values will be computed averaging the values of neighboring pixels. reduce_factor has to divide the size of grid exactly. If reduce_grid = :circular, the new values will be computed averaging the values of the pixels the fall within each of the reduce_factor concentric rings.

  • reduce_grid::Symbol=:square: Type of grid to reduce the resolution of the result. The options are:

    • :square -> The density distribution will be reduced into a regular square grid, with a resolution reduce_factor times lower than grid. This emulates the way the surface densities are measured in observations. reduce_factor = 1 means no reduction in resolution.
    • :circular -> The density distribution will be reduced into a flat circular grid, formed by a series of reduce_factor concentric rings. This emulates the traditional way the Kennicutt-Schmidt law is measured in simulations. reduce_factor = 1 means that the result will be a single point, the opposite of the reduce_grid = :square case.
  • projection_plane::Symbol=:xy: Projection plane. The options are :xy, :xz, and :yz. The disk is generally oriented to have its axis of rotation parallel to the z axis.

  • m_unit::Unitful.Units=u"Msun": Mass unit.

  • l_unit::Unitful.Units=u"kpc": Length unit.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the $\log_{10}$ of the density at each point of the 2D grid.

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

source
GalaxyInspector.daDiscAccretionMethod
daDiscAccretion(
    sim_data::Simulation;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the evolution of the accreted mass into the disc.

Arguments

  • sim_data::Simulation: Information about the simulation in a Simulation object.

  • 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 radius DISK_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) as the new origin. It can be any of the keys of PARTICLE_INDEX.
        • (halo_idx, subhalo_rel_idx) -> Sets the position of the potential minimum for the subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo) as the new origin.
        • (halo_idx, 0) -> Sets the center of mass of the halo_idx::Int halo as the new origin.
        • subhalo_abs_idx -> Sets the center of mass of the subhalo_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 in subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo), as the new coordinate system.
        • (halo_idx, 0) -> Sets the principal axis of the stars in the halo_idx::Int halo, as the new coordinate system.
        • subhalo_abs_idx -> Sets the principal axis of the stars in the subhalo_abs_idx::Int subhalo as the new coordinate system.
  • 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 using smooth bins. Set it to 0 if you want no smoothing.

Returns

  • A Tuple with two elements:

    • A Vector with the physical times.
    • A Vector with the accreted mass at each time.
source
GalaxyInspector.daEvolutionMethod
daEvolution(
    sim_data::Simulation,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the time series of two quantities.

Arguments

  • sim_data::Simulation: Information about the simulation in a Simulation object.

  • 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 of DISK_R.
    • :gas_area_density -> Gas mass surface density, for a radius of DISK_R.
    • :molecular_area_density -> Molecular mass surface density, for a radius of DISK_R.
    • :br_molecular_area_density -> Molecular mass surface density, for a radius of DISK_R, computed using the pressure relation in Blitz et al. (2006).
    • :atomic_area_density -> Atomic hydrogen area mass density, for a radius of DISK_R.
    • :ionized_area_density -> Ionized hydrogen area mass density, for a radius of DISK_R.
    • :neutral_area_density -> Neutral mass surface density, for a radius of DISK_R.
    • :sfr_area_density -> Star formation rate area density, for the last AGE_RESOLUTION and a radius of DISK_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of DISK_R.
    • :gas_area_density -> Gas mass surface density, for a radius of DISK_R.
    • :molecular_area_density -> Molecular mass surface density, for a radius of DISK_R.
    • :br_molecular_area_density -> Molecular mass surface density, for a radius of DISK_R, computed using the pressure relation in Blitz et al. (2006).
    • :atomic_area_density -> Atomic hydrogen area mass density, for a radius of DISK_R.
    • :ionized_area_density -> Ionized hydrogen area mass density, for a radius of DISK_R.
    • :neutral_area_density -> Neutral mass surface density, for a radius of DISK_R.
    • :sfr_area_density -> Star formation rate area density, for the last AGE_RESOLUTION and a radius of DISK_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • integration_functions::NTuple{2,Function}=(integrateQty, integrateQty): Functions to compute the integral value of x_quantity and y_quantity at a given time. The functions must have the signature:

    integration_functions(data_dict::Dict, quantity::Symbol)::Number

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • quantity::Symbol: The quantity to be integrated. The options are the same as for x_quantity and y_quantity.

  • 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 radius DISK_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) as the new origin. It can be any of the keys of PARTICLE_INDEX.
        • (halo_idx, subhalo_rel_idx) -> Sets the position of the potential minimum for the subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo) as the new origin.
        • (halo_idx, 0) -> Sets the center of mass of the halo_idx::Int halo as the new origin.
        • subhalo_abs_idx -> Sets the center of mass of the subhalo_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 in subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo), as the new coordinate system.
        • (halo_idx, 0) -> Sets the principal axis of the stars in the halo_idx::Int halo, as the new coordinate system.
        • subhalo_abs_idx -> Sets the principal axis of the stars in the subhalo_abs_idx::Int subhalo as the new coordinate system.
  • extra_filter::Function=filterNothing: Filter function that will be applied after the one given by filter_mode.

  • ff_request::Dict{Symbol,Vector{String}}=Dict{Symbol,Vector{String}}(): Request dictionary for the extra_filter filter function.

  • smooth::Int=0: The result of integrateQty will be smoothed out using smooth bins. Set it to 0 if you want no smoothing.

  • cumulative::Bool=false: If the y_quantity will be accumulated or not.

  • fraction::Bool=false: If the y_quantity will be represented as a fraction of the last value. If cumulative = true, this will apply to the accumulated values.

  • scaling::Function=identity: Function to scale the x-axis (only relevant if smooth != 0). The bins will be computed accordingly. The options are the scaling functions accepted by Makie.jl: log10, log2, log, sqrt, Makie.logit, Makie.Symlog10, Makie.pseudolog10, and identity.

Returns

  • A Tuple with two elements:

    • A Vector with the time series of x_quantity.
    • A Vector with the time series of y_quantity.

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

source
GalaxyInspector.daGasFractionsMethod
daGasFractions(
    data_dict::Dict,
    quantity::Symbol,
    edges::Vector{<:Number};
    <keyword arguments>
)::Union{NTuple{2,Vector{<:Number}},Nothing}

Compute the values for a bar plot of the gas fractions, where the bins are a given gas quantity.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • quantity::Symbol: Target quantity for the bins. 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_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 of ELEMENT_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.
    • :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 for quantity.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the positions of each bar.
    • A vector with the height of each bar.

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

source
GalaxyInspector.daGasSFR2DProjectionMethod
daGasSFR2DProjection(
    data_dict::Dict,
    grid::CubicGrid,
    field_type::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Length},Union{Matrix{Float64},Vector{Float64}}}

Project the 3D gas SFR field into a given plane.

Note

If the source of the field are particles, a simple 2D histogram is used. If they are Voronoi cells instead, the SFR of the cells that cross the line of sight of each pixel are added up.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • field_type::Symbol: If the source of the field are :particles or Voronoi :cells.

  • reduce_factor::Int=1: Factor by which the resolution of the result will be reduced. This will be applied after the density projection. If reduce_grid = :square, the new values will be computed adding up the values of neighboring pixels. reduce_factor has to divide the size of grid exactly. If reduce_grid = :circular, the new values will be computed adding up the values of the pixels the fall within each of the reduce_factor concentric rings.

  • reduce_grid::Symbol=:square: Type of grid to reduce the resolution of the result. The options are:

    • :square -> The density distribution will be reduced into a regular square grid, with a resolution reduce_factor times lower than grid. This emulates the way the surface densities are measured in observations. reduce_factor = 1 means no reduction in resolution.
    • :circular -> The density distribution will be reduced into a flat circular grid, formed by a series of reduce_factor concentric rings. This emulates the traditional way the Kennicutt-Schmidt law is measured in simulations. reduce_factor = 1 means that the result will be a single point, the opposite of the reduce_grid = :square case.
  • projection_plane::Symbol=:xy: Projection plane. The options are :xy, :xz, and :yz. The disk is generally oriented to have its axis of rotation parallel to the z axis.

  • m_unit::Unitful.Units=u"Msun": Mass unit.

  • l_unit::Unitful.Units=u"kpc": Length unit.

  • t_unit::Unitful.Units=u"yr": Time unit.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the $\log_{10}$ of the gas SFR at each point of the 2D grid.
source
GalaxyInspector.daIntegrateGalaxyMethod
daIntegrateGalaxy(
    data_dict::Dict,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute two global quantities of the simulation.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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 of DISK_R.
    • :gas_area_density -> Gas mass surface density, for a radius of DISK_R.
    • :molecular_area_density -> Molecular mass surface density, for a radius of DISK_R.
    • :br_molecular_area_density -> Molecular mass surface density, for a radius of DISK_R, computed using the pressure relation in Blitz et al. (2006).
    • :atomic_area_density -> Atomic hydrogen area mass density, for a radius of DISK_R.
    • :ionized_area_density -> Ionized hydrogen area mass density, for a radius of DISK_R.
    • :neutral_area_density -> Neutral mass surface density, for a radius of DISK_R.
    • :sfr_area_density -> Star formation rate area density, for the last AGE_RESOLUTION and a radius of DISK_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of DISK_R.
    • :gas_area_density -> Gas mass surface density, for a radius of DISK_R.
    • :molecular_area_density -> Molecular mass surface density, for a radius of DISK_R.
    • :br_molecular_area_density -> Molecular mass surface density, for a radius of DISK_R, computed using the pressure relation in Blitz et al. (2006).
    • :atomic_area_density -> Atomic hydrogen area mass density, for a radius of DISK_R.
    • :ionized_area_density -> Ionized hydrogen area mass density, for a radius of DISK_R.
    • :neutral_area_density -> Neutral mass surface density, for a radius of DISK_R.
    • :sfr_area_density -> Star formation rate area density, for the last AGE_RESOLUTION and a radius of DISK_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • filter_function::Function=filterNothing: A function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A single element vector with the value of x_quantity.
    • A single element vector with the value of y_quantity.

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

source
GalaxyInspector.daKennicuttSchmidtLawMethod
daKennicuttSchmidtLaw(
    data_dict::Dict,
    grid::CubicGrid,
    quantity::Symbol;
    <keyword arguments>
)::Union{NTuple{2,Vector{<:Float64}},Nothing}

Compute the gas mass surface density and the SFR surface density, used in the Kennicutt-Schmidt law.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • quantity::Symbol=:molecular_mass: Quantity for the x axis. The options are:

    • :gas_mass -> Gas mass surface density. This one will be plotted with the results of Kennicutt (1998).
    • :molecular_mass -> Molecular mass surface density. This one will be plotted with the results of Bigiel et al. (2008).
    • :br_molecular_mass -> Molecular hydrogen ($\mathrm{H_2}$) mass, computed using the pressure relation in Blitz et al. (2006). This one will be plotted with the results of Bigiel et al. (2008).
    • :neutral_mass -> Neutral mass surface density. This one will be plotted with the results of Bigiel et al. (2008).
  • type::Symbol=:cells: If the gas surface density will be calculated assuming the gas is in :particles or in Voronoi :cells.

  • 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 of grid exactly.

  • stellar_ff::Function=filterNothing: Filter function for the stars. It has to be a function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...
  • gas_ff::Function=filterNothing: Filter function for the gas. It has to be a function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with log10(ΣH / M⊙ * kpc^-2).
    • A vector with log10(Σsfr / M⊙ * yr^-1 * kpc^-2).

    It returns nothing if any of the necessary quantities are missing.

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

source
GalaxyInspector.daLineHistogramMethod
daLineHistogram(
    data_dict::Dict,
    quantity::Symbol,
    grid::LinearGrid;
    <keyword arguments>
)::Union{Tuple{Vector{<:Number},Vector{<:Number}},Nothing}

Compute a 1D histogram of a given quantity, normalized to the maximum number of counts.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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).
    • :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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • grid::LinearGrid: Linear grid.

  • type::Symbol: Type of cell/particle.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...
  • 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.

Returns

  • A tuple with two elements:

    • A vector with the value corresponding to each bin.
    • A vector with the counts, normalized to the maximum value.

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

source
GalaxyInspector.daMetallicity2DProjectionMethod
daMetallicity2DProjection(
    data_dict::Dict,
    grid::CubicGrid,
    component::Symbol,
    field_type::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Length},Union{Matrix{Float64},Vector{Float64}}}

Project the 3D metallicity field to a given plane.

Note

The metallicity in each pixel is the total metal mass divided by the total gas mass, in the column given by that pixel. By default, the total metallicity (element = :all) is given in solar units.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • component::Symbol: Target component. It can be either :stars or :gas.

  • field_type::Symbol: If the source of the field are :particles or Voronoi :cells.

  • element::Symbol=:all: Target element. The possibilities are the keys of ELEMENT_INDEX. Set it to :all if you want the total metallicity.

  • reduce_factor::Int=1: Factor by which the resolution of the result will be reduced. This will be applied after the density projection. If reduce_grid = :square, the new values will be computed adding the values of mass in each neighboring pixel. reduce_factor has to divide the size of grid exactly. If reduce_grid = :circular, the new values will be computed adding up the values of mass of the pixels the fall within each of the reduce_factor concentric rings.

  • reduce_grid::Symbol=:square: Type of grid to reduce the resolution of the result. The options are:

    • :square -> The density distribution will be reduced into a regular square grid, with a resolution reduce_factor times lower than grid. This emulates the way the surface densities are measured in observations. reduce_factor = 1 means no reduction in resolution.
    • :circular -> The density distribution will be reduced into a flat circular grid, formed by a series of reduce_factor concentric rings. This emulates the traditional way the Kennicutt-Schmidt law is measured in simulations. reduce_factor = 1 means that the result will be a single point, the opposite of the reduce_grid = :square case.
  • projection_plane::Symbol=:xy: Projection plane. The options are :xy, :xz, and :yz. The disk is generally oriented to have its axis of rotation parallel to the z axis.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the $\log_{10}$ of the metallicity at each point of the 2D grid.
source
GalaxyInspector.daMolla2015Method
daMolla2015(
    data_dict::Dict,
    grid::CircularGrid,
    quantity::Symbol;
    <keyword arguments>
)::Union{
    Tuple{
        Vector{<:Unitful.Length},
        <:Union{Vector{<:SurfaceDensity},Vector{<:MassFlowDensity},Vector{Float64}}
    },
    Nothing,
}

Compute a profile for the Milky Way, compatible with the experimental data in Mollá et al. (2015).

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CircularGrid: Circular grid.

  • quantity::Symbol: Quantity. 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 last AGE_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})$.
  • filter_function::Function=filterNothing: A function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the position of each ring.
    • A vector with the quantity area density of each ring.

    It returns nothing if any of the necessary quantities are missing.

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

source
GalaxyInspector.daProfileMethod
daProfile(
    data_dict::Dict,
    quantity::Symbol,
    grid::CircularGrid;
    <keyword arguments>
)::Union{Tuple{Vector{<:Unitful.Length},Vector{<:Number}},Nothing}

Compute a profile.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • quantity::Symbol: Target quantity. The options are the same as for scatterQty:

    • :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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • grid::CircularGrid: Circular grid.

  • flat::Bool=true: If the profile will be 2D, using rings, or 3D, using spherical shells.

  • total::Bool=true: If the sum (default) or the mean of quantity will be computed for each bin.

  • cumulative::Bool=false: If the profile will be accumulated or not.

  • density::Bool=false: If the profile will be of the density of quantity.

  • fractions::Bool=false: If a profile of the gas mass fractions will be calculated. It is only valid with quantity equal to :neutralmass, :molecularmass, :brmolecularmass, :atomicmass, :ionizedmass, :stellargasmass, :metalgasmass or :dust_mass, and it forces total = true, cumulative = false, and density = false.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the position of each ring or spherical shells.
    • A vector with the value quantity in each each ring or spherical shells.

    It returns nothing if any of the necessary quantities are missing.

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

source
GalaxyInspector.daRotationCurveMethod
daRotationCurve(
    data_dict::Dict,
    R::Unitful.Length;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Velocity}}

Compute a rotation curve.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • R::Unitful.Length: Maximum radius.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the distances to each star.
    • A vector with the circular velocity of each star.
source
GalaxyInspector.daSFRtxtMethod
daSFRtxt(
    sim_data::Simulation,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the stellar mass or SFR evolution using the data in the sfr.txt file.

Arguments

  • sim_data::Simulation: Information about the simulation in a Simulation object.

  • x_quantity::Symbol: Quantity for the x axis. The options are:

    • :scale_factor -> Scale factor.
    • :redshift -> Redshift.
    • :physical_time -> Physical time since the Big Bang.
    • :lookback_time -> Physical time left to reach the last snapshot.
  • 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 using smooth bins. Set it to 0 if you want no smoothing.

Returns

  • A Tuple with two elements:

    • A Vector with the time series of x_quantity.
    • A Vector with the time series of y_quantity.
source
GalaxyInspector.daScatterDensityMethod
daScatterDensity(
    data_dict::Dict,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Number},Vector{<:Number},Matrix{Float64}}

Turn a scatter plot into a 2D histogram.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • x_range::Union{NTuple{2,<:Number},Nothing}=nothing: x axis range for the histogram grid. If set to nothing, the extrema of the values will be used.

  • y_range::Union{NTuple{2,<:Number},Nothing}=nothing: y axis range for the histogram grid. If set to nothing, the extrema of the values will be used.

  • x_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of x_quantity, if you want to use log10(x_quantity) for the x axis.

  • y_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of y_quantity, if you want to use log10(y_quantity) for the y axis.

  • n_bins::Int=100: Number of bins per side of the grid.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the the log10 of the counts.

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

source
GalaxyInspector.daScatterGalaxyMethod
daScatterGalaxy(
    data_dict::Dict,
    x_quantity::Symbol,
    y_quantity::Symbol;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute two quantities for every cell/particle in the simulation.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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.
  • x_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of x_quantity, if you want to use log10(x_quantity) for the x axis.

  • y_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of y_quantity, if you want to use log10(y_quantity) for the y axis.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the values of x_quantity.
    • A vector with the values of y_quantity.

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

source
GalaxyInspector.daScatterWeightedDensityMethod
daScatterWeightedDensity(
    data_dict::Dict,
    x_quantity::Symbol,
    y_quantity::Symbol,
    z_quantity::Symbol,
    z_unit::Unitful.Units;
    <keyword arguments>
)::Tuple{Vector{<:Number},Vector{<:Number},Matrix{Float64}}

Turn a scatter plot into a 2D histogram, weighted by z_quantity.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • 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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 of ELEMENT_INDEX.
    • :X_stellar_abundance -> Stellar abundance of element $\mathrm{X}$, as $12 + \log_{10}(\mathrm{X \, / \, H})$. The possibilities are the keys of ELEMENT_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 last AGE_RESOLUTION.
    • :observational_ssfr -> The specific star formation rate of the last AGE_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 for the histogram grid. If set to nothing, the extrema of the values will be used.

  • y_range::Union{NTuple{2,<:Number},Nothing}=nothing: y axis range for the histogram grid. If set to nothing, the extrema of the values will be used.

  • x_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of x_quantity, if you want to use log10(x_quantity) for the x axis.

  • y_log::Union{Unitful.Units,Nothing}=nothing: Desired unit of y_quantity, if you want to use log10(y_quantity) for the y axis.

  • total::Bool=true: If the sum (default) or the mean of z_quantity will be used as the value of each pixel.

  • n_bins::Int=100: Number of bins per side of the grid.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the log10 of the weights (z_quantity) for each bin.

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

source
GalaxyInspector.daStellarBTHistogramMethod
daStellarBTHistogram(data_dict::Dict)::Union{Tuple{Vector{<:Unitful.Time}},Nothing}

Compute the stellar birth times, for an histogram.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...

Returns

  • A Tuple with one elements:

    • A Vector with the birth times.
source
GalaxyInspector.daStellarHistoryMethod
daStellarHistory(
    data_dict::Dict;
    <keyword arguments>
)::Union{Tuple{Vector{<:Unitful.Time},Vector{<:Number}},Nothing}

Compute the evolution of a given stellar quantity using the stellar ages at a given instant in time.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • quantity::Symbol=:sfr: Target quantity. 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).
  • n_bins::Int=100: Number of bins (time intervals).

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with the physical times.
    • A vector with the values of quantity at each time.
source
GalaxyInspector.daStellarMetallicityHistogramMethod
daStellarMetallicityHistogram(data_dict::Dict)::Union{Tuple{Vector{Float64}},Nothing}

Compute the stellar metallicity (in SOLAR_METALLICITY units), for an histogram.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...

Returns

  • A Tuple with one elements:

    • A Vector with the stellar metallicites.
source
GalaxyInspector.daTemperature2DProjectionMethod
daTemperature2DProjection(
    data_dict::Dict,
    grid::CubicGrid,
    field_type::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Length},Union{Matrix{Float64},Vector{Float64}}}

Project the 3D temperature field to a given plane.

Note

The temperature in each pixel is the mean temperature of the column given by that pixel. By default, $K$ is used as unit of temperature, so the output will be $\log_{10}(T \, [\mathrm{K}])$.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • field_type::Symbol: If the source of the field are :particles or Voronoi :cells.

  • reduce_factor::Int=1: Factor by which the resolution of the result will be reduced. This will be applied after the density projection. If reduce_grid = :square, the new values will be computed averaging the values of neighboring pixels. reduce_factor has to divide the size of grid exactly. If reduce_grid = :circular, the new values will be computed averaging the values of the pixels the fall within each of the reduce_factor concentric rings.

  • reduce_grid::Symbol=:square: Type of grid to reduce the resolution of the result. The options are:

    • :square -> The density distribution will be reduced into a regular square grid, with a resolution reduce_factor times lower than grid. This emulates the way the surface densities are measured in observations. reduce_factor = 1 means no reduction in resolution.
    • :circular -> The density distribution will be reduced into a flat circular grid, formed by a series of reduce_factor concentric rings. This emulates the traditional way the Kennicutt-Schmidt law is measured in simulations. reduce_factor = 1 means that the result will be a single point, the opposite of the reduce_grid = :square case.
  • projection_plane::Symbol=:xy: Projection plane. The options are :xy, :xz, and :yz. The disk is generally oriented to have its axis of rotation parallel to the z axis.

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with three elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the values of temperature at each grid point.
source
GalaxyInspector.daTrajectoryMethod
daTrajectory(
    simulation_path::String,
    target_ids::Vector{UInt64};
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the trajectory of a set of cells/particles, given their IDs.

Arguments

  • simulation_path::String: Path to the simulation directory, set in the code variable OutputDir.

  • target_ids::Vector{UInt64}: IDs of the cells/particles whose trajectory will be computed.

  • 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 radius DISK_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) as the new origin. It can be any of the keys of PARTICLE_INDEX.
        • (halo_idx, subhalo_rel_idx) -> Sets the position of the potential minimum for the subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo) as the new origin.
        • (halo_idx, 0) -> Sets the center of mass of the halo_idx::Int halo as the new origin.
        • subhalo_abs_idx -> Sets the center of mass of the subhalo_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 in subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo), as the new coordinate system.
        • (halo_idx, 0) -> Sets the principal axis of the stars in the halo_idx::Int halo, as the new coordinate system.
        • subhalo_abs_idx -> Sets the principal axis of the stars in the subhalo_abs_idx::Int subhalo as the new coordinate system.
  • component::Symbol: Type of cell/particle. The possibilities are the keys of PARTICLE_INDEX.

Returns

  • A dictionary with the following shape:

    • target_id::UInt64 -> A matrix with the trajectory of the cell/particle with ID target_id. The matrix has 7 rows, where:

      • Row 1: Physical time.
      • Rows 2-4: Position [x, y, z].
      • Rows 5-7: Velocity [vx, vy, vz].

    If the target ID is not found at a given physical time the position and velocity are NaN.

source
GalaxyInspector.daVSFLawMethod
daVSFLaw(
    data_dict::Dict,
    grid::CubicGrid,
    quantity::Symbol;
    <keyword arguments>
)::Union{NTuple{2,Vector{<:Float64}},Nothing}

Compute the gas mass density and the SFR density, used in the volumetric star formation (VSF) law.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::CubicGrid: Cubic grid.

  • 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.

  • stellar_ff::Function=filterNothing: Filter function for the stars. It has to be a function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...
  • gas_ff::Function=filterNothing: Filter function for the gas. It has to be a function with the signature:

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with two elements:

    • A vector with log10(ρH / M⊙ * pc^-3).
    • A vector with log10(ρsfr / M⊙ * yr^-1 * kpc^-3).

    It returns nothing if any of the necessary quantities are missing.

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

source
GalaxyInspector.daVelocityFieldMethod
daVelocityField(
    data_dict::Dict,
    grid::SquareGrid,
    component::Symbol;
    <keyword arguments>
)::Tuple{Vector{<:Unitful.Length},Vector{<:Unitful.Length},Matrix{<:Number},Matrix{<:Number}}

Compute a 2D mean velocity field.

Arguments

  • data_dict::Dict: A dictionary with the following shape:

    • :sim_data -> ::Simulation (see Simulation).
    • :snap_data -> ::Snapshot (see Snapshot).
    • :gc_data -> ::GroupCatalog (see GroupCatalog).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • cell/particle type -> (block -> data of block, block -> data of block, ...).
    • ...
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • groupcat type -> (block -> data of block, block -> data of block, ...).
    • ...
  • grid::SquareGrid: Square grid.

  • component::Symbol: For which cell/particle type the velocity field will be computed. The possibilities are the keys of PARTICLE_INDEX.

  • projection_plane::Symbol=:xy: Projection plane. The options are :xy, :xz, and :yz. The disk is generally oriented to have its axis of rotation parallel to the z axis.

  • velocity_units::Bool=false: If the velocity will be given as an Unitful.Quantity with units or as a Float64 (in which case the underlying unit is $\mathrm{km} \, \mathrm{s}^{-1}$).

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

    filter_function(data_dict) -> indices

    where

    • data_dict::Dict: A dictionary with the following shape:

      • :sim_data -> ::Simulation (see Simulation).
      • :snap_data -> ::Snapshot (see Snapshot).
      • :gc_data -> ::GroupCatalog (see GroupCatalog).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • cell/particle type -> (block -> data of block, block -> data of block, ...).
      • ...
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • groupcat type -> (block -> data of block, block -> data of block, ...).
      • ...
    • indices::Dict: A dictionary with the following shape:

      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • cell/particle type -> idxs::IndexType
      • ...

Returns

  • A tuple with four elements:

    • A vector with the x coordinates of the grid.
    • A vector with the y coordinates of the grid.
    • A matrix with the mean velocity in the x direction at each grid point.
    • A matrix with the mean velocity in the y direction at each grid point.
source
GalaxyInspector.daVirialAccretionMethod
daVirialAccretion(
    sim_data::Simulation;
    <keyword arguments>
)::NTuple{2,Vector{<:Number}}

Compute the evolution of the accreted mass into the virial radius.

Arguments

  • sim_data::Simulation: Information about the simulation in a Simulation object.

  • filter_mode::Union{Symbol,Dict{Symbol,Any}}=:all: Which cells/particles will be plotted. Only valid if tracers = true. 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 radius DISK_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) as the new origin. It can be any of the keys of PARTICLE_INDEX.
        • (halo_idx, subhalo_rel_idx) -> Sets the position of the potential minimum for the subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo) as the new origin.
        • (halo_idx, 0) -> Sets the center of mass of the halo_idx::Int halo as the new origin.
        • subhalo_abs_idx -> Sets the center of mass of the subhalo_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 in subhalo_rel_idx::Int subhalo (of the halo_idx::Int halo), as the new coordinate system.
        • (halo_idx, 0) -> Sets the principal axis of the stars in the halo_idx::Int halo, as the new coordinate system.
        • subhalo_abs_idx -> Sets the principal axis of the stars in the subhalo_abs_idx::Int subhalo as the new coordinate system.
  • 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. If false, filter_mode will be ignored.

  • smooth::Int=0: The time series will be smoothed out using smooth bins. Set it to 0 if you want no smoothing.

Returns

  • A Tuple with two elements:

    • A Vector with the physical times.
    • A Vector with the accreted mass at each time.
source