MERA.jl

High-performance RAMSES AMR + particle + gravity analysis in pure Julia with a unified, extensible API

DOI

MERA is a Julia package for high-performance analysis of large-scale astrophysical simulation data from RAMSES hydrodynamic code. Built entirely in Julia, it provides a unified API for AMR grids, N-body particles, and gravity data with native performance and extensive scientific functionality.

MERA.jl Computational Astrophysics Workflow

Computational astrophysicist analyzing AMR simulation data with MERA.jl's powerful visualization and analysis capabilities

Why MERA for Computational Research?

Julia Performance Advantage: Compiled language speed for numerical computations while maintaining interactive development RAMSES-Native Processing: Direct binary file reading with optimized AMR algorithms and Hilbert space-filling curve support AMR-Aware Analysis: Proper handling of multi-resolution grids with correct level weighting Reproducible Research Pipeline: Complete environment management with Project.toml/Manifest.toml for computational reproducibility

Quick Start: Choose Your Path

5-Minute Demo

See MERA in action immediately

using Mera
info = getinfo(1, "path/sim")
gas = gethydro(info)
projection(gas, :rho)

→ Get Started

For Scientists

RAMSES expert, new to Julia?

  • Native RAMSES support
  • Physics variables built-in
  • Multi-threaded performance

→ Scientific Workflows

For Programmers

Python/MATLAB user learning Julia?

  • Migration guides
  • Performance comparisons
  • Ecosystem integration

→ Migration Guide

Quick Navigation

Want to: Make a density plot → Projections • Calculate stellar masses → Basic Calculations • Load specific regions → Selections • Optimize performance → Multi-Threading

How to Cite MERA

If you use MERA in your research, please cite it using the DOI badge above. This supports continued development and helps other researchers discover the tool. Please also star the GitHub repository!

Installation & First Steps

Quick Installation (2 minutes)

using Pkg
Pkg.add("Mera")
using Mera

Requirements: Julia 1.10+, 8GB+ RAM recommended Platforms: macOS (including Apple Silicon), Linux, Windows

Your First MERA Analysis

# Load simulation metadata
info = getinfo(output=1, "/path/to/simulation")

# Load gas data  
gas = gethydro(info)

# Create density projection
proj = projection(gas, :rho, direction=:z)

# You're analyzing AMR data!

Key Capabilities

  • Julia-Native Performance: JIT compilation delivers native performance for numerical computations without Python overhead
  • Memory-Efficient AMR Processing: Handle TB-scale simulations with selective loading and IndexedTables.jl backend
  • Multi-Threaded I/O Optimization: Comprehensive benchmarking framework for optimal thread configuration
  • Extensive Physics Variables: 70+ hydro and 30+ particle derived quantities (Jeans mass, Mach numbers, virial parameters)
  • Advanced AMR Projections: Mass-conserving projections with proper AMR boundary handling
  • Professional Visualization Pipeline: VTK export preserving AMR structure for ParaView/VisIt
  • Compressed Data Storage: MERA-Files with LZ4/Zlib/Bzip2 compression for efficient time-series analysis
  • Publication-Grade Reproducibility: Julia environment management ensuring identical computational setups
  • RAMSES-Native Integration: Direct binary file reading with Hilbert space-filling curve support
  • Interactive Research Workflow: REPL exploration + Jupyter integration + production scripting

Why Julia + Multiple Dispatch?

MERA showcases Julia's multiple dispatch – the same function works differently based on data type, automatically choosing the correct method:

# One function name, different physics
getvar(gas_data, :mass)    # → Cell mass (density × volume)
getvar(particle_data, :mass) # → Particle mass (discrete values) 
getvar(clump_data, :mass)   # → Clump total mass (aggregated)

# Same analysis pattern, different data types
projection(gas, :rho)      # → Gas density projection
projection(particles, :age) # → Stellar age distribution

Benefit: Write analysis code once, works across all RAMSES data types automatically.

Learning Path & Documentation

🟢 Beginner Track (Start here!)

SectionPurposeTime
First StepsInstallation, core concepts, first analysis20 min
Data InspectionUnderstand RAMSES data structure15 min
Basic CalculationsUnits, statistics, physics variables25 min

🟡 Intermediate Track

SectionPurposeTime
Load by SelectionEfficient memory management20 min
Get SubregionsSpatial selections, coordinate systems25 min
Projections2D visualizations, publication plots30 min
MERA FilesData compression and sharing15 min

🔴 Advanced Features

SectionPurposeBest For
Multi-ThreadingHPC optimization, parallel processingPerformance users
Volume Rendering3D visualization with ParaViewAdvanced visualization
BenchmarksPerformance analysis and testingSystem optimization
Advanced TestingMERA's testing frameworkDevelopers, contributors

📚 Reference Materials

Community & Support

🤝 Get Involved

💡 Quick Help

Production Ready

  • Status: Production-ready with active development and comprehensive testing
  • RAMSES Compatibility: Versions stable-17.09 through stable-19.10, plus RAMSES 2025.05 (beta)
  • Testing: Multi-platform CI/CD with extensive coverage (see our testing approach)
  • Dependencies: Full list in Project.toml

Citation & License

📖 How to Cite

If you use MERA in your research, please cite it to support development:

DOI

Click the badge for BibTeX format. Please also ⭐ the GitHub repository!

⚖️ License

MIT License

Copyright (c) 2019 Manuel Behrendt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.