Skip to content

Commit

Permalink
Merge pull request #30 from desihub/importio
Browse files Browse the repository at this point in the history
isolate io imports
  • Loading branch information
sbailey committed Feb 15, 2016
2 parents c86eba2 + 54df0b2 commit 6a1e16d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py/desitarget/cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
from astropy.table import Table, Row

from desitarget import io
from desitarget.internal import sharedmem
import desitarget.targets
from desitarget import desi_mask, bgs_mask, mws_mask
Expand Down Expand Up @@ -254,6 +253,7 @@ def apply_cuts(objects):
"""
#- Check if objects is a filename instead of the actual data
if isinstance(objects, (str, unicode)):
from desitarget import io
objects = io.read_tractor(objects)

#- ensure uppercase column names if astropy Table
Expand Down Expand Up @@ -367,6 +367,7 @@ def select_targets(infiles, numproc=4, verbose=False):
#- function to run on every brick/sweep file
def _select_targets_file(filename):
'''Returns targets in filename that pass the cuts'''
from desitarget import io
objects = io.read_tractor(filename)
desi_target, bgs_target, mws_target = apply_cuts(objects)

Expand Down

0 comments on commit 6a1e16d

Please sign in to comment.