! Started logfile: J0204+1514_X_2001_07_05_pus_uvs.log on Wed Jul  4 19:42:39 2007
obs J0204+1514_X_2001_07_05_pus_uva.fits
! Reading UV FITS file: J0204+1514_X_2001_07_05_pus_uva.fits
! AN table 1: 85 integrations on 171 of 171 possible baselines.
! AN table 2: 138 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.11709 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0204+1514
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! 
! There are 4 IFs, and a total of 4 channels:
! 
!  IF  Channel    Frequency  Freq offset  Number of   Overall IF
!       origin    at origin  per channel   channels    bandwidth
!  ------------------------------------------------------------- (Hz)
!  01        1  8.40997e+09        8e+06          1        8e+06
!  02        2  8.47997e+09        8e+06          1        8e+06
!  03        3  8.79497e+09        8e+06          1        8e+06
!  04        4  8.89997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 2370 lines of history.
! 
! Reading 17860 visibilities.
select I
! Polarization I is unavailable.
! Selecting polarization: RR,  channels: 1..4
! Reading IF 1 channels: 1..1
! Reading IF 2 channels: 2..2
! Reading IF 3 channels: 3..3
! Reading IF 4 channels: 4..4
print "field_size =",field_size
! field_size = 256 
print "field_cell =",field_cell
! field_cell = 0.2 
print "taper_size =",taper_size
! taper_size = 70 
integer clean_niter
clean_niter = 100
float clean_gain
clean_gain = 0.03
float dynam
dynam = 6.0
float soltime1
soltime1 = 120
float soltime2
soltime2 = 20
float thresh
thresh = 0.5
float win_mult
win_mult = 1.8
float time_av
time_av = 16
float old_peak
float new_peak
float flux_cutoff
mapsize field_size, field_cell
! Map grid = 256x256 pixels with 0.200x0.200 milli-arcsec cellsize.
startmod
! Applying default point source starting model.
! Performing phase self-cal
! Adding 1 model components to the UV plane model.
! The established model now contains 1 components and 1 Jy
! 
! Correcting IF 1.
!  A total of 1291 telescope corrections were flagged in sub-array 1.
!  A total of 1815 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 2.
!  A total of 1291 telescope corrections were flagged in sub-array 1.
!  A total of 1815 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 3.
!  A total of 1291 telescope corrections were flagged in sub-array 1.
!  A total of 1815 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 4.
!  A total of 1291 telescope corrections were flagged in sub-array 1.
!  A total of 1815 telescope corrections were flagged in sub-array 2.
! 
! Fit before self-cal, rms=1.023905Jy  sigma=0.008702
! Fit after  self-cal, rms=0.526703Jy  sigma=0.004637
! clrmod: Cleared the established, tentative and continuum models.
! Redundant starting model cleared.
uvw 2,-1
! Uniform weighting binwidth: 2 (pixels).
! Gridding weights will be scaled by errors raised to the power -1.
! Radial weighting is not currently selected.
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Your choice of large map pixels excluded 2.52% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.5455 mas, bmaj=1.08 mas, bpa=-4.893 degrees
! Estimated noise=1088.88 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (0, 0).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.0942 Jy
! Component: 100  -  total flux cleaned = 1.35825 Jy
! Total flux subtracted in 100 components = 1.35825 Jy
! Clean residual min=-0.034077 max=0.107701 Jy/beam
! Clean residual mean=0.000866 rms=0.010604 Jy/beam
! Combined flux in latest and established models = 1.35825 Jy
! Performing phase self-cal
! Adding 4 model components to the UV plane model.
! The established model now contains 4 components and 1.35825 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300901Jy  sigma=0.002520
! Fit after  self-cal, rms=0.300846Jy  sigma=0.002519
! Inverting map 
! Your choice of large map pixels excluded 2.52% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.115033 Jy
! Component: 100  -  total flux cleaned = 0.181373 Jy
! Total flux subtracted in 100 components = 0.181373 Jy
! Clean residual min=-0.027782 max=0.036611 Jy/beam
! Clean residual mean=0.000509 rms=0.007604 Jy/beam
! Combined flux in latest and established models = 1.53962 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 9 components and 1.53962 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.253358Jy  sigma=0.001967
! Fit after  self-cal, rms=0.252907Jy  sigma=0.001963
! Inverting map 
! Your choice of large map pixels excluded 2.52% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
print "************** FINISHED UNIFORM WEIGHTING CLEAN **************"
! ************** FINISHED UNIFORM WEIGHTING CLEAN ************** 
! 
uvw 0,-1
! Uniform weighting is not currently selected.
! Gridding weights will be scaled by errors raised to the power -1.
! Radial weighting is not currently selected.
win_mult = win_mult * 1.6
clean_niter = clean_niter * 2
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Your choice of large map pixels excluded 2.52% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6669 mas, bmaj=1.322 mas, bpa=-7.174 degrees
! Estimated noise=658.909 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0441633 Jy
! Component: 100  -  total flux cleaned = 0.0671992 Jy
! Component: 150  -  total flux cleaned = 0.0781393 Jy
! Component: 200  -  total flux cleaned = 0.0803791 Jy
! Total flux subtracted in 200 components = 0.0803791 Jy
! Clean residual min=-0.021932 max=0.048347 Jy/beam
! Clean residual mean=0.002507 rms=0.009629 Jy/beam
! Combined flux in latest and established models = 1.62 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 16 components and 1.62 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.247445Jy  sigma=0.001866
! Fit after  self-cal, rms=0.247403Jy  sigma=0.001866
! Inverting map 
! Your choice of large map pixels excluded 2.52% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.94     FD        0.98     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        0.98     KK        0.93     KP        0.93     
!   LA        0.93     MC        1.00*    MK        0.97     NL        0.98     
!   NY        1.14     OV        1.01     PT        0.96     SC        0.96     
!   TS        1.13     WF        1.03     WZ        1.00*    
! 
!  A total of 93 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        1.01     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.95     KK        1.29     KP        1.03     
!   LA        0.97     MC        1.10     MK        1.00     NL        0.99     
!   NY        1.04     OV        0.99     PT        0.99     SC        0.96     
!   TS        0.87     WF        0.99     WZ        0.98     
! 
! 
! Correcting IF 2.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.96     FD        0.99     GC        0.94     GG        1.00*    
!   HH        1.00*    HN        0.99     KK        0.95     KP        0.93     
!   LA        0.92     MC        1.00*    MK        0.96     NL        0.94     
!   NY        1.25     OV        0.99     PT        0.93     SC        0.93     
!   TS        1.16     WF        1.03     WZ        1.00*    
! 
!  A total of 93 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        1.01     GC        0.94     GG        1.00*    
!   HH        1.00*    HN        0.95     KK        1.26     KP        1.03     
!   LA        0.96     MC        1.10     MK        1.01     NL        0.95     
!   NY        1.13     OV        0.98     PT        0.96     SC        0.91     
!   TS        0.86     WF        0.97     WZ        0.97     
! 
! 
! Correcting IF 3.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.99     FD        0.98     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        0.93     KP        0.96     
!   LA        0.93     MC        1.00*    MK        0.98     NL        0.97     
!   NY        1.25     OV        1.03     PT        0.97     SC        0.95     
!   TS        1.18     WF        1.02     WZ        1.00*    
! 
!  A total of 93 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00     FD        1.00     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.28     KP        1.07     
!   LA        0.99     MC        1.11     MK        1.03     NL        0.99     
!   NY        1.13     OV        1.03     PT        0.98     SC        0.91     
!   TS        0.86     WF        0.98     WZ        0.97     
! 
! 
! Correcting IF 4.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.97     FD        0.96     GC        0.95     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        0.96     KP        0.93     
!   LA        0.91     MC        1.00*    MK        1.01     NL        0.98     
!   NY        1.20     OV        1.00     PT        0.96     SC        1.01     
!   TS        1.18     WF        1.01     WZ        1.00*    
! 
!  A total of 93 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.97     FD        0.98     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.27     KP        1.04     
!   LA        0.96     MC        1.11     MK        1.06     NL        1.00     
!   NY        1.05     OV        1.02     PT        0.98     SC        0.99     
!   TS        0.87     WF        0.97     WZ        0.97     
! 
! 
! Fit before self-cal, rms=0.247403Jy  sigma=0.001866
! Fit after  self-cal, rms=0.216044Jy  sigma=0.001536
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6686 mas, bmaj=1.349 mas, bpa=-7.411 degrees
! Estimated noise=668.047 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (-3.8, 3.6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0423019 Jy
! Component: 100  -  total flux cleaned = 0.0659733 Jy
! Component: 150  -  total flux cleaned = 0.0783739 Jy
! Component: 200  -  total flux cleaned = 0.0819978 Jy
! Total flux subtracted in 200 components = 0.0819978 Jy
! Clean residual min=-0.016157 max=0.019142 Jy/beam
! Clean residual mean=-0.000182 rms=0.004875 Jy/beam
! Combined flux in latest and established models = 1.702 Jy
! Performing phase self-cal
! Adding 33 model components to the UV plane model.
! The established model now contains 48 components and 1.702 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.208295Jy  sigma=0.001440
! Fit after  self-cal, rms=0.207358Jy  sigma=0.001432
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
selfcal true, true, soltime1
! Performing amp+phase self-cal over 120 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.207358Jy  sigma=0.001432
! Fit after  self-cal, rms=0.195568Jy  sigma=0.001329
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.668 mas, bmaj=1.352 mas, bpa=-7.784 degrees
! Estimated noise=667.867 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0196256 Jy
! Component: 100  -  total flux cleaned = 0.0277654 Jy
! Component: 150  -  total flux cleaned = 0.0317592 Jy
! Component: 200  -  total flux cleaned = 0.0340901 Jy
! Total flux subtracted in 200 components = 0.0340901 Jy
! Clean residual min=-0.006577 max=0.014223 Jy/beam
! Clean residual mean=0.000716 rms=0.002313 Jy/beam
! Combined flux in latest and established models = 1.73609 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 68 components and 1.73609 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.193515Jy  sigma=0.001304
! Fit after  self-cal, rms=0.193254Jy  sigma=0.001301
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (-1.4, 0.4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0143031 Jy
! Component: 100  -  total flux cleaned = 0.0158905 Jy
! Component: 150  -  total flux cleaned = 0.0182704 Jy
! Component: 200  -  total flux cleaned = 0.020302 Jy
! Total flux subtracted in 200 components = 0.020302 Jy
! Clean residual min=-0.006758 max=0.008094 Jy/beam
! Clean residual mean=0.000405 rms=0.001957 Jy/beam
! Combined flux in latest and established models = 1.75639 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 86 components and 1.75639 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.192091Jy  sigma=0.001287
! Fit after  self-cal, rms=0.191945Jy  sigma=0.001287
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Added new window around map position (-2, 5.2).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00711132 Jy
! Component: 100  -  total flux cleaned = 0.0086108 Jy
! Component: 150  -  total flux cleaned = 0.00933958 Jy
! Component: 200  -  total flux cleaned = 0.0103293 Jy
! Total flux subtracted in 200 components = 0.0103293 Jy
! Clean residual min=-0.006641 max=0.006545 Jy/beam
! Clean residual mean=0.000256 rms=0.001815 Jy/beam
! Combined flux in latest and established models = 1.76672 Jy
! Performing phase self-cal
! Adding 29 model components to the UV plane model.
! The established model now contains 101 components and 1.76672 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.191465Jy  sigma=0.001282
! Fit after  self-cal, rms=0.191409Jy  sigma=0.001281
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
selfcal true, true, soltime2
! Performing amp+phase self-cal over 20 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.191409Jy  sigma=0.001281
! Fit after  self-cal, rms=0.190748Jy  sigma=0.001275
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6678 mas, bmaj=1.354 mas, bpa=-7.878 degrees
! Estimated noise=666.933 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00549224 Jy
! Component: 100  -  total flux cleaned = 0.00796473 Jy
! Component: 150  -  total flux cleaned = 0.0100548 Jy
! Component: 200  -  total flux cleaned = 0.0115096 Jy
! Total flux subtracted in 200 components = 0.0115096 Jy
! Clean residual min=-0.005299 max=0.007568 Jy/beam
! Clean residual mean=0.000351 rms=0.001506 Jy/beam
! Combined flux in latest and established models = 1.77823 Jy
selfcal
! Performing phase self-cal
! Adding 32 model components to the UV plane model.
! The established model now contains 114 components and 1.77823 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.190221Jy  sigma=0.001269
! Fit after  self-cal, rms=0.190157Jy  sigma=0.001269
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (-3, 0.6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00708318 Jy
! Component: 100  -  total flux cleaned = 0.00788852 Jy
! Component: 150  -  total flux cleaned = 0.00852312 Jy
! Component: 200  -  total flux cleaned = 0.00894903 Jy
! Total flux subtracted in 200 components = 0.00894903 Jy
! Clean residual min=-0.005069 max=0.004281 Jy/beam
! Clean residual mean=0.000216 rms=0.001327 Jy/beam
! Combined flux in latest and established models = 1.78718 Jy
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 131 components and 1.78718 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189735Jy  sigma=0.001265
! Fit after  self-cal, rms=0.189694Jy  sigma=0.001264
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
win_mult = win_mult * 1.2
selfcal true, true, soltime2
! Performing amp+phase self-cal over 20 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189694Jy  sigma=0.001264
! Fit after  self-cal, rms=0.189533Jy  sigma=0.001263
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=2.173 mas, bmaj=2.763 mas, bpa=-17.37 degrees
! Estimated noise=987.17 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00936551 Jy
! Component: 100  -  total flux cleaned = 0.0108186 Jy
! Component: 150  -  total flux cleaned = 0.0114129 Jy
! Component: 200  -  total flux cleaned = 0.0118849 Jy
! Total flux subtracted in 200 components = 0.0118849 Jy
! Clean residual min=-0.006137 max=0.004976 Jy/beam
! Clean residual mean=0.000389 rms=0.002082 Jy/beam
! Combined flux in latest and established models = 1.79906 Jy
selfcal
! Performing phase self-cal
! Adding 38 model components to the UV plane model.
! The established model now contains 159 components and 1.79906 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189363Jy  sigma=0.001261
! Fit after  self-cal, rms=0.189295Jy  sigma=0.001260
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00237164 Jy
! Component: 100  -  total flux cleaned = 0.00311103 Jy
! Component: 150  -  total flux cleaned = 0.00301912 Jy
! Component: 200  -  total flux cleaned = 0.00301766 Jy
! Total flux subtracted in 200 components = 0.00301766 Jy
! Clean residual min=-0.006088 max=0.004481 Jy/beam
! Clean residual mean=0.000254 rms=0.001988 Jy/beam
! Combined flux in latest and established models = 1.80208 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 172 components and 1.80208 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189220Jy  sigma=0.001259
! Fit after  self-cal, rms=0.189203Jy  sigma=0.001259
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
uvtaper 0,0
! No UV-taper is currently set.
win_mult = win_mult / 1.2
print "************** FINISHED AMPLITUDE SELF-CAL **************"
! ************** FINISHED AMPLITUDE SELF-CAL ************** 
restore
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6677 mas, bmaj=1.355 mas, bpa=-7.918 degrees
! Estimated noise=666.371 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6677 x 1.355 at -7.918 degrees (North through East)
! Clean map  min=-0.0041938  max=1.4366 Jy/beam
if(peak(flux) > thresh)
  selfcal true, true
  clean clean_niter,clean_gain
  selfcal
  flux_cutoff = imstat(rms) * dynam
  repeat
    if (peak(flux) > flux_cutoff) peakwin win_mult
    clean clean_niter,clean_gain
    flux_cutoff = imstat(rms) * dynam
    selfcal
    new_peak = peak(flux)
    until(new_peak<=flux_cutoff)
  selfcal true, true
  end if
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189203Jy  sigma=0.001259
! Fit after  self-cal, rms=0.174396Jy  sigma=0.001144
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.668 mas, bmaj=1.356 mas, bpa=-7.932 degrees
! Estimated noise=666.219 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00135774 Jy
! Component: 100  -  total flux cleaned = 0.00180008 Jy
! Component: 150  -  total flux cleaned = 0.00233522 Jy
! Component: 200  -  total flux cleaned = 0.00281551 Jy
! Total flux subtracted in 200 components = 0.00281551 Jy
! Clean residual min=-0.004054 max=0.004242 Jy/beam
! Clean residual mean=0.000176 rms=0.001075 Jy/beam
! Combined flux in latest and established models = 1.8049 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 180 components and 1.8049 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.174150Jy  sigma=0.001142
! Fit after  self-cal, rms=0.174137Jy  sigma=0.001142
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00101033 Jy
! Component: 100  -  total flux cleaned = 0.00133767 Jy
! Component: 150  -  total flux cleaned = 0.00153525 Jy
! Component: 200  -  total flux cleaned = 0.00172011 Jy
! Total flux subtracted in 200 components = 0.00172011 Jy
! Clean residual min=-0.003962 max=0.004192 Jy/beam
! Clean residual mean=0.000151 rms=0.001036 Jy/beam
! Combined flux in latest and established models = 1.80662 Jy
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 186 components and 1.80662 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.174002Jy  sigma=0.001141
! Fit after  self-cal, rms=0.173998Jy  sigma=0.001141
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.173998Jy  sigma=0.001141
! Fit after  self-cal, rms=0.173863Jy  sigma=0.001141
print "************** CLEARING MODEL AND STARTING OVER **********"
! ************** CLEARING MODEL AND STARTING OVER ********** 
clrmod true
! clrmod: Cleared the established and tentative models.
uvw 2,-1
! Uniform weighting binwidth: 2 (pixels).
! Gridding weights will be scaled by errors raised to the power -1.
! Radial weighting is not currently selected.
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.5509 mas, bmaj=1.107 mas, bpa=-5.322 degrees
! Estimated noise=1080.42 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.08541 Jy
! Component: 100  -  total flux cleaned = 1.33378 Jy
! Component: 150  -  total flux cleaned = 1.43182 Jy
! Component: 200  -  total flux cleaned = 1.48299 Jy
! Total flux subtracted in 200 components = 1.48299 Jy
! Clean residual min=-0.009437 max=0.026427 Jy/beam
! Clean residual mean=0.000565 rms=0.003768 Jy/beam
! Combined flux in latest and established models = 1.48299 Jy
uvw 0,-1
! Uniform weighting is not currently selected.
! Gridding weights will be scaled by errors raised to the power -1.
! Radial weighting is not currently selected.
flux_cutoff = imstat(rms) * dynam
! Adding 11 model components to the UV plane model.
! The established model now contains 11 components and 1.48299 Jy
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6681 mas, bmaj=1.357 mas, bpa=-7.955 degrees
! Estimated noise=665.844 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  keep
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0708109 Jy
! Component: 100  -  total flux cleaned = 0.122595 Jy
! Component: 150  -  total flux cleaned = 0.16236 Jy
! Component: 200  -  total flux cleaned = 0.193532 Jy
! Total flux subtracted in 200 components = 0.193532 Jy
! Clean residual min=-0.007392 max=0.019636 Jy/beam
! Clean residual mean=0.001981 rms=0.005185 Jy/beam
! Combined flux in latest and established models = 1.67652 Jy
! Adding 60 model components to the UV plane model.
! The established model now contains 64 components and 1.67652 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=2.17 mas, bmaj=2.763 mas, bpa=-17.2 degrees
! Estimated noise=986.429 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0573243 Jy
! Component: 100  -  total flux cleaned = 0.0881761 Jy
! Component: 150  -  total flux cleaned = 0.106111 Jy
! Component: 200  -  total flux cleaned = 0.116962 Jy
! Total flux subtracted in 200 components = 0.116962 Jy
! Clean residual min=-0.006046 max=0.006040 Jy/beam
! Clean residual mean=0.001048 rms=0.002519 Jy/beam
! Combined flux in latest and established models = 1.79348 Jy
flux_cutoff = imstat(rms) * dynam
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  keep
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00677774 Jy
! Component: 100  -  total flux cleaned = 0.0111355 Jy
! Component: 150  -  total flux cleaned = 0.013972 Jy
! Component: 200  -  total flux cleaned = 0.0155769 Jy
! Total flux subtracted in 200 components = 0.0155769 Jy
! Clean residual min=-0.005081 max=0.004351 Jy/beam
! Clean residual mean=0.000402 rms=0.001649 Jy/beam
! Combined flux in latest and established models = 1.80906 Jy
! Adding 131 model components to the UV plane model.
! The established model now contains 181 components and 1.80906 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! Estimated beam: bmin=0.6681 mas, bmaj=1.357 mas, bpa=-7.955 degrees
! Estimated noise=665.844 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00271505 Jy
! Component: 100  -  total flux cleaned = -0.00136221 Jy
! Component: 150  -  total flux cleaned = -0.000389019 Jy
! Component: 200  -  total flux cleaned = 0.00048176 Jy
! Total flux subtracted in 200 components = 0.00048176 Jy
! Clean residual min=-0.003616 max=0.004115 Jy/beam
! Clean residual mean=0.000122 rms=0.001045 Jy/beam
! Combined flux in latest and established models = 1.80954 Jy
selfcal
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 192 components and 1.80954 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.174459Jy  sigma=0.001145
! Fit after  self-cal, rms=0.174367Jy  sigma=0.001145
wmodel J0204+1514_X_2001_07_05_pus_map.mod
! Writing 192 model components to file: J0204+1514_X_2001_07_05_pus_map.mod
wobs J0204+1514_X_2001_07_05_pus_uvs.fits
! Writing UV FITS file: J0204+1514_X_2001_07_05_pus_uvs.fits
wwins J0204+1514_X_2001_07_05_pus_map.win
! wwins: Wrote 5 windows to J0204+1514_X_2001_07_05_pus_map.win
x = (field_size-8) * field_cell / 4
addwin -x,x,-x,x
clean (field_size*4),0.01
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! clean: niter=1024  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = 0.00114605 Jy
! Component: 100  -  total flux cleaned = 0.0018689 Jy
! Component: 150  -  total flux cleaned = 0.00255036 Jy
! Component: 200  -  total flux cleaned = 0.00325551 Jy
! Component: 250  -  total flux cleaned = 0.00398566 Jy
! Component: 300  -  total flux cleaned = 0.00447467 Jy
! Component: 350  -  total flux cleaned = 0.00495012 Jy
! Component: 400  -  total flux cleaned = 0.00541331 Jy
! Component: 450  -  total flux cleaned = 0.00591495 Jy
! Component: 500  -  total flux cleaned = 0.00620917 Jy
! Component: 550  -  total flux cleaned = 0.00649783 Jy
! Component: 600  -  total flux cleaned = 0.00682852 Jy
! Component: 650  -  total flux cleaned = 0.00715287 Jy
! Component: 700  -  total flux cleaned = 0.00738118 Jy
! Component: 750  -  total flux cleaned = 0.00760599 Jy
! Component: 800  -  total flux cleaned = 0.00782765 Jy
! Component: 850  -  total flux cleaned = 0.00804617 Jy
! Component: 900  -  total flux cleaned = 0.00830456 Jy
! Component: 950  -  total flux cleaned = 0.00838958 Jy
! Component: 1000  -  total flux cleaned = 0.00860044 Jy
! Total flux subtracted in 1024 components = 0.00872536 Jy
! Clean residual min=-0.002289 max=0.002229 Jy/beam
! Clean residual mean=0.000061 rms=0.000818 Jy/beam
! Combined flux in latest and established models = 1.81827 Jy
keep
! Adding 72 model components to the UV plane model.
! The established model now contains 260 components and 1.81827 Jy
wmap "J0204+1514_X_2001_07_05_pus\_map.fits"
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6681 x 1.357 at -7.955 degrees (North through East)
! Clean map  min=-0.0028778  max=1.4367 Jy/beam
! Writing clean map to FITS file: J0204+1514_X_2001_07_05_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.43675 
invert
! Inverting map 
! Your choice of large map pixels excluded 2.59% of the data.
!  The x-axis pixel size should ideally be below 0.1584 milli-arcsec
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.00081598 
device "J0204+1514_X_2001_07_05_pus\_map.eps/VPS"
! Attempting to open device: 'J0204+1514_X_2001_07_05_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.170381 0.170381 0.340761 0.681523 1.36305 2.72609 5.45218 10.9044 21.8087 43.6175 87.2349
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0024 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.436 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6681 x 1.357 at -7.955 degrees (North through East)
! Clean map  min=-0.0028778  max=1.4367 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0204+1514_X_2001_07_05_pus\_map.gif/vgif"
! Attempting to open device: 'J0204+1514_X_2001_07_05_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0204+1514_X_2001_07_05_pus_uvs.log closed on Wed Jul  4 19:43:42 2007