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.findTracers
— MethodfindTracers(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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
indices::Dict
: A dictionary with the following shape:cell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexTypecell/particle type
-> idxs::IndexType- ...
Returns
- A vector with the IDs of the tracers.
GalaxyInspector.parentIDToIndex
— MethodparentIDToIndex(
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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
target_ids::Vector{UInt}
: List of tracer IDs.
Returns
A dictionary with the following shape:
cell/particle type
-> idxs::Intcell/particle type
-> idxs::Intcell/particle type
-> idxs::Int- ...
GalaxyInspector.parentToTracerID
— MethodparentToTracerID(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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
target_ids::Vector{UInt}
: List of parent IDs.
Returns
- A vector with the IDs of the tracers.
GalaxyInspector.tracerToParentID
— MethodtracerToParentID(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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
target_ids::Vector{UInt}
: List of tracer IDs.
Returns
- A vector with the IDs of the parents.
GalaxyInspector.tracersToMass
— MethodtracersToMass(
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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
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}- ...
GalaxyInspector.tracersWithinDisc
— MethodtracersWithinDisc(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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
max_r::Unitful.Length=DISK_R
: Radius of the cylinder.max_z::Unitful.Length=5.0u"kpc"
: Half height of the cylinder.
Returns
- A vector with the IDs of the tracers.
GalaxyInspector.tracersWithinR200
— MethodtracersWithinR200(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 (seeSimulation
).:snap_data
-> ::Snapshot (seeSnapshot
).:gc_data
-> ::GroupCatalog (seeGroupCatalog
).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).cell/particle type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).groupcat type
-> (block
-> data ofblock
,block
-> data ofblock
, ...).- ...
halo_idx::Int=1
: Index of the target halo (FoF group). Starts at 1.
Returns
- A vector with the IDs of the tracers.