Skip to content

Time-based interpolation of UVCal calibration tables - #1691

Merged
kartographer merged 11 commits into
mainfrom
uvcal_interp
Aug 18, 2026
Merged

Time-based interpolation of UVCal calibration tables#1691
kartographer merged 11 commits into
mainfrom
uvcal_interp

Conversation

@kartographer

Copy link
Copy Markdown
Contributor

Description

A new method has been added to UVCal (interpolate_in_time) that allows for calibration tables to be "upsampled", effectively allowing gains/delay measurements taken at one set of times to be interpolated/extrapolated to another set of times. Code associated with performing the interpolations has also been added to a new module, utils.gain_interpolation, which supports several different interpolation schemes, including nearest, linear, and cubic (PCHIP) interpolation strategies. An additional strategy -- "poly" -- allows for fitting the calibration solution with a variable-order Chebyshev polynomial and then performing interpolation/extrapolation using the fitted polynomial.

A separate small change has been made to uvcalibrate, which also allows users to reweight nsamples_array based on the amplitude calibration being applied to data_array.

Motivation and Context

Higher frequency interferometers like the SMA frequently interleave observations of science targets with observations of bright quasars (or other point sources) that can act as gain calibrators for the data. Because those observations are disjoint in time with the observations of the "source", interpolation between the derived gain solutions is typically used to derive effective gains corrections during science target observations. This PR effectively provides that functionality, allowing uvcalibrate to be used for SMA observations (among other facilities) .

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

New feature checklist:

  • 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/updated tests to cover my new feature.
  • I have updated the CHANGELOG.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.94%. Comparing base (840dd06) to head (6958a74).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1691    +/-   ##
========================================
  Coverage   99.93%   99.94%            
========================================
  Files          67       68     +1     
  Lines       22982    23506   +524     
========================================
+ Hits        22968    23492   +524     
  Misses         14       14            

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bhazelton bhazelton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty major enhancement and looks super useful. I just have a few comments and questions.

Comment thread src/pyuvdata/utils/gain_interpolate.py Outdated
Comment thread src/pyuvdata/utils/gain_interpolate.py Outdated
Comment thread src/pyuvdata/utils/gain_interpolate.py
Comment thread src/pyuvdata/utils/gain_interpolate.py Outdated
Comment thread src/pyuvdata/utils/gain_interpolate.py
Comment thread src/pyuvdata/utils/uvcalibrate.py Outdated
Comment thread src/pyuvdata/utils/uvcalibrate.py Outdated
Comment thread src/pyuvdata/uvcal/uvcal.py
Comment thread src/pyuvdata/uvcal/uvcal.py

@bhazelton bhazelton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now, thanks!

@kartographer
kartographer merged commit a12cae9 into main Aug 18, 2026
63 of 64 checks passed
@kartographer
kartographer deleted the uvcal_interp branch August 18, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants