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

SRF.centroid() - Mistake #361

Open
oam31 opened this issue Apr 6, 2020 · 5 comments
Open

SRF.centroid() - Mistake #361

oam31 opened this issue Apr 6, 2020 · 5 comments

Comments

@oam31
Copy link

oam31 commented Apr 6, 2020

import numpy as np
from typhon.physics.units.common import ureg
from typhon.physics.units.em import SRF
frequency = ureg.Quantity(np.array(
[37011414567901.24, 36560055853658.54, 36119573253012.05, 35689578333333.336,
35269700941176.47, 34859588139534.887, 34458903218390.805, 34067324772727.27,
33684545842696.633, 33310273111111.11, 32944226153846.156]), 'Hz')
weight = np.array([1]*11)
srf = SRF(frequency, weight)
print(srf.centroid())

--> 34906834926126.227 hertz ** 2

Why hertz ^2 and not hertz ?

Thanks

@gerritholl
Copy link
Contributor

Units of weight should be 1/Hz. At least that's what's expected here.

@oam31
Copy link
Author

oam31 commented Apr 6, 2020

;-) ok but generally, a weight is dimensionless...

@gerritholl
Copy link
Contributor

It depends on how the sensor response is defined. A channel radiance is the spectral radiance integrated over the channel, weighted by the spectral response function. If I remember correctly, here I have used a normalisation such that the integral of the spectral response function is dimensionless. For the integral of the spectral response function with frequency to be dimensionless, the spectral response at any given frequency must be 1/Hz.

Perhaps weight is not the best term here, but I think physically it makes sense that the value of the spectral response function at any given frequency has the dimensions 1/[frequency].

@oam31
Copy link
Author

oam31 commented Apr 6, 2020

It seems to me that the spectral response of an instrument for a frequency or wavelength is given dimensionless ( e.g. http://www.astro.ucla.edu/~wright/WISE/passbands.html ).

I have tried your solution, but it does not seem to work.
I just replaced :
weight = np.array([1]*11)
by:
weight = ureg.Quantity(np.array([1]*11), '1/Hz')

@gerritholl
Copy link
Contributor

Maybe you're right, I don't remember right now. I don't know why the result is wrong; it's been a while since I worked on this, sorry.

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

No branches or pull requests

2 participants