Tracer functions

These functions are used internally and none are exported.

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


GalaxyInspector.findTracersMethod
findTracers(data_dict::Dict; <keyword arguments>)::Vector{UInt}

Find the tracers whose parents are allowed by filter_function.

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, ...).
    • ...
  • 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 vector with the IDs of the tracers.
source
GalaxyInspector.parentIDToIndexMethod
parentIDToIndex(
    data_dict::Dict,
    target_ids::Vector{UInt},
)::Dict{Symbol,Vector{Int}}

Find the indices of the cells/particles with IDs given by target_ids.

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, ...).
    • ...
  • target_ids::Vector{UInt}: List of tracer IDs.

Returns

  • A dictionary with the following shape:

    • cell/particle type -> idxs::Int
    • cell/particle type -> idxs::Int
    • cell/particle type -> idxs::Int
    • ...
source
GalaxyInspector.parentToTracerIDMethod
parentToTracerID(data_dict::Dict, target_ids::Vector{UInt})::Vector{UInt}

Find the IDs of the tracers corresponding to a given list of parent IDs.

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, ...).
    • ...
  • target_ids::Vector{UInt}: List of parent IDs.

Returns

  • A vector with the IDs of the tracers.
source
GalaxyInspector.tracerToParentIDMethod
tracerToParentID(data_dict::Dict, target_ids::Vector{UInt})::Vector{UInt}

Find the IDs of the parents corresponding to a given list of tracer IDs.

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, ...).
    • ...
  • target_ids::Vector{UInt}: List of tracer IDs.

Returns

  • A vector with the IDs of the parents.
source
GalaxyInspector.tracersToMassMethod
tracersToMass(
    data_dict::Dict,
    target_ids::Vector{UInt},
)::Dict{Symbol,Vector{<:Unitful.Mass}}

Find the masses of the parent cells/particles of the tracers with IDs target_ids.

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, ...).
    • ...
  • target_ids::Vector{UInt}: List of tracer IDs.

Returns

  • A dictionary with the following shape:

    • cell/particle type -> masses::Vector{<:Unitful.Mass}
    • cell/particle type -> masses::Vector{<:Unitful.Mass}
    • cell/particle type -> masses::Vector{<:Unitful.Mass}
    • ...
source
GalaxyInspector.tracersWithinDiscMethod
tracersWithinDisc(data_dict::Dict; <keyword arguments>)::Vector{UInt}

Find the tracers whose parents are within a given cylinder.

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, ...).
    • ...
  • max_r::Unitful.Length=DISK_R: Radius of the cylinder.

  • max_z::Unitful.Length=5.0u"kpc": Half height of the cylinder.

Returns

  • A vector with the IDs of the tracers.
source
GalaxyInspector.tracersWithinR200Method
tracersWithinR200(data_dict::Dict; <keyword arguments>)::Vector{UInt}

Find the tracers whose parents are within the virial radius ($R_{200}$).

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, ...).
    • ...
  • halo_idx::Int=1: Index of the target halo (FoF group). Starts at 1.

Returns

  • A vector with the IDs of the tracers.
source