hipspy / hips

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

Introduce method for creating children tiles #83

Closed adl1995 closed 7 years ago

adl1995 commented 7 years ago

As discussed during telecon today with @cdeil (also mentioned in the precise algorithm), I will open a PR adding a method named: make_child_tiles(?) which will take as parameter the father tile. It will then split this into four children tiles by slicing the father tile into four quarters. It will use something like: tile[0, width / 4] and then call HipsTile.from_numpy class method. The new tiles will be labeled according to the scheme mentioned in the HiPS paper, page 31, titled "Children of the tile".

cdeil commented 7 years ago

I'm never sure with naming at first and then find that only over time as one starts to call the functionality good names and locations for code are found. In this case, I think I would start by putting it as a property on HipsTile called children which returns the list of 4 child tiles.

There should be a good docstring and a parameterised test using these tiles we already have with the different formats: https://github.com/hipspy/hips/blob/master/hips/tiles/tests/test_tile.py#L54

Otherwise, yes, your description sounds good to me ... go ahead!

adl1995 commented 7 years ago

Done in #85. Closing this issue now.