! Started logfile: J1640+3946_S_2001_04_09_pus_uvs.log on Fri Oct  5 16:11:10 2007
obs J1640+3946_S_2001_04_09_pus_uva.fits
! Reading UV FITS file: J1640+3946_S_2001_04_09_pus_uva.fits
! AN table 1: 11 integrations on 190 of 190 possible baselines.
! AN table 2: 172 integrations on 190 of 190 possible baselines.
! AN table 3: 34 integrations on 190 of 190 possible baselines.
! AN table 4: 32 integrations on 190 of 190 possible baselines.
! AN table 5: 38 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.309426 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.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 67492 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_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 190 telescope corrections were flagged in sub-array 1.
!  A total of 1385 telescope corrections were flagged in sub-array 2.
!  A total of 616 telescope corrections were flagged in sub-array 3.
!  A total of 273 telescope corrections were flagged in sub-array 4.
!  A total of 363 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 190 telescope corrections were flagged in sub-array 1.
!  A total of 1385 telescope corrections were flagged in sub-array 2.
!  A total of 616 telescope corrections were flagged in sub-array 3.
!  A total of 273 telescope corrections were flagged in sub-array 4.
!  A total of 363 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 190 telescope corrections were flagged in sub-array 1.
!  A total of 1385 telescope corrections were flagged in sub-array 2.
!  A total of 616 telescope corrections were flagged in sub-array 3.
!  A total of 273 telescope corrections were flagged in sub-array 4.
!  A total of 363 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 190 telescope corrections were flagged in sub-array 1.
!  A total of 1385 telescope corrections were flagged in sub-array 2.
!  A total of 616 telescope corrections were flagged in sub-array 3.
!  A total of 273 telescope corrections were flagged in sub-array 4.
!  A total of 363 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=0.716052Jy  sigma=0.006239
! Fit after  self-cal, rms=0.404396Jy  sigma=0.003248
! 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.944 mas, bpa=-5.459 degrees
! Estimated noise=641.766 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.501413 Jy
! Component: 100  -  total flux cleaned = 0.612831 Jy
! Total flux subtracted in 100 components = 0.612831 Jy
! Clean residual min=-0.008745 max=0.038761 Jy/beam
! Clean residual mean=0.000011 rms=0.002638 Jy/beam
! Combined flux in latest and established models = 0.612831 Jy
! Performing phase self-cal
! Adding 6 model components to the UV plane model.
! The established model now contains 6 components and 0.612831 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.235975Jy  sigma=0.001782
! Fit after  self-cal, rms=0.235944Jy  sigma=0.001782
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0442975 Jy
! Component: 100  -  total flux cleaned = 0.0730011 Jy
! Total flux subtracted in 100 components = 0.0730011 Jy
! Clean residual min=-0.006992 max=0.015652 Jy/beam
! Clean residual mean=0.000008 rms=0.001892 Jy/beam
! Combined flux in latest and established models = 0.685832 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 17 components and 0.685832 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.223454Jy  sigma=0.001605
! Fit after  self-cal, rms=0.223399Jy  sigma=0.001605
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.019691 Jy
! Component: 100  -  total flux cleaned = 0.0331452 Jy
! Total flux subtracted in 100 components = 0.0331452 Jy
! Clean residual min=-0.006441 max=0.008936 Jy/beam
! Clean residual mean=0.000006 rms=0.001701 Jy/beam
! Combined flux in latest and established models = 0.718977 Jy
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 19 components and 0.718977 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.220779Jy  sigma=0.001562
! Fit after  self-cal, rms=0.220755Jy  sigma=0.001562
! 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.268 mas, bmaj=3.719 mas, bpa=-6.962 degrees
! Estimated noise=316.707 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.0175059 Jy
! Component: 100  -  total flux cleaned = 0.026694 Jy
! Component: 150  -  total flux cleaned = 0.0319489 Jy
! Component: 200  -  total flux cleaned = 0.0350538 Jy
! Total flux subtracted in 200 components = 0.0350538 Jy
! Clean residual min=-0.004412 max=0.007380 Jy/beam
! Clean residual mean=-0.000010 rms=0.001337 Jy/beam
! Combined flux in latest and established models = 0.754031 Jy
! Performing phase self-cal
! Adding 29 model components to the UV plane model.
! The established model now contains 41 components and 0.754031 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.219840Jy  sigma=0.001543
! Fit after  self-cal, rms=0.219815Jy  sigma=0.001543
! Inverting map 
! Added new window around map position (-3.5, -2.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00750338 Jy
! Component: 100  -  total flux cleaned = 0.0117753 Jy
! Component: 150  -  total flux cleaned = 0.0131634 Jy
! Component: 200  -  total flux cleaned = 0.014316 Jy
! Total flux subtracted in 200 components = 0.014316 Jy
! Clean residual min=-0.004235 max=0.005524 Jy/beam
! Clean residual mean=-0.000050 rms=0.001135 Jy/beam
! Combined flux in latest and established models = 0.768347 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 61 components and 0.768347 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.219505Jy  sigma=0.001540
! Fit after  self-cal, rms=0.219479Jy  sigma=0.001540
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 30 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MA        0.00*    MC        0.00*    MK        0.00*    
!   NL        0.00*    NY        0.00*    OV        0.00*    PT        0.00*    
!   SC        0.00*    TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        0.99     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.01     KP        0.97     
!   LA        0.97     MA        1.12     MC        0.94     MK        0.99     
!   NL        1.00     NY        0.97     OV        1.01     PT        0.95     
!   SC        0.98     TS        1.01     WF        1.28     WZ        1.01     
! 
!  A total of 24 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        0.97     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        1.89     MC        0.95     MK        1.00*    
!   NL        1.00*    NY        1.00*    OV        1.00*    PT        1.00*    
!   SC        1.00*    TS        0.96     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.02     FD        1.09     GC        1.06     GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.97     KP        1.01     
!   LA        1.02     MA        1.00*    MC        1.00*    MK        0.98     
!   NL        1.04     NY        0.96     OV        1.01     PT        1.01     
!   SC        1.00*    TS        0.95     WF        1.00*    WZ        1.34     
! 
!  A total of 3 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.97     FD        1.01     GC        1.05     GG        1.00*    
!   HH        1.00*    HN        0.95     KK        1.00*    KP        0.95     
!   LA        0.92     MA        1.34     MC        1.00     MK        1.00*    
!   NL        0.94     NY        0.97     OV        1.04     PT        0.91     
!   SC        0.94     TS        1.00*    WF        0.97     WZ        1.01     
! 
! 
! Correcting IF 2.
!  A total of 30 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MA        0.00*    MC        0.00*    MK        0.00*    
!   NL        0.00*    NY        0.00*    OV        0.00*    PT        0.00*    
!   SC        0.00*    TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        0.98     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.03     KP        1.01     
!   LA        0.99     MA        1.01     MC        1.00     MK        1.01     
!   NL        1.00     NY        1.01     OV        0.99     PT        1.00     
!   SC        0.98     TS        1.05     WF        1.08     WZ        0.99     
! 
!  A total of 24 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.16     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        1.44     MC        0.89     MK        1.00*    
!   NL        1.00*    NY        1.00*    OV        1.00*    PT        1.00*    
!   SC        1.00*    TS        1.00     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.01     FD        1.06     GC        1.02     GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.95     KP        0.88     
!   LA        1.04     MA        1.00*    MC        1.00*    MK        0.99     
!   NL        1.08     NY        0.98     OV        0.98     PT        1.05     
!   SC        1.00*    TS        0.98     WF        1.00*    WZ        1.34     
! 
!  A total of 3 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.95     FD        0.99     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00*    KP        1.02     
!   LA        0.95     MA        1.38     MC        0.97     MK        1.00*    
!   NL        0.96     NY        0.97     OV        1.00     PT        0.93     
!   SC        0.96     TS        1.00*    WF        0.99     WZ        1.02     
! 
! 
! Correcting IF 3.
!  A total of 30 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MA        0.00*    MC        0.00*    MK        0.00*    
!   NL        0.00*    NY        0.00*    OV        0.00*    PT        0.00*    
!   SC        0.00*    TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.04     FD        1.00     GC        1.01     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.05     KP        1.04     
!   LA        0.96     MA        1.02     MC        1.15     MK        1.00     
!   NL        1.01     NY        0.98     OV        0.99     PT        1.00     
!   SC        0.97     TS        1.06     WF        1.25     WZ        1.02     
! 
!  A total of 24 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.13     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        1.01     MC        0.85     MK        1.00*    
!   NL        1.00*    NY        1.00*    OV        1.00*    PT        1.00*    
!   SC        1.00*    TS        1.05     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.07     FD        1.08     GC        1.05     GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        1.01     KP        1.07     
!   LA        1.00     MA        1.00*    MC        1.00*    MK        0.95     
!   NL        1.03     NY        0.98     OV        1.02     PT        1.07     
!   SC        1.00*    TS        1.00     WF        1.00*    WZ        1.31     
! 
!  A total of 3 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.03     FD        1.00     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.00*    KP        1.00     
!   LA        0.91     MA        0.92     MC        0.88     MK        1.00*    
!   NL        0.97     NY        0.97     OV        1.02     PT        0.95     
!   SC        0.95     TS        1.00*    WF        1.00     WZ        1.00     
! 
! 
! Correcting IF 4.
!  A total of 30 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MA        0.00*    MC        0.00*    MK        0.00*    
!   NL        0.00*    NY        0.00*    OV        0.00*    PT        0.00*    
!   SC        0.00*    TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        1.01     GC        1.04     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.01     KP        1.03     
!   LA        1.00     MA        0.73     MC        1.05     MK        0.97     
!   NL        1.01     NY        1.02     OV        1.00     PT        1.04     
!   SC        0.98     TS        1.03     WF        1.08     WZ        1.00     
! 
!  A total of 24 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.12     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MA        0.84     MC        0.69     MK        1.00*    
!   NL        1.00*    NY        1.00*    OV        1.00*    PT        1.00*    
!   SC        1.00*    TS        1.26     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.01     FD        1.10     GC        1.07     GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.92     KP        1.06     
!   LA        1.04     MA        1.00*    MC        1.00*    MK        0.97     
!   NL        1.06     NY        1.01     OV        1.00     PT        1.07     
!   SC        1.00*    TS        0.98     WF        1.00*    WZ        1.28     
! 
!  A total of 3 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.96     FD        1.02     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        1.00*    KP        0.99     
!   LA        0.96     MA        0.71     MC        0.85     MK        1.00*    
!   NL        0.96     NY        1.04     OV        1.03     PT        1.00     
!   SC        0.98     TS        1.00*    WF        0.97     WZ        1.02     
! 
! 
! Fit before self-cal, rms=0.219479Jy  sigma=0.001540
! Fit after  self-cal, rms=0.214707Jy  sigma=0.001490
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.284 mas, bmaj=3.731 mas, bpa=-7.193 degrees
! Estimated noise=317.938 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.000297998 Jy
! Component: 100  -  total flux cleaned = 2.04046e-05 Jy
! Component: 150  -  total flux cleaned = 0.000334303 Jy
! Component: 200  -  total flux cleaned = 0.00068561 Jy
! Total flux subtracted in 200 components = 0.00068561 Jy
! Clean residual min=-0.002374 max=0.002594 Jy/beam
! Clean residual mean=0.000093 rms=0.000624 Jy/beam
! Combined flux in latest and established models = 0.769032 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 76 components and 0.769032 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.214646Jy  sigma=0.001490
! Fit after  self-cal, rms=0.214762Jy  sigma=0.001490
! 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.214762Jy  sigma=0.001490
! Fit after  self-cal, rms=0.219660Jy  sigma=0.001476
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.283 mas, bmaj=3.736 mas, bpa=-7.266 degrees
! Estimated noise=317.833 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000743866 Jy
! Component: 100  -  total flux cleaned = 0.000985008 Jy
! Component: 150  -  total flux cleaned = 0.00102518 Jy
! Component: 200  -  total flux cleaned = 0.00106199 Jy
! Total flux subtracted in 200 components = 0.00106199 Jy
! Clean residual min=-0.002151 max=0.002040 Jy/beam
! Clean residual mean=0.000081 rms=0.000524 Jy/beam
! Combined flux in latest and established models = 0.770094 Jy
selfcal
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 90 components and 0.770094 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.219640Jy  sigma=0.001476
! Fit after  self-cal, rms=0.219684Jy  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)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000148213 Jy
! Component: 100  -  total flux cleaned = 0.000182104 Jy
! Component: 150  -  total flux cleaned = 0.000213892 Jy
! Component: 200  -  total flux cleaned = 0.000243611 Jy
! Total flux subtracted in 200 components = 0.000243611 Jy
! Clean residual min=-0.002146 max=0.002036 Jy/beam
! Clean residual mean=0.000081 rms=0.000520 Jy/beam
! Combined flux in latest and established models = 0.770338 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 97 components and 0.770338 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.219673Jy  sigma=0.001476
! Fit after  self-cal, rms=0.219672Jy  sigma=0.001476
! 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.219672Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220057Jy  sigma=0.001476
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.283 mas, bmaj=3.738 mas, bpa=-7.279 degrees
! Estimated noise=317.762 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000200267 Jy
! Component: 100  -  total flux cleaned = -0.000107575 Jy
! Component: 150  -  total flux cleaned = -7.89559e-05 Jy
! Component: 200  -  total flux cleaned = -5.18662e-05 Jy
! Total flux subtracted in 200 components = -5.18662e-05 Jy
! Clean residual min=-0.002101 max=0.002003 Jy/beam
! Clean residual mean=0.000075 rms=0.000519 Jy/beam
! Combined flux in latest and established models = 0.770286 Jy
selfcal
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 99 components and 0.770286 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.220048Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220056Jy  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)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 8.54951e-05 Jy
! Component: 100  -  total flux cleaned = 0.000136501 Jy
! Component: 150  -  total flux cleaned = 0.000136285 Jy
! Component: 200  -  total flux cleaned = 0.00013657 Jy
! Total flux subtracted in 200 components = 0.00013657 Jy
! Clean residual min=-0.002103 max=0.002010 Jy/beam
! Clean residual mean=0.000074 rms=0.000516 Jy/beam
! Combined flux in latest and established models = 0.770422 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 101 components and 0.770422 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.220051Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220050Jy  sigma=0.001476
! 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.220050Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220105Jy  sigma=0.001476
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.576 mas, bmaj=9.112 mas, bpa=30.18 degrees
! Estimated noise=464.381 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00112324 Jy
! Component: 100  -  total flux cleaned = 0.00128576 Jy
! Component: 150  -  total flux cleaned = 0.0013983 Jy
! Component: 200  -  total flux cleaned = 0.00147558 Jy
! Total flux subtracted in 200 components = 0.00147558 Jy
! Clean residual min=-0.002460 max=0.002759 Jy/beam
! Clean residual mean=0.000221 rms=0.000811 Jy/beam
! Combined flux in latest and established models = 0.771898 Jy
selfcal
! Performing phase self-cal
! Adding 7 model components to the UV plane model.
! The established model now contains 104 components and 0.771898 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.220106Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220109Jy  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)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0001111 Jy
! Component: 100  -  total flux cleaned = 0.000198852 Jy
! Component: 150  -  total flux cleaned = 0.000259087 Jy
! Component: 200  -  total flux cleaned = 0.000312732 Jy
! Total flux subtracted in 200 components = 0.000312732 Jy
! Clean residual min=-0.002489 max=0.002739 Jy/beam
! Clean residual mean=0.000218 rms=0.000805 Jy/beam
! Combined flux in latest and established models = 0.772211 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 106 components and 0.772211 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.220112Jy  sigma=0.001476
! Fit after  self-cal, rms=0.220112Jy  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.284 mas, bmaj=3.739 mas, bpa=-7.292 degrees
! Estimated noise=317.719 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.284 x 3.739 at -7.292 degrees (North through East)
! Clean map  min=-0.0018194  max=0.66766 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.220112Jy  sigma=0.001476
! Fit after  self-cal, rms=0.294369Jy  sigma=0.001399
! Inverting map and beam 
! Estimated beam: bmin=2.283 mas, bmaj=3.738 mas, bpa=-7.266 degrees
! Estimated noise=317.398 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00121768 Jy
! Component: 100  -  total flux cleaned = -0.00158066 Jy
! Component: 150  -  total flux cleaned = -0.00172079 Jy
! Component: 200  -  total flux cleaned = -0.00179649 Jy
! Total flux subtracted in 200 components = -0.00179649 Jy
! Clean residual min=-0.001960 max=0.002027 Jy/beam
! Clean residual mean=0.000081 rms=0.000493 Jy/beam
! Combined flux in latest and established models = 0.770414 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 111 components and 0.770414 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294361Jy  sigma=0.001399
! Fit after  self-cal, rms=0.294362Jy  sigma=0.001399
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -7.52997e-05 Jy
! Component: 100  -  total flux cleaned = -0.000144001 Jy
! Component: 150  -  total flux cleaned = -0.000187117 Jy
! Component: 200  -  total flux cleaned = -0.000228781 Jy
! Total flux subtracted in 200 components = -0.000228781 Jy
! Clean residual min=-0.001956 max=0.002023 Jy/beam
! Clean residual mean=0.000081 rms=0.000493 Jy/beam
! Combined flux in latest and established models = 0.770186 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 112 components and 0.770185 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294359Jy  sigma=0.001399
! Fit after  self-cal, rms=0.294359Jy  sigma=0.001399
! Inverting map 
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294359Jy  sigma=0.001399
! Fit after  self-cal, rms=0.434411Jy  sigma=0.001399
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.91 mas, bmaj=2.977 mas, bpa=-6.823 degrees
! Estimated noise=649.128 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.505565 Jy
! Component: 100  -  total flux cleaned = 0.617383 Jy
! Component: 150  -  total flux cleaned = 0.659649 Jy
! Component: 200  -  total flux cleaned = 0.686136 Jy
! Total flux subtracted in 200 components = 0.686136 Jy
! Clean residual min=-0.004590 max=0.014410 Jy/beam
! Clean residual mean=0.000016 rms=0.001391 Jy/beam
! Combined flux in latest and established models = 0.686136 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 18 model components to the UV plane model.
! The established model now contains 18 components and 0.686136 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.283 mas, bmaj=3.74 mas, bpa=-7.279 degrees
! Estimated noise=317.316 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.0296214 Jy
! Component: 100  -  total flux cleaned = 0.0461165 Jy
! Component: 150  -  total flux cleaned = 0.0565231 Jy
! Component: 200  -  total flux cleaned = 0.0634754 Jy
! Total flux subtracted in 200 components = 0.0634754 Jy
! Clean residual min=-0.002159 max=0.003865 Jy/beam
! Clean residual mean=0.000133 rms=0.000761 Jy/beam
! Combined flux in latest and established models = 0.749611 Jy
! Adding 51 model components to the UV plane model.
! The established model now contains 63 components and 0.749611 Jy
! Inverting map 
! Added new window around map position (-5, -8.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00488542 Jy
! Component: 100  -  total flux cleaned = 0.00849867 Jy
! Component: 150  -  total flux cleaned = 0.0113042 Jy
! Component: 200  -  total flux cleaned = 0.0134951 Jy
! Total flux subtracted in 200 components = 0.0134951 Jy
! Clean residual min=-0.002029 max=0.002383 Jy/beam
! Clean residual mean=0.000098 rms=0.000535 Jy/beam
! Combined flux in latest and established models = 0.763106 Jy
! Adding 38 model components to the UV plane model.
! The established model now contains 86 components and 0.763106 Jy
! Inverting map 
! Added new window around map position (-4.5, 5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00230816 Jy
! Component: 100  -  total flux cleaned = 0.00388816 Jy
! Component: 150  -  total flux cleaned = 0.00479755 Jy
! Component: 200  -  total flux cleaned = 0.00545849 Jy
! Total flux subtracted in 200 components = 0.00545849 Jy
! Clean residual min=-0.002001 max=0.001831 Jy/beam
! Clean residual mean=0.000085 rms=0.000490 Jy/beam
! Combined flux in latest and established models = 0.768565 Jy
! Adding 37 model components to the UV plane model.
! The established model now contains 104 components and 0.768565 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.579 mas, bmaj=9.116 mas, bpa=30.21 degrees
! Estimated noise=463.686 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00212151 Jy
! Component: 100  -  total flux cleaned = 0.0031336 Jy
! Component: 150  -  total flux cleaned = 0.00372861 Jy
! Component: 200  -  total flux cleaned = 0.00407711 Jy
! Total flux subtracted in 200 components = 0.00407711 Jy
! Clean residual min=-0.001911 max=0.002497 Jy/beam
! Clean residual mean=0.000239 rms=0.000716 Jy/beam
! Combined flux in latest and established models = 0.772642 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 = 7.5984e-05 Jy
! Component: 100  -  total flux cleaned = 0.000122803 Jy
! Component: 150  -  total flux cleaned = 0.000167208 Jy
! Component: 200  -  total flux cleaned = 0.000188855 Jy
! Total flux subtracted in 200 components = 0.000188855 Jy
! Clean residual min=-0.001918 max=0.002503 Jy/beam
! Clean residual mean=0.000237 rms=0.000713 Jy/beam
! Combined flux in latest and established models = 0.772831 Jy
! Adding 26 model components to the UV plane model.
! The established model now contains 126 components and 0.772831 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.283 mas, bmaj=3.74 mas, bpa=-7.279 degrees
! Estimated noise=317.316 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000960676 Jy
! Component: 100  -  total flux cleaned = -0.0010976 Jy
! Component: 150  -  total flux cleaned = -0.00109852 Jy
! Component: 200  -  total flux cleaned = -0.00109916 Jy
! Total flux subtracted in 200 components = -0.00109916 Jy
! Clean residual min=-0.001961 max=0.001883 Jy/beam
! Clean residual mean=0.000077 rms=0.000473 Jy/beam
! Combined flux in latest and established models = 0.771732 Jy
selfcal
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 133 components and 0.771732 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.434413Jy  sigma=0.001398
! Fit after  self-cal, rms=0.434419Jy  sigma=0.001398
wmodel J1640+3946_S_2001_04_09_pus_map.mod
! Writing 133 model components to file: J1640+3946_S_2001_04_09_pus_map.mod
wobs J1640+3946_S_2001_04_09_pus_uvs.fits
! Writing UV FITS file: J1640+3946_S_2001_04_09_pus_uvs.fits
wwins J1640+3946_S_2001_04_09_pus_map.win
! wwins: Wrote 4 windows to J1640+3946_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 = 5.80534e-05 Jy
! Component: 100  -  total flux cleaned = 0.000380271 Jy
! Component: 150  -  total flux cleaned = 0.000809253 Jy
! Component: 200  -  total flux cleaned = 0.00122529 Jy
! Component: 250  -  total flux cleaned = 0.00160254 Jy
! Component: 300  -  total flux cleaned = 0.00202824 Jy
! Component: 350  -  total flux cleaned = 0.00236257 Jy
! Component: 400  -  total flux cleaned = 0.0027182 Jy
! Component: 450  -  total flux cleaned = 0.00306748 Jy
! Component: 500  -  total flux cleaned = 0.0033852 Jy
! Component: 550  -  total flux cleaned = 0.00372439 Jy
! Component: 600  -  total flux cleaned = 0.00398159 Jy
! Component: 650  -  total flux cleaned = 0.0042357 Jy
! Component: 700  -  total flux cleaned = 0.00453677 Jy
! Component: 750  -  total flux cleaned = 0.00471029 Jy
! Component: 800  -  total flux cleaned = 0.00490635 Jy
! Component: 850  -  total flux cleaned = 0.00507635 Jy
! Component: 900  -  total flux cleaned = 0.00529273 Jy
! Component: 950  -  total flux cleaned = 0.00550678 Jy
! Component: 1000  -  total flux cleaned = 0.00571878 Jy
! Component: 1050  -  total flux cleaned = 0.00592853 Jy
! Component: 1100  -  total flux cleaned = 0.0060904 Jy
! Component: 1150  -  total flux cleaned = 0.00625089 Jy
! Component: 1200  -  total flux cleaned = 0.00645548 Jy
! Component: 1250  -  total flux cleaned = 0.00656864 Jy
! Component: 1300  -  total flux cleaned = 0.00672552 Jy
! Component: 1350  -  total flux cleaned = 0.00694809 Jy
! Component: 1400  -  total flux cleaned = 0.0071686 Jy
! Component: 1450  -  total flux cleaned = 0.00727811 Jy
! Component: 1500  -  total flux cleaned = 0.00749559 Jy
! Component: 1550  -  total flux cleaned = 0.00762524 Jy
! Component: 1600  -  total flux cleaned = 0.00777543 Jy
! Component: 1650  -  total flux cleaned = 0.00794608 Jy
! Component: 1700  -  total flux cleaned = 0.00809431 Jy
! Component: 1750  -  total flux cleaned = 0.00826274 Jy
! Component: 1800  -  total flux cleaned = 0.00843017 Jy
! Component: 1850  -  total flux cleaned = 0.00851335 Jy
! Component: 1900  -  total flux cleaned = 0.00872006 Jy
! Component: 1950  -  total flux cleaned = 0.00886408 Jy
! Component: 2000  -  total flux cleaned = 0.00898681 Jy
! Total flux subtracted in 2048 components = 0.00919029 Jy
! Clean residual min=-0.001255 max=0.001295 Jy/beam
! Clean residual mean=0.000039 rms=0.000387 Jy/beam
! Combined flux in latest and established models = 0.780922 Jy
keep
! Adding 180 model components to the UV plane model.
! The established model now contains 313 components and 0.780922 Jy
![Exited script file: muppet]
wmap "J1640+3946_S_2001_04_09_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.283 x 3.74 at -7.279 degrees (North through East)
! Clean map  min=-0.0015293  max=0.66746 Jy/beam
! Writing clean map to FITS file: J1640+3946_S_2001_04_09_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.667463 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000387154 
device "J1640+3946_S_2001_04_09_pus\_map.eps/VPS"
! Attempting to open device: 'J1640+3946_S_2001_04_09_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.174011 0.174011 0.348022 0.696045 1.39209 2.78418 5.56836 11.1367 22.2734 44.5469 89.0938
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0011 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.667 
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.283 x 3.74 at -7.279 degrees (North through East)
! Clean map  min=-0.0015293  max=0.66746 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1640+3946_S_2001_04_09_pus\_map.gif/vgif"
! Attempting to open device: 'J1640+3946_S_2001_04_09_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1640+3946_S_2001_04_09_pus_uvs.log closed on Fri Oct  5 16:11:33 2007