! Started logfile: J1642+6856_S_2001_04_09_pus_uvs.log on Fri Oct  5 16:11:34 2007
obs J1642+6856_S_2001_04_09_pus_uva.fits
! Reading UV FITS file: J1642+6856_S_2001_04_09_pus_uva.fits
! AN table 1: 234 integrations on 190 of 190 possible baselines.
! AN table 2: 78 integrations on 190 of 190 possible baselines.
! AN table 3: 246 integrations on 190 of 190 possible baselines.
! AN table 4: 163 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.242076 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1642+6856
! 
! 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  2.22997e+09        8e+06          1        8e+06
!  02        2  2.25997e+09        8e+06          1        8e+06
!  03        3  2.34997e+09        8e+06          1        8e+06
!  04        4  2.36997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 1949 lines of history.
! 
! Reading 132648 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 = 512 
print "field_cell =",field_cell
! field_cell = 0.5 
print "taper_size =",taper_size
! taper_size = 20 
![@muppet J1642+6856_S_2001_04_09_pus]
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 = 512x512 pixels with 0.500x0.500 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 2618 telescope corrections were flagged in sub-array 1.
!  A total of 963 telescope corrections were flagged in sub-array 2.
!  A total of 3399 telescope corrections were flagged in sub-array 3.
!  A total of 1233 telescope corrections were flagged in sub-array 4.
! 
! Correcting IF 2.
!  A total of 2618 telescope corrections were flagged in sub-array 1.
!  A total of 963 telescope corrections were flagged in sub-array 2.
!  A total of 3399 telescope corrections were flagged in sub-array 3.
!  A total of 1233 telescope corrections were flagged in sub-array 4.
! 
! Correcting IF 3.
!  A total of 2618 telescope corrections were flagged in sub-array 1.
!  A total of 963 telescope corrections were flagged in sub-array 2.
!  A total of 3399 telescope corrections were flagged in sub-array 3.
!  A total of 1234 telescope corrections were flagged in sub-array 4.
! 
! Correcting IF 4.
!  A total of 2618 telescope corrections were flagged in sub-array 1.
!  A total of 963 telescope corrections were flagged in sub-array 2.
!  A total of 3399 telescope corrections were flagged in sub-array 3.
!  A total of 1234 telescope corrections were flagged in sub-array 4.
! 
! Fit before self-cal, rms=0.748169Jy  sigma=0.005546
! Fit after  self-cal, rms=0.652521Jy  sigma=0.004868
! 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 
! Estimated beam: bmin=2.017 mas, bmaj=2.067 mas, bpa=-21.52 degrees
! Estimated noise=682.768 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 = 0.267133 Jy
! Component: 100  -  total flux cleaned = 0.361399 Jy
! Total flux subtracted in 100 components = 0.361399 Jy
! Clean residual min=-0.014187 max=0.088596 Jy/beam
! Clean residual mean=0.000028 rms=0.004159 Jy/beam
! Combined flux in latest and established models = 0.361399 Jy
! Performing phase self-cal
! Adding 7 model components to the UV plane model.
! The established model now contains 7 components and 0.361399 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.324392Jy  sigma=0.002171
! Fit after  self-cal, rms=0.323719Jy  sigma=0.002167
! Inverting map 
! Added new window around map position (-1, -3).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0786382 Jy
! Component: 100  -  total flux cleaned = 0.117369 Jy
! Total flux subtracted in 100 components = 0.117369 Jy
! Clean residual min=-0.012195 max=0.047495 Jy/beam
! Clean residual mean=0.000018 rms=0.002934 Jy/beam
! Combined flux in latest and established models = 0.478768 Jy
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 13 components and 0.478768 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.293139Jy  sigma=0.001790
! Fit after  self-cal, rms=0.290707Jy  sigma=0.001773
! Inverting map 
! Added new window around map position (-2, -8.5).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0459821 Jy
! Component: 100  -  total flux cleaned = 0.0738309 Jy
! Total flux subtracted in 100 components = 0.0738309 Jy
! Clean residual min=-0.009131 max=0.016384 Jy/beam
! Clean residual mean=0.000005 rms=0.002151 Jy/beam
! Combined flux in latest and established models = 0.552599 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 22 components and 0.552599 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.276415Jy  sigma=0.001583
! Fit after  self-cal, rms=0.275317Jy  sigma=0.001574
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0245731 Jy
! Component: 100  -  total flux cleaned = 0.0423947 Jy
! Total flux subtracted in 100 components = 0.0423947 Jy
! Clean residual min=-0.007782 max=0.012714 Jy/beam
! Clean residual mean=-0.000002 rms=0.001814 Jy/beam
! Combined flux in latest and established models = 0.594993 Jy
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 31 components and 0.594993 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.269715Jy  sigma=0.001494
! Fit after  self-cal, rms=0.269410Jy  sigma=0.001491
! Inverting map 
! Added new window around map position (-1.5, -6).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.016722 Jy
! Component: 100  -  total flux cleaned = 0.02975 Jy
! Total flux subtracted in 100 components = 0.02975 Jy
! Clean residual min=-0.006839 max=0.008835 Jy/beam
! Clean residual mean=-0.000008 rms=0.001644 Jy/beam
! Combined flux in latest and established models = 0.624743 Jy
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 43 components and 0.624743 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.266445Jy  sigma=0.001447
! Fit after  self-cal, rms=0.266295Jy  sigma=0.001446
! Inverting map 
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 
! Estimated beam: bmin=2.755 mas, bmaj=3.454 mas, bpa=-32.71 degrees
! Estimated noise=251.304 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.0318808 Jy
! Component: 100  -  total flux cleaned = 0.0514807 Jy
! Component: 150  -  total flux cleaned = 0.0645648 Jy
! Component: 200  -  total flux cleaned = 0.0735069 Jy
! Total flux subtracted in 200 components = 0.0735069 Jy
! Clean residual min=-0.005005 max=0.010387 Jy/beam
! Clean residual mean=0.000123 rms=0.001423 Jy/beam
! Combined flux in latest and established models = 0.69825 Jy
! Performing phase self-cal
! Adding 48 model components to the UV plane model.
! The established model now contains 77 components and 0.69825 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.262605Jy  sigma=0.001387
! Fit after  self-cal, rms=0.262209Jy  sigma=0.001383
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00912302 Jy
! Component: 100  -  total flux cleaned = 0.0145483 Jy
! Component: 150  -  total flux cleaned = 0.0179107 Jy
! Component: 200  -  total flux cleaned = 0.0200419 Jy
! Total flux subtracted in 200 components = 0.0200419 Jy
! Clean residual min=-0.003945 max=0.004339 Jy/beam
! Clean residual mean=0.000032 rms=0.001040 Jy/beam
! Combined flux in latest and established models = 0.718292 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 83 components and 0.718292 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.261936Jy  sigma=0.001378
! Fit after  self-cal, rms=0.261886Jy  sigma=0.001377
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 69 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.98     FD        1.04     GC        1.04     GG        1.00*    
!   HH        1.00*    HN        0.98     KK        1.03     KP        0.97     
!   LA        0.99     MA        1.01     MC        1.11     MK        1.00*    
!   NL        1.00     NY        0.95     OV        1.04     PT        0.98     
!   SC        1.00*    TS        0.97     WF        1.02     WZ        0.93     
! 
!  A total of 51 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        1.01     GC        1.07     GG        1.00*    
!   HH        1.00*    HN        0.99     KK        1.01     KP        1.20     
!   LA        0.95     MA        0.89     MC        1.03     MK        0.99     
!   NL        0.96     NY        0.98     OV        1.00     PT        0.94     
!   SC        1.00*    TS        1.02     WF        0.99     WZ        1.02     
! 
!  A total of 81 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.96     FD        0.97     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.02     KP        0.98     
!   LA        0.96     MA        0.91     MC        1.48     MK        0.99     
!   NL        0.99     NY        1.04     OV        0.98     PT        0.94     
!   SC        0.99     TS        0.99     WF        0.96     WZ        1.08     
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        0.97     FD        0.97     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        0.96     KP        1.00     
!   LA        0.97     MA        0.92     MC        1.18     MK        1.02     
!   NL        1.06     NY        0.99     OV        1.02     PT        0.95     
!   SC        1.01     TS        0.98     WF        1.02     WZ        1.06     
! 
! 
! Correcting IF 2.
!  A total of 69 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00     FD        1.03     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        1.06     KP        1.09     
!   LA        1.02     MA        0.78     MC        1.12     MK        1.00*    
!   NL        1.02     NY        1.03     OV        1.02     PT        1.02     
!   SC        1.00*    TS        1.04     WF        1.02     WZ        0.89     
! 
!  A total of 51 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        1.00     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        0.96     KP        0.98     
!   LA        0.99     MA        0.95     MC        0.98     MK        1.06     
!   NL        0.96     NY        1.03     OV        0.96     PT        1.00     
!   SC        1.00*    TS        1.06     WF        1.01     WZ        1.03     
! 
!  A total of 81 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.95     FD        0.96     GC        1.01     GG        1.00*    
!   HH        1.00*    HN        0.98     KK        1.00     KP        0.94     
!   LA        0.98     MA        0.78     MC        0.93     MK        1.02     
!   NL        0.99     NY        1.01     OV        0.96     PT        0.97     
!   SC        1.00     TS        1.05     WF        1.01     WZ        1.04     
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        0.97     FD        0.98     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        0.99     KP        1.02     
!   LA        0.99     MA        0.73     MC        1.00     MK        1.03     
!   NL        1.00     NY        0.98     OV        0.97     PT        0.99     
!   SC        1.01     TS        0.99     WF        1.00     WZ        1.00     
! 
! 
! Correcting IF 3.
!  A total of 69 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        1.04     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        1.02     KK        1.08     KP        1.14     
!   LA        0.99     MA        1.02     MC        1.08     MK        1.00*    
!   NL        1.03     NY        0.94     OV        1.04     PT        1.03     
!   SC        1.00*    TS        0.97     WF        1.05     WZ        0.93     
! 
!  A total of 51 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        1.00     GC        1.04     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.00     KP        1.06     
!   LA        0.95     MA        0.96     MC        3.08     MK        1.03     
!   NL        0.97     NY        0.98     OV        0.99     PT        0.99     
!   SC        1.00*    TS        1.08     WF        0.94     WZ        1.01     
! 
!  A total of 81 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00     FD        0.99     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.02     KP        1.00     
!   LA        0.96     MA        1.06     MC        1.35     MK        1.00     
!   NL        0.99     NY        0.97     OV        0.97     PT        0.98     
!   SC        1.00     TS        1.01     WF        1.04     WZ        1.10     
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.03     FD        0.99     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        0.99     KK        0.99     KP        1.04     
!   LA        0.96     MA        1.02     MC        1.86     MK        1.01     
!   NL        1.00     NY        0.98     OV        1.00     PT        1.01     
!   SC        1.01     TS        0.98     WF        0.98     WZ        1.03     
! 
! 
! Correcting IF 4.
!  A total of 69 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.99     FD        1.06     GC        1.06     GG        1.00*    
!   HH        1.00*    HN        1.03     KK        1.05     KP        1.20     
!   LA        1.02     MA        1.01     MC        0.70     MK        1.00*    
!   NL        1.03     NY        0.95     OV        1.03     PT        1.05     
!   SC        1.00*    TS        1.06     WF        1.04     WZ        0.93     
! 
!  A total of 51 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        1.00     GC        1.07     GG        1.00*    
!   HH        1.00*    HN        1.04     KK        0.92     KP        1.05     
!   LA        0.99     MA        0.76     MC        0.76     MK        1.04     
!   NL        0.94     NY        1.05     OV        0.97     PT        0.94     
!   SC        1.00*    TS        1.08     WF        1.02     WZ        1.07     
! 
!  A total of 81 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.95     FD        1.01     GC        1.07     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        0.97     KP        1.00     
!   LA        0.99     MA        0.63     MC        0.40     MK        0.98     
!   NL        0.99     NY        1.07     OV        0.97     PT        0.99     
!   SC        1.01     TS        0.98     WF        1.03     WZ        1.14     
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        0.97     FD        1.00     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        0.96     KP        1.10     
!   LA        1.01     MA        0.89     MC        1.10     MK        0.98     
!   NL        1.00     NY        1.03     OV        1.00     PT        1.18     
!   SC        1.04     TS        0.96     WF        1.00     WZ        1.02     
! 
! 
! Fit before self-cal, rms=0.261886Jy  sigma=0.001377
! Fit after  self-cal, rms=0.258047Jy  sigma=0.001346
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.747 mas, bmaj=3.47 mas, bpa=-33.86 degrees
! Estimated noise=251.075 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 (-1, -11.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00369191 Jy
! Component: 100  -  total flux cleaned = 0.00477506 Jy
! Component: 150  -  total flux cleaned = 0.00563756 Jy
! Component: 200  -  total flux cleaned = 0.00628307 Jy
! Total flux subtracted in 200 components = 0.00628307 Jy
! Clean residual min=-0.001951 max=0.003286 Jy/beam
! Clean residual mean=0.000034 rms=0.000558 Jy/beam
! Combined flux in latest and established models = 0.724575 Jy
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 106 components and 0.724575 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.257959Jy  sigma=0.001345
! Fit after  self-cal, rms=0.258123Jy  sigma=0.001344
! Inverting map 
! Added new window around map position (-4, -36.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00326114 Jy
! Component: 100  -  total flux cleaned = 0.0048892 Jy
! Component: 150  -  total flux cleaned = 0.00596927 Jy
! Component: 200  -  total flux cleaned = 0.00692225 Jy
! Total flux subtracted in 200 components = 0.00692225 Jy
! Clean residual min=-0.002029 max=0.002254 Jy/beam
! Clean residual mean=-0.000003 rms=0.000481 Jy/beam
! Combined flux in latest and established models = 0.731497 Jy
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 123 components and 0.731497 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.258059Jy  sigma=0.001343
! Fit after  self-cal, rms=0.258059Jy  sigma=0.001343
! Inverting map 
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.258059Jy  sigma=0.001343
! Fit after  self-cal, rms=0.258335Jy  sigma=0.001342
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.74 mas, bmaj=3.468 mas, bpa=-34.2 degrees
! Estimated noise=250.813 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00211288 Jy
! Component: 100  -  total flux cleaned = 0.00321739 Jy
! Component: 150  -  total flux cleaned = 0.00406452 Jy
! Component: 200  -  total flux cleaned = 0.00487978 Jy
! Total flux subtracted in 200 components = 0.00487978 Jy
! Clean residual min=-0.001996 max=0.002201 Jy/beam
! Clean residual mean=-0.000033 rms=0.000450 Jy/beam
! Combined flux in latest and established models = 0.736377 Jy
selfcal
! Performing phase self-cal
! Adding 30 model components to the UV plane model.
! The established model now contains 126 components and 0.736377 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.258291Jy  sigma=0.001342
! Fit after  self-cal, rms=0.258319Jy  sigma=0.001342
flux_cutoff = imstat(rms) * dynam
! Inverting map 
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.5, -24).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00225434 Jy
! Component: 100  -  total flux cleaned = 0.00293167 Jy
! Component: 150  -  total flux cleaned = 0.00355211 Jy
! Component: 200  -  total flux cleaned = 0.00409962 Jy
! Total flux subtracted in 200 components = 0.00409962 Jy
! Clean residual min=-0.001954 max=0.001624 Jy/beam
! Clean residual mean=-0.000053 rms=0.000413 Jy/beam
! Combined flux in latest and established models = 0.740477 Jy
! Performing phase self-cal
! Adding 29 model components to the UV plane model.
! The established model now contains 140 components and 0.740477 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.258290Jy  sigma=0.001341
! Fit after  self-cal, rms=0.258290Jy  sigma=0.001341
! Inverting map 
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.258290Jy  sigma=0.001341
! Fit after  self-cal, rms=0.259106Jy  sigma=0.001341
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.736 mas, bmaj=3.467 mas, bpa=-34.4 degrees
! Estimated noise=250.928 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00187966 Jy
! Component: 100  -  total flux cleaned = 0.00294082 Jy
! Component: 150  -  total flux cleaned = 0.00347988 Jy
! Component: 200  -  total flux cleaned = 0.00400398 Jy
! Total flux subtracted in 200 components = 0.00400398 Jy
! Clean residual min=-0.001930 max=0.001553 Jy/beam
! Clean residual mean=-0.000066 rms=0.000400 Jy/beam
! Combined flux in latest and established models = 0.744481 Jy
selfcal
! Performing phase self-cal
! Adding 32 model components to the UV plane model.
! The established model now contains 146 components and 0.744481 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.259082Jy  sigma=0.001341
! Fit after  self-cal, rms=0.259089Jy  sigma=0.001341
flux_cutoff = imstat(rms) * dynam
! Inverting map 
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.000441131 Jy
! Component: 100  -  total flux cleaned = 0.000785075 Jy
! Component: 150  -  total flux cleaned = 0.00103035 Jy
! Component: 200  -  total flux cleaned = 0.00122897 Jy
! Total flux subtracted in 200 components = 0.00122897 Jy
! Clean residual min=-0.001952 max=0.001560 Jy/beam
! Clean residual mean=-0.000072 rms=0.000395 Jy/beam
! Combined flux in latest and established models = 0.74571 Jy
! Performing phase self-cal
! Adding 38 model components to the UV plane model.
! The established model now contains 155 components and 0.74571 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.259081Jy  sigma=0.001341
! Fit after  self-cal, rms=0.259080Jy  sigma=0.001340
! Inverting map 
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 20 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.259080Jy  sigma=0.001340
! Fit after  self-cal, rms=0.259272Jy  sigma=0.001340
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.47 mas, bmaj=9.266 mas, bpa=-17.49 degrees
! Estimated noise=352.034 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00187605 Jy
! Component: 100  -  total flux cleaned = 0.00292652 Jy
! Component: 150  -  total flux cleaned = 0.00364662 Jy
! Component: 200  -  total flux cleaned = 0.00406297 Jy
! Total flux subtracted in 200 components = 0.00406297 Jy
! Clean residual min=-0.001743 max=0.001350 Jy/beam
! Clean residual mean=-0.000262 rms=0.000503 Jy/beam
! Combined flux in latest and established models = 0.749773 Jy
selfcal
! Performing phase self-cal
! Adding 38 model components to the UV plane model.
! The established model now contains 180 components and 0.749773 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.259263Jy  sigma=0.001340
! Fit after  self-cal, rms=0.259263Jy  sigma=0.001340
flux_cutoff = imstat(rms) * dynam
! Inverting map 
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.000278474 Jy
! Component: 100  -  total flux cleaned = 0.000483144 Jy
! Component: 150  -  total flux cleaned = 0.000600301 Jy
! Component: 200  -  total flux cleaned = 0.000672799 Jy
! Total flux subtracted in 200 components = 0.000672799 Jy
! Clean residual min=-0.001709 max=0.001379 Jy/beam
! Clean residual mean=-0.000271 rms=0.000501 Jy/beam
! Combined flux in latest and established models = 0.750446 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 189 components and 0.750446 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.259260Jy  sigma=0.001340
! Fit after  self-cal, rms=0.259260Jy  sigma=0.001340
! Inverting map 
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 
! Estimated beam: bmin=2.733 mas, bmaj=3.467 mas, bpa=-34.59 degrees
! Estimated noise=251.084 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.733 x 3.467 at -34.59 degrees (North through East)
! Clean map  min=-0.0017483  max=0.3769 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
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 
! Estimated beam: bmin=1.988 mas, bmaj=2.079 mas, bpa=-36.52 degrees
! Estimated noise=675.892 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.268763 Jy
! Component: 100  -  total flux cleaned = 0.384123 Jy
! Component: 150  -  total flux cleaned = 0.453395 Jy
! Component: 200  -  total flux cleaned = 0.501506 Jy
! Total flux subtracted in 200 components = 0.501506 Jy
! Clean residual min=-0.008120 max=0.027180 Jy/beam
! Clean residual mean=0.000019 rms=0.002314 Jy/beam
! Combined flux in latest and established models = 0.501506 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 17 model components to the UV plane model.
! The established model now contains 17 components and 0.501506 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.733 mas, bmaj=3.467 mas, bpa=-34.59 degrees
! Estimated noise=251.084 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.083398 Jy
! Component: 100  -  total flux cleaned = 0.132225 Jy
! Component: 150  -  total flux cleaned = 0.163822 Jy
! Component: 200  -  total flux cleaned = 0.184996 Jy
! Total flux subtracted in 200 components = 0.184996 Jy
! Clean residual min=-0.003157 max=0.011822 Jy/beam
! Clean residual mean=0.000223 rms=0.001554 Jy/beam
! Combined flux in latest and established models = 0.686502 Jy
! Adding 57 model components to the UV plane model.
! The established model now contains 62 components and 0.686502 Jy
! Inverting map 
! Added new window around map position (-3.5, -6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0145159 Jy
! Component: 100  -  total flux cleaned = 0.0245204 Jy
! Component: 150  -  total flux cleaned = 0.031532 Jy
! Component: 200  -  total flux cleaned = 0.0366693 Jy
! Total flux subtracted in 200 components = 0.0366693 Jy
! Clean residual min=-0.002161 max=0.003668 Jy/beam
! Clean residual mean=0.000048 rms=0.000676 Jy/beam
! Combined flux in latest and established models = 0.723171 Jy
! Adding 37 model components to the UV plane model.
! The established model now contains 89 components and 0.723171 Jy
! Inverting map 
! Added new window around map position (-1, 2.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00428117 Jy
! Component: 100  -  total flux cleaned = 0.00780638 Jy
! Component: 150  -  total flux cleaned = 0.0107764 Jy
! Component: 200  -  total flux cleaned = 0.0133045 Jy
! Total flux subtracted in 200 components = 0.0133045 Jy
! Clean residual min=-0.001811 max=0.002042 Jy/beam
! Clean residual mean=-0.000019 rms=0.000485 Jy/beam
! Combined flux in latest and established models = 0.736476 Jy
! Adding 42 model components to the UV plane model.
! The established model now contains 112 components and 0.736476 Jy
! Inverting map 
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 20 mega-wavelengths.
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.47 mas, bmaj=9.266 mas, bpa=-17.49 degrees
! Estimated noise=352.034 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00430929 Jy
! Component: 100  -  total flux cleaned = 0.00717342 Jy
! Component: 150  -  total flux cleaned = 0.00919257 Jy
! Component: 200  -  total flux cleaned = 0.0106572 Jy
! Total flux subtracted in 200 components = 0.0106572 Jy
! Clean residual min=-0.001700 max=0.001578 Jy/beam
! Clean residual mean=-0.000221 rms=0.000556 Jy/beam
! Combined flux in latest and established models = 0.747133 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.00108135 Jy
! Component: 100  -  total flux cleaned = 0.00188776 Jy
! Component: 150  -  total flux cleaned = 0.00249129 Jy
! Component: 200  -  total flux cleaned = 0.00283055 Jy
! Total flux subtracted in 200 components = 0.00283055 Jy
! Clean residual min=-0.001698 max=0.001420 Jy/beam
! Clean residual mean=-0.000265 rms=0.000503 Jy/beam
! Combined flux in latest and established models = 0.749963 Jy
! Adding 113 model components to the UV plane model.
! The established model now contains 217 components and 0.749963 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.733 mas, bmaj=3.467 mas, bpa=-34.59 degrees
! Estimated noise=251.084 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000469509 Jy
! Component: 100  -  total flux cleaned = -0.000372688 Jy
! Component: 150  -  total flux cleaned = -0.000327952 Jy
! Component: 200  -  total flux cleaned = -0.000244397 Jy
! Total flux subtracted in 200 components = -0.000244397 Jy
! Clean residual min=-0.001878 max=0.001487 Jy/beam
! Clean residual mean=-0.000086 rms=0.000384 Jy/beam
! Combined flux in latest and established models = 0.749719 Jy
selfcal
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 230 components and 0.749719 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.259274Jy  sigma=0.001340
! Fit after  self-cal, rms=0.259258Jy  sigma=0.001340
wmodel J1642+6856_S_2001_04_09_pus_map.mod
! Writing 230 model components to file: J1642+6856_S_2001_04_09_pus_map.mod
wobs J1642+6856_S_2001_04_09_pus_uvs.fits
! Writing UV FITS file: J1642+6856_S_2001_04_09_pus_uvs.fits
wwins J1642+6856_S_2001_04_09_pus_map.win
! wwins: Wrote 9 windows to J1642+6856_S_2001_04_09_pus_map.win
x = (field_size-8) * field_cell / 4
addwin -x,x,-x,x
clean (field_size*4),0.01
! Inverting map 
! clean: niter=2048  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = -0.000741952 Jy
! Component: 100  -  total flux cleaned = -0.000825003 Jy
! Component: 150  -  total flux cleaned = -0.000981195 Jy
! Component: 200  -  total flux cleaned = -0.00100605 Jy
! Component: 250  -  total flux cleaned = -0.00105472 Jy
! Component: 300  -  total flux cleaned = -0.0011967 Jy
! Component: 350  -  total flux cleaned = -0.00128934 Jy
! Component: 400  -  total flux cleaned = -0.00140316 Jy
! Component: 450  -  total flux cleaned = -0.0015154 Jy
! Component: 500  -  total flux cleaned = -0.00162591 Jy
! Component: 550  -  total flux cleaned = -0.00175721 Jy
! Component: 600  -  total flux cleaned = -0.00186528 Jy
! Component: 650  -  total flux cleaned = -0.0019938 Jy
! Component: 700  -  total flux cleaned = -0.00216374 Jy
! Component: 750  -  total flux cleaned = -0.00237388 Jy
! Component: 800  -  total flux cleaned = -0.00245714 Jy
! Component: 850  -  total flux cleaned = -0.00262257 Jy
! Component: 900  -  total flux cleaned = -0.0027047 Jy
! Component: 950  -  total flux cleaned = -0.00286774 Jy
! Component: 1000  -  total flux cleaned = -0.00300902 Jy
! Component: 1050  -  total flux cleaned = -0.0031292 Jy
! Component: 1100  -  total flux cleaned = -0.00326845 Jy
! Component: 1150  -  total flux cleaned = -0.00338691 Jy
! Component: 1200  -  total flux cleaned = -0.00356338 Jy
! Component: 1250  -  total flux cleaned = -0.00366052 Jy
! Component: 1300  -  total flux cleaned = -0.00381509 Jy
! Component: 1350  -  total flux cleaned = -0.00393037 Jy
! Component: 1400  -  total flux cleaned = -0.00408305 Jy
! Component: 1450  -  total flux cleaned = -0.00421573 Jy
! Component: 1500  -  total flux cleaned = -0.00434781 Jy
! Component: 1550  -  total flux cleaned = -0.00446029 Jy
! Component: 1600  -  total flux cleaned = -0.00462794 Jy
! Component: 1650  -  total flux cleaned = -0.00477602 Jy
! Component: 1700  -  total flux cleaned = -0.00486803 Jy
! Component: 1750  -  total flux cleaned = -0.00501465 Jy
! Component: 1800  -  total flux cleaned = -0.00512404 Jy
! Component: 1850  -  total flux cleaned = -0.00525094 Jy
! Component: 1900  -  total flux cleaned = -0.00535917 Jy
! Component: 1950  -  total flux cleaned = -0.00548479 Jy
! Component: 2000  -  total flux cleaned = -0.0055918 Jy
! Total flux subtracted in 2048 components = -0.00568054 Jy
! Clean residual min=-0.001191 max=0.000971 Jy/beam
! Clean residual mean=-0.000056 rms=0.000325 Jy/beam
! Combined flux in latest and established models = 0.744038 Jy
keep
! Adding 146 model components to the UV plane model.
! The established model now contains 375 components and 0.744039 Jy
![Exited script file: muppet]
wmap "J1642+6856_S_2001_04_09_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.733 x 3.467 at -34.59 degrees (North through East)
! Clean map  min=-0.0018749  max=0.37696 Jy/beam
! Writing clean map to FITS file: J1642+6856_S_2001_04_09_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.376964 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000323903 
device "J1642+6856_S_2001_04_09_pus\_map.eps/VPS"
! Attempting to open device: 'J1642+6856_S_2001_04_09_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.257772 0.257772 0.515545 1.03109 2.06218 4.12436 8.24871 16.4974 32.9949 65.9897
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0009 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.376 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.733 x 3.467 at -34.59 degrees (North through East)
! Clean map  min=-0.0018749  max=0.37696 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1642+6856_S_2001_04_09_pus\_map.gif/vgif"
! Attempting to open device: 'J1642+6856_S_2001_04_09_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1642+6856_S_2001_04_09_pus_uvs.log closed on Fri Oct  5 16:12:24 2007