AnastrisTNG is a python package for processing and analyzing the cosmological simulation IllustrisTNG.
for 3.8 =< Python version <3.10:
git clone https://github.com/wx-ys/AnastrisTNG.git
for Python version >=3.10 and pynbody version >=2.0:
git clone -b release-v2.0.0 https://github.com/wx-ys/AnastrisTNG.git
Install this in editable mode.
cd AnastrisTNG
pip install -e .
AnastrisTNG uses the following python packages:
- numpy, scipy
- pynbody
- h5py
- tqdm
- six
- numba
-
Supports TNG50, TNG100 and TNG300, including all data units.
-
Quickly explore galaxy evolution history, merger history, halo evolution history.
-
Analyze galactic interactions under the same coordinate system.
-
Analyze groupcatalog, trace gas particles, etc
-
Easy to view the radial and vertical distribution of the constituent properties of galaxies, including 3D properties and 2D projection properties.
- Quickly (tens of seconds) check galaxy star formation history over time and space (not public). If you're interested, please contact me lushuai@stu.xmu.edu.cn.
from AnastrisTNG import TNGsimulation
BasePath = 'filepath'
snap=99 #snapshot
Snapshot=TNGsimulation.Snapshot(BasePath,snap) # use the data of snapshot99
Snapshot.load_halo(400) #load a halo(id=400)
Snapshot.load_subhalo(8) #load a subhalo(id=8)
# load a single subhalo
sub = Snapshot.load_particle(ID=10, groupType='Subhalo', decorate=True)
sub.physical_units() #in physical unit
sub.face_on(alignwith='star',rmax=8) # face on, based on stellar angular momentum.
See examples for more details,
MIT © Shuai Lu