typhon icon indicating copy to clipboard operation
typhon copied to clipboard

SRF.centroid() - Mistake

Open oam31 opened this issue 5 years ago • 5 comments

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

oam31 avatar Apr 06 '20 14:04 oam31

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

gerritholl avatar Apr 06 '20 15:04 gerritholl

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

oam31 avatar Apr 06 '20 15:04 oam31

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].

gerritholl avatar Apr 06 '20 15:04 gerritholl

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')

oam31 avatar Apr 06 '20 16:04 oam31

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.

gerritholl avatar Apr 06 '20 16:04 gerritholl