astropy / imageutils

Image processing utilities for Astropy (No longer maintained)
https://imageutils.readthedocs.org/
9 stars 17 forks source link

make `_get_slices` a public function #29

Closed hamogu closed 9 years ago

hamogu commented 9 years ago

Currently, the name of array_utils._get_slices indicates that this is a private function and should not be used by the user. Why is that so?

I propose to expose this function publically. There are two functions that use _get_slices, but they are essentially very thin wrappers around the _get_slices functionality. They allow to extract or add (add_array_2d and extract_array_2d) using the slices from _get_slices. However, there are other uses for _get_slices:

I have use cases for all three options in PSF phometry with masked values. I need to keep a mask in snyc with the data (my masks are calculated and do not come with the data, so it is more logical to use them separately instead of an NDData object, even when that works) and I need to do PSF photometry, even if the PSF only partially overlaps with the image.

We could either write wrappers for those uses, too, or we could just rename _get_slices to get_slices.

keflavich commented 9 years ago

:+1:, this looks like a generally useful function. Renaming sounds like a reasonable approach. If you go ahead and make that PR, it would be nice to include a few of these use cases as new Examples.

cdeil commented 9 years ago

Related issue: #40 I think we haven't found a good API for slices = sub-images = cutouts yet ... see my comment here: https://github.com/astropy/imageutils/issues/40#issuecomment-65224149

astrofrog commented 9 years ago

Fixed by #42