Merge pull request #547 in CASA/casa6 from CAS-940 to master
* commit '472ca936f5877aa1b5df07c60893f72cbc36f7bf': (116 commits) CAS-940 using Urvashi's suggested changes to make tests pass based on limited channels with iterations done CAS-940 : Added 'experimental' note to xml docs. Fixed type in subparam name in the conditional section of tclean.xml CAS-940 : Changed test values for test_onefield_asp, using truth values from the simulated images, and tolerances against this absolute truth CAS-940 Added unit test casas in test_tclean.py for asp devolution with sim_data_VLA_jet.ms simulated MS which contains 5 chans. sim_data_VLA_jet.ms need to be put into casatestdata set. CAS-940 added test cases for ASP in test_tclean.py and modified tclean.xml. CAS-940: Updated the doc to reflect that we switched back to the original approach for determining initial scale sizes. CAS-940: Changed back to the original approach to define the initial scale sizes (i.e. [0, w, 2w, 4w, 8w]) since it works better than the shortest baseline approach for majority of the dataset. Keep `largestscale` for cases like "jet" which requires smaller largest scale size. This has been tested on "jet" and works like before. CAS-940: Fixed the merge conflict. With this fix, AspClean in casa6 can be built fine locally. Haven't tested if the casa6 build gives the same AspClean output as casa5. CAS-940: Merged the changes for `asp` in task_tclean.py and input_parameters.py to the new location in casa6
Moved the source files that genie gave me into the casatools src/code/ subdir CAS-940: Added the new casatasks/xml from casa-master casa6 and merged the changes for `asp` to sdintimaging.xml and tclean.xml. ARD-26: Fixed the issue that AspClean running in parallel and in serial having slightly different results (~1e-4). The issue is because the equation used to calculate the Hogbom iterations depends a state dependent variable that tracks how many times Asp<->Hogbom switches have been done. Since this variable has very small contribution in the equation, the fix is to remove it from the equation. This change gives almost identical result as before and fixes the issue. ARD-26: Updated the stopping/exit criterion to prevent frequent major cycles when it is approaching convergence. End of hogbom runs used to exit the minor cycle but now the hogbom will run longer when convergence is detected. Two new ways are implemented to detect convergence. One is based on rms of residual and the other is based on model flux. Both ways give similar results. With the new approach, the major cycles of the "jet" run is reduced from 14 to 6. ARD-26: Developed an automated way to turn on 'stopAtLargeScaleNegative' if user's largest scale is > the largest scale allowed by the shortest baseline.
Copied new parameter from casa5 version of task_tclean.py to casa6 version ARD-26: Further reduced the default largest scale to be "5x smaller" than that allowed by the shortest baseline. This gives good "jet" image both without mask and without the need of careful masking. Added a tclean subparameter, largestscale, that allows user to overwrite the default largest scale if it's too conservative. If 'largestscale' is not specified, AspClean uses the default largest scale calculated by the "5x reduction" method mentioned above.
CAS-940-scale: Instead of restricting the largest scale to 5*PsfWidth, define the initial scale sizes based on the power-law distribution of (PsfWidth, largest scale), where "largest scale" = c/nu/baseline. This revision gives good "basic" and "jet" results, and both results are very similar to the "5W" approach. ARD-26: Fixed the mask issue so now only components centered inside the mask are picked. Fixed another issue when the optimal scale is <0.4 (we then manually make it a delta scale) and the optimal amp is large, it caused divergence. This is fixed by resetting the optimal amp = residual at the location when the optimal scale is < 0.4. This revision is in the intermediate state to fix the issue that Asp still picks large scale within the mask of "jet" causing big components below the "jet" source. Also, fixed SDAlgorithmAAspClean.cc and AspMatrixCleaner.h that got messed up during previous wrong merging of CAS-940-debug to CAS-940.
Edited test for test_iterbot_cube_2 to handle the change in the output return dictionary. Earlier, channels with no deconvolution did not have entries. Now they do. This tests triggers deconvolution only on a few channels, and so the change in return dict output mattered for this test.
Changed the location of the addSummaryMinor() calls within SDAlgorithmBase.cc. This is to ensure that empty minor cycle sets are also recorded and the model flux starts from zero. This affects only the convergence plots made from the return dictionary.
...