From 54df0b2fb312017cadf5f8a74b1638b21d5efdf0 Mon Sep 17 00:00:00 2001 From: Stephen Bailey Date: Sun, 14 Feb 2016 21:45:23 -0800 Subject: [PATCH] isolate io imports --- py/desitarget/cuts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/desitarget/cuts.py b/py/desitarget/cuts.py index 60128f764..978e76e62 100644 --- a/py/desitarget/cuts.py +++ b/py/desitarget/cuts.py @@ -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 @@ -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 @@ -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)