Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbacusSummit Cubic box catalogue out of bounds error right on boundary #18

Open
tsfraser opened this issue Dec 21, 2022 · 1 comment
Open

Comments

@tsfraser
Copy link

tsfraser commented Dec 21, 2022

```Traceback (most recent call last):
  File "/project/rrg-wperciva/tsfraser/Revolver/Revolver/revolver_modified.py", line 191, in <module>
    voidcat.run_voidfinder()
  File "/lustre06/project/6033532/tsfraser/Revolver/Revolver/python_tools/voxelvoids.py", line 164, in run_voidfinder
    fastmodules.allocate_gal_cic(rhog, self.cat.x, self.cat.y, self.cat.z, self.cat.weight, self.cat.size,
  File "python_tools/fastmodules.pyx", line 143, in fastmodules.allocate_gal_cic
IndexError: Out of bounds on buffer access (axis 2)```

Triggers when running AbacusSummit mocks, especially for the 1000 HOD mocks per cosmology. Axis in the error refers to the specific column in the coordinate array that's passed to allocate_gal_cic (i.e. in this case z has a single value at 2000.0 instead of 1999.9, which for a boxsize of 2000 is enough to trigger this). Will also flag this with Abacus, since their parameter space is 0<xyz<=2000 instead of 0<xyz<2000 since I'm assuming several codes are built around the latter assumption?

@HAWinther
Copy link

HAWinther commented Dec 21, 2022

Yeah some snapshots from sims use [0,Boxsize) - the convention the code expects - and some (0,Boxsize] (and some have forgotten to do a final wrapping) for the coordinates. A hack for this is to put 2000.01 as the boxsize, but some snapshots might have negative positions if they forgot to wrap so its a good idea is to not assume input is perfect and always wrap the coordinates in the code (this does not take any time) i.e. x = (x + Boxsize) % Boxsize etc. Then we ensure everything is in [0,Boxsize) and avoids this issue alltogether.

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

No branches or pull requests

2 participants