This library implements some functions which can be used to handle the outputs from the cosmological code MASCLET (Quilis, 2004). Do not hesitate to contact the creator of the library (David Vallés) for any troubles you might encounter or suggestions you might have regarding this library.
In the following lines, we add some brief information about each of the modules of the library. More information about the specific usage of each function can be found in their corresponding docstrings.
The modules can be imported independently,
from masclet_framework import read_masclet
or all at once,
import masclet_framework as masclet
in which case the modules can be accessed by masclet.read_masclet, for instance.
Our recommendation is to clone this repository and move the folder masclet_framework to the top level of your src folder (or equivalent). Then, you can import the library just by adding the src folder to your sys.path:
import sys
sys.path.append('/path/to/the/folder/containing/masclet_framework')
Contains the necessary functions to read MASCLET output files (gas, dark matter and stars files), as well as some other utilities.
Contains functions in order to write a json file with the parameters of the simulation and read them in other functions / in your own scripts.
Contains several functions which can become handy in the daily work with these simulations. From cleaning the fields from overlaps and refinements to build uniform grids from the AMR structure of MASCLET.
Contains functions to compute the coordinates of each cell in the simulation, which can be extremely useful to build radial profiles and compute enclosed masses. Functions for these precise purposes are also included. Several other calculations, like computing angular momenta, shape tensors, etc. can also be performed with this library.
Contains functions to deal with particle species (either dark matter or stars), which could indeed be easily applicable to other simulation codes.
Supplies easy unit conversion from MASCLET internal units to cgs, ISU and astrophysical units.
Includes several essential cosmological computations (like cosmological time from redshift, background and critical densities, etc. Also includes a function to write and read a cosmological parameters file for a simulation, analogously to what can be done with the parameters module.
Includes several functions for straightforward representations, like computing projections from uniform grids and plotting colormaps (using matplotlib).
Provides a framework from MASCLET outputs to the yt-package, in order to load the grid structure and fields into it. Although this function has not been thoroughly tested, this can be quite useful to perform more advanced representations (volume renders, for example).
Includes functions for reading the outputs from the halo finder ASOHF (Planelles & Quilis, 2010).