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.
Some skymodel behaviour was very opaque, as pointed out by Shijiao. So, I set out to make it a little more obvious what is going on.
Previous functionality
When
return_cal_visibilities
is set, then the calibration visibilities are kept around after calibration. If a different set of visibilities need to be calculated for the subtraction model, only sources that are extra to the initial calibration sources list are calculated and added to the returned calibration visibilities. This assumes that the calibration sources are a subset of the model sources. While this reduces the number of calculations, it is not obvious from the user that settingreturn_cal_visiblities
would cause this behaviour.The skymodel that is saved, regardless of whether or not
return_cal_visibilities
is set, only includes model sources that are not "duplicates" of the calibration sources. There is no indication in the source list whether a source was used in the model. Assumptions include 1) that the model is a subset, and 2) that sources that are co-located to within 1/100th of a pixel are duplicates, regardless of brightness.New functionality
When
return_cal_visibilities
is set, then the calibration visibilities are kept around after calibration. If a different set of visibilities need to be calculated for the subtraction model, all will be calculated unlesscombine_skymodels
is set. This gives flexibility to do the previous functionality (and be more efficient in your number of calculations) or do something more complicated where the assumptions do not apply.When
combine_skymodels
is set, the code attempts to combine the skymodels as above. Extra model sources are marked with unsetting theinclude_calibration
keyword (an already present keyword) for that source in the skymodel; duplicates are not included. If it seems as though the model is not a subset of calibration, then all sources are saved.If
combine_skymodels
is not set, then code will save separate skymodels.save_skymodels
must be set for skymodels to be saved.