pyuvdata icon indicating copy to clipboard operation
pyuvdata copied to clipboard

[WIP] Add optional near-field corrections to the phasing function

Open baron-de-montblanc opened this issue 1 year ago • 1 comments

Description

Included code to perform near-field corrections through keyword arguments passed to the phase() function.

I added two new keys to the phase_dict dictionary (cat_dist_units and cat_near_field), allowing the user to specify the units associated with the cat_dist key, and whether or not to apply near-field corrections (boolean value). As a result, a lot of tests are breaking because these extra keys didn't exist when they were written. I'm having trouble tracking down every instance of phase_dict to patch this.

It also still isn't clear whether or not an unproject_near_field() function is necessary, so I have left in some commented-out lines of code while I work on figuring this out (to be removed or uncommented when this is resolved).

Motivation and Context

This feature allows users to specify the RA, DEC, and distance to a near-field source, and "focus" on that source (it will then appear in focus in an image, for example). This is done in practice by calculating the geometric near-field w values for each visibility, updating those in the uvw_array, computing the resulting phase differences, and updating the phase directly for each visibility. This feature is turned off by default (i.e. the default behavior for the phase() function is just to perform the traditional far-field phasing).

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation change (documentation changes only)
  • [ ] Version change
  • [ ] Build or continuous integration change

Checklist:

  • [x] I have read the contribution guide.
  • [x] My code follows the code style of this project.

New feature checklist:

  • [x] I have added or updated the docstrings associated with my feature using the numpy docstring format.
  • [ ] I have updated the tutorial to highlight my new feature (if appropriate).
  • [ ] I have added tests to cover my new feature.
  • [ ] All new and existing tests pass.
  • [ ] I have updated the CHANGELOG.

baron-de-montblanc avatar Oct 08 '24 23:10 baron-de-montblanc