LSSTDESC/healsparse

productIntersection only works for floats

Closed this issue · 3 comments

I was going to trim a region down using a boundary polygon, but got an error that the value must be float

e.g. if I make two int16 maps, smape and tile_bounds

smap = hs.productIntersection([smap, tile_bounds])

I get the error

    smap = hs.productIntersection([smap, tile_bounds])
  File "/gpfs01/astro/workarea/esheldon/anaconda-dirs/miniconda3/envs/wpixels/lib/python3.6/site-packages/healsparse-0.0.7-py3.6.egg/healsparse/operations.py", line 82, in productIntersection
  File "/gpfs01/astro/workarea/esheldon/anaconda-dirs/miniconda3/envs/wpixels/lib/python3.6/site-packages/healsparse-0.0.7-py3.6.egg/healsparse/operations.py", line 302, in _applyOperation
  File "/gpfs01/astro/workarea/esheldon/anaconda-dirs/miniconda3/envs/wpixels/lib/python3.6/site-packages/healsparse-0.0.7-py3.6.egg/healsparse/healSparseMap.py", line 43, in __init__
  File "/gpfs01/astro/workarea/esheldon/anaconda-dirs/miniconda3/envs/wpixels/lib/python3.6/site-packages/healsparse-0.0.7-py3.6.egg/healsparse/utils.py", line 70, in checkSentinel
ValueError: Sentinel not of floating type

Using this directly with an integer 1 works

smap = hs.operations._applyOperation([smap, tile_bounds], np.multiply, 1, union=False)

what is the best way to adapt it?

well, that code runs but it doesn't seem to actually trim down the region

No, it is working. I misinterpreted my plots