Data Loading API Reference
Docstrings for reading simulation output into memory. The narrative guides are Load by Selection for the spatial and level keywords, and Multi-code support for other simulation codes.
All of these take the InfoType returned by getinfo and accept the same selection keywords (xrange/yrange/zrange, center, range_unit, lmax), so you read only the part of the box you need rather than filtering afterwards.
Loaders
Mera.gethydro — Function
gethydro(info::InfoType, var::Symbol; kwargs...)
gethydro(info::InfoType, vars::Vector{Symbol}; kwargs...)
gethydro(info::InfoType; vars=[:all], kwargs...)Load leaf-cell hydro variables from a RAMSES output described by an InfoType. Supports spatial sub-selection (xrange/yrange/zrange, center, range_unit), level restriction (lmax), variable filtering (vars or single var), basic data sanitation (smallr, smallc, negative value checks), progress + verbosity control, and explicit thread limiting (max_threads). Returns a HydroDataType containing an IndexedTable plus metadata (selected variables, scales, ranges). See extended docstring below for full argument reference and examples.
Read the leaf-cells of the hydro-data:
- select variables
- limit to a maximum level
- limit to a spatial range
- multi-threading
- set a minimum density or sound speed
- check for negative values in density and thermal pressure
- print the name of each data-file before reading it
- toggle verbose mode
- toggle progress bar
- pass a struct with arguments (myargs)
gethydro(dataobject::InfoType;
lmax::Real=dataobject.levelmax,
vars::Array{Symbol,1}=[:all],
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
smallr::Real=0.,
smallc::Real=0.,
check_negvalues::Bool=false,
print_filenames::Bool=false,
verbose::Bool=true,
show_progress::Bool=true,
myargs::ArgumentsType=ArgumentsType(),
max_threads::Int=Threads.nthreads())Returns an object of type HydroDataType, containing the hydro-data table, the selected options and the simulation ScaleType and summary of the InfoType
return HydroDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> gas = gethydro(info)
julia> viewfields(gas)
#or:
julia> fieldnames(gas)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
lmax: the maximum level to be read from the datavar(s): the selected hydro variables in arbitrary order: :all (default), :cpu, :rho, :vx, :vy, :vz, :p, and the passive scalars. When the output has ahydro_file_descriptor.txt, the scalars carry their descriptor names (e.g. :metallicity, :scalar00, :scalar01...); without a descriptor they are positional (:var6, :var7...). Positional :varN selectors keep working in either case.xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..smallr: set lower limit for density; zero means inactivesmallc: set lower limit for thermal pressure; zero means inactivecheck_negvalues: check loaded data of "rho" and "p" on negative values; false by defaultprint_filenames: print on screen the current processed hydro file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: trueshow_progress: print progress bar on screenmyargs: pass a struct of ArgumentsType to pass several arguments at once and to overwrite default values of lmax, xrange, yrange, zrange, center, rangeunit, verbose, showprogress- **
max_threads: give a maximum number of threads that is smaller or equal to the number of assigned threads in the running environment
Defined Methods - function defined for different arguments
- gethydro( dataobject::InfoType; ...) # no given variables -> all variables loaded
- gethydro( dataobject::InfoType, var::Symbol; ...) # one given variable -> no array needed
- gethydro( dataobject::InfoType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read hydro data of all variables, full-box, all levels
julia> gas = gethydro(info)
# Example 2:
# read hydro data of all variables up to level 8
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> gas = gethydro( info,
lmax=8,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> gas = gethydro( info,
lmax=8,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., bc:, 10.],
range_unit=:kpc )
# Example 4:
# read hydro data of the variables density and the thermal pressure, full-box, all levels
julia> gas = gethydro( info, [:rho, :p] ) # use array for the variables
# Example 5:
# read hydro data of the single variable density, full-box, all levels
julia> gas = gethydro( info, :rho ) # no array for a single variable needed
...Mera.getparticles — Function
Read the particle-data
- select variables
- limit to a spatial range
- multi-threading
- print the name of each data-file before reading it
- toggle verbose mode
- toggle progress bar
- pass a struct with arguments (myargs)
function getparticles( dataobject::InfoType;
lmax::Real=dataobject.levelmax, # Maximum refinement level to read
vars::Array{Symbol,1}=[:all], # Variables to read (:all for all available)
stars::Bool=true, # Include star particles
xrange::Array{<:Any,1}=[missing, missing], # X spatial range [min, max]
yrange::Array{<:Any,1}=[missing, missing], # Y spatial range [min, max]
zrange::Array{<:Any,1}=[missing, missing], # Z spatial range [min, max]
center::Array{<:Any,1}=[0., 0., 0.], # Center point for ranges
range_unit::Symbol=:standard, # Units for ranges (:standard, :kpc, etc.)
presorted::Bool=true, # Sort output table by key variables
print_filenames::Bool=false, # Print each CPU file being read
verbose::Bool=true, # Print progress information
show_progress::Bool=true, # Show progress bar
max_threads::Int=Threads.nthreads(), # Number of threads for parallel processing
myargs::ArgumentsType=ArgumentsType() ) # Struct to override default argumentsReturns an object of type PartDataType, containing the particle-data table, the selected and the simulation ScaleType and summary of the InfoType
return PartDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> particles = getparticles(info)
julia> viewfields(particles)
#or:
julia> fieldnames(particles)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
lmax: maximum AMR level to load (default:info.levelmax)stars: include star particles (default:true). Setstars=falseto drop star particles from the returned table. On the new RAMSES particle format (pversion > 0) this drops rows withfamily == 2; on the legacy format (no:familycolumn) it drops rows withbirth > 0(RAMSES convention for stellar formation time). Requires the:family(new) or:birth(legacy) column to be in the loaded variable subset.var(s): the selected particle variables in arbitrary order: :all (default), :cpu, :mass, :vx, :vy, :vz, :birth :metals, ...xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..presorted: presort data according to the key vars (by default)print_filenames: print on screen the current processed particle file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: trueshow_progress: print progress bar on screenmyargs: an ArgumentsType struct to override multiple keywords at once: lmax, xrange, yrange, zrange, center, rangeunit, verbose, showprogress- **
max_threads: give a maximum number of threads that is smaller or equal to the number of assigned threads in the running environment
Defined Methods - function defined for different arguments
- getparticles( dataobject::InfoType; ...) # no given variables -> all variables loaded
- getparticles( dataobject::InfoType, var::Symbol; ...) # one given variable -> no array needed
- getparticles( dataobject::InfoType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read particle data of all variables, full-box, all levels
julia> particles = getparticles(info)
# Example 2:
# read particle data of all variables
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> particles = getparticles( info,
xrange=[-10., 10.],
yrange=[-10., 10.],
zrange=[-2., 2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> particles = getparticles( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., :bc, 10.],
range_unit=:kpc )
# Example 4:
# read particle data of the variables mass and the birth-time, full-box, all levels
julia> particles = getparticles( info, [:mass, :birth] ) # use array for the variables
# Example 5:
# read particle data of the single variable mass, full-box, all levels
julia> particles = getparticles( info, :mass ) # no array for a single variable needed
...Mera.getgravity — Function
Read gravity leaf-cells with optional spatial selection and multithreading.
- Select variables (e.g., :epot, :ax, :ay, :az; include :cpu to add CPU column)
- Limit to a maximum refinement level (lmax)
- Select by spatial range around a center in a chosen unit
- Parallel file processing (configurable max_threads) with progress bar
- Verbose output with timestamps and table memory overview
- Pass an ArgumentsType struct (myargs) to override multiple keywords at once
getgravity(dataobject::InfoType;
lmax::Real=dataobject.levelmax,
vars::Array{Symbol,1}=[:all],
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
print_filenames::Bool=false,
verbose::Bool=true,
show_progress::Bool=true,
myargs::ArgumentsType=ArgumentsType(),
max_threads::Int=Threads.nthreads())Returns a GravDataType with:
- data: IndexedTable with position columns (:cx,:cy,:cz), optionally :level and/or :cpu, followed by selected variables
- info, lmin, lmax, boxlen, ranges, selectedgravvars, useddescriptors, scale
Arguments
- Required
- dataobject: InfoType from getinfo
- Keywords
- lmax: maximum refinement level to read (validated against the dataset)
- vars: gravity variables to load; default [:all]. Known names include :epot, :ax, :ay, :az. Include :cpu to add CPU column.
- xrange, yrange, zrange: [min,max] in units of range_unit relative to center; use missing to skip. Zero-length [0,0] is expanded to full box.
- center: selection center; default [0.,0.,0.]; you can use symbols like [:bc] for box center (also combinations like [val, :bc, :bc]).
- range_unit: units for ranges/center (e.g., :standard, :kpc, :pc, :Mpc, :km, :cm; Symbol)
- print_filenames: print each processed file path
- verbose: print timestamps and summaries
- show_progress: show a progress bar during reading
- myargs: ArgumentsType struct to override lmax, ranges, center, rangeunit, verbose, showprogress
- max_threads: cap threads used for table creation and column extraction (≤ available threads)
Defined methods
- getgravity(dataobject::InfoType; ...) # no vars → all variables loaded
- getgravity(dataobject::InfoType, var::Symbol; ...) # single variable (Symbol)
- getgravity(dataobject::InfoType, vars::Array{Symbol,1}; ...) # multiple variables
Examples
# Read all gravity variables at all levels, whole box
g = getgravity(info)
# Read only potential and acceleration components within a kpc-scale box around the center
g = getgravity(info, vars=[:epot, :ax, :ay, :az],
xrange=[-5,5], yrange=[-5,5], zrange=[-2,2],
center=[:bc], range_unit=:kpc)
# Include CPU column
g = getgravity(info, vars=[:cpu, :epot])
# Override several keywords at once via myargs
g = getgravity(info, myargs=ArgumentsType(lmax=12, range_unit=:kpc, verbose=false))Important notes
- Spatial selection is evaluated at cell centers (:cx,:cy,:cz).
- AMR vs uniform grid affects included columns and primary key: AMR adds :level.
- Variable names can also come from file descriptors; unknown indices are named :gravN.
Mera.getclumps — Function
Read the clump-data:
- selected variables
- limited to a spatial range
- print the name of each data-file before reading it
- toggle verbose mode
- pass a struct with arguments (myargs)
getclumps( dataobject::InfoType;
vars::Array{Symbol,1}=[:all],
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
print_filenames::Bool=false,
verbose::Bool=true,
myargs::ArgumentsType=ArgumentsType() )Returns an object of type ClumpDataType, containing the clump-data table, the selected options and the simulation ScaleType and summary of the InfoType
return ClumpDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> clumps = getclumps(info)
julia> viewfields(clumps)
#or:
julia> fieldnames(clumps)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
vars: Currently, the length of the loaded variable list can be modified *(see examples below).vars: List of clump columns to read; default[:all]uses the file header. The order must match the columns in the clump files. You may specify fewer names (to read a subset) or more names if the data contains more columns than listed in the header.xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible length Note: spatial filtering uses the columns :peakx, :peaky, :peak_z. If you set any ranges, ensure these columns are included invars(or usevars=[:all]).range_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of type Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..print_filenames: print on screen the current processed clump file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: truemyargs: pass a struct of ArgumentsType to pass several arguments at once and to overwrite default values of xrange, yrange, zrange, center, range_unit, verbose
Important notes
- Spatial selection is applied to the clump peak position only (columns
:peak_x,:peak_y,:peak_z). It does not test the full clump extent/volume. - All clump columns are parsed as
Float64from the text files. Cast to other types as needed after loading. - Column names with dashes in the header must be requested as symbols with quotes, e.g.
Symbol("rho-")andSymbol("rho+"). - For faster I/O, pass a smaller
varslist to read only the columns you need. - When supplying a custom
varslist, ensure the data files contain at least that many columns and that the order matches the file columns; otherwise parsing will fail.
Defined Methods - function defined for different arguments
- getclumps(dataobject::InfoType; ...) # no given variables -> all variables loaded
- getclumps(dataobject::InfoType, vars::Array{Symbol,1}; ...) # one or several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read clump data of all variables, full-box
julia> clumps = getclumps(info)
# Example 2:
# read clump data of all variables
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> clumps = getclumps( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> clumps = getclumps( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., :bc, 10.],
range_unit=:kpc )
# Example 4:
# Load less than the found 12 columns from the header of the clump files;
# Pass an array with the variables to the keyword argument *vars*.
# The order of the variables has to be consistent with the header in the clump files:
julia> clumps = getclumps(info, [ :index, :lev, :parent, :ncell,
:peak_x, :peak_y, :peak_z ])
# Example 5:
# Load more than the found 12 columns from the header of the clump files.
# E.g. the list can be extended with more names if there are more columns
# in the data than given by the header in the files.
# The order of the variables has to be consistent with the header in the clump files:
julia> clumps = getclumps(info, [ :index, :lev, :parent, :ncell,
:peak_x, :peak_y, :peak_z,
Symbol("rho-"), Symbol("rho+"),
:rho_av, :mass_cl, :relevance,
:vx, :vy, :vz ])
...Mera.getrt — Function
Read RAMSES radiative-transfer (RT) leaf-cells into an RtDataType.
RT data have the same AMR cell structure as hydro. Each photon group g contributes a photon number density Npgand flux componentsFxg/Fyg/Fzg (so nvarrt = 4 * nGroups). Variable names come from info.rt_variable_list.
getrt(dataobject::InfoType;
lmax::Real=dataobject.levelmax,
vars::Array{Symbol,1}=[:all],
xrange=[missing,missing], yrange=[missing,missing], zrange=[missing,missing],
center=[0.,0.,0.], range_unit::Symbol=:standard,
print_filenames::Bool=false, verbose::Bool=true, show_progress::Bool=true,
myargs::ArgumentsType=ArgumentsType(), max_threads::Int=Threads.nthreads())Returns an RtDataType with data (IndexedTable: position columns :cx,:cy,:cz, optionally :level/:cpu, then the selected RT variables), and info, lmin, lmax, boxlen, ranges, selected_rtvars, used_descriptors, scale.
info = getinfo(2, "…/rt_stromgren")
rt = getrt(info) # all RT variables
rt = getrt(info, vars=[:Np1, :Fx1]) # selectedMera.getgroups — Function
getgroups(info::InfoType; kwargs...)Read the halo/group catalogue that accompanies info's snapshot, dispatching to the frontend registered for its simcode — for the GADGET-HDF5 family (AREPO, IllustrisTNG, …) that is getgroups_gadget.
Prefer this over the frontend-specific name: it is the generic entry point, matching getinfo / getparticles, and it does not ask you to know which reader serves your data. getinfo already reports the real producer (simcode == "AREPO" for IllustrisTNG), even though one frontend covers the whole shared format.
info = getinfo(33, "/path/to/TNG50-4") # simcode = "AREPO"
gc = getgroups(info) # FoF catalogue
gas = getparticles(info; halo=0) # that group's cellsCoverage differs by code: only RAMSES writes gravity, RT and clumps to separate files, so only RAMSES has all six. See how mature is each reader.
Code-specific entry points
The loaders above dispatch to these automatically; call them directly only when you want to bypass detection.
Mera.getinfo_pluto — Function
getinfo_pluto(output::Int, path::String; unit_length=1.0, unit_density=1.0,
unit_velocity=1.0, verbose=true) -> InfoTypeRead PLUTO static-grid metadata (grid.out + dbl.out) for snapshot output in path into a Mera InfoType (simcode = "PLUTO"). Uniform 3-D Cartesian grid → levelmin == levelmax. Feed the result to gethydro.
Units. PLUTO writes data in code units and does not store its UNIT_* constants in the output, so by default the run is treated as dimensionless (unit_* = 1) — Mera's scale system still works, but physical conversions like :kpc/:Msol are only meaningful if you supply the run's CGS units. Pass PLUTO's UNIT_LENGTH, UNIT_DENSITY, UNIT_VELOCITY (the unit_length/unit_density/unit_velocity keywords, in CGS) for a dimensional run and every getvar/projection unit conversion becomes physical:
# a galactic PLUTO run, say UNIT_LENGTH = 1 kpc, UNIT_DENSITY = m_p, UNIT_VELOCITY = 1 km/s
info = getinfo_pluto(5, path; unit_length=3.086e21, unit_density=1.67e-24, unit_velocity=1e5)
getvar(gethydro(info), :x, :kpc) # now physically correctMera.gethydro_pluto — Function
gethydro_pluto(info::InfoType; xrange, yrange, zrange, center, range_unit, verbose=true) -> HydroDataTypeRead a PLUTO static-grid snapshot (data.NNNN.dbl, single-file double precision) described by info (from getinfo_pluto) into a uniform-grid HydroDataType — columns (:cx,:cy,:cz, :rho,:vx,:vy,:vz,:p), the same schema the RAMSES uniform-grid reader produces, so the whole analysis layer works on it unchanged.
xrange/yrange/zrange (+ center, range_unit) select a spatial window at load time, exactly as for the RAMSES gethydro; the returned object's ranges records it.
Mera.getparticles_pluto — Function
getparticles_pluto(info::InfoType; xrange, yrange, zrange, center, range_unit, verbose=true) -> PartDataTypeRead a PLUTO Lagrangian-particle snapshot (particles.NNNN.dbl, single binary file with an ASCII # header) described by info into a Mera PartDataType — columns :x,:y,:z, :id, :vx,:vy,:vz (+ any extra PLUTO particle fields by name), so the particle analysis runs unchanged. Positions are in code length (= info units).
xrange/yrange/zrange with center and range_unit select a sub-box, with the same semantics as gethydro_pluto: a particle is kept when its position lies inside the box-normalised range. vars is not supported — every field in the file is returned.
Note this reader provides no :mass column, because PLUTO particle files do not carry one; mass-weighted reductions (msum, center_of_mass, default projection weighting) therefore have no input on PLUTO particles.
Mera.getinfo_chombo — Function
getinfo_chombo(output, path; verbose=true)Read the metadata of a Chombo HDF5 output: component names, level count and grid layout, returned as an InfoType.
The Chombo-specific entry point behind getinfo, which dispatches here when it detects a Chombo file. Prefer getinfo, which keeps your script code-agnostic.
Mera.gethydro_chombo — Function
gethydro_chombo(info; xrange, yrange, zrange, center, range_unit=:standard, verbose=true)Read cell data from a Chombo HDF5 output into a HydroDataType, optionally restricted to a spatial range.
The Chombo-specific entry point behind gethydro, which dispatches here for Chombo data. Prefer gethydro, which keeps your script code-agnostic.
Mera.getgroups_gadget — Function
getgroups_gadget(info::InfoType; fields=:all, verbose=true) -> NamedTupleRead the FoF group catalogue of a SUBFIND run (AREPO / IllustrisTNG) into plain arrays.
Returns a NamedTuple with one entry per catalogue field (e.g. GroupMassType, GroupLenType, GroupPos, Group_M_Crit200), each concatenated across all catalogue chunks, plus :n (the number of groups) — checked against the header's Ngroups_Total, so a partial download is an error rather than a silently short catalogue.
Masses are in the file's own units (10¹⁰ M⊙/h for TNG); divide by info.H0/100 and multiply by 1e10 for M⊙. fields restricts which datasets are read.
info = getinfo(33, "/path/to/TNG50-4")
gc = getgroups_gadget(info)
gc.n # number of FoF groups
gc.GroupMassType[1, 1] # group 1, gas mass [1e10 Msol/h]See getparticles_gadget with halo= to load one group's particles.
Related
Spatial cuts after loading are in the Subregions API; value-based selection is in Masking & Filtering. To reload from Mera's own format instead, see the Mera-Files API.
Every docstring in the package is also on the Complete API Reference.