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

Interface for a noise model #39

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

aymgal
Copy link
Member

@aymgal aymgal commented Nov 15, 2024

This PR is about implementing an interface for optimizing noise properties during lens modelling (issue #35).

@aymgal aymgal linked an issue Nov 15, 2024 that may be closed by this pull request
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11853678423

Details

  • 36 of 51 (70.59%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 21.503%

Changes Missing Coverage Covered Lines Changed/Added Lines %
herculens/Analysis/plot.py 0 5 0.0%
herculens/Instrument/noise.py 28 38 73.68%
Files with Coverage Reduction New Missed Lines %
herculens/Instrument/noise.py 2 70.87%
Totals Coverage Status
Change from base Build 11707283366: 0.1%
Covered Lines: 1594
Relevant Lines: 7413

💛 - Coveralls

@aymgal
Copy link
Member Author

aymgal commented Nov 15, 2024

Hi @CKrawczyk , I'd appreciate any comments you may have about this feature, before merging it (since we discussed about it earlier this year) :)

Essentially, you can use it in a numpyro model as:

background_rms = numpyro.sample('noise_sigma_bkg', dist.Uniform(low=0., high=1.))
model_variance = lens_image.C_D_model(model_image, background_rms=background_rms)

and you could also provide a noise "boost map" as a 2D array that locally scales the variance, as C_D_model(..., boost_map=XXX).

I also updated the starting guide to showcase the feature.

@CKrawczyk
Copy link
Collaborator

These changes look great, very helpful for how we are using the code.

@aymgal
Copy link
Member Author

aymgal commented Nov 15, 2024

Great @CKrawczyk 👌

@aymgal aymgal merged commit 4110803 into main Nov 15, 2024
1 check passed
@aymgal aymgal deleted the 35-create-interface-for-a-noise-model branch November 15, 2024 17:34
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.

Create interface for a noise model
3 participants