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

Line background estimation #252

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

hiyoneda
Copy link
Contributor

We implemented the first version of the line background estimation class.
The basic idea is as follows:

  • Extracting the event distribution in the Compton data space from adjacent energy bins of the energy of interest.
  • Making a binned histogram using the extracted events.
  • Estimate the total number of expected background counts in the line energy bin by fitting the adjacent energy bin data, and modify the normalization of the binned histogram accordingly.

We also added an example notebook, on which we generated a background model for Al-26 line.

This class is very preliminary, and there are several areas for improvement. Future ideas include:

  • We may add more options in the minuit fitting, e.g., limiting the parameter region, fixing some parameters.
  • We may apply smoothing to the background histogram, which may help to mitigate Poisson fluctuation in the model.

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 98.92473% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.00%. Comparing base (d02846a) to head (c940cfc).
Report is 45 commits behind head on develop.

Files with missing lines Patch % Lines
.../background_estimation/LineBackgroundEstimation.py 98.90% 1 Missing ⚠️
Files with missing lines Coverage Δ
cosipy/__init__.py 100.00% <100.00%> (ø)
cosipy/background_estimation/__init__.py 100.00% <100.00%> (ø)
.../background_estimation/LineBackgroundEstimation.py 98.90% <98.90%> (ø)

... and 2 files with indirect coverage changes

@ckarwin ckarwin self-assigned this Oct 22, 2024
@ckarwin
Copy link
Contributor

ckarwin commented Oct 24, 2024

@hiyoneda I plan to check this first thing tomorrow. Do you plan to add unit tests?

@hiyoneda
Copy link
Contributor Author

@hiyoneda I plan to check this first thing tomorrow. Do you plan to add unit tests?

Yes, I have added unit tests just now.

Copy link
Contributor

@ckarwin ckarwin left a comment

Choose a reason for hiding this comment

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

Runs fine for me, and additions all look good.

@ckarwin ckarwin merged commit b9ac312 into cositools:develop Oct 25, 2024
4 checks passed
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