Skip to content

Add spatially varying dust grain sub-species abundances#9

Open
psheehan wants to merge 19 commits into
mainfrom
add_abundance_variation
Open

Add spatially varying dust grain sub-species abundances#9
psheehan wants to merge 19 commits into
mainfrom
add_abundance_variation

Conversation

@psheehan
Copy link
Copy Markdown
Owner

This PR enables using dust opacities that have varying abundances of its constituent sub-species. That includes running models with these abundances varying spatially, but also training dust models with spatially varying abundances.

As a part of this PR, I’ve now moved the code to a mode where the supplied opacities should be at a list of amax, p, and each of the abundances, each as 1D arrays with shape (nsamples,) and opacities should be provided for each of those samples (amax[i], p[i],) + tuple([a[i] for a in abundances]) at a uniform set of wavelengths such that each opacity array has shape (nsamples, nwavelengths). The training set is picked by dividing the nsamples into training, validation, and test sets, such that the validation and test sets are previously unseen visibilities. This also simplifies calculating the Planck mean opacity and random nu samples, as each can be integrated directly from the provided data.

The diana_wice dust has been updated following this new setup, though does not include varying abundances.

psheehan added 15 commits April 19, 2026 01:20
…ksca directly as the training data, rather than interpolating to create samples. Also gets more than two constituent species (i.e. greater than 1 abundances array) working.
… of input dust properties, add a helper function to suggest sampling, and add tests.
…acities that are formatted in the new style of providing opacities.
… a better idea of how the model reproduces unseen values.
… tests), and also make test plots go to a non-gui backend for tests.
…t to prevent excessive run times. random_nu samples are prepared in batches to prevent overflowing memory. Get random_nu_ml working again. Update diana_wice dust to the new format, along with the accompanying notebook.
…ties because they are needed for sources. Also only add source intensity if sources are included. For mom0 test do not include sources, and also update test values now that NaNs are fixed.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.17722% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.84%. Comparing base (1299f78) to head (67946c8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pinballrt/dust.py 94.66% 16 Missing ⚠️
pinballrt/grids.py 79.16% 5 Missing ⚠️
pinballrt/camera.py 50.00% 1 Missing ⚠️
pinballrt/sources.py 50.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   88.82%   89.84%   +1.01%     
==========================================
  Files          11       11              
  Lines        2220     2333     +113     
==========================================
+ Hits         1972     2096     +124     
+ Misses        248      237      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants