-
Notifications
You must be signed in to change notification settings - Fork 22
Revised units for parameter K (ph/cm2/s) in extended source fit tutorial to match the units in the SpecFromDat file #241
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
base: develop
Are you sure you want to change the base?
Conversation
…ial to match the units in the SpecFromDat file
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Hi @krishnatejavedula, thanks for working on this. First, I verified that you are changing only this line
the rest are just images in the notebook that are actually the same, as expected. I think there's something still off. Looking at SpecFromDat the dataFlux = dataFlux / np.sum(dataFlux * ewidths) However, the from cosipy.threeml.custom_functions import SpecFromDat
import astropy.units as u
spec = SpecFromDat(dat="</path/to/cosipy>/docs/tutorials/spectral_fits/extended_source_fit/OPsSpectrum.dat")
K = 1/u.cm/u.cm/u.s
spec.evaluate([1]*u.MeV, K) returns The issue is that when you divide by I'm actually not sure how this will affect other code using
I think that should be revisited as well. |
Hello @israelmcmc I have updated the SpecFromDat class to ensure correct unit consistency in the evaluate() method. I've checked the notebooks that use this function, and the change does not affect their functionality. |
Closing and reopening to re-run the tests. |
@krishnatejavedula I'm getting this error
when executing the extended source notebook, here:
Can you please try to run it again after syncing with develop? Maybe it's something that changed since you opened this PR (sorry for just getting to it!) |
Hi @israelmcmc, it's okay. I am checking it now. |
…notebook; updated units for K in SpecFromDat to 'ph/cm2/s/keV'
Hello @israelmcmc. I have reverted the changes I made in this PR and updated the docstring for We may need to revisit the units of |
Addresses issue #194