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 SpectrumFileProcessor class for automated spectral data conversion and formatting #257

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

krishnatejavedula
Copy link
Contributor

  • Implemented SpectrumFileProcessor class to handle energy and flux data conversion for spectrum files not in the MEGAlib spectrum file format.
  • Added energy conversion feature: converts frequency (Hz) to energy (keV) and flux from ergs/cm²/sec to ph/cm²/sec/keV using astropy units.
  • Implemented data filtering to restrict energy range to 100 keV - 10,000 keV for accurate source injector functionality.
  • Reformatted output to ensure compatibility with SpecFromDat class and consistency across cosipy and DCs spectral files.

…n and formatting

- Implemented SpectrumFileProcessor class to handle energy and flux data conversion for spectrum files not in the MEGAlib spectrum file format.
- Added energy conversion feature: converts frequency (Hz) to energy (keV) and flux from ergs/cm²/sec to ph/cm²/sec/keV using astropy units.
- Implemented data filtering to restrict energy range to 100 keV - 10,000 keV for accurate source injector functionality.
- Reformatted output to ensure compatibility with SpecFromDat class and consistency across cosipy and DCs spectral files.
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 13.69863% with 63 lines in your changes missing coverage. Please review.

Project coverage is 72.00%. Comparing base (d02846a) to head (e03eba7).

Files with missing lines Patch % Lines
cosipy/threeml/custom_functions.py 13.69% 63 Missing ⚠️
Files with missing lines Coverage Δ
cosipy/threeml/custom_functions.py 29.50% <13.69%> (-9.09%) ⬇️

@hiyoneda
Copy link
Contributor

@krishnatejavedula Thanks for this work. Looks good. I have a quick comment. threeml/custom_function.py, to which you added this new class, is used to implement new spectral and spatial functions for astromodels in threeml fitting. I think that your new class can be used more generally. Can you think of a better directory for this class, maybe dataIO?

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