thegooglecodearchive / healpy

Automatically exported from code.google.com/p/healpy
GNU General Public License v2.0
0 stars 0 forks source link

ud_grade fails with error #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The check in _ud_grade_core for non-finite pixels is incorrect.

In svn r188, file pixelfunc.py, line 606 is
bads = (npy.where(m==UNSEEN)) | (~npy.isfinite(m))

This fails with the error
ValueError: shape mismatch: objects cannot be broadcast to a single shape

This is due to the fact that the where() command returns a list of indices that 
match the condition, whereas isfinite() returns True or False for every entry 
in m.

To correct this make where() return True or False for all the entries in m:
bads = (npy.where(m==UNSEEN, True, False)) | (~npy.isfinite(m))

This succeeds.

Original issue reported on code.google.com by cjc...@gmail.com on 2 Jun 2011 at 12:53

GoogleCodeExporter commented 9 years ago
Coerrected in rev 194. Use function pixelfunc.mask_bad.

Original comment by cyrille....@gmail.com on 5 Jul 2011 at 2:14