From 49b471343a894ad557bfdc5306ad4b47849adf0c Mon Sep 17 00:00:00 2001 From: jaimerzp Date: Tue, 1 Oct 2024 16:31:30 +0300 Subject: [PATCH] exlcude --- heracles/catalog/filters.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/heracles/catalog/filters.py b/heracles/catalog/filters.py index 5169541..c1e6dbb 100644 --- a/heracles/catalog/filters.py +++ b/heracles/catalog/filters.py @@ -60,7 +60,10 @@ def __call__(self, page): class FootprintFilter: - """Filter a catalogue using a footprint map.""" + """Filter a catalogue using a footprint map. + This rempoves the pixels that are not in the footprint map. + Moreover, it removes the pixels which have NaN values in the + longitude and latitude columns.""" def __init__(self, footprint, lon, lat): """Filter using the given footprint map and position columns.""" @@ -94,6 +97,7 @@ def __call__(self, page): _lon, _lat = page[lon], page[lat] good_entry = np.isfinite(_lon) & np.isfinite(_lat) _lon, _lat = _lon[good_entry], _lat[good_entry] + page.delete(np.where(~good_entry)[0]) ipix = ang2pix(self._nside, _lon, _lat, lonlat=True) exclude = np.where(self._footprint[ipix] == 0)[0] page.delete(exclude)