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

EXPERIMENTAL: Add a crosshand phase solver which expolits the zero Stokes V assumption. #344

Merged
merged 10 commits into from
Nov 29, 2024

Conversation

JSKenyon
Copy link
Collaborator

@JSKenyon JSKenyon commented Nov 5, 2024

@landmanbester I believe this is a working prototype of the solver component of zero Stokes V approach. It is by no means complete, and I have not yet tested it in a chain.

There is still a fair amount of additional work to be done, including:

  • Include an explicit parallactic angle Jones term. This is required for this specific case as its inverse needs to be applied to the data on the fly inside the solver.
  • Make it possible for users to add pi radians to the output phases/specify the expected sign of Stokes U. There is an ambiguity in the results as both visibility = [1, 1, 1, 1] and visibility = [1, -1, -1, 1] correspond to zero Stokes V i.e. there are two valid solutions for the crosshand phase.
  • Fix residual computations as the residual will be somewhat meaningless for a term which doesn't actually have a model. A more useful metric would be the residual Stokes V.
  • (Possibly) Add a mechanism for identifying circular feeds and doing an on the fly conversion to linear feeds so that the zero Stokes V assumption can be used regardless of the actual feed type. See http://www.aips.nrao.edu/TEXT/PUBL/AIPSMEM125.PDF for the conversion matrices.
  • Fix the broken tests (related to the second point above)/come up with better tests.

@landmanbester
Copy link
Collaborator

Awesome, thanks @JSKenyon. I should get to testing it out during the week. I will have a think about your second point above. It must be possible to infer the sign by looking at the other visibility products (maybe before and after correcting for crosshand phase)

@JSKenyon
Copy link
Collaborator Author

JSKenyon commented Nov 7, 2024

Ok, this PR now includes a parallactic angle term which can be be included in the chain. I have not tested this extensively but most of the code already existed so I am cautiously optimistic. Currently, I have not put in many checks and balances. Consequently, it is up to the user to disable input_model.apply_p_jones and output.apply_p_jones_inv to avoid double applying the parallactic angle. The frequency solution interval for the parallactic angle term is likely best set to 0 as the parallactic angle is not frequency dependent. Any iterations given in solver.iter_recipe for the parallactic angle term will be disregarded. This should be most of what is required to use the new solver. @landmanbester This should also give you the ability to include the parallactic angle in the net gain.

@landmanbester
Copy link
Collaborator

Hooray! Very cool. Thanks @JSKenyon. I have started processing the data but I haven't gotten as far as crosshand phase. I will give it a bash once I get there

@JSKenyon
Copy link
Collaborator Author

JSKenyon commented Nov 8, 2024

I have added a test to check that the parallactic angle Jones term functions correctly for both linear and circular feeds. I also wrote but have not included a test which includes both the parallactic angle term and the null-v solver. That also works, barring the two solution problem.

JSKenyon and others added 3 commits November 8, 2024 13:57
* remove question marks when plotting (treated as wildcard by ls in radio-padre)

* Replace question marks with N/A.

---------

Co-authored-by: Jonathan Kenyon <jonathan.simon.kenyon@gmail.com>
@JSKenyon
Copy link
Collaborator Author

This serves to summarise the state of this PR.

Include an explicit parallactic angle Jones term. This is required for this specific case as its inverse needs to be applied to the data on the fly inside the solver.

This has been implemented and tested.

Make it possible for users to add pi radians to the output phases/specify the expected sign of Stokes U. There is an ambiguity in the results as both visibility = [1, 1, 1, 1] and visibility = [1, -1, -1, 1] correspond to zero Stokes V i.e. there are two valid solutions for the crosshand phase.

This has not yet been added. I will omit this for the current release as further investigation is required.

Fix residual computations as the residual will be somewhat meaningless for a term which doesn't actually have a model. A more useful metric would be the residual Stokes V.

This has not yet been added but it is not critical.

(Possibly) Add a mechanism for identifying circular feeds and doing an on the fly conversion to linear feeds so that the zero Stokes V assumption can be used regardless of the actual feed type. See http://www.aips.nrao.edu/TEXT/PUBL/AIPSMEM125.PDF for the conversion matrices.

This does not work as the effect is determined by the feed type i.e. conversion doesn't make it possible to do the self consistency trick on circular feed data.

Fix the broken tests (related to the second point above)/come up with better tests.

I will mark the tests as xfail for now - the null v solver is experimental after all. The tests do work in principle, but the sign flipping makes the results inconsistent.

@JSKenyon JSKenyon merged commit 4bca93a into v0.2.4-dev Nov 29, 2024
6 checks passed
@JSKenyon JSKenyon deleted the v0.2.4-nullv branch November 29, 2024 10:56
JSKenyon added a commit that referenced this pull request Nov 29, 2024
* Add experimental combined delay and tec solver. (#339)

* Commit initial attempt at delay and tec solver.

* Add poor test for delay and tec.

* Add missing coerce_literal calls. (#341)

* Make schema consistent with that required by cult-cargo. (#346)

* Update depdendencies  (#345)

* Partiallu update dependencies/lock while waiting for dask-ms release.

* Remove 3.9 from test matrix.

* Bump dependency versions.

* Fix bad python version specification.

* Fix for reindex change. Update Poetry lock.

* Remove 3.12 support for now due to difficulties in tigger-lsm.

* Update lock.

* Add support for Python3.12 (#348)

* Add python3.12 support.

* Update lock.

* Further lock update.

* Serparate versioning for astro-tigger-lsm when using python 3.12.

* EXPERIMENTAL: Add a crosshand phase solver which expolits the zero Stokes V assumption.  (#344)

* Initial commit of null V WIP.

* Seemingly working implementation of solver exploiting the null-v trick.

* Add new term type to allowed gain types.

* Add a parallactic angle gain type.

* Add test for parallactic angle term. Fix minor bugs.

* Remove unused imports.

* Improve removal of coords/attts added by quartical during writes.

* remove question marks when plotting (#347)

* remove question marks when plotting (treated as wildcard by ls in radio-padre)

* Replace question marks with N/A.

---------

Co-authored-by: Jonathan Kenyon <jonathan.simon.kenyon@gmail.com>

* Mark test as xfail die to sign ambiguity.

---------

Co-authored-by: Landman Bester <lbester@sarao.ac.za>

---------

Co-authored-by: Landman Bester <lbester@sarao.ac.za>
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

Successfully merging this pull request may close these issues.

2 participants