Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawn many small reprojection tasks #41

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Copying the WCS header info to the other layers in the fits shard.
drewoldag committed Sep 10, 2024
commit c9efb141e5dc36e7a4ab6d81248856da60732267
Original file line number Diff line number Diff line change
@@ -49,13 +49,17 @@ def reproject_shard(
opt_wcs.array_shape = shape

shard = fitsio.open(original_wu_shard_filepath)
shard_wcs = WCS(shard[0].header)
shard[1].header.update(shard_wcs.to_header())
shard[2].header.update(shard_wcs.to_header())

sci = reproject_adaptive(
shard,
opt_wcs,
hdu_in=0,
shape_out=opt_wcs.array_shape,
bad_value_mode="ignore",
roundtrip_coords=False
roundtrip_coords=False,
)

var = reproject_adaptive(
@@ -64,7 +68,7 @@ def reproject_shard(
hdu_in=1,
shape_out=opt_wcs.array_shape,
bad_value_mode="ignore",
roundtrip_coords=False
roundtrip_coords=False,
)

mask = reproject_adaptive(
@@ -73,7 +77,7 @@ def reproject_shard(
hdu_in=2,
shape_out=opt_wcs.array_shape,
bad_value_mode="ignore",
roundtrip_coords=False
roundtrip_coords=False,
)

shard[0].data = sci.astype(np.float32)