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

Units of Spectrum: counts or photons? #19

Open
alexkolo opened this issue Nov 25, 2019 · 3 comments
Open

Units of Spectrum: counts or photons? #19

alexkolo opened this issue Nov 25, 2019 · 3 comments
Assignees

Comments

@alexkolo
Copy link

In general counts don't equal photons. Hence, I'm confused with the given units in the documentation.

In the description of make_spectrum the unit of the energy spectrum is given as:

Returns: Emissivity in counts cm^3 s^-1 bin^-1.

while in the corresponding example it states:

a = pyatomdb.spectrum.make_spectrum(ebins, ite,dummyfirst=True)
ax.loglog(ebins, a, drawstyle='steps', label='Unbroadened')
ax.set_ylabel('Emissivity (ph cm$^{3}$ s$^{-1}$ bin$^{-1}$)')

So, one time it's counts and in another time it's photons. Which one is correct?
I would naively assume counts, if the response had been applied. However, in the example only a dummy response was used. Hence, I'm not sure. How would I make sure that I really get counts and not photons?

The description of the class spectrum.Session may also be incorrect. For its method return_spectra it states that:

Returns: The spectrum in photons cm^5 s^-1 bin^-1, with the response, or photons cm^3 s^-1 bin^-1 if raw is set.

I understand the unit for the raw case. However, if the response is applied, shouldn't the unit be counts cm^5 s^-1 bin^-1 ?

@jagophile jagophile self-assigned this Nov 25, 2019
@jagophile
Copy link
Member

Hi,

You are correct that there is a distinction between counts and photons, and that the documentation should be updated to reflect this.

The gist of it is, however, that the moment you apply a response, you are dealing with counts, since counts = photons * effective area [from the response]. If you have not applied a response, you have photons.

I will clean up the documentation to make this clearer, but for now does that rule of thumb help?

@alexkolo
Copy link
Author

Yes, it does. Thank you.

@alexkolo alexkolo reopened this Dec 21, 2019
@alexkolo
Copy link
Author

alexkolo commented Dec 21, 2019

I reopened this since it's hasn't been corrected yet in the documentation.
Feel free to close it, once it was done ;)

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

No branches or pull requests

2 participants