Skip to content

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.
@codecov
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

❌ Patch coverage is 0% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.97%. Comparing base (aecb327) to head (6fa5c5e).
⚠️ Report is 120 commits behind head on develop.

Files with missing lines Patch % Lines
cosipy/data_io/custom_functions.py 0.00% 75 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Files with missing lines Coverage Δ
cosipy/data_io/custom_functions.py 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

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

@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?

@israelmcmc
Copy link
Collaborator

Thanks @krishnatejavedula. Any updates to this?

  • I think what @hiyoneda suggested makes sense. Since there don't seem to be any interactions of SpectrumFileProcessor with 3ML, you can move this class to its own file inside the DataIO module.
  • Besides that, the other thing to resolve is to add unit tests to cover this new class.

@israelmcmc israelmcmc added the pull-request-waiting-for-author The ball is on the author's side. label Sep 11, 2025
@israelmcmc israelmcmc requested a review from hiyoneda September 11, 2025 18:16
@israelmcmc israelmcmc added the Feature / Enhancement New functionality or improvement label Sep 15, 2025
@Yong2Sheng Yong2Sheng self-requested a review November 19, 2025 18:39
Copy link
Contributor

@Yong2Sheng Yong2Sheng left a comment

Choose a reason for hiding this comment

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

I tested the module and it works well.

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

Labels

Feature / Enhancement New functionality or improvement pull-request-waiting-for-author The ball is on the author's side.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants