You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
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:
assign a value to a subregion (e.g. to mask it)
use the slices to address a related array of same size as the data array (e.g. a mask array)
extract the overlapping part of a 2d array, even if it only partially overlaps (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 to get_slices.
👍, 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.
Activity
keflavich commentedon Oct 2, 2014
👍, 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 commentedon Dec 2, 2014
Related issue: #40
I think we haven't found a good API for slices = sub-images = cutouts yet ... see my comment here:
#40 (comment)
Fix for astropy#40 and astropy#29
Fix for astropy#40 and astropy#29
Fix for astropy#40 and astropy#29
Merge pull request #42 from adonath/fix_for_#40
astrofrog commentedon Dec 14, 2014
Fixed by #42
Fix for astropy/imageutils#40 and astropy/imageutils#29
Fix for astropy/imageutils#40 and astropy/imageutils#29
Fix for astropy/imageutils#40 and astropy/imageutils#29