Skip to content

Commit

Permalink
fix a bug in the name of output array shape variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Oct 21, 2024
1 parent f96f688 commit 0a686a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions jwst/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def __init__(self, input_models, output=None, single=False, blendheaders=True,
np.deg2rad(tr['cdelt2'].factor.value)
)

self.out_arr_shape = tuple(self.output_wcs.array_shape)
log.debug(f"Output mosaic size: {self.out_arr_shape}")
self.output_array_shape = tuple(self.output_wcs.array_shape)
log.debug(f"Output mosaic size: {self.output_array_shape}")

if pscale is None:
pscale = np.rad2deg(np.sqrt(self.output_pix_area))
Expand All @@ -172,7 +172,7 @@ def __init__(self, input_models, output=None, single=False, blendheaders=True,
available_memory = psutil.virtual_memory().available + psutil.swap_memory().total

# compute the output array size
required_memory = np.prod(self.out_arr_shape) * dtype.itemsize
required_memory = np.prod(self.output_array_shape) * dtype.itemsize

# compare used to available
used_fraction = required_memory / available_memory
Expand Down Expand Up @@ -278,15 +278,15 @@ def resample_group(self, input_models, indices, compute_error=False):

# Initialize the output with the wcs
driz = Drizzle(
out_shape=self.out_arr_shape,
out_shape=self.output_array_shape,
kernel=self.kernel,
fillval=self.fillval,
disable_ctx=True,
)
# Also make a temporary model to hold error data
if compute_error:
driz_error = Drizzle(
out_shape=self.out_arr_shape,
out_shape=self.output_array_shape,
kernel=self.kernel,
fillval=self.fillval,
disable_ctx=True,
Expand Down Expand Up @@ -442,7 +442,7 @@ def resample_many_to_one(self, input_models):
)

driz = Drizzle(
out_shape=self.out_arr_shape,
out_shape=self.output_array_shape,
kernel=self.kernel,
fillval=self.fillval,
max_ctx_id=len(input_models),
Expand Down Expand Up @@ -526,7 +526,7 @@ def resample_many_to_one(self, input_models):
inwht=inwht,
pixmap=pixmap,
in_image_limits=in_image_limits,
output_shape=self.out_arr_shape,
output_shape=self.output_array_shape,
)

del data, inwht
Expand Down Expand Up @@ -565,7 +565,7 @@ def resample_many_to_one(self, input_models):
return ModelLibrary([output_model,], on_disk=False)

def _init_variance_arrays(self):
shape = self.out_arr_shape
shape = self.output_array_shape
self._weighted_rn_var = np.full(shape, np.nan, dtype=np.float32)
self._weighted_pn_var = np.full(shape, np.nan, dtype=np.float32)
self._weighted_flat_var = np.full(shape, np.nan, dtype=np.float32)
Expand Down Expand Up @@ -712,7 +712,7 @@ def resample_variance_arrays(self, output_model, input_models):
The output_model is modified in place.
"""
self._init_variance_arrays()
output_shape = self.out_arr_shape
output_shape = self.output_array_shape
log.info("Resampling variance components")

with input_models:
Expand Down Expand Up @@ -773,7 +773,7 @@ def _resample_one_variance_array(self, name, input_model, iscale,
)
return

output_shape = self.out_arr_shape
output_shape = self.output_array_shape

# Resample the error array. Fill "unpopulated" pixels with NaNs.
driz = Drizzle(
Expand Down
4 changes: 2 additions & 2 deletions jwst/resample/resample_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def __init__(self, input_models, output=None, single=False, blendheaders=False,
output_pix_area = None

self.output_pix_area = output_pix_area
self.out_arr_shape = tuple(self.output_wcs.array_shape)
log.debug(f"Output mosaic size: {self.out_arr_shape}")
self.output_array_shape = tuple(self.output_wcs.array_shape)
log.debug(f"Output mosaic size: {self.output_array_shape}")

if pscale is None:
log.info(f'Specified output pixel scale ratio: {self.pscale_ratio}.')
Expand Down

0 comments on commit 0a686a1

Please sign in to comment.