Where to start

The rest of this site is organised by what Mera has. This page is organised by what you want, which is the order you actually meet things in.

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.

If you have a snapshot and no idea what is in it
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.

Getting data in

I want to …start withread
see what is in an output I have never openedquicklookFirst Look
know which outputs exist and are completecheckoutputs, printtimeData Inspection
read the gasgetinfo then gethydroLoad & Select
read everything the snapshot holds, in one callloadallPipelines
read only part of the boxxrange, yrange, zrange with center=[:bc], range_unit=:kpcLoad & Select
stop waiting for the same read every timesavedata, loaddata, convertdataPerformance
practise on data with a known answerdownload_testdataReproducibility

Asking for numbers

I want to …start withread
a total mass, or any totalmsumBasic Calculations
a centre, a bulk velocity, a dispersioncenter_of_mass, bulk_velocity, velocitydispersionBasic Calculations
a derived quantity: temperature, sound speed, Machgetvar(obj, :T, :K)Basic Calculations
to see every quantity availablegetvar(), list_fields(obj), list_units()run it in the REPL
mean, median, spread, weighted or maskedwstatStatistics
a quantity of my own, usable everywhereadd_fieldBasic Calculations

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 withread
a sphere, a box, a cylinder, a shellsubregion with Mera.Sphere, Mera.Cuboid, Mera.CylinderSub-regions
a ring, or one region minus another \ ! between regionsHow it is measured
everything above 10⁴ K, or between two densitiesfilterdata with Above, Below, InRangeMasking & Filtering
to keep the whole object but mark rowsgetmask, then pass mask=Masking & Filtering
to reuse one selection across a whole scriptwithargs / myargsBundling Arguments

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 withread
a surface-density mapprojection(gas, :sd, :Msol_pc2, pxsize=[50.0, :pc])Projection
the galaxy seen from any angleprojection(...; inclination, azimuth)Off-axis Projection
to know which projection tool fits my caseWhich tool
a radial or vertical profileprofileProfiles & Phase
a density-temperature diagramphaseProfiles & Phase
a uniform grid for an FFT or a power spectrumcovering_grid, covering_grid_memoryCovering Grid
to open it in ParaViewexport_vtkParaView

Use pxsize=[value, :unit] rather than res=: it says what a pixel means on the sky rather than how many of them there are.

Bigger jobs

I want to …start withread
find clumps or coresclumpfindClump Finding
a star-formation rate or historysfr, sfr_snapshot, depletion_timeStar-Formation Rate
the same analysis over fifty outputstimeseriesTime Series
a moviegetmovie, savemovie, rotation_sequenceMovies
ages and redshifts on a cosmological runcosmic_time, lookback_time, iscosmologicalCosmology
to use all my coresstart Julia with -t 8; max_threads where it mattersMulti-Threading
to be told when a long run finishesnotifyme, bellNotifications

Making the result defensible

I want to …start withread
to record what produced a numberprovenance_string, mera_buildReproducibility
someone else to reproduce ita Project.toml beside the script, and its Manifest.tomlGallery
to check I did not invert a conditionthe partition check aboveMasking & Filtering
to know how a number is computed before I quote itHow it is measured

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 rest. Troubleshooting covers the rest.