Open cdeil opened 7 years ago
So as mentioned on https://github.com/hipspy/hips-extra/issues/6#issuecomment-318153188 this is actually a publicly available HiPS that people will want to use.
But I now get this:
>>> from skimage.io import imread
>>> imread('http://alasky.u-strasbg.fr/IRAC4/Norder3/Dir0/Npix0.jpg').shape
(512, 512, 3)
>>> imread('https://github.com/hipspy/hips-extra/raw/master/datasets/samples/IRAC4/Norder3/Dir0/Npix299.jpg').shape
(512, 512)
It looks like the tiles we have in hips-extra
are different (single channel) from the ones on the CDS server (3 channel as for other JPEG).
@tboch - I'm assigning this issue to you: please clarify if we need to change our code to handle single-channel JPEG. And if it's not the case, then we should update the example dataset in hips-extra
for IRAC4
.
@tboch - Can you please comment here? Are there JPEG HiPS tiles that are 2D, or are they always 3D with the RGB color channel?
@cdeil : the HiPS standard says nothing about the layout of the JPEG tiles, thus we should expect to have 3 channels or a single channel. I think most of the JPEP grayscale tiles are encoded on 3 channels nevertheless.
In the very case you mention, I'm quite surprised that we have a mix between 1-channel and 3-channels tiles.
Just now I noticed that there are HiPS JPEG tiles that are grayscale, i.e. don't have the 3 color channels. Example:
I think that currently we don't process those correctly, because here we assume with JPEG we always have 3 channels: https://github.com/hipspy/hips/blob/fce110c0e2bf31baba5d9050ccf08a9c67493dff/hips/tiles/tile.py#L52
So the task here is to add test cases for the already parameterized tests using this example, in
test_tile.py
andtest_draw.py
, and then possibly to fix the handling of the shape to return a 2-dim image without color channels in that case.