! Started logfile: J1640+3946_S_2000_05_22_pus_uvs.log on Mon Nov 19 18:53:22 2007
obs J1640+3946_S_2000_05_22_pus_uva.fits
! Reading UV FITS file: J1640+3946_S_2000_05_22_pus_uva.fits
! AN table 1: 79 integrations on 190 of 190 possible baselines.
! AN table 2: 93 integrations on 190 of 190 possible baselines.
! AN table 3: 155 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.129969 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1640+3946
! 
! 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 2003 lines of history.
! 
! Reading 32300 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 J1640+3946_S_2000_05_22_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 1001 telescope corrections were flagged in sub-array 1.
!  A total of 1605 telescope corrections were flagged in sub-array 2.
!  A total of 2032 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 1001 telescope corrections were flagged in sub-array 1.
!  A total of 1548 telescope corrections were flagged in sub-array 2.
!  A total of 2032 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 1001 telescope corrections were flagged in sub-array 1.
!  A total of 1548 telescope corrections were flagged in sub-array 2.
!  A total of 2032 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 1001 telescope corrections were flagged in sub-array 1.
!  A total of 1599 telescope corrections were flagged in sub-array 2.
!  A total of 2032 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=0.927919Jy  sigma=0.006628
! Fit after  self-cal, rms=0.520219Jy  sigma=0.002190
! 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.776 mas, bmaj=3.047 mas, bpa=-20.1 degrees
! Estimated noise=1242.58 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.63266 Jy
! Component: 100  -  total flux cleaned = 0.776537 Jy
! Total flux subtracted in 100 components = 0.776537 Jy
! Clean residual min=-0.019123 max=0.053274 Jy/beam
! Clean residual mean=0.000199 rms=0.005429 Jy/beam
! Combined flux in latest and established models = 0.776537 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 8 components and 0.776537 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486446Jy  sigma=0.001961
! Fit after  self-cal, rms=0.486340Jy  sigma=0.001961
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0612884 Jy
! Component: 100  -  total flux cleaned = 0.0994095 Jy
! Total flux subtracted in 100 components = 0.0994095 Jy
! Clean residual min=-0.017029 max=0.020464 Jy/beam
! Clean residual mean=0.000084 rms=0.004046 Jy/beam
! Combined flux in latest and established models = 0.875946 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 21 components and 0.875946 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.478551Jy  sigma=0.001719
! Fit after  self-cal, rms=0.478246Jy  sigma=0.001719
! 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.028 mas, bmaj=3.602 mas, bpa=-17.01 degrees
! Estimated noise=507.842 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.0396682 Jy
! Component: 100  -  total flux cleaned = 0.0627192 Jy
! Component: 150  -  total flux cleaned = 0.0769002 Jy
! Component: 200  -  total flux cleaned = 0.0857945 Jy
! Total flux subtracted in 200 components = 0.0857945 Jy
! Clean residual min=-0.013053 max=0.015007 Jy/beam
! Clean residual mean=-0.000324 rms=0.003339 Jy/beam
! Combined flux in latest and established models = 0.961741 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 42 components and 0.96174 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.476974Jy  sigma=0.001631
! Fit after  self-cal, rms=0.476696Jy  sigma=0.001631
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 15 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.91     FD        0.92     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.00*    KP        1.02     
!   MA        1.24     MC        1.05     MK        1.00*    NL        0.99     
!   NY        1.01     OV        0.96     PT        0.91     SC        1.01     
!   TS        1.00*    WF        1.02     WZ        0.98     LA        0.92     
! 
!  A total of 90 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.17     GG        1.00*    
!   HH        1.02     HN        1.17     KK        1.00*    KP        1.00*    
!   MA        1.00*    MC        0.98     MK        1.00*    NL        1.00*    
!   NY        1.01     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        0.99     WF        1.13     WZ        1.07     LA        1.00*    
! 
!  A total of 210 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.01     FD        0.99     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.95     KK        1.01     KP        0.98     
!   MA        2.21     MC        1.08     MK        1.00     NL        0.99     
!   NY        1.02     OV        1.00     PT        0.99     SC        1.01     
!   TS        1.00*    WF        1.11     WZ        0.95     LA        0.99     
! 
! 
! Correcting IF 2.
!  A total of 15 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.92     FD        0.95     GC        0.98     GG        1.00*    
!   HH        1.00*    HN        1.04     KK        1.00*    KP        0.95     
!   MA        1.10     MC        0.95     MK        1.00*    NL        1.03     
!   NY        1.69     OV        0.95     PT        0.92     SC        1.02     
!   TS        1.00*    WF        1.07     WZ        0.97     LA        0.88     
! 
!  A total of 69 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.06     GG        1.00*    
!   HH        1.01     HN        1.21     KK        1.00*    KP        1.00*    
!   MA        1.34     MC        1.38     MK        1.00*    NL        1.00*    
!   NY        1.03     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.04     WF        1.08     WZ        1.05     LA        1.00*    
! 
!  A total of 210 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.01     FD        1.02     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        1.04     KK        1.04     KP        0.98     
!   MA        1.16     MC        0.91     MK        0.96     NL        1.03     
!   NY        1.00     OV        0.99     PT        1.01     SC        1.04     
!   TS        1.00*    WF        1.03     WZ        0.94     LA        0.95     
! 
! 
! Correcting IF 3.
!  A total of 15 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.90     FD        0.93     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        1.02     KK        1.00*    KP        0.91     
!   MA        0.78     MC        0.75     MK        1.00*    NL        0.98     
!   NY        0.30     OV        0.99     PT        0.90     SC        1.01     
!   TS        1.00*    WF        1.09     WZ        1.02     LA        0.94     
! 
!  A total of 69 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.09     GG        1.00*    
!   HH        0.90     HN        1.24     KK        1.00*    KP        1.00*    
!   MA        2.83     MC        1.13     MK        1.00*    NL        1.00*    
!   NY        1.03     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.07     WF        1.06     WZ        1.08     LA        1.00*    
! 
!  A total of 210 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        1.01     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.02     KP        1.00     
!   MA        0.99     MC        1.18     MK        0.98     NL        0.98     
!   NY        1.03     OV        1.05     PT        0.98     SC        1.04     
!   TS        1.00*    WF        1.03     WZ        0.97     LA        1.00     
! 
! 
! Correcting IF 4.
!  A total of 15 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.94     FD        0.95     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        1.04     KK        1.00*    KP        0.97     
!   MA        1.21     MC        0.94     MK        1.00*    NL        1.00     
!   NY        0.49     OV        0.96     PT        0.91     SC        1.02     
!   TS        1.00*    WF        1.05     WZ        1.00     LA        0.95     
! 
!  A total of 18 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00*    FD        1.00*    GC        1.19     GG        1.00*    
!   HH        1.17     HN        1.21     KK        1.00*    KP        1.00*    
!   MA        1.70     MC        0.83     MK        1.00*    NL        1.00*    
!   NY        1.05     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.04     WF        1.15     WZ        1.09     LA        1.00*    
! 
!  A total of 210 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.01     FD        1.01     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.02     KK        1.05     KP        1.01     
!   MA        1.03     MC        1.06     MK        1.02     NL        1.00     
!   NY        0.99     OV        1.01     PT        1.01     SC        1.04     
!   TS        1.00*    WF        1.03     WZ        0.97     LA        1.00     
! 
! 
! Fit before self-cal, rms=0.476696Jy  sigma=0.001631
! Fit after  self-cal, rms=0.562183Jy  sigma=0.001484
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.031 mas, bmaj=3.602 mas, bpa=-17.26 degrees
! Estimated noise=520.869 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.00682112 Jy
! Component: 100  -  total flux cleaned = -0.00798548 Jy
! Component: 150  -  total flux cleaned = -0.00889133 Jy
! Component: 200  -  total flux cleaned = -0.00959354 Jy
! Total flux subtracted in 200 components = -0.00959354 Jy
! Clean residual min=-0.004440 max=0.006114 Jy/beam
! Clean residual mean=0.000304 rms=0.001089 Jy/beam
! Combined flux in latest and established models = 0.952147 Jy
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 45 components and 0.952147 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.562030Jy  sigma=0.001482
! Fit after  self-cal, rms=0.563017Jy  sigma=0.001482
! Inverting map 
! Added new window around map position (-4.5, -4.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00577234 Jy
! Component: 100  -  total flux cleaned = 0.00765017 Jy
! Component: 150  -  total flux cleaned = 0.00795669 Jy
! Component: 200  -  total flux cleaned = 0.00796174 Jy
! Total flux subtracted in 200 components = 0.00796174 Jy
! Clean residual min=-0.004131 max=0.003951 Jy/beam
! Clean residual mean=0.000229 rms=0.000987 Jy/beam
! Combined flux in latest and established models = 0.960109 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 63 components and 0.960109 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.562983Jy  sigma=0.001480
! Fit after  self-cal, rms=0.562964Jy  sigma=0.001480
! 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.562964Jy  sigma=0.001480
! Fit after  self-cal, rms=0.565919Jy  sigma=0.001479
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.038 mas, bmaj=3.605 mas, bpa=-17.23 degrees
! Estimated noise=521.127 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00388956 Jy
! Component: 100  -  total flux cleaned = -0.00377773 Jy
! Component: 150  -  total flux cleaned = -0.00358444 Jy
! Component: 200  -  total flux cleaned = -0.00325424 Jy
! Total flux subtracted in 200 components = -0.00325424 Jy
! Clean residual min=-0.003590 max=0.003745 Jy/beam
! Clean residual mean=0.000245 rms=0.000895 Jy/beam
! Combined flux in latest and established models = 0.956854 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 69 components and 0.956854 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.565852Jy  sigma=0.001478
! Fit after  self-cal, rms=0.565904Jy  sigma=0.001478
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.000311465 Jy
! Component: 100  -  total flux cleaned = 0.000383195 Jy
! Component: 150  -  total flux cleaned = 0.000507521 Jy
! Component: 200  -  total flux cleaned = 0.000564389 Jy
! Total flux subtracted in 200 components = 0.000564389 Jy
! Clean residual min=-0.003569 max=0.003664 Jy/beam
! Clean residual mean=0.000240 rms=0.000881 Jy/beam
! Combined flux in latest and established models = 0.957419 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 70 components and 0.957419 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.565893Jy  sigma=0.001478
! Fit after  self-cal, rms=0.565897Jy  sigma=0.001478
! 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.565897Jy  sigma=0.001478
! Fit after  self-cal, rms=0.568244Jy  sigma=0.001477
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.042 mas, bmaj=3.607 mas, bpa=-17.21 degrees
! Estimated noise=521.411 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00268677 Jy
! Component: 100  -  total flux cleaned = -0.00285459 Jy
! Component: 150  -  total flux cleaned = -0.00279534 Jy
! Component: 200  -  total flux cleaned = -0.00268076 Jy
! Total flux subtracted in 200 components = -0.00268076 Jy
! Clean residual min=-0.003243 max=0.003530 Jy/beam
! Clean residual mean=0.000247 rms=0.000835 Jy/beam
! Combined flux in latest and established models = 0.954738 Jy
selfcal
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 71 components and 0.954738 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.568210Jy  sigma=0.001477
! Fit after  self-cal, rms=0.568246Jy  sigma=0.001477
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.000228202 Jy
! Component: 100  -  total flux cleaned = 0.000378141 Jy
! Component: 150  -  total flux cleaned = 0.000423872 Jy
! Component: 200  -  total flux cleaned = 0.000506351 Jy
! Total flux subtracted in 200 components = 0.000506351 Jy
! Clean residual min=-0.003227 max=0.003484 Jy/beam
! Clean residual mean=0.000242 rms=0.000827 Jy/beam
! Combined flux in latest and established models = 0.955244 Jy
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 73 components and 0.955244 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.568243Jy  sigma=0.001477
! Fit after  self-cal, rms=0.568245Jy  sigma=0.001477
! 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.568245Jy  sigma=0.001477
! Fit after  self-cal, rms=0.570125Jy  sigma=0.001476
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.085 mas, bmaj=8.834 mas, bpa=14.98 degrees
! Estimated noise=818.569 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000198993 Jy
! Component: 100  -  total flux cleaned = 4.40521e-06 Jy
! Component: 150  -  total flux cleaned = 0.000182934 Jy
! Component: 200  -  total flux cleaned = 0.000294417 Jy
! Total flux subtracted in 200 components = 0.000294417 Jy
! Clean residual min=-0.002527 max=0.004825 Jy/beam
! Clean residual mean=0.000920 rms=0.001117 Jy/beam
! Combined flux in latest and established models = 0.955539 Jy
selfcal
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 87 components and 0.955539 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.570128Jy  sigma=0.001476
! Fit after  self-cal, rms=0.570126Jy  sigma=0.001476
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 (61.5, 30).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00410317 Jy
! Component: 100  -  total flux cleaned = 0.00615666 Jy
! Component: 150  -  total flux cleaned = 0.00711683 Jy
! Component: 200  -  total flux cleaned = 0.00765141 Jy
! Total flux subtracted in 200 components = 0.00765141 Jy
! Clean residual min=-0.002300 max=0.003870 Jy/beam
! Clean residual mean=0.000782 rms=0.001029 Jy/beam
! Combined flux in latest and established models = 0.96319 Jy
! Performing phase self-cal
! Adding 33 model components to the UV plane model.
! The established model now contains 118 components and 0.963191 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.570114Jy  sigma=0.001476
! Fit after  self-cal, rms=0.570109Jy  sigma=0.001476
! 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.046 mas, bmaj=3.608 mas, bpa=-17.2 degrees
! Estimated noise=521.731 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.046 x 3.608 at -17.2 degrees (North through East)
! Clean map  min=-0.0027392  max=0.8352 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.570109Jy  sigma=0.001476
! Fit after  self-cal, rms=1.123832Jy  sigma=0.001362
! Inverting map and beam 
! Estimated beam: bmin=2.046 mas, bmaj=3.608 mas, bpa=-17.18 degrees
! Estimated noise=520.641 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000807137 Jy
! Component: 100  -  total flux cleaned = -0.00151301 Jy
! Component: 150  -  total flux cleaned = -0.00174435 Jy
! Component: 200  -  total flux cleaned = -0.00195996 Jy
! Total flux subtracted in 200 components = -0.00195996 Jy
! Clean residual min=-0.002752 max=0.003012 Jy/beam
! Clean residual mean=0.000156 rms=0.000702 Jy/beam
! Combined flux in latest and established models = 0.961231 Jy
! Performing phase self-cal
! Adding 30 model components to the UV plane model.
! The established model now contains 143 components and 0.961231 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.123798Jy  sigma=0.001361
! Fit after  self-cal, rms=1.123811Jy  sigma=0.001361
! Inverting map 
! Added new window around map position (-61.5, 26).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00172521 Jy
! Component: 100  -  total flux cleaned = 0.00209029 Jy
! Component: 150  -  total flux cleaned = 0.00209185 Jy
! Component: 200  -  total flux cleaned = 0.0021547 Jy
! Total flux subtracted in 200 components = 0.0021547 Jy
! Clean residual min=-0.002577 max=0.002854 Jy/beam
! Clean residual mean=0.000145 rms=0.000685 Jy/beam
! Combined flux in latest and established models = 0.963385 Jy
! Performing phase self-cal
! Adding 39 model components to the UV plane model.
! The established model now contains 162 components and 0.963385 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.123775Jy  sigma=0.001361
! Fit after  self-cal, rms=1.123780Jy  sigma=0.001361
! 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.123780Jy  sigma=0.001361
! Fit after  self-cal, rms=1.040782Jy  sigma=0.001361
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.792 mas, bmaj=3.107 mas, bpa=-19.8 degrees
! Estimated noise=1261.1 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.638886 Jy
! Component: 100  -  total flux cleaned = 0.780402 Jy
! Component: 150  -  total flux cleaned = 0.83249 Jy
! Component: 200  -  total flux cleaned = 0.863558 Jy
! Total flux subtracted in 200 components = 0.863558 Jy
! Clean residual min=-0.008791 max=0.016373 Jy/beam
! Clean residual mean=0.000112 rms=0.002403 Jy/beam
! Combined flux in latest and established models = 0.863558 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 19 model components to the UV plane model.
! The established model now contains 19 components and 0.863558 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.048 mas, bmaj=3.608 mas, bpa=-17.18 degrees
! Estimated noise=520.292 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.0287574 Jy
! Component: 100  -  total flux cleaned = 0.0452218 Jy
! Component: 150  -  total flux cleaned = 0.0560576 Jy
! Component: 200  -  total flux cleaned = 0.0638217 Jy
! Total flux subtracted in 200 components = 0.0638217 Jy
! Clean residual min=-0.003122 max=0.005412 Jy/beam
! Clean residual mean=0.000393 rms=0.000936 Jy/beam
! Combined flux in latest and established models = 0.92738 Jy
! Adding 32 model components to the UV plane model.
! The established model now contains 43 components and 0.92738 Jy
! Inverting map 
! Added new window around map position (0, -4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00592135 Jy
! Component: 100  -  total flux cleaned = 0.0103172 Jy
! Component: 150  -  total flux cleaned = 0.0135179 Jy
! Component: 200  -  total flux cleaned = 0.0161379 Jy
! Total flux subtracted in 200 components = 0.0161379 Jy
! Clean residual min=-0.002874 max=0.003320 Jy/beam
! Clean residual mean=0.000267 rms=0.000761 Jy/beam
! Combined flux in latest and established models = 0.943518 Jy
! Adding 34 model components to the UV plane model.
! The established model now contains 64 components and 0.943518 Jy
! Inverting map 
! Added new window around map position (-26.5, -43.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00286541 Jy
! Component: 100  -  total flux cleaned = 0.00480632 Jy
! Component: 150  -  total flux cleaned = 0.0062088 Jy
! Component: 200  -  total flux cleaned = 0.00734892 Jy
! Total flux subtracted in 200 components = 0.00734892 Jy
! Clean residual min=-0.002814 max=0.003015 Jy/beam
! Clean residual mean=0.000217 rms=0.000719 Jy/beam
! Combined flux in latest and established models = 0.950867 Jy
! Adding 50 model components to the UV plane model.
! The established model now contains 90 components and 0.950867 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.095 mas, bmaj=8.84 mas, bpa=14.99 degrees
! Estimated noise=814.216 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00334598 Jy
! Component: 100  -  total flux cleaned = 0.00561295 Jy
! Component: 150  -  total flux cleaned = 0.00701556 Jy
! Component: 200  -  total flux cleaned = 0.00800943 Jy
! Total flux subtracted in 200 components = 0.00800943 Jy
! Clean residual min=-0.002435 max=0.003405 Jy/beam
! Clean residual mean=0.000670 rms=0.000944 Jy/beam
! Combined flux in latest and established models = 0.958877 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.000797383 Jy
! Component: 100  -  total flux cleaned = 0.00127195 Jy
! Component: 150  -  total flux cleaned = 0.00173642 Jy
! Component: 200  -  total flux cleaned = 0.002056 Jy
! Total flux subtracted in 200 components = 0.002056 Jy
! Clean residual min=-0.002461 max=0.003343 Jy/beam
! Clean residual mean=0.000615 rms=0.000932 Jy/beam
! Combined flux in latest and established models = 0.960933 Jy
! Adding 53 model components to the UV plane model.
! The established model now contains 137 components and 0.960933 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.048 mas, bmaj=3.608 mas, bpa=-17.18 degrees
! Estimated noise=520.292 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00163484 Jy
! Component: 100  -  total flux cleaned = -0.00212472 Jy
! Component: 150  -  total flux cleaned = -0.00197182 Jy
! Component: 200  -  total flux cleaned = -0.00204307 Jy
! Total flux subtracted in 200 components = -0.00204307 Jy
! Clean residual min=-0.002677 max=0.003002 Jy/beam
! Clean residual mean=0.000169 rms=0.000690 Jy/beam
! Combined flux in latest and established models = 0.95889 Jy
selfcal
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 149 components and 0.95889 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.040788Jy  sigma=0.001361
! Fit after  self-cal, rms=1.040820Jy  sigma=0.001361
wmodel J1640+3946_S_2000_05_22_pus_map.mod
! Writing 149 model components to file: J1640+3946_S_2000_05_22_pus_map.mod
wobs J1640+3946_S_2000_05_22_pus_uvs.fits
! Writing UV FITS file: J1640+3946_S_2000_05_22_pus_uvs.fits
wwins J1640+3946_S_2000_05_22_pus_map.win
! wwins: Wrote 6 windows to J1640+3946_S_2000_05_22_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.000942497 Jy
! Component: 100  -  total flux cleaned = 0.00187373 Jy
! Component: 150  -  total flux cleaned = 0.00258531 Jy
! Component: 200  -  total flux cleaned = 0.0033241 Jy
! Component: 250  -  total flux cleaned = 0.00399941 Jy
! Component: 300  -  total flux cleaned = 0.00452854 Jy
! Component: 350  -  total flux cleaned = 0.00513514 Jy
! Component: 400  -  total flux cleaned = 0.00564623 Jy
! Component: 450  -  total flux cleaned = 0.00619082 Jy
! Component: 500  -  total flux cleaned = 0.00660383 Jy
! Component: 550  -  total flux cleaned = 0.00709239 Jy
! Component: 600  -  total flux cleaned = 0.00749416 Jy
! Component: 650  -  total flux cleaned = 0.00785166 Jy
! Component: 700  -  total flux cleaned = 0.00820515 Jy
! Component: 750  -  total flux cleaned = 0.00859273 Jy
! Component: 800  -  total flux cleaned = 0.00886094 Jy
! Component: 850  -  total flux cleaned = 0.00916412 Jy
! Component: 900  -  total flux cleaned = 0.00946415 Jy
! Component: 950  -  total flux cleaned = 0.00976105 Jy
! Component: 1000  -  total flux cleaned = 0.00998155 Jy
! Component: 1050  -  total flux cleaned = 0.0102364 Jy
! Component: 1100  -  total flux cleaned = 0.0104887 Jy
! Component: 1150  -  total flux cleaned = 0.0107385 Jy
! Component: 1200  -  total flux cleaned = 0.0108447 Jy
! Component: 1250  -  total flux cleaned = 0.0111259 Jy
! Component: 1300  -  total flux cleaned = 0.0113349 Jy
! Component: 1350  -  total flux cleaned = 0.011577 Jy
! Component: 1400  -  total flux cleaned = 0.0117827 Jy
! Component: 1450  -  total flux cleaned = 0.0120211 Jy
! Component: 1500  -  total flux cleaned = 0.012291 Jy
! Component: 1550  -  total flux cleaned = 0.012425 Jy
! Component: 1600  -  total flux cleaned = 0.0126249 Jy
! Component: 1650  -  total flux cleaned = 0.0127241 Jy
! Component: 1700  -  total flux cleaned = 0.012954 Jy
! Component: 1750  -  total flux cleaned = 0.013117 Jy
! Component: 1800  -  total flux cleaned = 0.0132789 Jy
! Component: 1850  -  total flux cleaned = 0.013472 Jy
! Component: 1900  -  total flux cleaned = 0.0135998 Jy
! Component: 1950  -  total flux cleaned = 0.0137585 Jy
! Component: 2000  -  total flux cleaned = 0.0139163 Jy
! Total flux subtracted in 2048 components = 0.0140416 Jy
! Clean residual min=-0.001820 max=0.001639 Jy/beam
! Clean residual mean=0.000070 rms=0.000559 Jy/beam
! Combined flux in latest and established models = 0.972931 Jy
keep
! Adding 148 model components to the UV plane model.
! The established model now contains 297 components and 0.972932 Jy
![Exited script file: muppet]
wmap "J1640+3946_S_2000_05_22_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.048 x 3.608 at -17.18 degrees (North through East)
! Clean map  min=-0.002684  max=0.83498 Jy/beam
! Writing clean map to FITS file: J1640+3946_S_2000_05_22_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.834976 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000559627 
device "J1640+3946_S_2000_05_22_pus\_map.eps/VPS"
! Attempting to open device: 'J1640+3946_S_2000_05_22_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.20107 0.20107 0.402139 0.804278 1.60856 3.21711 6.43423 12.8685 25.7369 51.4738
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0016 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.834 
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.048 x 3.608 at -17.18 degrees (North through East)
! Clean map  min=-0.002684  max=0.83498 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1640+3946_S_2000_05_22_pus\_map.gif/vgif"
! Attempting to open device: 'J1640+3946_S_2000_05_22_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1640+3946_S_2000_05_22_pus_uvs.log closed on Mon Nov 19 18:53:39 2007