hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
12 stars 16 forks source link

WIP: Compute image ipix and only update masked indices in all sky image #144

Open adl1995 opened 4 years ago

adl1995 commented 4 years ago

This is a followup of #79. Previously, the output image contained bright lines as the values were being summed twice at tile edges. The current change applies the resulting tile image only at certain indices, which it receives by applying a mask on the all sky image based on the ipix values.

Previous output: result_unmasked

Current output: result_masked

However, the updated output image now contains 'holes' where pixels values are not inserted. I believe this is an issue with the warping function we're currently using. I will trying using either skimage.transform.warp_coords or scipy.ndimage.map_coordiantes and see if it resolves the issue.

cdeil commented 4 years ago

@adl1995 - Thanks for attempting to improve this!

To avoid issues at the edges, you have to call a function in scipy.ndimage or scikit-image to compute the pixel values at "target" coordinates that has an option or even by default extrapolates, i.e. if the target coordinate is just slightly outside the tile image, it will fill the tile edge pixel value and not black or white.

And to be efficient, you have to first compute the target coordinate array, only for the pixels for which a given tile should be used, and only then call the "reproject" or "interpolate" function to compute the pixel values for exactly those target positions.

Hope it's clear ...