hipspy / hips

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

Grid structure in large mosaics #133

Open intheobservingzone opened 5 years ago

intheobservingzone commented 5 years ago

Hola, hola,

I've trying to build large plots based on DeCAPS color images available at Aladin and the displayed plots show an unwanted grid-diamond structure. The code is very plain, based in a "hips" example:

from astropy.coordinates import SkyCoord
from hips import WCSGeometry, make_sky_image
# Compute the sky image
geometry = WCSGeometry.create(
    skydir=SkyCoord(330., 3.000, unit='deg', frame='galactic'),
    width=2000, height=2000, fov="2.0 deg",
    coordsys='galactic', projection='AIT',
)
hips_survey = 'CDS/P/DECaPS/DR1/color'
result = make_sky_image(geometry=geometry, hips_survey=hips_survey,
                precise='yes', tile_format='png')

# Draw the sky image
import matplotlib.pyplot as plt
ax = plt.subplot(projection=geometry.wcs)
ax.imshow(result.image, origin='lower')
ax.set_xlabel("Gal. longitude [deg]")
ax.set_ylabel("Gal. latitude [deg]")
plt.savefig('zzz.png', dpi=600)

plt.show()

The image result is attached. Depending of the resolution of the image or the size, the grid is not the same, even changing color from white to red, etc. The diamonds look like healpix tesselation. I've added the "precise=yes" in make_sky_image, without improvements. I'm using Python 3.6 with fresh Anaconda3-5.3, in Mac Mojave. Thank you very much in advance. All the best.

image

adl1995 commented 5 years ago

The grid structure you observe is not actually HEALPix tessellation, but a bug in our drawing algorithm. Currently, we sum up all the tiles which leads to bright lines around the edges.

@cdeil - If you have time, we can continue the discussion in (https://github.com/hipspy/hips/issues/79) and I will try to get this fixed.