hipspy / hips

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

Document dtypes used and conversions #40

Open cdeil opened 7 years ago

cdeil commented 7 years ago

I'm splitting out one point of discussion from #30 : we should have a strategy how to handle different dtypes (int, float) and when conversions occur. This is a reminder issue for @adl1995 to write a small docs page describing the behaviour and to add tests asserting it.

At the moment it looks like the scikit-image transform we call always outputs floats, it can't output ints directly (this kinda makes sense, interpolation methods usually need floats as far as I know).

So for now, we're calling with preserve_range=True, which gives back float64 with roughly the same values as the input int16 image in our FITS test case.

preserve_range : bool, optional
Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float.

There's several things to discuss / decide here, namely whether to convert to float32 by default to save space and avoid the float64, whether to provide options in hips to convert back to int images, or whether to only document to users how to do that, ...

cdeil commented 7 years ago

I've added some info in this docstring: https://github.com/hipspy/hips/commit/9b52a7a7eac2b8092ab568dec8e8a13b8bb0a877

I'm keeping this issue open and assigning to myself, the remaining task is to explain this clearly in the high-level docs.