Closed hamogu closed 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.
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
Fixed by #42
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
andextract_array_2d
) using the slices from_get_slices
. However, there are other uses for_get_slices
:extract_array_2d
will raise an Exception in this case.)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
toget_slices
.