diff --git a/LICENSE b/LICENSE index fd4afaf..ba48312 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Michael Kelley +Copyright (c) 2018-2019 University of Maryland and the calviacat contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 96d3657..48df092 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# calviacat v1.0.1 +# calviacat v1.0.2 Calibrate star photometry by comparison to a catalog. PanSTARRS 1 and SkyMapper catalogs currently implemented. Catalog queries are cached so that subsequent calibrations of the same or similar fields can be more quickly executed. +## Attribution and license + +calviacat is written by Michael S. P. Kelley, with contributions from: Tim Lister. It is licensed with the MIT License (see LICENSE for details). + ## Requirements * sqlite3 diff --git a/calviacat/catalog.py b/calviacat/catalog.py index b4ca92f..dd0156b 100644 --- a/calviacat/catalog.py +++ b/calviacat/catalog.py @@ -13,7 +13,16 @@ from astropy.coordinates import SkyCoord from astropy.stats import sigma_clipped_stats, sigma_clip from astropy.modeling import models, fitting -from astropy.version import version_info as astropy_version + +try: + from astropy.version import version_info as astropy_version +except ImportError: + import astropy.version + astropy_version = [int(x) for x in astropy.version.version.split('.')] + + +class CalibrationError(Exception): + pass class TableDefinition: @@ -418,10 +427,16 @@ def cal_color(self, matched, m_inst, filt, color, C=None, fitting.LinearLSQFitter(), sigma_clip) i = np.isfinite(dm) * ~dm.mask - if astropy_version[0] > 3 or (astropy_version[0] == 3 and astropy_version[1] >= 1): - # Return order changed in astropy 3.1 (http://docs.astropy.org/en/stable/changelog.html#id10) - # Also now returns a boolean mask array rather than a MaskedArray of the data which could - # be applied back to reconstuct 'line' if needed (not currently used) + if sum(i) == 0: + raise CalibrationError('All sources masked.') + + if (astropy_version[0] > 3 or + (astropy_version[0] == 3 and astropy_version[1] >= 1)): + # Return order changed in astropy 3.1 + # (http://docs.astropy.org/en/stable/changelog.html#id10) + # Also now returns a boolean mask array rather than a + # MaskedArray of the data which could be applied back to + # reconstuct 'line' if needed (not currently used) fit, mask = fitter(model, cindex[i], dm[i]) else: line, fit = fitter(model, cindex[i], dm[i]) diff --git a/setup.py b/setup.py index 4e8158b..cdedec0 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='calviacat', - version='1.0.1', + version='1.0.2', description='Calibrate star photometry by comparison to a catalog.', author='Michael S. P. Kelley', author_email='msk@astro.umd.edu',