Clean up freq_range and freq_array handling in UVCal #1361
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We should really only have one of
freq_array
orfreq_range
defined on a UVCal object in the future (e.g. in version 3.0). This is along the lines of what we decided for time_range vs time_array (see #1306).This is very clear in v 3.0+ because of the move to the
wide_band
structure. It's a bit muddier before that because of the support for flag arrays that have a frequency axis in delay-type calibrations.So this PR just adds deprecation warnings for the clear cases so users can know what's coming in v3.0. To be clear:
freq_range
should not be set on non-wide-band gain style objects (which have a frequency axis)freq_array
andchannel_width
should not be set on wide-band objects (which do not have a frequency axis)It also fixes a couple of small bugs I found in testing related to handling of the
freq_range
parameter in thereorder_freqs
and__add__
methods.Motivation and Context
I stumbled on this while working on improvements to UVCal methods that I'm implementing as part of developing the
calH5
format. I thought we should get the deprecation warnings in ASAP to give users as much heads up as possible. But I don't actually expect many users to run into this.Types of changes
Checklist:
Breaking change checklist: