From bea31355095ca83b3457aefe890b043a56b98acc Mon Sep 17 00:00:00 2001 From: Lehman Garrison Date: Tue, 19 May 2026 16:45:08 -0400 Subject: [PATCH] maplog: change quantization to match updated data model --- abacusnbody/data/maplog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/abacusnbody/data/maplog.py b/abacusnbody/data/maplog.py index 37ce295f..7eef1e54 100644 --- a/abacusnbody/data/maplog.py +++ b/abacusnbody/data/maplog.py @@ -11,8 +11,8 @@ reference unpacker's pattern for ``mult_sec`` and ``pid``) so columns are safe to read without filtering. Use ``node_type`` as the discriminator. -Position is returned in Mpc/h (5 kpc/h quantum, fixed); velocity in km/s -(via the vect32 encoding shared with ``output_particle``). +Position is returned in Mpc/h (1/128 Mpc/h ≈ 7.8 kpc/h quantum, fixed); +velocity in km/s (via the vect32 encoding shared with ``output_particle``). The C++ source-of-truth is ``maplog.cc`` / ``vect32.cc`` in the Abacus codebase. The reference Python unpacker is @@ -44,9 +44,10 @@ NODE_TIMESLICE = 3 NODE_CONTROL_MASK = 0x3 -# Position encoding: 21 bits per axis, centered at 2^20, 5 kpc/h quantum. +# Position encoding: 21 bits per axis, centered at 2^20, 1/128 Mpc/h +# (~7.8 kpc/h) quantum. Range is ±8192 Mpc/h. _POS_OFFSET = 1 << 20 # 1048576 -_POS_SCALE = 200.0 # quanta per Mpc/h (1 / 0.005) +_POS_SCALE = 128.0 # quanta per Mpc/h _POS_MASK = (1 << 21) - 1 # 0x1FFFFF