Where to start
The rest of this site is organised by what Mera has. This page is organised by what you want to do.
Nothing here is a tutorial. Each row names the one or two functions that do the job and points at the page that explains them properly. Find your row, run the call, read the page when the call raises a question.
using Mera
quicklook(400, path="/path/to/simulation")One call. It reads within a budget, maps the box along all three axes, draws a density and temperature diagram, and reports masses, densities and temperatures. See First Look. New to Mera? First Steps is a guided first session, and Coming from Other Tools translates habits you bring.
Getting data in
| I want to … | start with | read |
|---|---|---|
| see what is in an output I have never opened | quicklook | First Look |
| a first-look summary with the panels I choose, and its cost before it runs | report | Composable Reports |
| know which outputs exist and are complete | checkoutputs, checksimulations, gettime | Data Inspection |
| read the gas | getinfo then gethydro | Load by Selection |
| read stars, dark matter, gravity, clumps, sinks or radiative transfer | getparticles, getgravity, getclumps, getsinks, getrt | Particles, Gravity |
| read everything the snapshot holds, in one call | loadall | Pipelines |
| read only part of the box | xrange, yrange, zrange with center=[:bc], range_unit=:kpc | Load by Selection |
| stop waiting for the same read every time | savedata, loaddata, convertdata | Mera Files, Converter |
| restart RAMSES on a different number of CPUs | repartition, then compareramses to check; writeramses from Mera data or a mera file | RAMSES restart, any CPUs |
| practise on data with a known answer | download_testdata (fifteen small RAMSES runs) | Test simulations |
Asking for numbers
| I want to … | start with | read |
|---|---|---|
| a total mass, or any total | msum | Basic Calculations |
| a centre or a bulk velocity | center_of_mass, bulk_velocity | Basic Calculations |
| a derived quantity: temperature, sound speed, Mach | getvar(obj, :T, :K) | Basic Calculations |
| to see every quantity available | getvar(), list_fields(obj), list_units() | Derived Fields, Units & Constants |
| mean, median, spread, weighted or masked | wstat | Basic Calculations |
| a quantity of my own, usable everywhere | add_field | Derived Fields & add_field |
| to check that my run resolves the Jeans length | getvar(gas, :jeansnumber_iso) | How Quantities Are Computed |
| a centre or a radius in a periodic box | center_of_mass(...; periodic=true), getvar(gas, :r_sphere_periodic) | Periodic Boxes |
Say the unit. getvar(gas, :T) gives code units, which mean something different in the next simulation. getvar(gas, :T, :K) is a statement about physics.
Choosing what to look at
| I want to … | start with | read |
|---|---|---|
| a sphere, a box, a cylinder, a shell | subregion with sphere, cuboid, cylinder, sphericalshell, cylindricalshell | Get Subregions |
| a ring, or one region minus another | ∩ ∪ \ ! between regions | Get Subregions §5 |
| everything above 10⁴ K, or between two densities | filterdata with Above, Below, InRange | Masking & Filtering |
| to keep the whole object but mark rows | getmask, then pass mask= | Masking & Filtering |
| to reuse one selection across a whole script | ArgumentsType, passed as myargs=; withargs | Bundling Arguments |
| a region boundary that looks sharp in a figure | subregion(..., refine_to=[px, :kpc]) | Get Subregions §7 |
The operators are set intersection, union, difference and complement. Type ∩ as \cap then TAB and ∪ as \cup then TAB, or avoid Unicode entirely: A & B, A | B, intersect(A, B), union(A, B), setdiff(A, B) and !A all mean the same.
With region values (sphere(...), cuboid(...) and the others), boundary cells are split by default, so a region and its complement add up to the parent exactly. That is worth checking once in any new script: msum(subregion(gas, reg), :Msol) + msum(subregion(gas, !reg), :Msol).
Making pictures
| I want to … | start with | read |
|---|---|---|
| a surface-density map | projection(gas, :sd, :Msol_pc2, pxsize=[50.0, :pc]) | Projection |
| a map of the stars or the dark matter | projection(part, :sd, :Msol_pc2, pxsize=[100.0, :pc]) | Projection: Particles |
| the galaxy seen from any angle | projection(...; inclination, azimuth) | Off-axis Projection, Cheatsheet |
| the galaxy centre and a face-on or edge-on view, found from the data | center_of, face_on, edge_on, angmom | Auto-Frame |
| values in one plane instead of summed along the line of sight | slice | Which tool? |
| to know which projection tool fits my case | (reading only) | Which tool? |
| a 3-D picture in which dense gas hides what is behind it | volumerender; volumeorbit or volumepath for a movie | Volume Rendering |
| a radial or vertical profile | profile | Profiles & Phase Diagrams |
| a density-temperature diagram | phase | Profiles & Phase Diagrams |
| profiles over many snapshots, or binned in three quantities | profiletimeseries, profile3d | Profiles & Phase Diagrams |
| a velocity-dispersion profile, with or without the thermal part | velocitydispersion, localdispersion | Profiles & Phase |
| a density PDF, mass- or volume-weighted | pdf | Statistics |
| a uniform grid for an FFT or a power spectrum | covering_grid, covering_grid_memory | Covering Grid |
| to open it in ParaView | export_vtk | ParaView |
Use pxsize=[value, :unit] rather than res=: it says how large a pixel is in physical units, not how many pixels there are.
Bigger jobs
| I want to … | start with | read |
|---|---|---|
| find clumps or cores | clumpfind | Clump Finding |
| a star-formation rate or history | sfr, sfr_snapshot, depletion_time | Star-Formation Rate |
| the same analysis over fifty outputs | timeseries | Time Series |
| a movie | getmovie, savemovie, rotation_sequence | Movies, Which tool? |
| ages and redshifts on a cosmological run | cosmic_time, lookback_time, iscosmological | Cosmological Runs |
| magnetic fields, or radiative-transfer data | getvar(gas, :bmag), getrt | Magnetic Fields, Radiative Transfer |
| to use all my cores | start Julia with -t 8; max_threads where it matters | Multi-Threading |
| quieter output, or no progress bars | output_mode(false) | Verbose & Progress Switches |
| to be told when a long run finishes | notifyme, bell | Notifications |
Making the result defensible
| I want to … | start with | read |
|---|---|---|
| to record what produced a number | provenance(obj), provenance_string, mera_build | Provenance |
| someone else to reproduce it | a Project.toml beside the script, and its Manifest.toml | Reproducibility |
| to check I did not invert a condition | the partition check above | Masking & Filtering |
| to know how a number is computed before I quote it | (reading only) | How Quantities Are Computed |
When the row you want is not here
A gallery recipe is a whole workflow rather than one function: download it, change the path, run it. If you are working with an AI assistant, Using an AI Assistant has a file to give it so that what it writes runs, and the checks worth keeping.
And when something goes wrong, the error messages are written to be read: they suggest near matches, list what the object actually holds, and name the function that reports the details. Troubleshooting covers common first-hour errors.