Skip to content

Commit

Permalink
Fix addition of calibrators from PanSTARRS. (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanep97 authored Oct 9, 2024
1 parent c75a487 commit 46e5c17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iop4admin/modeladmins/astrosource.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def add_field_stars_from_panstarrs(self, request, queryset):

logger.info(f"Got {len(catalog_data)} PanSTARRS field stars around {main_src.name}")


column_names = ['objName', 'raMean', 'decMean',
'rMeanApMag', 'rMeanApMagErr', 'rMeanApMagStd', 'rMeanApMagNpt',
'gMeanApMag', 'gMeanApMagErr', 'gMeanApMagStd', 'gMeanApMagNpt',
Expand All @@ -114,9 +113,10 @@ def add_field_stars_from_panstarrs(self, request, queryset):

for col in column_names:

idx = np.isfinite(catalog_data[col])
idx = idx.data & idx.mask
catalog_data = catalog_data[~idx]
if np.issubdtype(catalog_data.dtype[col], np.number):
idx = np.isfinite(catalog_data[col])
idx = idx.data & idx.mask
catalog_data = catalog_data[~idx]

idx = (MIN_R_MAG <= catalog_data["rMeanApMag"]) & (catalog_data["rMeanApMag"] <= MAX_R_MAG)
idx = idx & (catalog_data["rMeanApMagStd"] < MAX_MAG_STD)
Expand Down

0 comments on commit 46e5c17

Please sign in to comment.