! Started logfile: J0927+3902_S_2001_04_09_pus_uvs.log on Fri Oct  5 15:59:14 2007
obs J0927+3902_S_2001_04_09_pus_uva.fits
! Reading UV FITS file: J0927+3902_S_2001_04_09_pus_uva.fits
! AN table 1: 149 integrations on 190 of 190 possible baselines.
! AN table 2: 60 integrations on 190 of 190 possible baselines.
! AN table 3: 231 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.179665 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0927+3902
! 
! 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 60080 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 J0927+3902_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 1814 telescope corrections were flagged in sub-array 1.
!  A total of 499 telescope corrections were flagged in sub-array 2.
!  A total of 3631 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 1814 telescope corrections were flagged in sub-array 1.
!  A total of 499 telescope corrections were flagged in sub-array 2.
!  A total of 3631 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 1814 telescope corrections were flagged in sub-array 1.
!  A total of 499 telescope corrections were flagged in sub-array 2.
!  A total of 3631 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 1814 telescope corrections were flagged in sub-array 1.
!  A total of 499 telescope corrections were flagged in sub-array 2.
!  A total of 3631 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=3.309927Jy  sigma=0.028406
! Fit after  self-cal, rms=2.774239Jy  sigma=0.024197
! 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=1.903 mas, bmaj=2.85 mas, bpa=-8.523 degrees
! Estimated noise=693.083 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 = 2.6397 Jy
! Component: 100  -  total flux cleaned = 3.40442 Jy
! Total flux subtracted in 100 components = 3.40442 Jy
! Clean residual min=-0.076613 max=0.348657 Jy/beam
! Clean residual mean=0.000085 rms=0.023444 Jy/beam
! Combined flux in latest and established models = 3.40442 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 8 components and 3.40442 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.973129Jy  sigma=0.007800
! Fit after  self-cal, rms=0.972573Jy  sigma=0.007798
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.388472 Jy
! Component: 100  -  total flux cleaned = 0.617733 Jy
! Total flux subtracted in 100 components = 0.617733 Jy
! Clean residual min=-0.069664 max=0.120679 Jy/beam
! Clean residual mean=-0.000049 rms=0.016613 Jy/beam
! Combined flux in latest and established models = 4.02215 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 15 components and 4.02215 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.783031Jy  sigma=0.005516
! Fit after  self-cal, rms=0.781516Jy  sigma=0.005506
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.150036 Jy
! Component: 100  -  total flux cleaned = 0.247136 Jy
! Total flux subtracted in 100 components = 0.247136 Jy
! Clean residual min=-0.067080 max=0.057055 Jy/beam
! Clean residual mean=-0.000101 rms=0.015166 Jy/beam
! Combined flux in latest and established models = 4.26929 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 22 components and 4.26929 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.755564Jy  sigma=0.005075
! Fit after  self-cal, rms=0.755030Jy  sigma=0.005071
! 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.208 mas, bmaj=3.457 mas, bpa=-9.707 degrees
! Estimated noise=358.183 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.06835 Jy
! Component: 100  -  total flux cleaned = 0.0954808 Jy
! Component: 150  -  total flux cleaned = 0.0974228 Jy
! Component: 200  -  total flux cleaned = 0.0990692 Jy
! Total flux subtracted in 200 components = 0.0990692 Jy
! Clean residual min=-0.046151 max=0.038472 Jy/beam
! Clean residual mean=-0.001143 rms=0.009534 Jy/beam
! Combined flux in latest and established models = 4.36836 Jy
! Performing phase self-cal
! Adding 10 model components to the UV plane model.
! The established model now contains 28 components and 4.36836 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.751905Jy  sigma=0.004982
! Fit after  self-cal, rms=0.751788Jy  sigma=0.004982
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.01     FD        1.03     GC        1.07     GG        1.00*    
!   HH        1.63     HN        0.93     KK        0.98     KP        1.12     
!   LA        1.01     MA        1.13     MC        1.55     MK        1.00     
!   NL        1.02     NY        1.05     OV        1.06     PT        1.00     
!   SC        0.97     TS        1.08     WF        1.05     WZ        0.50     
! 
!  A total of 3 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.01     FD        0.99     GC        1.04     GG        1.00*    
!   HH        1.00*    HN        1.08     KK        0.98     KP        0.99     
!   LA        0.97     MA        1.02     MC        1.56     MK        0.99     
!   NL        1.01     NY        0.97     OV        1.03     PT        0.97     
!   SC        1.02     TS        1.00*    WF        0.94     WZ        1.09     
! 
!  A total of 51 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00     FD        1.00     GC        1.06     GG        1.00*    
!   HH       33.42     HN        1.00     KK        1.00*    KP        1.04     
!   LA        0.98     MA        2.28     MC        0.88     MK        0.94     
!   NL        1.00     NY        0.99     OV        0.99     PT        0.96     
!   SC        1.08     TS        1.01     WF        0.97     WZ        0.92     
! 
! 
! Correcting IF 2.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.01     FD        1.04     GC        1.03     GG        1.00*    
!   HH        1.09     HN        0.98     KK        0.97     KP        1.01     
!   LA        1.03     MA        1.36     MC        0.98     MK        1.00     
!   NL        1.02     NY        1.02     OV        1.03     PT        1.04     
!   SC        1.04     TS        1.02     WF        1.03     WZ        1.07     
! 
!  A total of 3 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00     FD        0.97     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.05     KK        1.00     KP        0.97     
!   LA        0.99     MA        1.04     MC        1.12     MK        0.99     
!   NL        1.00     NY        0.98     OV        0.98     PT        0.99     
!   SC        1.01     TS        1.00*    WF        1.11     WZ        1.05     
! 
!  A total of 51 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        0.97     GC        1.02     GG        1.00*    
!   HH       26.49     HN        1.00     KK        1.00*    KP        0.98     
!   LA        0.99     MA        1.49     MC        0.96     MK        0.93     
!   NL        1.00     NY        1.02     OV        0.95     PT        0.98     
!   SC        1.07     TS        1.04     WF        1.03     WZ        0.91     
! 
! 
! Correcting IF 3.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.03     FD        1.02     GC        1.00     GG        1.00*    
!   HH        1.09     HN        0.98     KK        0.96     KP        1.05     
!   LA        0.97     MA        1.00     MC        0.94     MK        0.95     
!   NL        0.99     NY        0.97     OV        1.01     PT        1.01     
!   SC        0.98     TS        1.00     WF        1.00     WZ        1.05     
! 
!  A total of 3 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.02     FD        0.95     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        1.08     KK        1.00     KP        0.97     
!   LA        0.94     MA        1.04     MC        1.02     MK        0.94     
!   NL        0.98     NY        0.93     OV        0.96     PT        0.99     
!   SC        0.96     TS        1.00*    WF        1.01     WZ        1.03     
! 
!  A total of 51 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00     FD        0.96     GC        1.01     GG        1.00*    
!   HH       27.76     HN        1.01     KK        1.00*    KP        0.97     
!   LA        0.94     MA        0.96     MC        0.92     MK        0.88     
!   NL        0.97     NY        0.97     OV        0.92     PT        0.98     
!   SC        1.03     TS        1.01     WF        1.09     WZ        0.90     
! 
! 
! Correcting IF 4.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.96     FD        1.02     GC        1.04     GG        1.00*    
!   HH        1.17     HN        0.99     KK        0.93     KP        1.03     
!   LA        1.00     MA        0.96     MC        1.91     MK        0.94     
!   NL        0.99     NY        1.01     OV        0.99     PT        0.97     
!   SC        0.99     TS        0.94     WF        1.00     WZ        1.04     
! 
!  A total of 3 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        0.96     GC        1.01     GG        1.00*    
!   HH        1.00*    HN        1.07     KK        0.95     KP        0.97     
!   LA        0.96     MA        2.86     MC        1.43     MK        0.91     
!   NL        0.96     NY        0.97     OV        0.95     PT        1.19     
!   SC        0.97     TS        1.00*    WF        1.05     WZ        1.03     
! 
!  A total of 51 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.94     FD        0.96     GC        1.03     GG        1.00*    
!   HH        9.53     HN        1.01     KK        1.00*    KP        0.97     
!   LA        0.97     MA        1.05     MC        1.92     MK        0.86     
!   NL        0.96     NY        1.00     OV        0.92     PT        1.21     
!   SC        1.04     TS        0.97     WF        1.02     WZ        0.88     
! 
! 
! Fit before self-cal, rms=0.751788Jy  sigma=0.004982
! Fit after  self-cal, rms=0.921072Jy  sigma=0.003653
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.237 mas, bmaj=3.49 mas, bpa=-8.322 degrees
! Estimated noise=360.309 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, -1).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00688907 Jy
! Component: 100  -  total flux cleaned = 0.00872892 Jy
! Component: 150  -  total flux cleaned = 0.0117193 Jy
! Component: 200  -  total flux cleaned = 0.0142389 Jy
! Total flux subtracted in 200 components = 0.0142389 Jy
! Clean residual min=-0.017399 max=0.015813 Jy/beam
! Clean residual mean=0.000120 rms=0.003996 Jy/beam
! Combined flux in latest and established models = 4.3826 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 41 components and 4.3826 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.919209Jy  sigma=0.003621
! Fit after  self-cal, rms=0.928996Jy  sigma=0.003619
! 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.928996Jy  sigma=0.003619
! Fit after  self-cal, rms=0.908934Jy  sigma=0.003080
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.234 mas, bmaj=3.501 mas, bpa=-8.487 degrees
! Estimated noise=360.137 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00565664 Jy
! Component: 100  -  total flux cleaned = 0.0086181 Jy
! Component: 150  -  total flux cleaned = 0.0105784 Jy
! Component: 200  -  total flux cleaned = 0.0122752 Jy
! Total flux subtracted in 200 components = 0.0122752 Jy
! Clean residual min=-0.006380 max=0.016399 Jy/beam
! Clean residual mean=0.000318 rms=0.001728 Jy/beam
! Combined flux in latest and established models = 4.39487 Jy
selfcal
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 51 components and 4.39487 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.908113Jy  sigma=0.003069
! Fit after  self-cal, rms=0.908516Jy  sigma=0.003068
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 (-2.5, 1).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00816929 Jy
! Component: 100  -  total flux cleaned = 0.00819024 Jy
! Component: 150  -  total flux cleaned = 0.00818571 Jy
! Component: 200  -  total flux cleaned = 0.00817982 Jy
! Total flux subtracted in 200 components = 0.00817982 Jy
! Clean residual min=-0.005591 max=0.006085 Jy/beam
! Clean residual mean=0.000283 rms=0.001580 Jy/beam
! Combined flux in latest and established models = 4.40305 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 59 components and 4.40305 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.908055Jy  sigma=0.003062
! Fit after  self-cal, rms=0.907965Jy  sigma=0.003062
! 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.907965Jy  sigma=0.003062
! Fit after  self-cal, rms=0.916895Jy  sigma=0.003059
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.232 mas, bmaj=3.504 mas, bpa=-8.445 degrees
! Estimated noise=360.214 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0058288 Jy
! Component: 100  -  total flux cleaned = 0.00719412 Jy
! Component: 150  -  total flux cleaned = 0.00803816 Jy
! Component: 200  -  total flux cleaned = 0.00901494 Jy
! Total flux subtracted in 200 components = 0.00901494 Jy
! Clean residual min=-0.005114 max=0.005240 Jy/beam
! Clean residual mean=0.000177 rms=0.001340 Jy/beam
! Combined flux in latest and established models = 4.41207 Jy
selfcal
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 68 components and 4.41207 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.916574Jy  sigma=0.003055
! Fit after  self-cal, rms=0.916596Jy  sigma=0.003055
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.00103833 Jy
! Component: 100  -  total flux cleaned = 0.00123973 Jy
! Component: 150  -  total flux cleaned = 0.0016065 Jy
! Component: 200  -  total flux cleaned = 0.0017764 Jy
! Total flux subtracted in 200 components = 0.0017764 Jy
! Clean residual min=-0.005175 max=0.005105 Jy/beam
! Clean residual mean=0.000170 rms=0.001296 Jy/beam
! Combined flux in latest and established models = 4.41384 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 72 components and 4.41384 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.916454Jy  sigma=0.003054
! Fit after  self-cal, rms=0.916413Jy  sigma=0.003054
! 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.916413Jy  sigma=0.003054
! Fit after  self-cal, rms=0.919686Jy  sigma=0.003053
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.4 mas, bmaj=8.872 mas, bpa=-13.2 degrees
! Estimated noise=556.985 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00685453 Jy
! Component: 100  -  total flux cleaned = 0.0100538 Jy
! Component: 150  -  total flux cleaned = 0.0117669 Jy
! Component: 200  -  total flux cleaned = 0.012324 Jy
! Total flux subtracted in 200 components = 0.012324 Jy
! Clean residual min=-0.006374 max=0.006179 Jy/beam
! Clean residual mean=0.000259 rms=0.001785 Jy/beam
! Combined flux in latest and established models = 4.42617 Jy
selfcal
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 92 components and 4.42617 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.919699Jy  sigma=0.003052
! Fit after  self-cal, rms=0.919736Jy  sigma=0.003052
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.000472874 Jy
! Component: 100  -  total flux cleaned = 0.000506677 Jy
! Component: 150  -  total flux cleaned = 0.00053616 Jy
! Component: 200  -  total flux cleaned = 0.000588078 Jy
! Total flux subtracted in 200 components = 0.000588078 Jy
! Clean residual min=-0.006471 max=0.006272 Jy/beam
! Clean residual mean=0.000250 rms=0.001787 Jy/beam
! Combined flux in latest and established models = 4.42675 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 99 components and 4.42675 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.919731Jy  sigma=0.003052
! Fit after  self-cal, rms=0.919734Jy  sigma=0.003052
! 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.231 mas, bmaj=3.505 mas, bpa=-8.417 degrees
! Estimated noise=360.213 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.231 x 3.505 at -8.417 degrees (North through East)
! Clean map  min=-0.0044908  max=3.5922 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.919734Jy  sigma=0.003052
! Fit after  self-cal, rms=1.138474Jy  sigma=0.001450
! Inverting map and beam 
! Estimated beam: bmin=2.23 mas, bmaj=3.505 mas, bpa=-8.433 degrees
! Estimated noise=360.02 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00417312 Jy
! Component: 100  -  total flux cleaned = 0.00526858 Jy
! Component: 150  -  total flux cleaned = 0.00564808 Jy
! Component: 200  -  total flux cleaned = 0.00564986 Jy
! Total flux subtracted in 200 components = 0.00564986 Jy
! Clean residual min=-0.003939 max=0.003372 Jy/beam
! Clean residual mean=0.000045 rms=0.000875 Jy/beam
! Combined flux in latest and established models = 4.4324 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 104 components and 4.4324 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.138369Jy  sigma=0.001447
! Fit after  self-cal, rms=1.138310Jy  sigma=0.001447
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 4.79242e-06 Jy
! Component: 100  -  total flux cleaned = 3.86879e-06 Jy
! Component: 150  -  total flux cleaned = -0.000123285 Jy
! Component: 200  -  total flux cleaned = -0.000125112 Jy
! Total flux subtracted in 200 components = -0.000125112 Jy
! Clean residual min=-0.003778 max=0.003438 Jy/beam
! Clean residual mean=0.000046 rms=0.000849 Jy/beam
! Combined flux in latest and established models = 4.43228 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 107 components and 4.43228 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.138257Jy  sigma=0.001446
! Fit after  self-cal, rms=1.138228Jy  sigma=0.001446
! Inverting map 
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.138228Jy  sigma=0.001446
! Fit after  self-cal, rms=1.140802Jy  sigma=0.001445
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.922 mas, bmaj=2.964 mas, bpa=-5.793 degrees
! Estimated noise=714.084 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 2.68113 Jy
! Component: 100  -  total flux cleaned = 3.44305 Jy
! Component: 150  -  total flux cleaned = 3.82101 Jy
! Component: 200  -  total flux cleaned = 4.01739 Jy
! Total flux subtracted in 200 components = 4.01739 Jy
! Clean residual min=-0.020514 max=0.096736 Jy/beam
! Clean residual mean=0.000072 rms=0.006072 Jy/beam
! Combined flux in latest and established models = 4.01739 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 12 model components to the UV plane model.
! The established model now contains 12 components and 4.01739 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.229 mas, bmaj=3.505 mas, bpa=-8.418 degrees
! Estimated noise=359.985 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.161 Jy
! Component: 100  -  total flux cleaned = 0.250753 Jy
! Component: 150  -  total flux cleaned = 0.307179 Jy
! Component: 200  -  total flux cleaned = 0.344456 Jy
! Total flux subtracted in 200 components = 0.344456 Jy
! Clean residual min=-0.005047 max=0.020157 Jy/beam
! Clean residual mean=0.000313 rms=0.002152 Jy/beam
! Combined flux in latest and established models = 4.36185 Jy
! Adding 26 model components to the UV plane model.
! The established model now contains 31 components and 4.36185 Jy
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0251106 Jy
! Component: 100  -  total flux cleaned = 0.0422714 Jy
! Component: 150  -  total flux cleaned = 0.0544462 Jy
! Component: 200  -  total flux cleaned = 0.0597696 Jy
! Total flux subtracted in 200 components = 0.0597696 Jy
! Clean residual min=-0.006762 max=0.005844 Jy/beam
! Clean residual mean=0.000064 rms=0.001108 Jy/beam
! Combined flux in latest and established models = 4.42162 Jy
! Adding 28 model components to the UV plane model.
! The established model now contains 49 components and 4.42162 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.393 mas, bmaj=8.869 mas, bpa=-13.23 degrees
! Estimated noise=557.824 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00957892 Jy
! Component: 100  -  total flux cleaned = 0.0133376 Jy
! Component: 150  -  total flux cleaned = 0.0143896 Jy
! Component: 200  -  total flux cleaned = 0.0145643 Jy
! Total flux subtracted in 200 components = 0.0145643 Jy
! Clean residual min=-0.003713 max=0.003165 Jy/beam
! Clean residual mean=0.000002 rms=0.001167 Jy/beam
! Combined flux in latest and established models = 4.43618 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 = 9.91905e-05 Jy
! Component: 100  -  total flux cleaned = 0.000143859 Jy
! Component: 150  -  total flux cleaned = 0.000225716 Jy
! Component: 200  -  total flux cleaned = 0.000298897 Jy
! Total flux subtracted in 200 components = 0.000298897 Jy
! Clean residual min=-0.003629 max=0.003169 Jy/beam
! Clean residual mean=-0.000003 rms=0.001157 Jy/beam
! Combined flux in latest and established models = 4.43648 Jy
! Adding 25 model components to the UV plane model.
! The established model now contains 66 components and 4.43648 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.229 mas, bmaj=3.505 mas, bpa=-8.418 degrees
! Estimated noise=359.985 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00230023 Jy
! Component: 100  -  total flux cleaned = -0.00254646 Jy
! Component: 150  -  total flux cleaned = -0.00299109 Jy
! Component: 200  -  total flux cleaned = -0.0031956 Jy
! Total flux subtracted in 200 components = -0.0031956 Jy
! Clean residual min=-0.004369 max=0.004015 Jy/beam
! Clean residual mean=0.000015 rms=0.000949 Jy/beam
! Combined flux in latest and established models = 4.43328 Jy
selfcal
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 77 components and 4.43328 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.141066Jy  sigma=0.001455
! Fit after  self-cal, rms=1.142395Jy  sigma=0.001454
wmodel J0927+3902_S_2001_04_09_pus_map.mod
! Writing 77 model components to file: J0927+3902_S_2001_04_09_pus_map.mod
wobs J0927+3902_S_2001_04_09_pus_uvs.fits
! Writing UV FITS file: J0927+3902_S_2001_04_09_pus_uvs.fits
wwins J0927+3902_S_2001_04_09_pus_map.win
! wwins: Wrote 3 windows to J0927+3902_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.00019568 Jy
! Component: 100  -  total flux cleaned = 0.000460288 Jy
! Component: 150  -  total flux cleaned = 0.00149825 Jy
! Component: 200  -  total flux cleaned = 0.00256136 Jy
! Component: 250  -  total flux cleaned = 0.00333344 Jy
! Component: 300  -  total flux cleaned = 0.00358508 Jy
! Component: 350  -  total flux cleaned = 0.0040173 Jy
! Component: 400  -  total flux cleaned = 0.00450291 Jy
! Component: 450  -  total flux cleaned = 0.00468166 Jy
! Component: 500  -  total flux cleaned = 0.00497579 Jy
! Component: 550  -  total flux cleaned = 0.00514993 Jy
! Component: 600  -  total flux cleaned = 0.00537943 Jy
! Component: 650  -  total flux cleaned = 0.00560587 Jy
! Component: 700  -  total flux cleaned = 0.00571766 Jy
! Component: 750  -  total flux cleaned = 0.00593942 Jy
! Component: 800  -  total flux cleaned = 0.00604947 Jy
! Component: 850  -  total flux cleaned = 0.00615887 Jy
! Component: 900  -  total flux cleaned = 0.0063742 Jy
! Component: 950  -  total flux cleaned = 0.00653344 Jy
! Component: 1000  -  total flux cleaned = 0.00663899 Jy
! Component: 1050  -  total flux cleaned = 0.00684806 Jy
! Component: 1100  -  total flux cleaned = 0.00695172 Jy
! Component: 1150  -  total flux cleaned = 0.00720853 Jy
! Component: 1200  -  total flux cleaned = 0.00736135 Jy
! Component: 1250  -  total flux cleaned = 0.00736123 Jy
! Component: 1300  -  total flux cleaned = 0.0075625 Jy
! Component: 1350  -  total flux cleaned = 0.00766229 Jy
! Component: 1400  -  total flux cleaned = 0.00776161 Jy
! Component: 1450  -  total flux cleaned = 0.00776195 Jy
! Component: 1500  -  total flux cleaned = 0.0079573 Jy
! Component: 1550  -  total flux cleaned = 0.00805414 Jy
! Component: 1600  -  total flux cleaned = 0.00815032 Jy
! Component: 1650  -  total flux cleaned = 0.00819818 Jy
! Component: 1700  -  total flux cleaned = 0.00819813 Jy
! Component: 1750  -  total flux cleaned = 0.00829246 Jy
! Component: 1800  -  total flux cleaned = 0.00824545 Jy
! Component: 1850  -  total flux cleaned = 0.00829206 Jy
! Component: 1900  -  total flux cleaned = 0.00829194 Jy
! Component: 1950  -  total flux cleaned = 0.00819985 Jy
! Component: 2000  -  total flux cleaned = 0.00815396 Jy
! Total flux subtracted in 2048 components = 0.00819928 Jy
! Clean residual min=-0.002351 max=0.002270 Jy/beam
! Clean residual mean=-0.000034 rms=0.000787 Jy/beam
! Combined flux in latest and established models = 4.44148 Jy
keep
! Adding 143 model components to the UV plane model.
! The established model now contains 205 components and 4.44148 Jy
![Exited script file: muppet]
wmap "J0927+3902_S_2001_04_09_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.229 x 3.505 at -8.418 degrees (North through East)
! Clean map  min=-0.0032819  max=3.5964 Jy/beam
! Writing clean map to FITS file: J0927+3902_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 3.59643 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000787655 
device "J0927+3902_S_2001_04_09_pus\_map.eps/VPS"
! Attempting to open device: 'J0927+3902_S_2001_04_09_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.065703 0.065703 0.131406 0.262812 0.525624 1.05125 2.1025 4.20499 8.40998 16.82 33.6399 67.2799
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0023 
print "peak=",int(1000*peak_flux)/1000
! peak= 3.596 
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.229 x 3.505 at -8.418 degrees (North through East)
! Clean map  min=-0.0032819  max=3.5964 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0927+3902_S_2001_04_09_pus\_map.gif/vgif"
! Attempting to open device: 'J0927+3902_S_2001_04_09_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0927+3902_S_2001_04_09_pus_uvs.log closed on Fri Oct  5 15:59:36 2007