! Started logfile: J1608+1029_S_1999_03_08_pus_uvs.log on Tue Jan  8 18:28:20 2008
obs J1608+1029_S_1999_03_08_pus_uva.fits
! Reading UV FITS file: J1608+1029_S_1999_03_08_pus_uva.fits
! AN table 1: 52 integrations on 190 of 190 possible baselines.
! AN table 2: 122 integrations on 190 of 190 possible baselines.
! AN table 3: 326 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.1484 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1608+1029
! 
! 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.22497e+09        8e+06          1        8e+06
!  02        2  2.24497e+09        8e+06          1        8e+06
!  03        3  2.33497e+09        8e+06          1        8e+06
!  04        4  2.36497e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 2332 lines of history.
! 
! Reading 56392 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 J1608+1029_S_1999_03_08_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 685 telescope corrections were flagged in sub-array 1.
!  A total of 1692 telescope corrections were flagged in sub-array 2.
!  A total of 4630 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 685 telescope corrections were flagged in sub-array 1.
!  A total of 1692 telescope corrections were flagged in sub-array 2.
!  A total of 4630 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 685 telescope corrections were flagged in sub-array 1.
!  A total of 1692 telescope corrections were flagged in sub-array 2.
!  A total of 4460 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 685 telescope corrections were flagged in sub-array 1.
!  A total of 1692 telescope corrections were flagged in sub-array 2.
!  A total of 4460 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=0.867255Jy  sigma=0.005814
! Fit after  self-cal, rms=0.442791Jy  sigma=0.002838
! 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.105 mas, bmaj=4.062 mas, bpa=-4.073 degrees
! Estimated noise=838.085 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.811782 Jy
! Component: 100  -  total flux cleaned = 1.05005 Jy
! Total flux subtracted in 100 components = 1.05005 Jy
! Clean residual min=-0.025865 max=0.105497 Jy/beam
! Clean residual mean=0.000284 rms=0.007607 Jy/beam
! Combined flux in latest and established models = 1.05005 Jy
! Performing phase self-cal
! Adding 7 model components to the UV plane model.
! The established model now contains 7 components and 1.05005 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.404493Jy  sigma=0.002527
! Fit after  self-cal, rms=0.404146Jy  sigma=0.002526
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.117223 Jy
! Component: 100  -  total flux cleaned = 0.186781 Jy
! Total flux subtracted in 100 components = 0.186781 Jy
! Clean residual min=-0.019849 max=0.037506 Jy/beam
! Clean residual mean=0.000106 rms=0.005337 Jy/beam
! Combined flux in latest and established models = 1.23683 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 23 components and 1.23683 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.355520Jy  sigma=0.002052
! Fit after  self-cal, rms=0.355184Jy  sigma=0.002051
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0474428 Jy
! Component: 100  -  total flux cleaned = 0.0808757 Jy
! Total flux subtracted in 100 components = 0.0808757 Jy
! Clean residual min=-0.020622 max=0.025017 Jy/beam
! Clean residual mean=0.000029 rms=0.004853 Jy/beam
! Combined flux in latest and established models = 1.31771 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 29 components and 1.31771 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.345928Jy  sigma=0.001965
! Fit after  self-cal, rms=0.345847Jy  sigma=0.001965
! 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.353 mas, bmaj=5.476 mas, bpa=-6.595 degrees
! Estimated noise=410.943 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.0285556 Jy
! Component: 100  -  total flux cleaned = 0.0438603 Jy
! Component: 150  -  total flux cleaned = 0.0488955 Jy
! Component: 200  -  total flux cleaned = 0.0515034 Jy
! Total flux subtracted in 200 components = 0.0515034 Jy
! Clean residual min=-0.024958 max=0.022732 Jy/beam
! Clean residual mean=-0.000234 rms=0.006311 Jy/beam
! Combined flux in latest and established models = 1.36921 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 40 components and 1.36921 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.343312Jy  sigma=0.001942
! Fit after  self-cal, rms=0.343510Jy  sigma=0.001942
! Inverting map 
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.95     FD        0.98     GC        0.97     GG        1.00*    
!   HN        0.97     KP        1.00     LA        0.98     NL        0.99     
!   OV        0.99     PT        1.01     SC        1.03     WF        0.95     
!   GN        0.96     HH        1.00*    KK        0.96     MC        1.00*    
!   MK        0.92     NY        1.00*    ON        1.00*    WZ        1.00*    
! 
!  A total of 63 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        0.97     GC        0.98     GG        1.00*    
!   HN        0.97     KP        0.82     LA        0.99     NL        0.86     
!   OV        1.01     PT        1.03     SC        1.00     WF        0.95     
!   GN        0.98     HH        1.00*    KK        0.98     MC        1.00*    
!   MK        0.93     NY        1.07     ON        1.00*    WZ        1.00*    
! 
!  A total of 57 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        0.97     GC        1.12     GG        1.00*    
!   HN        0.99     KP        0.95     LA        0.99     NL        1.04     
!   OV        0.99     PT        1.01     SC        0.99     WF        0.99     
!   GN        0.97     HH        1.00*    KK        1.00*    MC        0.98     
!   MK        1.00*    NY        0.97     ON        0.98     WZ        1.09     
! 
! 
! Correcting IF 2.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00     FD        1.03     GC        0.99     GG        1.00*    
!   HN        0.94     KP        1.00     LA        0.97     NL        0.87     
!   OV        0.96     PT        0.98     SC        1.11     WF        0.97     
!   GN        0.98     HH        1.00*    KK        0.92     MC        1.00*    
!   MK        0.94     NY        1.00*    ON        1.00*    WZ        1.00*    
! 
!  A total of 63 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        1.01     GC        1.00     GG        1.00*    
!   HN        0.93     KP        0.93     LA        0.98     NL        0.77     
!   OV        0.97     PT        0.99     SC        1.04     WF        1.00     
!   GN        0.99     HH        1.00*    KK        0.94     MC        1.00*    
!   MK        0.93     NY        1.07     ON        1.00*    WZ        1.00*    
! 
!  A total of 57 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.01     FD        1.02     GC        1.17     GG        1.00*    
!   HN        0.97     KP        0.97     LA        0.97     NL        0.98     
!   OV        0.97     PT        0.98     SC        1.04     WF        0.99     
!   GN        0.96     HH        1.00*    KK        1.00*    MC        1.00     
!   MK        1.00*    NY        0.98     ON        0.99     WZ        1.11     
! 
! 
! Correcting IF 3.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.01     FD        1.01     GC        1.00     GG        1.00*    
!   HN        1.22     KP        1.00     LA        1.00     NL        0.94     
!   OV        1.01     PT        0.96     SC        1.08     WF        0.98     
!   GN        0.98     HH        1.00*    KK        0.92     MC        1.00*    
!   MK        0.93     NY        1.00*    ON        1.00*    WZ        1.00*    
! 
!  A total of 63 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00     FD        0.99     GC        1.00     GG        1.00*    
!   HN        1.17     KP        1.01     LA        1.01     NL        0.84     
!   OV        1.01     PT        0.98     SC        1.04     WF        1.01     
!   GN        0.99     HH        1.00*    KK        0.97     MC        1.00*    
!   MK        0.94     NY        1.09     ON        1.00*    WZ        1.00*    
! 
!  A total of 207 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.03     FD        1.00     GC        1.12     GG        1.00*    
!   HN        1.25     KP        1.00     LA        1.00     NL        1.01     
!   OV        1.00     PT        0.97     SC        1.01     WF        1.01     
!   GN        0.98     HH        1.08     KK        1.00*    MC        1.54     
!   MK        1.00*    NY        0.98     ON        0.98     WZ        1.01     
! 
! 
! Correcting IF 4.
!  A total of 27 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.98     FD        1.03     GC        1.01     GG        1.00*    
!   HN        1.18     KP        0.98     LA        0.99     NL        0.89     
!   OV        1.02     PT        0.92     SC        1.07     WF        0.98     
!   GN        0.97     HH        1.00*    KK        0.98     MC        1.00*    
!   MK        0.95     NY        1.00*    ON        1.00*    WZ        1.00*    
! 
!  A total of 63 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        0.99     GC        1.01     GG        1.00*    
!   HN        1.11     KP        0.96     LA        1.02     NL        0.79     
!   OV        1.03     PT        1.00     SC        1.04     WF        1.00     
!   GN        0.97     HH        1.00*    KK        1.03     MC        1.00*    
!   MK        0.96     NY        1.09     ON        1.00*    WZ        1.00*    
! 
!  A total of 207 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.99     FD        1.00     GC        1.11     GG        1.00*    
!   HN        1.19     KP        0.97     LA        1.00     NL        1.02     
!   OV        1.00     PT        0.95     SC        1.01     WF        0.99     
!   GN        0.98     HH        1.10     KK        1.00*    MC        1.67     
!   MK        1.00*    NY        3.09     ON        0.95     WZ        1.04     
! 
! 
! Fit before self-cal, rms=0.343510Jy  sigma=0.001942
! Fit after  self-cal, rms=0.356216Jy  sigma=0.001647
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.435 mas, bmaj=5.672 mas, bpa=-6.989 degrees
! Estimated noise=422.282 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 (-4, 5.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0075033 Jy
! Component: 100  -  total flux cleaned = 0.00584238 Jy
! Component: 150  -  total flux cleaned = 0.00665753 Jy
! Component: 200  -  total flux cleaned = 0.00700677 Jy
! Total flux subtracted in 200 components = 0.00700677 Jy
! Clean residual min=-0.017158 max=0.013458 Jy/beam
! Clean residual mean=0.000016 rms=0.004004 Jy/beam
! Combined flux in latest and established models = 1.37622 Jy
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 54 components and 1.37622 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.354573Jy  sigma=0.001630
! Fit after  self-cal, rms=0.355166Jy  sigma=0.001628
! 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.355166Jy  sigma=0.001628
! Fit after  self-cal, rms=0.389100Jy  sigma=0.001444
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.455 mas, bmaj=5.672 mas, bpa=-6.944 degrees
! Estimated noise=423.623 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.0026211 Jy
! Component: 100  -  total flux cleaned = -0.00136579 Jy
! Component: 150  -  total flux cleaned = -0.00102862 Jy
! Component: 200  -  total flux cleaned = -0.000464048 Jy
! Total flux subtracted in 200 components = -0.000464048 Jy
! Clean residual min=-0.007662 max=0.006886 Jy/beam
! Clean residual mean=0.000045 rms=0.001515 Jy/beam
! Combined flux in latest and established models = 1.37575 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 67 components and 1.37575 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.388176Jy  sigma=0.001435
! Fit after  self-cal, rms=0.388337Jy  sigma=0.001434
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.00152315 Jy
! Component: 100  -  total flux cleaned = 0.00195826 Jy
! Component: 150  -  total flux cleaned = 0.00214937 Jy
! Component: 200  -  total flux cleaned = 0.0023169 Jy
! Total flux subtracted in 200 components = 0.0023169 Jy
! Clean residual min=-0.005671 max=0.006165 Jy/beam
! Clean residual mean=0.000032 rms=0.001402 Jy/beam
! Combined flux in latest and established models = 1.37807 Jy
! Performing phase self-cal
! Adding 32 model components to the UV plane model.
! The established model now contains 86 components and 1.37807 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.388086Jy  sigma=0.001431
! Fit after  self-cal, rms=0.388072Jy  sigma=0.001431
! 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.388072Jy  sigma=0.001431
! Fit after  self-cal, rms=0.358741Jy  sigma=0.001412
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.461 mas, bmaj=5.675 mas, bpa=-6.914 degrees
! Estimated noise=423.676 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00254418 Jy
! Component: 100  -  total flux cleaned = -0.00276827 Jy
! Component: 150  -  total flux cleaned = -0.00293088 Jy
! Component: 200  -  total flux cleaned = -0.00292994 Jy
! Total flux subtracted in 200 components = -0.00292994 Jy
! Clean residual min=-0.004774 max=0.004184 Jy/beam
! Clean residual mean=0.000012 rms=0.001029 Jy/beam
! Combined flux in latest and established models = 1.37514 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 93 components and 1.37514 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.358521Jy  sigma=0.001409
! Fit after  self-cal, rms=0.358559Jy  sigma=0.001409
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.000737557 Jy
! Component: 100  -  total flux cleaned = 0.000740189 Jy
! Component: 150  -  total flux cleaned = 0.000521086 Jy
! Component: 200  -  total flux cleaned = 0.000423786 Jy
! Total flux subtracted in 200 components = 0.000423786 Jy
! Clean residual min=-0.003807 max=0.003938 Jy/beam
! Clean residual mean=0.000009 rms=0.000990 Jy/beam
! Combined flux in latest and established models = 1.37556 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 100 components and 1.37556 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.358470Jy  sigma=0.001408
! Fit after  self-cal, rms=0.358468Jy  sigma=0.001408
! 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.358468Jy  sigma=0.001408
! Fit after  self-cal, rms=0.360705Jy  sigma=0.001408
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.372 mas, bmaj=9.15 mas, bpa=-1.207 degrees
! Estimated noise=564.13 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000486815 Jy
! Component: 100  -  total flux cleaned = -0.000939509 Jy
! Component: 150  -  total flux cleaned = -0.00126751 Jy
! Component: 200  -  total flux cleaned = -0.00164679 Jy
! Total flux subtracted in 200 components = -0.00164679 Jy
! Clean residual min=-0.004203 max=0.005372 Jy/beam
! Clean residual mean=-0.000013 rms=0.001510 Jy/beam
! Combined flux in latest and established models = 1.37392 Jy
selfcal
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 118 components and 1.37392 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.360648Jy  sigma=0.001407
! Fit after  self-cal, rms=0.360674Jy  sigma=0.001407
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 = 8.89301e-05 Jy
! Component: 100  -  total flux cleaned = -1.98028e-05 Jy
! Component: 150  -  total flux cleaned = -0.000215232 Jy
! Component: 200  -  total flux cleaned = -0.000366144 Jy
! Total flux subtracted in 200 components = -0.000366144 Jy
! Clean residual min=-0.004109 max=0.005008 Jy/beam
! Clean residual mean=-0.000008 rms=0.001485 Jy/beam
! Combined flux in latest and established models = 1.37355 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 123 components and 1.37355 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.360662Jy  sigma=0.001407
! Fit after  self-cal, rms=0.360649Jy  sigma=0.001407
! 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.468 mas, bmaj=5.679 mas, bpa=-6.906 degrees
! Estimated noise=424.029 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.468 x 5.679 at -6.906 degrees (North through East)
! Clean map  min=-0.0029263  max=1.1057 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.360649Jy  sigma=0.001407
! Fit after  self-cal, rms=0.622285Jy  sigma=0.001287
! Inverting map and beam 
! Estimated beam: bmin=2.469 mas, bmaj=5.685 mas, bpa=-6.921 degrees
! Estimated noise=423.399 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00243496 Jy
! Component: 100  -  total flux cleaned = -0.00275021 Jy
! Component: 150  -  total flux cleaned = -0.00292881 Jy
! Component: 200  -  total flux cleaned = -0.00301159 Jy
! Total flux subtracted in 200 components = -0.00301159 Jy
! Clean residual min=-0.003067 max=0.002885 Jy/beam
! Clean residual mean=0.000017 rms=0.000764 Jy/beam
! Combined flux in latest and established models = 1.37054 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 131 components and 1.37054 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.622245Jy  sigma=0.001286
! Fit after  self-cal, rms=0.622236Jy  sigma=0.001286
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -5.73549e-05 Jy
! Component: 100  -  total flux cleaned = -0.000196783 Jy
! Component: 150  -  total flux cleaned = -0.000327132 Jy
! Component: 200  -  total flux cleaned = -0.000447221 Jy
! Total flux subtracted in 200 components = -0.000447221 Jy
! Clean residual min=-0.002823 max=0.002795 Jy/beam
! Clean residual mean=0.000019 rms=0.000755 Jy/beam
! Combined flux in latest and established models = 1.37009 Jy
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 133 components and 1.37009 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.622216Jy  sigma=0.001286
! Fit after  self-cal, rms=0.622208Jy  sigma=0.001286
! Inverting map 
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.622208Jy  sigma=0.001286
! Fit after  self-cal, rms=0.625898Jy  sigma=0.001286
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=2.171 mas, bmaj=4.153 mas, bpa=-4.859 degrees
! Estimated noise=869.559 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.83138 Jy
! Component: 100  -  total flux cleaned = 1.05425 Jy
! Component: 150  -  total flux cleaned = 1.15836 Jy
! Component: 200  -  total flux cleaned = 1.21331 Jy
! Total flux subtracted in 200 components = 1.21331 Jy
! Clean residual min=-0.010253 max=0.028506 Jy/beam
! Clean residual mean=0.000147 rms=0.002587 Jy/beam
! Combined flux in latest and established models = 1.21331 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 15 model components to the UV plane model.
! The established model now contains 15 components and 1.21331 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.473 mas, bmaj=5.688 mas, bpa=-6.928 degrees
! Estimated noise=423.515 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.0569886 Jy
! Component: 100  -  total flux cleaned = 0.0905424 Jy
! Component: 150  -  total flux cleaned = 0.111575 Jy
! Component: 200  -  total flux cleaned = 0.125522 Jy
! Total flux subtracted in 200 components = 0.125522 Jy
! Clean residual min=-0.003597 max=0.007586 Jy/beam
! Clean residual mean=0.000175 rms=0.001191 Jy/beam
! Combined flux in latest and established models = 1.33884 Jy
! Adding 40 model components to the UV plane model.
! The established model now contains 47 components and 1.33884 Jy
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00958991 Jy
! Component: 100  -  total flux cleaned = 0.0164723 Jy
! Component: 150  -  total flux cleaned = 0.0214867 Jy
! Component: 200  -  total flux cleaned = 0.0248998 Jy
! Total flux subtracted in 200 components = 0.0248998 Jy
! Clean residual min=-0.003184 max=0.003088 Jy/beam
! Clean residual mean=0.000041 rms=0.000802 Jy/beam
! Combined flux in latest and established models = 1.36374 Jy
! Adding 31 model components to the UV plane model.
! The established model now contains 68 components and 1.36374 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.374 mas, bmaj=9.16 mas, bpa=-1.345 degrees
! Estimated noise=561.807 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00403425 Jy
! Component: 100  -  total flux cleaned = 0.00433941 Jy
! Component: 150  -  total flux cleaned = 0.00439727 Jy
! Component: 200  -  total flux cleaned = 0.00444756 Jy
! Total flux subtracted in 200 components = 0.00444756 Jy
! Clean residual min=-0.003327 max=0.004291 Jy/beam
! Clean residual mean=0.000049 rms=0.001153 Jy/beam
! Combined flux in latest and established models = 1.36818 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 = 4.11912e-05 Jy
! Component: 100  -  total flux cleaned = 7.46912e-05 Jy
! Component: 150  -  total flux cleaned = 7.37406e-05 Jy
! Component: 200  -  total flux cleaned = 7.3859e-05 Jy
! Total flux subtracted in 200 components = 7.3859e-05 Jy
! Clean residual min=-0.003356 max=0.004098 Jy/beam
! Clean residual mean=0.000047 rms=0.001140 Jy/beam
! Combined flux in latest and established models = 1.36826 Jy
! Adding 31 model components to the UV plane model.
! The established model now contains 97 components and 1.36826 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.473 mas, bmaj=5.688 mas, bpa=-6.928 degrees
! Estimated noise=423.515 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000507147 Jy
! Component: 100  -  total flux cleaned = 0.000169342 Jy
! Component: 150  -  total flux cleaned = 0.00056288 Jy
! Component: 200  -  total flux cleaned = 0.000743049 Jy
! Total flux subtracted in 200 components = 0.000743049 Jy
! Clean residual min=-0.003184 max=0.002956 Jy/beam
! Clean residual mean=0.000012 rms=0.000759 Jy/beam
! Combined flux in latest and established models = 1.369 Jy
selfcal
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 103 components and 1.369 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.625995Jy  sigma=0.001287
! Fit after  self-cal, rms=0.626112Jy  sigma=0.001287
wmodel J1608+1029_S_1999_03_08_pus_map.mod
! Writing 103 model components to file: J1608+1029_S_1999_03_08_pus_map.mod
wobs J1608+1029_S_1999_03_08_pus_uvs.fits
! Writing UV FITS file: J1608+1029_S_1999_03_08_pus_uvs.fits
wwins J1608+1029_S_1999_03_08_pus_map.win
! wwins: Wrote 2 windows to J1608+1029_S_1999_03_08_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.000439596 Jy
! Component: 100  -  total flux cleaned = -0.00114294 Jy
! Component: 150  -  total flux cleaned = -0.00176645 Jy
! Component: 200  -  total flux cleaned = -0.00199699 Jy
! Component: 250  -  total flux cleaned = -0.00226603 Jy
! Component: 300  -  total flux cleaned = -0.00248554 Jy
! Component: 350  -  total flux cleaned = -0.00270041 Jy
! Component: 400  -  total flux cleaned = -0.00278445 Jy
! Component: 450  -  total flux cleaned = -0.00278432 Jy
! Component: 500  -  total flux cleaned = -0.00282491 Jy
! Component: 550  -  total flux cleaned = -0.00290446 Jy
! Component: 600  -  total flux cleaned = -0.00298306 Jy
! Component: 650  -  total flux cleaned = -0.00302158 Jy
! Component: 700  -  total flux cleaned = -0.0030217 Jy
! Component: 750  -  total flux cleaned = -0.00305896 Jy
! Component: 800  -  total flux cleaned = -0.00302202 Jy
! Component: 850  -  total flux cleaned = -0.00294919 Jy
! Component: 900  -  total flux cleaned = -0.00291302 Jy
! Component: 950  -  total flux cleaned = -0.00280684 Jy
! Component: 1000  -  total flux cleaned = -0.00280737 Jy
! Component: 1050  -  total flux cleaned = -0.00277266 Jy
! Component: 1100  -  total flux cleaned = -0.00273893 Jy
! Component: 1150  -  total flux cleaned = -0.00277309 Jy
! Component: 1200  -  total flux cleaned = -0.00280653 Jy
! Component: 1250  -  total flux cleaned = -0.0028724 Jy
! Component: 1300  -  total flux cleaned = -0.00280597 Jy
! Component: 1350  -  total flux cleaned = -0.00287099 Jy
! Component: 1400  -  total flux cleaned = -0.00280607 Jy
! Component: 1450  -  total flux cleaned = -0.00274205 Jy
! Component: 1500  -  total flux cleaned = -0.00280605 Jy
! Component: 1550  -  total flux cleaned = -0.00286898 Jy
! Component: 1600  -  total flux cleaned = -0.00277466 Jy
! Component: 1650  -  total flux cleaned = -0.00283707 Jy
! Component: 1700  -  total flux cleaned = -0.00286793 Jy
! Component: 1750  -  total flux cleaned = -0.00286778 Jy
! Component: 1800  -  total flux cleaned = -0.00286749 Jy
! Component: 1850  -  total flux cleaned = -0.00286735 Jy
! Component: 1900  -  total flux cleaned = -0.00289762 Jy
! Component: 1950  -  total flux cleaned = -0.00295729 Jy
! Component: 2000  -  total flux cleaned = -0.00295702 Jy
! Total flux subtracted in 2048 components = -0.00295683 Jy
! Clean residual min=-0.001692 max=0.002054 Jy/beam
! Clean residual mean=0.000013 rms=0.000566 Jy/beam
! Combined flux in latest and established models = 1.36604 Jy
keep
! Adding 151 model components to the UV plane model.
! The established model now contains 253 components and 1.36604 Jy
![Exited script file: muppet]
wmap "J1608+1029_S_1999_03_08_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.473 x 5.688 at -6.928 degrees (North through East)
! Clean map  min=-0.0026595  max=1.1074 Jy/beam
! Writing clean map to FITS file: J1608+1029_S_1999_03_08_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.10742 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000566398 
device "J1608+1029_S_1999_03_08_pus\_map.eps/VPS"
! Attempting to open device: 'J1608+1029_S_1999_03_08_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.153437 0.153437 0.306873 0.613746 1.22749 2.45499 4.90997 9.81994 19.6399 39.2798 78.5595
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0016 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.107 
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.473 x 5.688 at -6.928 degrees (North through East)
! Clean map  min=-0.0026595  max=1.1074 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1608+1029_S_1999_03_08_pus\_map.gif/vgif"
! Attempting to open device: 'J1608+1029_S_1999_03_08_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1608+1029_S_1999_03_08_pus_uvs.log closed on Tue Jan  8 18:28:49 2008