diff --git a/metadetect/lsst/measure.py b/metadetect/lsst/measure.py index df3930e..ded53f2 100644 --- a/metadetect/lsst/measure.py +++ b/metadetect/lsst/measure.py @@ -27,7 +27,7 @@ from ..fitting import fit_mbobs_wavg, get_wavg_output_struct from . import util -from .util import ContextNoiseReplacer +from .util import ContextNoiseReplacer, get_jacobian from . import vis from .defaults import DEFAULT_THRESH @@ -657,7 +657,6 @@ def _extract_jacobian_at_source(exp, source): Jacobian: ngmix.Jacobian The local jacobian """ - from .util import get_jacobian orig_cen = exp.getWcs().skyToPixel(source.getCoord()) diff --git a/metadetect/lsst/metadetect.py b/metadetect/lsst/metadetect.py index b3d136e..e8527dc 100644 --- a/metadetect/lsst/metadetect.py +++ b/metadetect/lsst/metadetect.py @@ -608,7 +608,6 @@ def fit_original_psfs_mbexp(mbexp, rng, wgts): This can fail and flags will be set, but we proceed """ - from .measure import extract_psf_image assert len(wgts) == len(mbexp) wsum = sum(wgts) @@ -634,7 +633,7 @@ def fit_original_psfs_mbexp(mbexp, rng, wgts): ) jac = get_jacobian(exp=exp, cen=cen) - psf_im = extract_psf_image(exp, cen) + psf_im = measure.extract_psf_image(exp, cen) psf_cen = (np.array(psf_im.shape)-1.0)/2.0 psf_jacob = jac.copy() diff --git a/metadetect/lsst/skysub.py b/metadetect/lsst/skysub.py index 05df3e5..7229791 100644 --- a/metadetect/lsst/skysub.py +++ b/metadetect/lsst/skysub.py @@ -6,8 +6,8 @@ ) from lsst.meas.algorithms import SourceDetectionConfig as OriginalSourceDetectionConfig from lsst.pex.config import Config, ConfigurableField, Field -from lsst.pipe.base import Task - +from lsst.pex.exceptions import RuntimeError as LSSTRuntimeError +from lsst.pipe.base import Task, TaskError from .defaults import DEFAULT_THRESH from . import util @@ -64,8 +64,6 @@ def __init__(self, *args, **kwargs): self.makeSubtask("back") def run(self, exposure): - from lsst.pex.exceptions import RuntimeError as LSSTRuntimeError - from lsst.pipe.base.task import TaskError if self.config.niter < 1: raise ValueError(f'niter {self.config.niter} is less than 1')