Skip to content

Commit 0c503ea

Browse files
committed
More WIP
1 parent d39f49c commit 0c503ea

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

reproject/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ def _reproject_dispatcher(
255255

256256
block_size = [(block_size[i] if block_size[i] != -1 else shape_out[i]) for i in range(len(block_size))]
257257

258-
print(block_size, shape_out, n_dim_reproject)
259-
260258
block_size = tuple(block_size)
261259
shape_out = tuple(shape_out)
262260

reproject/mosaicking/coadd.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,15 @@ def reproject_and_coadd(
243243
# convex in the output projection), and transforming every edge pixel,
244244
# which provides a lot of redundant information.
245245

246-
edges = sample_array_edges(
247-
array_in.shape[-wcs_in.low_level_wcs.pixel_n_dim :], n_samples=11
248-
)[::-1]
249-
edges_out = pixel_to_pixel(wcs_in, wcs_out, *edges)[::-1]
246+
# TODO: ignore non-repreojected dims here and slice WCS
247+
248+
try:
249+
edges = sample_array_edges(
250+
array_in.shape[-wcs_in.low_level_wcs.pixel_n_dim :], n_samples=11
251+
)[::-1]
252+
edges_out = pixel_to_pixel(wcs_in, wcs_out, *edges)[::-1]
253+
except:
254+
edges_out = np.array([np.nan])
250255

251256
# Determine the cutout parameters
252257

@@ -257,7 +262,7 @@ def reproject_and_coadd(
257262
ndim_out = len(shape_out)
258263

259264
# Determine how many extra broadcasted dimensions are present
260-
n_broadcasted = len(shape_out) - wcs_in.low_level_wcs.pixel_n_dim
265+
n_broadcasted = len(shape_out) - wcs_out.low_level_wcs.pixel_n_dim
261266

262267
skip_data = False
263268
if np.any(np.isnan(edges_out)):

0 commit comments

Comments
 (0)