Skip to content

Commit

Permalink
CHG: adding min_samp variable when using statwt
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcarcamov committed Dec 29, 2022
1 parent ac31ec3 commit e6221ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/snow/selfcalibration/selfcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def _plot_selfcal(
# gridcols=subplot[1], antenna=antenna, timerange=timerange, plotrange=plotrange, plotfile=figfile_name,
# overwrite=True, showgui=False)

def selfcal_output(self, overwrite=False, _statwt=False) -> str:
def selfcal_output(self, overwrite=False, _statwt=False, min_samp=8) -> str:
"""
Public function that creates a new measurement set only taking the corrected column.
If _statwt is True then applies the statwt function and creates a .statwt measurement
Expand All @@ -513,7 +513,8 @@ def selfcal_output(self, overwrite=False, _statwt=False) -> str:
Whether to overwrite the measurement set files
_statwt :
Whether to create a new measurement applying the statwt function
min_samp :
Minimum number of unflagged visibilities for estimating the scatter if _statwt is True
Returns
-------
Name of the self-calibrated measurement set file
Expand All @@ -537,7 +538,7 @@ def selfcal_output(self, overwrite=False, _statwt=False) -> str:
if os.path.exists(statwt_path):
shutil.rmtree(statwt_path)
shutil.copytree(output_vis, statwt_path)
statwt(vis=statwt_path, datacolumn="data")
statwt(vis=statwt_path, datacolumn="data", minsamp=min_samp)
return output_vis

def _uvsubtract(self):
Expand Down

0 comments on commit e6221ca

Please sign in to comment.