Skip to content

Commit e28e13b

Browse files
authored
Merge pull request #243 from larrybradley/photutils3-compat
More photutils 3.0 compat for findsat_mrt
2 parents 5c71bee + 964709c commit e28e13b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

acstools/findsat_mrt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ def find_mrt_sources(self):
764764
from astropy.utils import minversion
765765

766766
PHOTUTILS_LT_3 = not minversion(photutils, "2.3.1.dev") # dev tag a little off
767+
photutils.future_column_names = True
767768

768769
LOG.info('Detection threshold: {}'.format(self.threshold))
769770

@@ -787,7 +788,6 @@ def find_mrt_sources(self):
787788

788789
# can fail for cases where nothing found. Allow code to return
789790
# nothing and move on
790-
791791
tbl = s.find_stars(snrmap, mask=snrmap_mask)
792792
if tbl is None:
793793
nsources = 0
@@ -797,6 +797,12 @@ def find_mrt_sources(self):
797797
LOG.info('{{no}} sources found using kernel: {}'.format(nsources))
798798

799799
if nsources > 0:
800+
if not PHOTUTILS_LT_3:
801+
col_map = {'x_centroid': 'xcentroid',
802+
'y_centroid': 'ycentroid'}
803+
for col in col_map:
804+
tbl.rename_column(col, col_map[col])
805+
800806
tbl = tbl[np.isfinite(tbl['xcentroid'])]
801807
LOG.info('{} sources found using kernel'.format(len(tbl)))
802808
if (len(tbls) > 0):

0 commit comments

Comments
 (0)