-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dictionary used in the convert #310
Comments
It's been a while since I looked at this: codex-africanus/africanus/model/coherency/conversion.py Lines 13 to 38 in cbc64d7
but it's likely because the "RR": {("I", "V"): lambda i, v: i + v + 0j},
"LL": {("I", "V"): lambda i, v: i - v + 0j},
"XX": {("I", "Q"): lambda i, q: i + q + 0j},
"YY": {("I", "Q"): lambda i, q: i - q + 0j}, I now wonder if this is a dangerous assumption to make in terms of real data. @landmanbester @o-smirnov, what do you think? |
The conversions by @LeoVergaraS are correct. The conversions in this implementation (for I,Q,U,V) are presumably only used once visibilities have been gridded and fourier transformed Complex->Real - otherwise they would not make sense. Mind you stokes products only make sense in image space, not visibility space. |
What context is the conversion being done in? "Physical" IQUV is always real so the resulting XX/YY/RR/LL will be real-only. When going from observed coherencies to Stokes, the imaginary part is usually discarded (it is zero by construction assuming perfect visibilities), so the above is correct. In practice, the resulting "imaginary" Stokes will be non-zero due to noise and calibration errors. I could just about conceive of a use case where one wants to retain the imaginaries for diagnostic purposes, but rather cross that bridge when we come to it... |
We definitely don't expect the Stokes coherencies to be real valued, only the Stokes images are real after gridding+FFT. It looks like this function is meant for visibilities though so I think the implementation is incorrect.
Why do you say this? In my mind Stokes coherencies are just what you get if you apply the vCZ theorem to Stokes images. Of course the conversions are more complicated when taking gains into account but that doesn't mean Stokes coherencies don't make sense.
If the visibilities are assumed to be Hermitian the imaginary parts of the corresponding images have to cancel by construction. Dirty images will of course have an imaginary component if we only grid half the uv-plane (the usual case) |
Hi, @LeoVergaraS is my undergraduate student and we had this question for a long time. The code in africanus did not make sense to me since the convert function and its dictionary is meant to convert visibilities with shape (row, chan, corr) to visibilities with shape (row, chan, stokes). There is a confusion in the thread. The context of the conversion is in visibility space and not image space where stokes values are real valued. |
One solution to the above might be to add entries for codex-africanus/africanus/model/coherency/conversion.py Lines 13 to 38 in cbc64d7
Other suggestions:
Would you consider submitting a PR? |
Description
Hello, I would like to know why .imag and .real are used within the dictionary that convert uses when converting from correlations to Stokes visibilities. The visibilities should be complex numbers, but with this approach, real numbers are obtained.
What I Did
I did the following, is it correct?
The text was updated successfully, but these errors were encountered: