abacusorg / abacusutils

Python code to interface with halo catalogs and other Abacus N-body data products

Home Page:https://abacusutils.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add function to read multiple particle files

lgarrison opened this issue · comments

Currently, we expose a function to read a single particle file (read_abacus.read_asdf()). We should add a higher-level function that can read multiple files into a single table.

Basically, we want a smarter version of this snippet:

from pathlib import Path
from abacusnbody.data import read_abacus
import astropy.table
allp = []
for fn in Path('AbacusSummit_small_c000_ph3000/halos/z1.100/').glob(*_rv_*/*.asdf'):
    allp += [read_abacus.read_asdf(fn, load=['pos'])]
allp = astropy.table.vstack(allp)