Skip to content

Commit

Permalink
WCS footprint improvements (#61)
Browse files Browse the repository at this point in the history
* Fixing odd merge
  • Loading branch information
wtgee authored Jan 19, 2020
1 parent 32c9e52 commit 9d56302
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
16 changes: 2 additions & 14 deletions panoptes/piaa/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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})'
Expand All @@ -110,7 +98,7 @@ def get_stars(
{dec_selector}
;
"""

if verbose:
print(fetch_sql)

Expand Down
7 changes: 3 additions & 4 deletions panoptes/piaa/utils/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d56302

Please sign in to comment.