HERA-Team / hera_notebook_templates

Repository for HERA analysis / real-time pipeline notebooks and related support code
MIT License
0 stars 0 forks source link

Add frf noise cov #54

Closed mwilensky768 closed 1 month ago

mwilensky768 commented 2 months ago

This PR will add a (analytic) noise covariance calculation for the effects of the main lobe filter + coherent averaging, ignoring the effects of the notch filter. Things left to do include

[ x] Make the conversion to pI happen after coherent averaging [ x] Recheck that the FRF + coherent average operation is similar b/w the noise covariance filter implementation and the pipeline filter implementation [ ] Ensure the analytically propagated variances agree with the noise-dominated delay spectra [ x] See if Josh's rule of thumb can be extracted from the covariance matrices [ ] Try with a few different baselines to make sure nothing wild is happening

review-notebook-app[bot] commented 2 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

mwilensky768 commented 2 months ago

Here are some test results with new correlation matrix based correction factors to the noise variances. To tease this out in an obvious way, we used noise-only simulations and just the central LSTs for the non-incoherently averaged PS (top row in the following plots) since the edge LSTs have pretty different statistics compared to the central ones.

Here is using the original correction factors, there is a ~10% error in the standard deviation in the top panel:

OG_correction_noise_only_central_LST

Here is using the new correction:

matrix_correction_noise_only_central_LST

The data in the top panel now look standardized.

The bottom panel doesn't visually change depending on which correction factor we use, but you can see that the MAD statistic improves (gets closer to 1) with the new correction factor.

mwilensky768 commented 2 months ago

@jsdillon I don't know to what extent we want to finish all the items in the checklist above before merging (also there is a cell with a known bug in it related to converting to pI after coherent averaging). Theoretically one could go as far as propagating these matrices to the delay spectra themselves, which could range from easy to hard depending on how much is going on under the hood in pspec.

My inclination is to leave this here (perhaps with an earmark since I've only looked at 1 baseline) since the noise-dominated delay bins look Gaussian anyway after incoherent averaging and the correction factors appear to be doing the right thing as noted in the previous comment.