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

add sharded WorkUnit output for non-lazy input WorkUnits in reprojection #683

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

maxwest-uw
Copy link
Collaborator

resolves #678

allows us more flexibility in the reprojection workflow to choose between time and memory usage, i.e. instead of writing out an intermediary WorkUnit between the ic->wu generation and reprojection we can just pass in our already loaded WorkUnit but have the output be a sharded WorkUnit, using more memory but potentially saving time.

  • new write_output flag in reproject_work_unit to create write the output of reprojection instead of re-materializing as a WorkUnit in memory
  • also integrates the reproject_lazy_work_unit function into the main reproject_work_unit function.

Copy link
Contributor

@jeremykubica jeremykubica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions and stylistic comments

reprojected=True,
)
hdul = new_work_unit.metadata_to_primary_header()
hdul.writeto(os.path.join(directory, filename))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you are no longer returning a workunit down this branch. Is that correct? If so, you should update the doc string to note that the function will return None if write_output is set to True.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for now, although once I add #679 I think I'll change it to return a lazily loaded and reprojected WorkUnit. I'll change the docstring to reflect this

src/kbmod/reprojection.py Outdated Show resolved Hide resolved
src/kbmod/reprojection.py Outdated Show resolved Hide resolved
src/kbmod/reprojection.py Outdated Show resolved Hide resolved
src/kbmod/reprojection.py Show resolved Hide resolved
@maxwest-uw maxwest-uw merged commit 85eaccc into main Aug 8, 2024
2 checks passed
@maxwest-uw maxwest-uw deleted the issue/678 branch August 8, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add ability for non-lazy reprojection to write to a sharded fits
2 participants