Closed r-pascua closed 9 months ago
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
959420a
) 97.18% compared to head (d6de897
) 97.17%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thank you for the review @jsdillon! I will make the recommended changes. I apologize for adding a bunch of fluff in the form of whitespace changes, but I develop in vim and it was practically impossible to read the code in the terminal with how much line wrapping there was. I will keep this in mind if I make future additions to the code.
Before addressing your comments, I would like to get your opinion on the file format. Ideally, I would access the filter parameters with an antenna pair tuple; however, python tuples are not supported by yaml.SafeLoader
(which is what I figure we would want to use). I have two proposals, and would like your input on which you would prefer.
"(0,1)"
for example. This feels like the worse of the two options, since this is susceptible to whitespace issues (e.g., assuming this format would cause the code to miss keys formatted like "(0, 1)"
), and generally feels kind of clunky.Thank you again for the review! I can make all of the requested changes once we settle on a final format for the filter files.
What do you mean by baseline integers? Like the ones in pyuvdata? Those aren't human readable...
Yeah, like the ones from pyuvdata
. The main problem I'm butting up against is that yaml.SafeLoader
doesn't work with python tuples as keys, and using tuples as keys gives really wonky looking yaml files. Here's an example:
filter_centers:
? &id001 !!python/tuple
- 0
- 1
: 0.123
? &id002 !!python/tuple
- 0
- 2
: 0.173
filter_half_widths:
*id001: 0.07
*id002: 0.08
OK, I have updated the code so that filter parameter files use strings for the antenna pairs, and there is an extra bit of code that converts those strings into tuples. I have also fleshed out the documentation regarding the parameter files and added an example parameter file. Here is what the sample file looks like:
filter_centers:
(0, 1): 0.1234
(0, 2): 0.173
filter_half_widths:
(0, 1): 0.05
(0, 2): 0.08
Please let me know what additional changes you would like to see when you have time to go through the changes.
This PR adds the ability to use the tophat filtering code with
yaml
files containing pre-computed filter parameters. The core assumption here is that there is one filter file per spectral window, and the filter files have the following structure:where
(ant1, ant2)
here is a placeholder for all of the baselines in the array (or a superset of baselines in the array). I am open to changing the file format slightly, sinceyaml.SafeLoader
doesn't know how to interpret python tuples; we would just need to agree on a format to use, document it, and stick with it. I have written simple unit tests for the code functionality, but I haven't yet tried a more sophisticated test (i.e., on something that looks like real data with many baselines).I also added some line breaks here and there because the code was wrapping in my terminal.