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.).
This is the starting point of almost every workflow, because gethydro, getparticles, getgravity and the rest all take the InfoType it returns. It reads headers only and never touches cell or particle data.
For a first impression of an unfamiliar output rather than an object to work with, see quicklook: it reports the same header facts and then reads a budgeted sample to add projections along all three axes, a phase diagram and a mass budget. Use getinfo in a script, quicklook when you open a directory and want to know what is in it.
code = :auto detects which simulation code wrote the output; give it, e.g. code=:ramses, to skip the detection.
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)Prints the fields and returns nothing.
Mera.viewallfields — Function
Get a detailed overview of many fields from the MERA InfoType:
viewallfields(dataobject::InfoType)Prints the fields and returns nothing.
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 directlyPrints the namelist and returns nothing.
Overviews
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)Returns the names, as a Vector{Symbol}.
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.
Function Reference
Mera.getextent — Function
getextent(proj::DataMapsType, unit::Symbol=:standard; center::Bool=false) -> [xmin,xmax,ymin,ymax]Map extent of a projection result in a physical unit (e.g. :kpc, :pc, :Mpc).
The stored proj.extent/proj.cextent fields are in code length units — so when the map values are physical (e.g. surface density in :Msol_pc2) the plotting axes would otherwise be mismatched. This scales them: getextent(proj, :kpc) gives [xmin,xmax,ymin,ymax] in kpc. center=true returns the centre-relative extent (proj.cextent). Equivalent to proj.extent .* proj.scale.<unit>.
getextent(data, unit=:standard; center=[0, 0, 0], center_unit=:standard,
direction=:z) -> ((xmin, xmax), (ymin, ymax), (zmin, zmax))Return the region that data was read from, as three (min, max) pairs.
The region is the one selected when loading (or by subregion), not the extent of the cells that happen to be in it. For the extent of a map, use getextent(map, unit).
Arguments
data: any Mera data object, e.g. fromgethydro.unit::Symbol = :standard: the unit of the result, e.g.:kpc.:standardmeans code length. It can also be given as the keywordunit.
Keywords
center = [0, 0, 0]: the origin of the result, incenter_unit.[:bc]is the box centre.center_unit::Symbol = :standard: the unit ofcenter;:standardmeans fractions of the box.direction::Symbol = :z: the axis that comes last, as forgetpositions.
Examples
julia> getextent(gas, :kpc; center=[:bc])
((-24.0, 24.0), (-24.0, 24.0), (-24.0, 24.0))See also getpositions, subregion.
Mera.getpositions — Function
getpositions(data, unit=:standard; center=[0, 0, 0], center_unit=:standard,
direction=:z, mask=[false]) -> (x, y, z)Return the positions of the cells, particles or clumps of data as three vectors.
A short form of getvar(data, [:x, :y, :z]; units=[unit, unit, unit], ...).
Arguments
data: any Mera data object, e.g. fromgethydroorgetparticles.unit::Symbol = :standard: the unit of the result, e.g.:kpc.:standardmeans code length. It can also be given as the keywordunit.
Keywords
center = [0, 0, 0]: the origin of the positions, incenter_unit.[:bc]is the box centre.center_unit::Symbol = :standard: the unit ofcenter;:standardmeans fractions of the box.direction::Symbol = :z: the axis that comes last.:xreturns(z, y, x)and:yreturns(z, x, y), so the chosen axis plays the role ofz, as the line of sight in a projection.mask: aBoolvector with one entry per row; only rows markedtrueare returned.
Returns
A tuple of three Vector{Float64}.
Examples
julia> x, y, z = getpositions(gas, :kpc; center=[:bc]); # in kpc, from the box centreSee also getvelocities, getextent, getvar.
Mera.getvelocities — Function
getvelocities(data, unit=:standard; direction=:z, center=[0, 0, 0],
center_unit=:standard, mask=[false]) -> (vx, vy, vz)Return the velocities of the cells, particles or clumps of data as three vectors.
A short form of getvar(data, [:vx, :vy, :vz]; units=[unit, unit, unit], ...).
Arguments
data: any Mera data object with velocities, e.g. fromgethydroorgetparticles.unit::Symbol = :standard: the unit of the result, e.g.:km_s.:standardmeans code units. It can also be given as the keywordunit.
Keywords
direction::Symbol = :z: the axis that comes last.:xreturns(vz, vy, vx)and:yreturns(vz, vx, vy), as forgetpositions.center,center_unit: passed on togetvar; they do not change the Cartesian velocities.mask: aBoolvector with one entry per row; only rows markedtrueare returned.
Returns
A tuple of three Vector{Float64}.
Examples
julia> vx, vy, vz = getvelocities(gas, :km_s);See also getpositions, getvar.
Mera.capabilities — Function
capabilities(info::InfoType) -> Vector{Symbol}The entry points the reader that produced info provides, e.g. [:info, :hydro, :particles] for PLUTO data. See supports.
Mera.supports — Function
supports(info::InfoType, what::Symbol) -> BoolWhether the reader that produced info provides the entry point what (one of :info, :hydro, :particles, :gravity, :rt, :clumps). This is a capability of the READER, not of the snapshot — e.g. supports(info, :hydro) is true for any RAMSES run even if that run wrote no hydro files.
info = getinfo(300, "sim/") # e.g. a PLUTO run
supports(info, :hydro) # true
supports(info, :gravity) # falseMera.register_reader! — Function
register_reader!(code::Symbol; simcodes, name="", detect=nothing, priority=100,
note="", info=nothing, hydro=nothing, particles=nothing, groups=nothing,
gravity=nothing, rt=nothing, clumps=nothing, logs=nothing,
physics=nothing, input_files=nothing, outputs=nothing, output_files=nothing)Register a simulation-code frontend (internal API). code is the symbol accepted by getinfo(...; code=…); simcodes lists the InfoType.simcode strings the reader serves. Entry-function contracts:
info(output::Int, path::String; verbose::Bool)→InfoTypehydro(info::InfoType; xrange, yrange, zrange, center, range_unit, verbose)→HydroDataTypeparticles(info::InfoType; xrange, yrange, zrange, center, range_unit, verbose)→PartDataTypegravity/rt/clumps: analogous tohydro.
Wrap a function in a closure if it does not accept the full keyword set. The public entry points also pass any EXTRA user keywords through to the frontend (e.g. getparticles(info; families=[0]) reaches getparticles_gadget), so a frontend with code-specific options just declares them; unknown keywords raise its MethodError. A capability left nothing marks the code as not supporting it — the public entry points then raise a clear error, supports returns false, and the docs capability matrix shows a gap. detect (optional) is tried by detect_simcode before the built-in detection chain.
select_vars=true declares that the hydro entry point implements COLUMN SELECTION: it accepts vars=[…] and reads only what those columns need. gethydro then forwards the user's vars. By default it refuses a vars= it cannot honour, rather than silently returning every variable. Only claim this when the reader really reads less. A format whose records interleave every field cannot.
logs is the optional function that reads the run-time log files of the code, like the other capability functions (info, hydro, particles, ...).
physics is the optional function info -> OrderedDict that describes which physics a run used, for simulationrecord. It returns a "summary" with the keys hydro, mhd, gravity, particles, radiative_transfer, cooling, star_formation, feedback and sinks (each false, true, a dictionary of settings, or nothing when unknown), and may add the code's own parameters next to it.
input_files is the optional function info -> Vector{String} that names the files defining a run: its parameters, its build settings, its code patches. Sidecars and simulationrecord record each of them by name with its SHA-256, so a result can be traced to the exact setup. List the files your code writes; the ones that do not exist for a given run are skipped. Without this function no input files are recorded.
outputs is the optional function path -> Vector{Int} that lists the output numbers of the run in a folder, for timeseries, getmovie and the folder form of simulationrecord. output_files is the optional function info -> Vector{String} that names the files (or folders) of one output, so the record can give its size on disk.
Mera.provenance — Function
provenance(x) -> ProvenanceBuild a Provenance record from an InfoType or from any result that carries one: a data object (gethydro/getparticles/getgravity/getclumps/getrt, and any subregion of one), a projection map, a profile, phase or pdf of a data object or map, or a galaxy frame from face_on. Deterministic: it reads only the snapshot's own metadata, so it is safe to compare across runs.
gas = gethydro(getinfo(100, "/data/sim"))
provenance(gas) # data object
provenance(projection(gas, :sd)) # projection map
provenance(pdf(gas, :rho)) # a pdf keeps the snapshot it came from
provenance(profile(gas, :r_sphere, :rho)) # so do profile and phase
provenance(gas.info) # the InfoType directlyA result that carries no .info throws an ArgumentError: a timeseries table, a pdf of a plain array, or a plain value such as a getvar array. Take the provenance of the data object you computed it from. To store it with a file, see exportdata: every saved or exported file gets a sidecar that holds it.
Mera.provenance_string — Function
provenance_string(x) -> StringA compact one-line provenance string, ready for a figure caption, a file header or a log. Accepts the same inputs as provenance (or a Provenance). The time is shown as z=… for a cosmological run, otherwise in Myr/Gyr.
The version names the build. On a normal install it is the plain version; on a git checkout it carries the branch and commit, and marks an uncommitted working tree, so a result made on a development version cannot be mistaken for one made on the release:
Mera v1.8.0 | mw_L10/output_00300 | 445.89 Myr | L=48.0 ndim=3 lmin=6 lmax=10 | ScalesType003
Mera v1.8.0 (dev master @ 3a91f2c +uncommitted) | mw_L10/output_00300 | 445.89 Myr | ...Set the environment variable MERA_PROVENANCE_PLAIN=1 to force the plain version, which is how these pages are rendered. It also hides the hint that Mera has uncommitted changes, so the pages show what a user of the release sees.
Mera.mera_build — Function
mera_build() -> StringWhich Mera actually ran, as a short string. pkgversion alone reports the same version for every kind of install, so this adds where the code came from:
| install | string |
|---|---|
registered release, pkg> add Mera | "1.8.3" |
a branch from GitHub, pkg> add Mera#master | "1.8.3 (repo master @ tree 62c57b9)" |
a git checkout, pkg> dev Mera | "1.8.3 (dev master @ 3a91f2c +uncommitted)" |
| a local folder without git | "1.8.3 (local path)" |
Use it when you share a script or a notebook, so a reader knows what produced the result. It is the version field of provenance_string; mera_install gives the full record, including whether the code is exactly the registered release. Set MERA_PROVENANCE_PLAIN=1 to force the plain version. Never throws: if git or the manifest cannot be read, it falls back to the version.
Mera.mera_install — Function
mera_install() -> NamedTupleHow the running Mera was installed, and whether it is exactly a registered release.
Fields: version, source, registered, and where they apply branch, commit, dirty, url, rev, tree_hash (nothing where they do not).
source | installed with | also recorded |
|---|---|---|
:registry | pkg> add Mera | tree_hash |
:repository | pkg> add Mera#master, add https://github.com/.../Mera.jl#multicode | url, rev (the branch or commit asked for), tree_hash |
:checkout | a git checkout: pkg> dev Mera, or the repository itself | branch, commit, dirty (uncommitted changes), url, tree_hash |
:path | pkg> dev /some/folder without git | tree_hash if any |
:unknown | none of the above could be read |
registered compares the code's git tree hash with the one the Julia registry stores for this version. true means the code is exactly the registered release, also when it was installed from a branch. false means it differs, or the checkout has uncommitted changes. nothing means unknown, e.g. when the local copy of the registry is older than the version (pkg> registry up). A URL is recorded without any credentials in it.
Every sidecar stores this record. mera_build gives the short form.
mera_install()
# (version = v"1.8.3", source = :registry, registered = true, branch = nothing, ...)Never throws; anything that cannot be read is nothing.
Mera.simulationrecord — Function
simulationrecord(info::InfoType) -> SimulationRecord
simulationrecord(path::String; outputs=nothing, verbose=true) -> SimulationRecordA machine-readable description of a simulation: which code, box and resolution, units, cosmology, which physics was switched on, which data the outputs hold, and the SHA-256 of the run's input files. Where a sidecar describes one result, this describes the simulation behind it.
Arguments
info::InfoType: one output, fromgetinfo. The record describes that output.path::String: a simulation folder. The record of its last output, plus arunpart that lists every output with its time, redshift and size on disk, and the outputs at which the run's input files changed (namelist_changed_at; for RAMSES the namelist or the build: a restart with new settings).
Keywords (folder form)
outputs = nothing: the output numbers to include;nothingtakes every output in the folder.verbose::Bool = true: say how many outputs were read.
Returns
A SimulationRecord. Index it like a dictionary, e.g. rec["physics"]["summary"].
The physics part comes from the code's reader. For RAMSES it is read from the namelist and, when makefile.txt holds them, the makefile variables; the namelist values are cleaned (comments removed, .true. and numbers parsed). Its summary uses the same keys for every code: hydro, mhd, gravity, particles, radiative_transfer, cooling, star_formation, feedback, sinks; each is false, true, the settings of that process, or nothing when unknown.
Examples
rec = simulationrecord(getinfo(300, "/data/sim")) # one output
rec["resolution"]["finest_cell_pc"]
rec["physics"]["summary"]["star_formation"]
run = simulationrecord("/data/sim") # the whole run
run["run"]["outputs"] # number of outputs
datacite(run; creators=["Behrendt, Manuel"], title="Isolated disc galaxy", file="datacite.json")See also datacite, writesimulationrecord, provenance.
Mera.writesimulationrecord — Function
writesimulationrecord(rec, file) -> StringWrite a SimulationRecord to file as readable JSON, and return the file name.
writesimulationrecord(simulationrecord("/data/sim"), "simulation.json")Mera.datacite — Function
datacite(rec::SimulationRecord; creators=nothing, title=nothing, description=nothing,
license=nothing, keywords=String[], publisher=nothing, year=nothing,
related=[], toml=:auto, file=nothing) -> OrderedDictThe simulation as DataCite metadata (schema 4.5), the record that data repositories and DOI registration use. Mera fills what it knows: the resource type, the technical description, the size and formats, the creation date, and the paper of the simulation code. You supply what only you know: who made it, its title, its license.
Arguments
rec::SimulationRecord: fromsimulationrecord, best the folder form, so the record knows every output.
Keywords
creators: the people, as"Family, Given"strings or as(name=…, orcid=…, affiliation=…). Required.title::String: the title of the dataset. Required.description::String: a short abstract.license::String: an SPDX identifier, e.g."CC-BY-4.0".keywords: subject keywords.publisher::String: the repository that will hold it, e.g."Zenodo". Required by DataCite; defaults to"Zenodo".year: the publication year; defaults to this year.related: further related works, each(identifier=…, relation=…, type="DOI"), e.g. the paper the data supplements:(identifier="10.1093/mnras/…", relation="IsSupplementTo").toml = :auto: read the same fields from asimulation.tomlfile.:autolooks for one in the simulation folder; a path reads that file;nothingreads none. Keywords given here win over the file.file = nothing: also write the metadata to this JSON file.
A simulation.toml holds the same fields:
title = "Isolated Milky-Way-like disc, 10 levels"
description = "Hydrodynamics with star formation and supernova feedback."
license = "CC-BY-4.0"
keywords = ["galaxy", "interstellar medium"]
[[creators]]
name = "Behrendt, Manuel"
orcid = "0000-0000-0000-0000"
affiliation = "My institute"Returns
The metadata as an ordered dictionary, ready for JSON3.write.
Examples
rec = simulationrecord("/data/sim")
datacite(rec; creators=["Behrendt, Manuel"], title="Isolated disc galaxy",
license="CC-BY-4.0", file="datacite.json")See also simulationrecord, exportdata.
Mera.citation — Function
citation(source=nothing; file=nothing) -> TextThe BibTeX to cite for a result: Mera at its exact version, and the papers of the simulation code and of the physics modules the run used (for RAMSES: the code paper, and the MHD and RT papers when the run has them).
Arguments
source:nothingfor Mera alone; a data object, projection, profile orInfoType; aSimulationRecord; or a saved file with a sidecar ("fig3.png"), which gives the Mera version that wrote it.
Keywords
file::String = nothing: also write the BibTeX to this file, e.g."mera.bib".
Returns
The BibTeX as Text, which prints as plain text; string(citation()) gives the String.
Examples
citation() # Mera, at the version that runs
citation(gas) # also RAMSES, and RAMSES-RT for an RT run
citation("fig3.png") # the Mera version recorded in fig3.png.meta.json
citation(gas; file="software.bib")The DOI is Mera's Zenodo concept DOI, which covers all versions; the version field names the one you used, and the Zenodo page lists the DOI of each version.
See also provenance, readsidecar, datacite.
Mera.quicklook — Function
quicklook(output; path=".", budget=2_000_000, read=true, res=256, lmax=nothing,
particle_subsample=1.0, datatypes=[:hydro,:stars,:dm], directions=[:z,:x,:y],
verbose=true) -> QuickLookResultA first impression of a simulation output. Reads the header for instant facts (box, levels, finest cell, time/redshift, and the cell & particle census) and — unless read=false — does a single budgeted hydro read (only the coarse AMR levels when the full output would exceed budget cells), then builds surface-density projections along each axis (.maps.x/.y/.z — face-on plus the two edge-on views), a ρ–T phase diagram, a global snapshot budget (gas / stellar / dark-matter mass and the current SFR), and prints a compact dashboard. On an MHD run it additionally reads the magnetic field and adds a face-on |B| map (.maps.bmag, μG) plus |B| and plasma-β ranges.
Units. The dashboard and the plot use physical units picked to suit the run: kpc and M⊙ for a galaxy, cm, g and g/cm³ for a run with RAMSES's default units (1 cm, 1 g/cm³, 1 s). The summary fields always keep the units in their names (box_kpc, gas_mass_Msol, nH_range, …), and summary.units says which units were shown.
How long it takes. read=false returns immediately whatever the run size: it touches no data. A reading call is dominated by the number of per-CPU files, not by the box size, because every one of them has to be opened. On a 640-CPU output that is tens of seconds; on a run with several thousand CPU domains, expect minutes. The reader threads over those files, so julia -t N helps, and progress is printed as it goes. budget and lmax reduce the cells taken from each file but not the number of files opened; only a spatial range does that, by skipping the CPU domains that fall outside it (see gethydro's xrange/yrange/zrange).
budget— cell-count cap; if the full output is predicted larger, only coarse levels are read and the result is flaggedsampled=true(estimates labelled APPROXIMATE).lmaxoverrides the choice.read=false— header-only (sub-second): box, levels, finest cell, ncpu, fields, time/redshift.res— pixel size of the quick map.datatypes— which components to show, any subset of[:hydro, :stars, :dm](default all that are present).[:hydro]reads gas only;[:stars]or[:dm]skip the gas read entirely (faster); the panels and census adapt to what was read.directions— which projection axes, any subset of[:z, :x, :y](:z= face-on for a disk in the xy-plane;:x,:y= the two edge-on views). Applies to the gas maps and to the stellar and dark-matter maps alike. Usedirections=[:z]for a single, compact map per component. The face-on map keeps the bare key (q.maps.stars); edge-on views areq.maps.stars_x/.stars_y(anddm_x/dm_y).- RT — on a radiative-transfer run the temperature uses μ per cell from the tracked ionisation, and the dashboard gives the ionised share of the gas mass (
summary.ionised_fraction). - sinks — when the output has a sink catalogue, the dashboard gives their number and mass and the plot marks them on the maps (
summary.sink_count,.sink_mass_Msol,.sink_pos_code). particle_subsample— for very large particle runs, read only ~this fraction of the particle CPU files (e.g.0.1); RAMSES balances ~equal particles per CPU, so this reads ~that fraction of particles (skipping whole files → cuts I/O & memory). The particle census, masses and SFR are then scaled up by 1/fraction and flagged approximate. (Gas is bounded separately bybudget/lmax.)
When a particle file is present, the budget includes the stellar and dark-matter mass and the current star-formation rate (10/100 Myr windows + lifetime mean, see sfr_snapshot); these are exact even when the hydro read is coarse. Returns a QuickLookResult; figure/summary data is in .maps, .phase, .budget.
For radial density profiles and any other composable cards, use report — the composable form of this first look: report(output) runs a default card trio (map, phase, radial profile), and you can add/replace cards (projections, phases, profiles, SFR, scalars, …) and render to ascii / plot / JLD2 / file.
Not a replacement for getinfo. With read=false the two report much the same header facts, but getinfo returns the InfoType that gethydro, getparticles and the other readers require, so it is what a script calls. quicklook returns a QuickLookResult and is what you call on a directory you have not seen before.
X_frac and mu set the gas composition used for :nH and temperatures, as in setcomposition!; by default the run's own values are kept.
Mera.quicklookplot — Function
quicklookplot(q::QuickLookResult; kwargs...) -> Makie.FigureRender a QuickLookResult as a multi-panel dashboard that adapts to what was read: gas surface density along each requested axis (:z face-on, :x/:y edge-on), face-on stellar and dark-matter surface density when particles are present, the ρ–T phase diagram, and a text census (cells, particles, masses, SFR, ranges). Panels fill a tight 3-column grid; colormaps are the colorblind-safe viridis/inferno. Needs a Makie backend loaded (using CairoMakie or GLMakie); the figure is returned, so save it with Makie.save("ql.png", fig).
using CairoMakie
q = quicklook(300; path="…")
fig = quicklookplot(q)Simulation Build Information
RAMSES records how the binary that produced an output was built. These print that record back, which is what you need when a result has to be traced to a specific code version.
Mera.makefile — Function
Get a printout of the makefile:
makefile(object::InfoType)Prints the file and returns nothing.
Mera.patchfile — Function
Get a printout of the patchfile:
patchfile(object::InfoType)Prints the file and returns nothing.
Mera.timerfile — Function
Get a printout of the timerfile:
timerfile(object::InfoType)Prints the file and returns nothing.