diff --git a/jwst/background/background_step.py b/jwst/background/background_step.py index e31fd82033..2b16d91a8e 100755 --- a/jwst/background/background_step.py +++ b/jwst/background/background_step.py @@ -1,7 +1,7 @@ #! /usr/bin/env python from jwst.stpipe import Step -from jwst import datamodels +from .. import datamodels from . import background_sub class BackgroundStep(Step): @@ -35,7 +35,7 @@ def process(self, input, bkg_list): """ # Load the input data model - with models.open(input) as input_model: + with datamodels.open(input) as input_model: # Do the background subtraction result = background_sub.background_sub(input_model, bkg_list) diff --git a/jwst/background/background_sub.py b/jwst/background/background_sub.py index 2c1502f6de..c08fb80415 100755 --- a/jwst/background/background_sub.py +++ b/jwst/background/background_sub.py @@ -1,6 +1,6 @@ from __future__ import division -from jwst import datamodels +from .. import datamodels from . import subtract_images import numpy as np @@ -71,11 +71,11 @@ def average_background(bkg_list): # Loop over the images to be used as background for bkg_file in bkg_list: log.debug(' Accumulate bkg from %s', bkg_file) - bkg_model = models.ImageModel(bkg_file) + bkg_model = datamodels.ImageModel(bkg_file) # Initialize the avg_bkg model, if necessary if avg_bkg is None: - avg_bkg = models.ImageModel(bkg_model.data.shape) + avg_bkg = datamodels.ImageModel(bkg_model.data.shape) # Accumulate the data from this background image avg_bkg.data += bkg_model.data diff --git a/jwst/background/subtract_images.py b/jwst/background/subtract_images.py index d79a480136..bf68f1081f 100644 --- a/jwst/background/subtract_images.py +++ b/jwst/background/subtract_images.py @@ -1,6 +1,6 @@ from __future__ import division -from jwst import datamodels +from .. import datamodels import numpy as np import logging diff --git a/jwst/background/subtract_images_step.py b/jwst/background/subtract_images_step.py index 8b083fc521..7a5cab2b92 100755 --- a/jwst/background/subtract_images_step.py +++ b/jwst/background/subtract_images_step.py @@ -1,7 +1,7 @@ #! /usr/bin/env python from jwst.stpipe import Step -from jwst import datamodels +from .. import datamodels from jwst.background import subtract_images class SubtractImagesStep(Step): @@ -36,25 +36,25 @@ def process(self, input1, input2): """ # First, determine what kind of input model has been provided - model1 = models.open(input1) + model1 = datamodels.open(input1) - if isinstance(model1, models.CubeModel): + if isinstance(model1, datamodels.CubeModel): self.log.debug('Input is a CubeModel') model1.close() - model1 = models.CubeModel(input1) - elif isinstance(model1, models.ImageModel): + model1 = datamodels.CubeModel(input1) + elif isinstance(model1, datamodels.ImageModel): self.log.debug('Input is an ImageModel') model1.close() - model1 = models.ImageModel(input1) - elif isinstance(model1, models.DataModel): + model1 = datamodels.ImageModel(input1) + elif isinstance(model1, datamodels.DataModel): self.log.debug('Input is a MultiSlitModel') model1.close() - model1 = models.MultiSlitModel(input1) + model1 = datamodels.MultiSlitModel(input1) # Assume that the second input model is always Image or MultiSlit with # a single image, which is safe to open as MultiSlit for either case - #model2 = models.MultiSlitModel(input2) - model2 = models.ImageModel(input2) + #model2 = datamodels.MultiSlitModel(input2) + model2 = datamodels.ImageModel(input2) # Call the subtraction routine result = subtract_images.subtract(model1, model2)