Data Inspection API Reference
Docstrings for finding out what a simulation contains before you load it, and what a loaded object contains afterwards. The narrative guide is Data Inspection.
Before loading
checksimulations answers "what runs are on this disk?" and checkoutputs answers "which outputs does this run have?" — both worth reaching for before a path error rather than after one.
Mera.getinfo — Function
getinfo([output::Real]; path::String="", namelist::String="", verbose::Bool=true)Return simulation overview metadata (an InfoType) for a RAMSES output. It inspects info, descriptor and header files (hydro / gravity / particles / RT / clumps), parses the namelist when available, gathers compile + build information, and collects basic cosmological units & scaling factors.
Call patterns: info = getinfo(42) # current directory, output 42 info = getinfo(output=42, path="/sim") # explicit keywords info = getinfo("/sim"; output=42) # path first
Set verbose=false to suppress the textual summary. The returned object exposes fields like descriptor, grid_info, part_info, scale, and helper accessors (namelist(info), makefile(info), timerfile(info), etc.).
Mera.checksimulations — Function
checksimulations(path="."; verbose=true, filternames=String[]) -> DictScan path for simulation folders and report which outputs each one holds.
Where checkoutputs inspects a single simulation, this walks a directory of them — the view you want when a project directory holds many runs and you need to know what is on disk before loading anything. filternames restricts the scan to named subfolders.
checksimulations("/data/simulations") # every run under the folder
checksimulations("/data", filternames=["mw_L10"]) # just oneSee also checkoutputs, storageoverview.
Mera.checkoutputs — Function
Get the existing simulation snapshots in a given folder
- returns field
outputswith Array{Int,1} containing the output-numbers of the existing simulations - returns field
misswith Array{Int,1} containing the output-numbers of empty simulation folders - returns field
pathas String
checkoutputs(path::String="./"; verbose::Bool=true)
return CheckOutputNumberTypeExamples
# Example 1:
# look in current folder
julia> N = checkoutputs();
julia> N.outputs
julia> N.miss
julia> N.path
# Example 2:
# look in given path
# without any keyword
julia>N = checkoutputs("simulation001");Inspecting an object
viewfields works on any Mera object and is the quickest way to see what you actually have — including InfoType sub-structures such as info.scale and info.fnames.
Mera.viewfields — Function
Get an overview of the fields from MERA composite types:
viewfields(object)Mera.viewallfields — Function
Get a detailed overview of many fields from the MERA InfoType:
viewallfields(dataobject::InfoType)Mera.namelist — Function
namelist(object::InfoType)
namelist(object::Dict{Any,Any})Pretty-print the RAMSES namelist content stored in object.
For an InfoType, the namelist is read from the simulation's namelist.txt and stored in object.namelist_content. Each namelist block header and its parameters are printed to stdout.
Examples
info = getinfo(1, "path/to/sim")
namelist(info) # show all namelist blocks
namelist(info.namelist_content) # equivalent, passing the Dict directlyOverviews
Mera.dataoverview — Function
dataoverview(dataobject::HydroDataType; verbose::Bool=true)Provide a comprehensive overview of hydro simulation data including variable statistics.
Arguments
dataobject::HydroDataType: Hydro simulation data objectverbose::Bool=true: Control level of output detail
Returns
IndexedTable: Mass and min/max values for each variable per refinement level
Description
Analyzes hydro data and provides statistics across AMR levels.
dataoverview(dataobject::GravDataType; verbose::Bool=true)Get total epot and min/max values of each gravity variable per level. Returns an IndexedTable summarizing epot and other variables.
dataoverview(dataobject::ClumpDataType)Get the extrema (min/max) of each variable in the clump database. Returns an IndexedTable with extrema per variable.
dataoverview(dataobject::PartDataType; verbose::Bool=true)Get the min/max value of each particle variable per AMR level. Returns an IndexedTable summarizing min/max per level.
Mera.amroverview — Function
amroverview(dataobject::HydroDataType; verbose::Bool=true)
amroverview(dataobject::GravDataType; verbose::Bool=true)
amroverview(dataobject::PartDataType; verbose::Bool=true)Generate an overview table showing the distribution of cells/particles across AMR levels.
Arguments
dataobject: AMR data object (HydroDataType, GravDataType, or PartDataType)verbose::Bool=true: Display progress information during calculation
Returns
IndexedTable: Table with columns::level: AMR refinement level:cells/:particles: Number of cells or particles at each level:cellsize: Physical size of cells at each level (Hydro/Grav only):cpus: Number of CPU domains at each level (if CPU info available)
Examples
```julia
Basic AMR overview for hydro data
gas = gethydro(info, verbose=false) table = amroverview(gas)
Silent processing
table = amroverview(gas, verbose=false)
amroverview(dataobject::GravDataType; verbose::Bool=true)Get the number of cells and CPUs per AMR level for gravity data. Returns an IndexedTable with columns level, cells, cellsize, and optionally cpus.
amroverview(dataobject::PartDataType; verbose::Bool=true)Get the number of particles and CPUs per AMR level for particle data. Returns an IndexedTable with columns level, particles, and optionally cpus.
Mera.storageoverview — Function
storageoverview(dataobject::InfoType; verbose::Bool=true)Provide a storage overview for loaded data, showing memory usage and data structure information.
Arguments
dataobject::InfoType: Simulation info objectverbose: Control level of output detail
Description
Displays comprehensive information about the storage characteristics of the selected simulation output. It helps users understand the resource requirements and structure of their data.
For RAMSES outputs it tallies the on-disc size per file type — folder total, and the amr, hydro, gravity, particle, clump, rt and sink files present — returned in a Dict. For other codes (GADGET/AREPO, PLUTO, Athena++, FLASH, Chombo) every quantity is packed into one file or folder, so a per-datatype split is not meaningful; instead the snapshot's disc footprint is reported under :snapshot (the file size for a single-file snapshot, else the folder total).
Examples
# Get storage overview for hydro data
storageoverview(info, true)
# Brief storage information
storageoverview(info, false)Mera.overviewplot — Function
overviewplot(dataobject; size=nothing) -> Makie figureVisual statistics overview of a loaded object (needs a Makie backend: using CairoMakie).
- Hydro / AMR: cells per level, mass per level, the mass-weighted density PDF, and the ρ–T phase diagram (when a temperature is available).
- Gravity / AMR: cells per level, the acceleration |a| and potential distributions, and the |a|–potential relation.
- Particles: the per-family census, the mass distribution, the projected x–y density, and the speed distribution.
All panels use getvar (physical units, derived fields) and are computed in one pass over the cells/particles — the visual companion to amroverview / dataoverview.
overviewplot needs a Makie backend loaded (Pkg.add("CairoMakie")); the others print.
Utilities
Mera.viewmodule — Function
Get a list of all exported Mera types and functions:
function viewmodule(modulename::Module)Mera.humanize — Function
Convert a value to human-readable astrophysical units and round to ndigits
(pass the value in code units and the quantity specification (length, time) )
function humanize(value::Float64, scale::ScalesType003, ndigits::Int, quantity::String)
return value, value_unitMera.usedmemory — Function
usedmemory(object, verbose::Bool=true)
usedmemory(obj_value::Real, verbose::Bool=true)Calculate and display memory usage of an object or raw byte value in human-readable units.
Arguments
object: Any Julia object whose memory usage should be calculatedobj_value::Real: Raw memory size in bytesverbose::Bool=true: Whether to print the result to console
Returns
value::Float64: Memory usage value in the appropriate unitunit::String: Unit string ("Bytes", "KB", "MB", "GB", or "TB")
Examples
# Check memory usage of a data object
data = rand(1000, 1000)
value, unit = usedmemory(data) # Prints: "Memory used: 7.629 MB"
# Silent calculation
value, unit = usedmemory(data, false) # Returns (7.629, "MB") without printing
# Direct byte value
value, unit = usedmemory(1048576, false) # Returns (1.0, "MB")Mera.createpath — Function
```julia createpath(output::Real, path::String; namelist::String="")
return FileNamesType ```
Data types
InfoType · HydroDataType · PartDataType · GravDataType · ClumpDataType · RtDataType
Related
Provenance — which Mera version, output and simulation code produced a result — is provenance, documented on the Provenance page.
Every docstring in the package is also on the Complete API Reference.