Skip to content

reducing memory usage on OU TDE notebook#326

Open
jkrick wants to merge 3 commits into
Caltech-IPAC:mainfrom
jkrick:tde-memory-reduction
Open

reducing memory usage on OU TDE notebook#326
jkrick wants to merge 3 commits into
Caltech-IPAC:mainfrom
jkrick:tde-memory-reduction

Conversation

@jkrick
Copy link
Copy Markdown
Contributor

@jkrick jkrick commented May 29, 2026

This PR reduces memory usage in the TDE light curve notebook to address CI failures likely caused by memory constraints. It does not effect the science or goals of the notebook

Changes:

  • Replace full-image background estimation (np.nanmedian/np.nanstd over 4088×4088 pixels) with a local annulus-based background using photutils SkyCircularAnnulus and ApertureStats
  • Add del data in show_gallery() to free each full image array immediately after display
  • Add del img in make_cutout() to free the full image array after the cutout is extracted
  • Reduce default number of gallery images from 6 to 4
  • Reduce default number of cutout images from 6 to 4

@jkrick jkrick self-assigned this May 29, 2026
@jkrick jkrick requested a review from bsipocz May 29, 2026 19:54
@jkrick jkrick added the content: openuniverse Content related issues/PRs for notebooks with OpenUniverse relevance label May 29, 2026
@jkrick
Copy link
Copy Markdown
Contributor Author

jkrick commented May 29, 2026

maybe this closes #317 ?

@bsipocz bsipocz added the GHA buildhtml Enable extra buildhtml job on GHA label Jun 3, 2026
@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented Jun 3, 2026

maybe this closes #317 ?

yes, we should try it, I'm pushing directly to this branch

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

I suppose we should try the rendering, hopefully this will be enough

The two plotting functions then compile these measurements into time-ordered plots showing how the observed flux evolves across multiple visits, providing a first look at temporal variability that could signal transient activity or host-galaxy changes.

```{code-cell} ipython3
---
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose this should stay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content: openuniverse Content related issues/PRs for notebooks with OpenUniverse relevance GHA buildhtml Enable extra buildhtml job on GHA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants