Skip to content

Commit

Permalink
hotfix for broken GFA tests (mea culpa)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbailey committed Sep 14, 2017
1 parent da73ea5 commit 81b9846
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion py/desimodel/focalplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import numpy as np
from astropy.io import fits
import astropy.units as u
from astropy.table import Table

# Define this here to avoid a problem with Sphinx compilation.
try:
Expand Down Expand Up @@ -834,7 +835,7 @@ def get_gfa_targets(targets, rfluxlim = 1000, tiles = None, buffer_arcsec = 100)
Note also that the function returns an empty Table if no targets are on any GFAs or of sufficient brightness
"""
# Checks if the flux_r meets a minimum threshold
targets = targets[targets['FLUX_R'] > rfluxlim]
targets = Table(targets[targets['FLUX_R'] > rfluxlim])
if len(targets) == 0:
targets['TILEID'] = np.zeros(0, dtype=np.int32)
targets['GFA_LOC'] = np.zeros(0, dtype=np.int8)
Expand Down
2 changes: 1 addition & 1 deletion py/desimodel/test/test_focalplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_get_gfa_targets(self):
tiles['DEC'] = [-2.0, -1.0, 1.0, 2.0]
tiles['FLUX_R'] = [50, 50, 50, 100]
targets = get_gfa_targets(tiles)
self.assertEqual([], targets)
self.assertEqual(len(targets), 0)



Expand Down

0 comments on commit 81b9846

Please sign in to comment.