Skip to content

fix local env B related artificial spikes#207

Open
ahnyu wants to merge 2 commits intoabacusorg:mainfrom
ahnyu:fixB
Open

fix local env B related artificial spikes#207
ahnyu wants to merge 2 commits intoabacusorg:mainfrom
ahnyu:fixB

Conversation

@ahnyu
Copy link
Copy Markdown

@ahnyu ahnyu commented Apr 8, 2026

This PR fixes a bug in the local environment calculation used by the assembly-bias parameters (Bcent, Bsat). The issue was that Menv was estimated independently within each superslab, so halos close to a superslab boundary were missing neighboring halos from adjacent superslabs. This led to incorrect Menv values near slab edges and introduced an artificial x-dependent striping pattern in the derived fenv field.
The fix is:

  1. in prepare_sim.py, compute raw Menv for each superslab using padded halos from neighboring superslabs, save slim per-slab env files containing id, mass, and Menv.
  2. in abacus_hod.py, build the final global fenv_rank from the concatenated env files and map it back to the staged halo and particle catalogs by halo ID.
    This fix is for box, the light-cone approach is unchanged.
    Included are before/after plots showing the clustering signal (Pk), galaxy counts along each axis.
  • Before (note spikes around k = 0.11, 0.22, 0.33, slab boundaries):
Screenshot from 2026-04-08 03-38-50
  • After:
Screenshot from 2026-04-08 03-39-27

@ahnyu ahnyu changed the title fix local env B related artifical spikes fix local env B related artificial spikes Apr 8, 2026
@lgarrison
Copy link
Copy Markdown
Member

Thanks @ahnyu! I think this sounds reasonable.

@SandyYuan Are you available to take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants