MERA.jl
High-performance RAMSES AMR + particle + gravity analysis in pure Julia with a unified, extensible API
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.

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
See MERA in action immediately
using Mera
info = getinfo(1, "path/sim")
gas = gethydro(info)
projection(gas, :rho)RAMSES expert, new to Julia?
- Native RAMSES support
- Physics variables built-in
- Multi-threaded performance
Python/MATLAB user learning Julia?
- Migration guides
- Performance comparisons
- Ecosystem integration
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 MeraRequirements: 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 distributionBenefit: Write analysis code once, works across all RAMSES data types automatically.
Learning Path & Documentation
🟢 Beginner Track (Start here!)
| Section | Purpose | Time |
|---|---|---|
| First Steps | Installation, core concepts, first analysis | 20 min |
| Data Inspection | Understand RAMSES data structure | 15 min |
| Basic Calculations | Units, statistics, physics variables | 25 min |
🟡 Intermediate Track
| Section | Purpose | Time |
|---|---|---|
| Load by Selection | Efficient memory management | 20 min |
| Get Subregions | Spatial selections, coordinate systems | 25 min |
| Projections | 2D visualizations, publication plots | 30 min |
| MERA Files | Data compression and sharing | 15 min |
🔴 Advanced Features
| Section | Purpose | Best For |
|---|---|---|
| Multi-Threading | HPC optimization, parallel processing | Performance users |
| Volume Rendering | 3D visualization with ParaView | Advanced visualization |
| Benchmarks | Performance analysis and testing | System optimization |
| Advanced Testing | MERA's testing framework | Developers, contributors |
📚 Reference Materials
- Complete API - All functions and types
- Julia Migration - From Python/MATLAB/IDL
- Examples - Real-world workflows
- Troubleshooting - Common issues and solutions
Community & Support
🤝 Get Involved
- GitHub Discussions - Ask questions, share tips, get help
- Show & Tell - Share your scientific results and visualizations
- Report Issues - Bug reports and feature requests
💡 Quick Help
- REPL Help:
?getinfofor function docs,methods(getinfo)for available methods - Tutorials: Jupyter notebooks and RUM2023 materials
- Julia Ecosystem: Official docs | JuliaAstro | Performance tips
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:
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.