From 9d56302ebc0eb9a8317cebcb5cf9d92b4b12f125 Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Sun, 19 Jan 2020 07:23:10 -1000 Subject: [PATCH] WCS footprint improvements (#61) * Fixing odd merge --- panoptes/piaa/utils/helpers.py | 16 ++-------------- panoptes/piaa/utils/sources.py | 7 +++---- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/panoptes/piaa/utils/helpers.py b/panoptes/piaa/utils/helpers.py index d1fa5d3..94029c1 100644 --- a/panoptes/piaa/utils/helpers.py +++ b/panoptes/piaa/utils/helpers.py @@ -69,18 +69,6 @@ def get_stars( if not cursor: if not cursor: cursor = get_cursor(port=5433, db_name='v702', db_user='panoptes') - - ra_selector = None - if np.abs(ra_max - ra_min) > 340: - ra_selector = f'(ra >= {ra_max} OR ra <= {ra_min})' - else: - ra_selector = f'(ra >= {ra_min} AND ra <= {ra_max})' - - dec_selector = None - if np.abs(dec_max - dec_min) > 70: - dec_selector = f'(dec >= {dec_max} OR dec <= {dec_min})' - else: - dec_selector = f'(dec >= {dec_min} AND dec <= {dec_max})' ra_selector = None if np.abs(ra_max - ra_min) > 340: @@ -89,7 +77,7 @@ def get_stars( ra_selector = f'(ra >= {ra_min} AND ra <= {ra_max})' dec_selector = None - if np.abs(dec_max - dec_min) > 340: + if np.abs(dec_max - dec_min) > 70: dec_selector = f'(dec >= {dec_max} OR dec <= {dec_min})' else: dec_selector = f'(dec >= {dec_min} AND dec <= {dec_max})' @@ -110,7 +98,7 @@ def get_stars( {dec_selector} ; """ - + if verbose: print(fetch_sql) diff --git a/panoptes/piaa/utils/sources.py b/panoptes/piaa/utils/sources.py index 70f0525..a0208af 100644 --- a/panoptes/piaa/utils/sources.py +++ b/panoptes/piaa/utils/sources.py @@ -141,13 +141,13 @@ def _print(msg): # Change the index to the picid point_sources.set_index('picid', inplace=True) - + _print(f'Point sources: {len(point_sources)}') # Remove catalog matches that are too large _print(f'Removing matches that are greater than {max_catalog_separation} arcsec from catalog.') point_sources = point_sources.loc[point_sources.catalog_sep_arcsec < max_catalog_separation] - + _print(f'Point sources: {len(point_sources)} {fits_file}') return point_sources @@ -217,7 +217,6 @@ def _print(msg): return point_sources - def _lookup_via_sextractor(fits_file, sextractor_params=None, trim_size=10, verbose=False, *args, **kwargs): def _print(msg): @@ -271,7 +270,7 @@ def _print(msg): raise Exception("Problem running sextractor: {}".format(e)) # Read catalog - _print('Building detected source table with {source_file}') + _print(f'Building detected source table with {source_file}') point_sources = Table.read(source_file, format='ascii.sextractor') # Remove the point sources that sextractor has flagged