Initial noise convergence test implementation and outline noise-only simulated obs for testing#312
Conversation
|
Local version runs. However, my test case (snapshot VLA in C config) is biased to mean != 0 and isn't well suited as a test. Still working on a suitable noise-only test case. This is now corrected as the initial version of the z-score did not account for the number of pixels (draws) in the image in the expected variance. |
|
My local tests (full imaging case and the new unit tests) are passing |
|
The PR also includes additional tests that we can wrap into a broader testing suite:
|
39fa990 to
cbd438c
Compare
|
Just run through with this. I've pushed the fix for the "no clean components" case to this as well, and it all seems quite a bit faster -- it's running waaaay fewer major cycles. I used I'll have a closer look through the code early next week, but this seems extremely promising! |
|
lower That being said, we should absolutely test this to set a reasonable default. |
|
@e-koch Had a look through, there's a couple of comments I had. I think the last one is giving me the most confusion, but maybe I'm being dumb here I've also done a quick check on the cubes with/without the criteria, and they look identical to me |
|
@thomaswilliamsastro addressed your comments. Should be good to merge now |
|
sorry, realised that I hadn't actually finished the review so this comment hadn't appeared. @e-koch it's just some clearup on "which pix" that I don't have clear in my head |
- Allow accessing/enabling the noise convergence test from `run_imaging` - Add unit tests for noise convergence function - Initial setup for simulating a noise-only MS and full pipeline test - Significantly expand noise-only MS generation for noise convergence test imaging full runs - Alter noise convergence test based on sampling of extrema in the nosie distribution by clean - Setup noise convergence tests for sdintimaging - Leave todo note for updating the sdintimaging import - Update custom sdintimaging to export fullsummary based on https://open-bitbucket.nrao.edu/projects/CASA/repos/casa6/diff/casatasks/src/private/task_sdintimaging.py?until=ad32f9697bdb372f975b0c8d11081e0d5c3a9ad6 - Default to always fullsummary=True in clean calls - Enable overwrite for parent gather cubes task - Catch case where we have no clean components - Add docstring for loop_imaging with explanation of the convergence kwargs - add a similar docstring for chunked imaging
7ff6b7d to
7a4a9d8
Compare
Add additional convergence test based on sampling from the noise distribution.
The main thing this PR adds is
check_noise_convergence. It's an optional, additional, convergence check that handles cases where a few clean iterations at the noise threshold are included in multiple imaging loops, leading to large fractional changes in the total flux despite being consistent with the noise. We've collectively started hitting chunked imaging cases where a noise-only channel chunk uses all 20 imaging loops and taking way longer to exit than should be needed.The thinking behind this new test is:
z_score < z_threshold.run_imagingandloop_imagingfrom the image handler with kwargconvergence_noise_z_threshold. By default it is None, and this test is not included; passing any finite >0 value enables the noise convergence test, in addition to the existing total flux convergence.We need the info dict from
fullsummary=Truein tclean and sdintimaging to know the number of iterations actually used, flux per major cycle, etc. The score above defaults to using the last 3 major cycles. There's a future option to correct by scale for multiscale cleaning as this info is also returned in the dictionary.Trying this on a VLA HI test case for a cube with some low S/N detections, the noise Z-score criterion matches the total flux convergence (the 4 loops is the minimum hardcoded in the PHANGS recipe; otherwise both tests would pass after loop 2):