Skip to content

IndexError - large negative index out of bounds in segmap in legacypipe #131

@craigwarner-ufastro

Description

@craigwarner-ufastro

This error only occurs in 1275p185 so far.

  File "/global/cfs/cdirs/desi/users/cdwarner/code/Tractor/legacypipe/py/legacypipe/oneblob.py", line 424, in run
    self.compute_segmentation_map()
  File "/global/cfs/cdirs/desi/users/cdwarner/code/Tractor/legacypipe/py/legacypipe/oneblob.py", line 615, in compute_segmentation_map
    Iseg, = np.nonzero(ok * ((self.refmap[iy, ix] & IN_BLOB['CLUSTER']) == 0))
                              ~~~~~~~~~~~^^^^^^^^
IndexError: index -2147483648 is out of bounds for axis 1 with size 33

It can be reproduced by running brick 1275p185 in the legacypipe gpu 1.4.4 image with the options --use-gpu --ngpu 1 --threads 8 --threads-per-gpu 8 --gpumode 2 so that all threads are run on the GPU. Yet the crash is in legacypipe and not tractor.

It also seems to only occur when python is run without the -O flag oddly. And it does not occur when I run the code outside the container in my environment, making this the opposite of the positionToPixel issue. But it does occur when running with my code in the PYTHONPATH within the image.

It may have been fixed by pulling in the latest changes from referency.py from main, which I did but may not be incorporated into the docker image? Yet I would think in this case it would not crash when using my legacypipe within the docker image.

Also ix and iy come from radec2pixelxy so this seems related to the other WCS issue:

        ok,ix,iy = self.blobwcs.radec2pixelxy(
            np.array([src.getPosition().ra  for src in self.srcs]),
            np.array([src.getPosition().dec for src in self.srcs]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions