Skip to main content

Pyramis: Python Reader for Adaptive Mesh Interface Simulations

A python library, to provide essential and efficient framework for management and analysis of the adaptive mesh simulation such as RAMSES.

Installing

Using pip

pip install pyramis

Using development mode

git clone https://github.com/sanhancluster/pyramis
cd pyramis

pip install -e .

Using conda

To create new conda environment specifically for Pyramis,

git clone https://github.com/sanhancluster/pyramis
cd pyramis

conda env create -f environment.yml
conda activate pyramis

python -m pip install -e .

If you want to install in an already existing environment,

git clone https://github.com/sanhancluster/pyramis
cd pyramis

conda activate <my_env_name>
conda env update -f environment.yml

python -m pip install -e .

How to use

Reading the RAMSES raw data

pyramis uses multi-threading (concurrent.futures.ThreadPoolExecutor) by default for reading RAMSES snapshot files. Number of workers will be automatically decided by the available resources when the package is imported.

The particle data

You can read particle data directly from specific region by following commands. Pyramis computes list of cpu domains to read the complete data within the region using Peano-Hilbert space filling curve.

import pyramis as pr
# path to the directory where output_* are located
ramses_path = '/path/to/ramses/'
# targeting box to read in code unit
region = [[0.4, 0.6], [0.4, 0.6], [0.4, 0.6]]

part = pr.ramses.read_part(ramses_path, iout=1, region=region) # reads output_00001

print(f"Total particle mass within the box is {np.sum(part['m'])}") # in code unit

For a particular type of particles, part_type option can be used.

part = pr.ramses.read_part(ramses_path, iout=1, part_type='star')

The cell data

You can read all cells from specific region by following commands.

# path to the directory where output_* are located
ramses_path = '/path/to/ramses/'
# targeting box to read in code unit
region = [[0.4, 0.6], [0.4, 0.6], [0.4, 0.6]]

cell = pr.ramses.read_cell(ramses_path, iout=1, region=region)

print(f"Mean gas density within the box is {np.mean(cell['rho'])}") # in code unit

Reading the RAMSES HDF format data

pyramis uses concurrent.futures.ProcessPoolExecutor by default to enable parallel read from HDF files. This requires main block guard for the top-level script.

The particle and cell data

if __name__ == '__main__':
    # path to the directory where part_*.h5, cell_*.h5 are located
    hdf_path = '/path/to/hdf/'
    # targeting box in code unit
    region = [[0.4, 0.6], [0.4, 0.6], [0.4, 0.6]]

    part = pr.hdf.read_part(hdf_path, part_type='star', iout=1, region=region)
    cell = pr.hdf.read_cell(hdf_path, iout=1, region=region)

Particle type (part_type) need to be always present for reading particle data.

Reading the Dyablo cell data

dyablo_path = '/path/to/dyablo/'

pr.dyablo.read_cell(dyablo_path, istep=0)

Reading the HaloMaker data

DM Halo and Galaxy Catalog

halomaker_path = '/path/to/halos/' # path the directory where tree_bricks* are located

halo = pr.halo_finder.read_halomaker(halomaker_path, iout=1)
galaxy = pr.halo_finder.read_halomaker(galaxymaker_path, iout=1, galaxy=True)

Metadata

Release files for pyramis 0.1.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyramis 0.1.22
File Size Uploaded
pyramis-0.1.22.tar.gz 69.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyramis 0.1.22
File Interpreter ABI Platform
pyramis-0.1.22-py3-none-any.whl Python 3 none any Details

Total release size: 145.5 kB

Release files / pyramis-0.1.22.tar.gz

Download URL pyramis-0.1.22.tar.gz
Size 69.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1f333684dc66fba62a726974873aa4fa02aff9bfebebea0283757dfee3de283e
BLAKE2b-256 checksum
How to use checksums
c58d0ae826dac4a68280edb38a81577db567cfece843d4de99dd3165fd3a1b41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / pyramis-0.1.22-py3-none-any.whl

Download URL pyramis-0.1.22-py3-none-any.whl
Size 75.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1a954e9d3eaa605c7ca33577e38e3cdb887cad27f163632a239e7304e3788a4
BLAKE2b-256 checksum
How to use checksums
08daa8fd5b50a349eff0e4e7e50bfbc0635a3e121f47e36fea7202d14f5eaa9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.22 This release

2 release files

0.1.21

2 release files

0.1.19

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page