! Started logfile: J0501+1356_S_2000_12_04_pus_uvs.log on Wed Oct 17 16:57:39 2007
obs J0501+1356_S_2000_12_04_pus_uva.fits
! Reading UV FITS file: J0501+1356_S_2000_12_04_pus_uva.fits
! AN table 1: 461 integrations on 190 of 190 possible baselines.
! AN table 2: 215 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.120391 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0501+1356
! 
! 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 2169 lines of history.
! 
! Reading 61852 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 J0501+1356_S_2000_12_04_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 6478 telescope corrections were flagged in sub-array 1.
!  A total of 3321 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 2.
!  A total of 6478 telescope corrections were flagged in sub-array 1.
!  A total of 3199 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 3.
!  A total of 6586 telescope corrections were flagged in sub-array 1.
!  A total of 3358 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 4.
!  A total of 6478 telescope corrections were flagged in sub-array 1.
!  A total of 3401 telescope corrections were flagged in sub-array 2.
! 
! Fit before self-cal, rms=0.958085Jy  sigma=0.008007
! Fit after  self-cal, rms=0.875141Jy  sigma=0.007467
! 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.253 mas, bmaj=4.203 mas, bpa=-5.167 degrees
! Estimated noise=708.602 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.125545 Jy
! Component: 100  -  total flux cleaned = 0.157952 Jy
! Total flux subtracted in 100 components = 0.157952 Jy
! Clean residual min=-0.011119 max=0.018919 Jy/beam
! Clean residual mean=0.000175 rms=0.003193 Jy/beam
! Combined flux in latest and established models = 0.157952 Jy
! Performing phase self-cal
! Adding 7 model components to the UV plane model.
! The established model now contains 7 components and 0.157952 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.302711Jy  sigma=0.002458
! Fit after  self-cal, rms=0.302528Jy  sigma=0.002456
! 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.618 mas, bmaj=4.898 mas, bpa=-7.056 degrees
! Estimated noise=364.267 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.0317485 Jy
! Component: 100  -  total flux cleaned = 0.0511474 Jy
! Component: 150  -  total flux cleaned = 0.0642452 Jy
! Component: 200  -  total flux cleaned = 0.0731974 Jy
! Total flux subtracted in 200 components = 0.0731974 Jy
! Clean residual min=-0.010392 max=0.016349 Jy/beam
! Clean residual mean=0.000447 rms=0.003369 Jy/beam
! Combined flux in latest and established models = 0.231149 Jy
! Performing phase self-cal
! Adding 40 model components to the UV plane model.
! The established model now contains 46 components and 0.231149 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.299391Jy  sigma=0.002418
! Fit after  self-cal, rms=0.299158Jy  sigma=0.002416
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 240 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.13     FD        1.01     GC        1.12     GG        1.00*    
!   HH        1.00*    HN        1.15     KK        0.98     KP        1.12     
!   LA        1.13     MA        1.00*    MC        1.00*    MK        1.05     
!   NL        1.48     NY        1.01     OV        1.05     PT        1.03     
!   SC        1.17     TS        1.05     WF        1.05     WZ        1.00*    
! 
!  A total of 123 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        0.33     MC        1.07     MK        1.00*    
!   NL        1.04     NY        0.90     OV        1.00*    PT        1.00*    
!   SC        1.19     TS        1.00*    WF        0.79     WZ        0.97     
! 
! 
! Correcting IF 2.
!  A total of 240 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.08     FD        1.00     GC        1.19     GG        1.00*    
!   HH        1.00*    HN        1.14     KK        1.03     KP        1.06     
!   LA        1.07     MA        1.00*    MC        1.00*    MK        1.05     
!   NL        1.54     NY        0.97     OV        1.01     PT        1.03     
!   SC        1.13     TS        1.08     WF        0.99     WZ        1.00*    
! 
!  A total of 120 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        0.57     MC        1.00     MK        1.00*    
!   NL        0.99     NY        0.99     OV        1.00*    PT        1.00*    
!   SC        1.08     TS        1.00*    WF        0.80     WZ        0.98     
! 
! 
! Correcting IF 3.
!  A total of 384 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.05     FD        0.53     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.89     KK        1.34     KP        1.27     
!   LA        0.45     MA        1.00*    MC        1.00*    MK        1.50     
!   NL        0.93     NY        0.96     OV        0.60     PT        1.31     
!   SC        1.33     TS        0.75     WF        0.66     WZ        1.00*    
! 
!  A total of 111 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        0.78     MC        0.37     MK        1.00*    
!   NL        0.74     NY        0.74     OV        1.00*    PT        1.00*    
!   SC        0.97     TS        1.00*    WF        0.75     WZ        0.87     
! 
! 
! Correcting IF 4.
!  A total of 240 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.05     FD        0.97     GC        1.10     GG        1.00*    
!   HH        1.00*    HN        1.08     KK        0.99     KP        1.11     
!   LA        1.06     MA        1.00*    MC        1.00*    MK        1.02     
!   NL        1.43     NY        1.01     OV        1.02     PT        0.92     
!   SC        1.10     TS        1.08     WF        0.95     WZ        1.00*    
! 
!  A total of 117 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.88     KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        0.58     MC        0.43     MK        1.00*    
!   NL        1.04     NY        0.57     OV        1.00*    PT        1.00*    
!   SC        1.16     TS        1.00*    WF        0.69     WZ        1.04     
! 
! 
! Fit before self-cal, rms=0.299158Jy  sigma=0.002416
! Fit after  self-cal, rms=0.242020Jy  sigma=0.002307
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.696 mas, bmaj=5.069 mas, bpa=-7.182 degrees
! Estimated noise=365.828 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 (-6.5, -6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00917535 Jy
! Component: 100  -  total flux cleaned = 0.0117385 Jy
! Component: 150  -  total flux cleaned = 0.0117448 Jy
! Component: 200  -  total flux cleaned = 0.0115278 Jy
! Total flux subtracted in 200 components = 0.0115278 Jy
! Clean residual min=-0.004339 max=0.005806 Jy/beam
! Clean residual mean=-0.000030 rms=0.001256 Jy/beam
! Combined flux in latest and established models = 0.242677 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 59 components and 0.242677 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.241535Jy  sigma=0.002306
! Fit after  self-cal, rms=0.245658Jy  sigma=0.002269
! 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.245658Jy  sigma=0.002269
! Fit after  self-cal, rms=0.260470Jy  sigma=0.002262
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.701 mas, bmaj=5.032 mas, bpa=-6.688 degrees
! Estimated noise=369.779 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00505984 Jy
! Component: 100  -  total flux cleaned = 0.00628937 Jy
! Component: 150  -  total flux cleaned = 0.00657864 Jy
! Component: 200  -  total flux cleaned = 0.0067407 Jy
! Total flux subtracted in 200 components = 0.0067407 Jy
! Clean residual min=-0.005308 max=0.005528 Jy/beam
! Clean residual mean=-0.000068 rms=0.001219 Jy/beam
! Combined flux in latest and established models = 0.249418 Jy
selfcal
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 84 components and 0.249418 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.260313Jy  sigma=0.002262
! Fit after  self-cal, rms=0.261506Jy  sigma=0.002258
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.000756327 Jy
! Component: 100  -  total flux cleaned = 0.00103914 Jy
! Component: 150  -  total flux cleaned = 0.00103757 Jy
! Component: 200  -  total flux cleaned = 0.00082385 Jy
! Total flux subtracted in 200 components = 0.00082385 Jy
! Clean residual min=-0.005400 max=0.005120 Jy/beam
! Clean residual mean=-0.000086 rms=0.001223 Jy/beam
! Combined flux in latest and established models = 0.250241 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 99 components and 0.250241 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.261426Jy  sigma=0.002258
! Fit after  self-cal, rms=0.261451Jy  sigma=0.002258
! 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.261451Jy  sigma=0.002258
! Fit after  self-cal, rms=0.266802Jy  sigma=0.002256
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.702 mas, bmaj=5.01 mas, bpa=-6.486 degrees
! Estimated noise=370.309 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00380192 Jy
! Component: 100  -  total flux cleaned = 0.00465177 Jy
! Component: 150  -  total flux cleaned = 0.00473102 Jy
! Component: 200  -  total flux cleaned = 0.00473483 Jy
! Total flux subtracted in 200 components = 0.00473483 Jy
! Clean residual min=-0.005247 max=0.005368 Jy/beam
! Clean residual mean=-0.000069 rms=0.001185 Jy/beam
! Combined flux in latest and established models = 0.254976 Jy
selfcal
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 113 components and 0.254976 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.266717Jy  sigma=0.002256
! Fit after  self-cal, rms=0.267276Jy  sigma=0.002254
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.000587684 Jy
! Component: 100  -  total flux cleaned = 0.000735222 Jy
! Component: 150  -  total flux cleaned = 0.000737189 Jy
! Component: 200  -  total flux cleaned = 0.000626398 Jy
! Total flux subtracted in 200 components = 0.000626398 Jy
! Clean residual min=-0.005159 max=0.005027 Jy/beam
! Clean residual mean=-0.000082 rms=0.001162 Jy/beam
! Combined flux in latest and established models = 0.255603 Jy
! Performing phase self-cal
! Adding 30 model components to the UV plane model.
! The established model now contains 120 components and 0.255603 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.267234Jy  sigma=0.002254
! Fit after  self-cal, rms=0.267251Jy  sigma=0.002254
! 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.267251Jy  sigma=0.002254
! Fit after  self-cal, rms=0.270441Jy  sigma=0.002253
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.4 mas, bmaj=8.885 mas, bpa=-1.073 degrees
! Estimated noise=485.107 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00364133 Jy
! Component: 100  -  total flux cleaned = 0.00365537 Jy
! Component: 150  -  total flux cleaned = 0.00349967 Jy
! Component: 200  -  total flux cleaned = 0.00345452 Jy
! Total flux subtracted in 200 components = 0.00345452 Jy
! Clean residual min=-0.007085 max=0.007423 Jy/beam
! Clean residual mean=-0.000215 rms=0.002177 Jy/beam
! Combined flux in latest and established models = 0.259057 Jy
selfcal
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 137 components and 0.259057 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.270408Jy  sigma=0.002253
! Fit after  self-cal, rms=0.270797Jy  sigma=0.002252
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.000225579 Jy
! Component: 100  -  total flux cleaned = 0.00013336 Jy
! Component: 150  -  total flux cleaned = 5.28168e-05 Jy
! Component: 200  -  total flux cleaned = 1.75645e-05 Jy
! Total flux subtracted in 200 components = 1.75645e-05 Jy
! Clean residual min=-0.006924 max=0.007126 Jy/beam
! Clean residual mean=-0.000254 rms=0.002046 Jy/beam
! Combined flux in latest and established models = 0.259075 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 147 components and 0.259075 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.270790Jy  sigma=0.002252
! Fit after  self-cal, rms=0.270797Jy  sigma=0.002252
! 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.704 mas, bmaj=4.996 mas, bpa=-6.31 degrees
! Estimated noise=370.136 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.704 x 4.996 at -6.31 degrees (North through East)
! Clean map  min=-0.0046759  max=0.1616 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=2.29 mas, bmaj=4.225 mas, bpa=-4.743 degrees
! Estimated noise=730.627 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.121071 Jy
! Component: 100  -  total flux cleaned = 0.155839 Jy
! Component: 150  -  total flux cleaned = 0.177313 Jy
! Component: 200  -  total flux cleaned = 0.192823 Jy
! Total flux subtracted in 200 components = 0.192823 Jy
! Clean residual min=-0.006208 max=0.009112 Jy/beam
! Clean residual mean=0.000091 rms=0.001932 Jy/beam
! Combined flux in latest and established models = 0.192823 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 27 model components to the UV plane model.
! The established model now contains 27 components and 0.192823 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.704 mas, bmaj=4.996 mas, bpa=-6.31 degrees
! Estimated noise=370.136 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.0197591 Jy
! Component: 100  -  total flux cleaned = 0.0331999 Jy
! Component: 150  -  total flux cleaned = 0.0427988 Jy
! Component: 200  -  total flux cleaned = 0.0497777 Jy
! Total flux subtracted in 200 components = 0.0497777 Jy
! Clean residual min=-0.004792 max=0.006437 Jy/beam
! Clean residual mean=0.000043 rms=0.001328 Jy/beam
! Combined flux in latest and established models = 0.2426 Jy
! Adding 56 model components to the UV plane model.
! The established model now contains 74 components and 0.2426 Jy
! Inverting map 
! Added new window around map position (9.5, 6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00611656 Jy
! Component: 100  -  total flux cleaned = 0.0103765 Jy
! Component: 150  -  total flux cleaned = 0.013236 Jy
! Component: 200  -  total flux cleaned = 0.0150521 Jy
! Total flux subtracted in 200 components = 0.0150521 Jy
! Clean residual min=-0.004779 max=0.004109 Jy/beam
! Clean residual mean=-0.000072 rms=0.001093 Jy/beam
! Combined flux in latest and established models = 0.257653 Jy
! Adding 31 model components to the UV plane model.
! The established model now contains 95 components and 0.257653 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.4 mas, bmaj=8.885 mas, bpa=-1.073 degrees
! Estimated noise=485.107 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00462215 Jy
! Component: 100  -  total flux cleaned = 0.00586492 Jy
! Component: 150  -  total flux cleaned = 0.00668597 Jy
! Component: 200  -  total flux cleaned = 0.00713432 Jy
! Total flux subtracted in 200 components = 0.00713432 Jy
! Clean residual min=-0.007486 max=0.006262 Jy/beam
! Clean residual mean=-0.000385 rms=0.001796 Jy/beam
! Combined flux in latest and established models = 0.264787 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.00026022 Jy
! Component: 100  -  total flux cleaned = 0.000348338 Jy
! Component: 150  -  total flux cleaned = 0.000347373 Jy
! Component: 200  -  total flux cleaned = 0.00038385 Jy
! Total flux subtracted in 200 components = 0.00038385 Jy
! Clean residual min=-0.007423 max=0.006112 Jy/beam
! Clean residual mean=-0.000394 rms=0.001770 Jy/beam
! Combined flux in latest and established models = 0.265171 Jy
! Adding 44 model components to the UV plane model.
! The established model now contains 129 components and 0.265171 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.704 mas, bmaj=4.996 mas, bpa=-6.31 degrees
! Estimated noise=370.136 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000338539 Jy
! Component: 100  -  total flux cleaned = -0.000339879 Jy
! Component: 150  -  total flux cleaned = -0.0003424 Jy
! Component: 200  -  total flux cleaned = -0.000297656 Jy
! Total flux subtracted in 200 components = -0.000297656 Jy
! Clean residual min=-0.004682 max=0.003742 Jy/beam
! Clean residual mean=-0.000125 rms=0.001008 Jy/beam
! Combined flux in latest and established models = 0.264873 Jy
selfcal
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 152 components and 0.264873 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.270689Jy  sigma=0.002251
! Fit after  self-cal, rms=0.270663Jy  sigma=0.002251
wmodel J0501+1356_S_2000_12_04_pus_map.mod
! Writing 152 model components to file: J0501+1356_S_2000_12_04_pus_map.mod
wobs J0501+1356_S_2000_12_04_pus_uvs.fits
! Writing UV FITS file: J0501+1356_S_2000_12_04_pus_uvs.fits
wwins J0501+1356_S_2000_12_04_pus_map.win
! wwins: Wrote 3 windows to J0501+1356_S_2000_12_04_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.0017448 Jy
! Component: 100  -  total flux cleaned = -0.00283852 Jy
! Component: 150  -  total flux cleaned = -0.00378017 Jy
! Component: 200  -  total flux cleaned = -0.0047322 Jy
! Component: 250  -  total flux cleaned = -0.00557631 Jy
! Component: 300  -  total flux cleaned = -0.00626543 Jy
! Component: 350  -  total flux cleaned = -0.00692385 Jy
! Component: 400  -  total flux cleaned = -0.00745101 Jy
! Component: 450  -  total flux cleaned = -0.00785829 Jy
! Component: 500  -  total flux cleaned = -0.00825316 Jy
! Component: 550  -  total flux cleaned = -0.00858919 Jy
! Component: 600  -  total flux cleaned = -0.00887019 Jy
! Component: 650  -  total flux cleaned = -0.00914433 Jy
! Component: 700  -  total flux cleaned = -0.00923357 Jy
! Component: 750  -  total flux cleaned = -0.00949624 Jy
! Component: 800  -  total flux cleaned = -0.00962445 Jy
! Component: 850  -  total flux cleaned = -0.00979273 Jy
! Component: 900  -  total flux cleaned = -0.00999892 Jy
! Component: 950  -  total flux cleaned = -0.0102005 Jy
! Component: 1000  -  total flux cleaned = -0.0103585 Jy
! Component: 1050  -  total flux cleaned = -0.0104355 Jy
! Component: 1100  -  total flux cleaned = -0.0104734 Jy
! Component: 1150  -  total flux cleaned = -0.0103982 Jy
! Component: 1200  -  total flux cleaned = -0.0105101 Jy
! Component: 1250  -  total flux cleaned = -0.0104372 Jy
! Component: 1300  -  total flux cleaned = -0.0104733 Jy
! Component: 1350  -  total flux cleaned = -0.0104733 Jy
! Component: 1400  -  total flux cleaned = -0.0104386 Jy
! Component: 1450  -  total flux cleaned = -0.0104388 Jy
! Component: 1500  -  total flux cleaned = -0.0104731 Jy
! Component: 1550  -  total flux cleaned = -0.0104728 Jy
! Component: 1600  -  total flux cleaned = -0.010506 Jy
! Component: 1650  -  total flux cleaned = -0.0105057 Jy
! Component: 1700  -  total flux cleaned = -0.0106363 Jy
! Component: 1750  -  total flux cleaned = -0.0106039 Jy
! Component: 1800  -  total flux cleaned = -0.0107003 Jy
! Component: 1850  -  total flux cleaned = -0.0107319 Jy
! Component: 1900  -  total flux cleaned = -0.0107636 Jy
! Component: 1950  -  total flux cleaned = -0.0108573 Jy
! Component: 2000  -  total flux cleaned = -0.0109188 Jy
! Total flux subtracted in 2048 components = -0.0110103 Jy
! Clean residual min=-0.001668 max=0.002835 Jy/beam
! Clean residual mean=-0.000032 rms=0.000609 Jy/beam
! Combined flux in latest and established models = 0.253863 Jy
keep
! Adding 161 model components to the UV plane model.
! The established model now contains 313 components and 0.253863 Jy
![Exited script file: muppet]
wmap "J0501+1356_S_2000_12_04_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.704 x 4.996 at -6.31 degrees (North through East)
! Clean map  min=-0.0030923  max=0.16091 Jy/beam
! Writing clean map to FITS file: J0501+1356_S_2000_12_04_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.160912 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.00060085 
device "J0501+1356_S_2000_12_04_pus\_map.eps/VPS"
! Attempting to open device: 'J0501+1356_S_2000_12_04_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -1.12021 1.12021 2.24042 4.48084 8.96169 17.9234 35.8467 71.6935
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0018 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.16 
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.704 x 4.996 at -6.31 degrees (North through East)
! Clean map  min=-0.0030923  max=0.16091 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0501+1356_S_2000_12_04_pus\_map.gif/vgif"
! Attempting to open device: 'J0501+1356_S_2000_12_04_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0501+1356_S_2000_12_04_pus_uvs.log closed on Wed Oct 17 16:58:03 2007