! Started logfile: J2202+4216_S_2003_06_18_pus_uvs.log on Wed Jan 24 19:09:53 2007
obs J2202+4216_S_2003_06_18_pus_uva.fits
! Reading UV FITS file: J2202+4216_S_2003_06_18_pus_uva.fits
! AN table 1: 10 integrations on 153 of 153 possible baselines.
! AN table 2: 123 integrations on 153 of 153 possible baselines.
! AN table 3: 105 integrations on 153 of 153 possible baselines.
! AN table 4: 133 integrations on 153 of 153 possible baselines.
! AN table 5: 167 integrations on 153 of 153 possible baselines.
! Apparent sampling: 0.0952329 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J2202+4216
! 
! 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.23697e+09        8e+06          1        8e+06
!  02        2  2.26697e+09        8e+06          1        8e+06
!  03        3  2.35697e+09        8e+06          1        8e+06
!  04        4  2.37697e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 2429 lines of history.
! 
! Reading 31356 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
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 180 telescope corrections were flagged in sub-array 1.
!  A total of 1707 telescope corrections were flagged in sub-array 2.
!  A total of 1656 telescope corrections were flagged in sub-array 3.
!  A total of 1673 telescope corrections were flagged in sub-array 4.
!  A total of 1982 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 180 telescope corrections were flagged in sub-array 1.
!  A total of 1724 telescope corrections were flagged in sub-array 2.
!  A total of 1655 telescope corrections were flagged in sub-array 3.
!  A total of 1636 telescope corrections were flagged in sub-array 4.
!  A total of 1982 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 180 telescope corrections were flagged in sub-array 1.
!  A total of 1755 telescope corrections were flagged in sub-array 2.
!  A total of 1653 telescope corrections were flagged in sub-array 3.
!  A total of 1673 telescope corrections were flagged in sub-array 4.
!  A total of 1982 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 180 telescope corrections were flagged in sub-array 1.
!  A total of 1755 telescope corrections were flagged in sub-array 2.
!  A total of 1665 telescope corrections were flagged in sub-array 3.
!  A total of 1673 telescope corrections were flagged in sub-array 4.
!  A total of 1982 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=0.972015Jy  sigma=0.009861
! Fit after  self-cal, rms=0.571153Jy  sigma=0.005809
! 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.054 mas, bmaj=3.686 mas, bpa=-7.221 degrees
! Estimated noise=959.044 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.726262 Jy
! Component: 100  -  total flux cleaned = 1.01734 Jy
! Total flux subtracted in 100 components = 1.01734 Jy
! Clean residual min=-0.040210 max=0.141620 Jy/beam
! Clean residual mean=0.000525 rms=0.014433 Jy/beam
! Combined flux in latest and established models = 1.01734 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 26 components and 1.01734 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.483005Jy  sigma=0.005046
! Fit after  self-cal, rms=0.477948Jy  sigma=0.005029
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.172999 Jy
! Component: 100  -  total flux cleaned = 0.283315 Jy
! Total flux subtracted in 100 components = 0.283315 Jy
! Clean residual min=-0.028368 max=0.075136 Jy/beam
! Clean residual mean=0.000297 rms=0.009326 Jy/beam
! Combined flux in latest and established models = 1.30066 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 43 components and 1.30066 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.367396Jy  sigma=0.003461
! Fit after  self-cal, rms=0.366230Jy  sigma=0.003456
! Inverting map 
! Added new window around map position (1.5, -7).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0868797 Jy
! Component: 100  -  total flux cleaned = 0.148441 Jy
! Total flux subtracted in 100 components = 0.148441 Jy
! Clean residual min=-0.023126 max=0.050160 Jy/beam
! Clean residual mean=0.000188 rms=0.007357 Jy/beam
! Combined flux in latest and established models = 1.4491 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 58 components and 1.4491 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.329818Jy  sigma=0.002891
! Fit after  self-cal, rms=0.328498Jy  sigma=0.002880
! Inverting map 
! Added new window around map position (4.5, -6.5).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.054379 Jy
! Component: 100  -  total flux cleaned = 0.0944384 Jy
! Total flux subtracted in 100 components = 0.0944384 Jy
! Clean residual min=-0.019750 max=0.030023 Jy/beam
! Clean residual mean=0.000114 rms=0.006224 Jy/beam
! Combined flux in latest and established models = 1.54354 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 71 components and 1.54354 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.312796Jy  sigma=0.002625
! Fit after  self-cal, rms=0.311748Jy  sigma=0.002615
! 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.995 mas, bmaj=5.441 mas, bpa=-5.606 degrees
! Estimated noise=404.809 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.060019 Jy
! Component: 100  -  total flux cleaned = 0.0951437 Jy
! Component: 150  -  total flux cleaned = 0.117916 Jy
! Component: 200  -  total flux cleaned = 0.13301 Jy
! Total flux subtracted in 200 components = 0.13301 Jy
! Clean residual min=-0.013963 max=0.033676 Jy/beam
! Clean residual mean=0.001872 rms=0.006617 Jy/beam
! Combined flux in latest and established models = 1.67655 Jy
! Performing phase self-cal
! Adding 37 model components to the UV plane model.
! The established model now contains 96 components and 1.67655 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300369Jy  sigma=0.002434
! Fit after  self-cal, rms=0.298922Jy  sigma=0.002416
! Inverting map 
! Added new window around map position (3.5, -15).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0368494 Jy
! Component: 100  -  total flux cleaned = 0.0556618 Jy
! Component: 150  -  total flux cleaned = 0.0683291 Jy
! Component: 200  -  total flux cleaned = 0.0759581 Jy
! Total flux subtracted in 200 components = 0.0759581 Jy
! Clean residual min=-0.013495 max=0.020570 Jy/beam
! Clean residual mean=0.000934 rms=0.004730 Jy/beam
! Combined flux in latest and established models = 1.75251 Jy
! Performing phase self-cal
! Adding 30 model components to the UV plane model.
! The established model now contains 121 components and 1.75251 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294148Jy  sigma=0.002354
! Fit after  self-cal, rms=0.293434Jy  sigma=0.002341
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GG        0.00*    HN        0.00*    
!   KK        0.00*    KP        0.00*    LA        0.00*    MA        0.00*    
!   MK        0.00*    NL        0.00*    ON        0.00*    OV        0.00*    
!   PT        0.00*    SC        0.00*    TC        0.00*    TS        0.00*    
!   WF        0.00*    WZ        0.00*    
! 
!  A total of 63 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.03     FD        0.95     GG        1.00*    HN        0.96     
!   KK        1.00*    KP        0.95     LA        0.94     MA        1.00*    
!   MK        0.99     NL        1.01     ON        0.85     OV        1.13     
!   PT        0.93     SC        0.90     TC        0.93     TS        1.00*    
!   WF        1.07     WZ        1.00*    
! 
!  A total of 90 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        1.00*    GG        1.00*    HN        0.94     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.06     NL        0.97     ON        1.22     OV        1.00*    
!   PT        1.00*    SC        0.93     TC        0.53     TS        1.14     
!   WF        1.02     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.10     FD        1.02     GG        1.00*    HN        1.02     
!   KK        1.00*    KP        0.83     LA        1.02     MA        1.00*    
!   MK        1.00*    NL        1.06     ON        1.21     OV        1.00*    
!   PT        1.01     SC        0.91     TC        1.00*    TS        1.10     
!   WF        0.88     WZ        1.00*    
! 
!  A total of 69 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.03     FD        1.01     GG        1.00*    HN        0.98     
!   KK        1.00*    KP        0.96     LA        0.98     MA        1.00*    
!   MK        1.00*    NL        1.05     ON        1.00*    OV        0.99     
!   PT        0.99     SC        0.96     TC        0.40     TS        1.00*    
!   WF        1.02     WZ        1.00*    
! 
! 
! Correcting IF 2.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GG        0.00*    HN        0.00*    
!   KK        0.00*    KP        0.00*    LA        0.00*    MA        0.00*    
!   MK        0.00*    NL        0.00*    ON        0.00*    OV        0.00*    
!   PT        0.00*    SC        0.00*    TC        0.00*    TS        0.00*    
!   WF        0.00*    WZ        0.00*    
! 
!  A total of 69 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.97     FD        0.93     GG        1.00*    HN        1.00     
!   KK        1.00*    KP        0.99     LA        0.94     MA        1.00*    
!   MK        0.98     NL        0.97     ON        0.83     OV        0.91     
!   PT        0.92     SC        0.92     TC        0.84     TS        1.00*    
!   WF        1.08     WZ        1.00*    
! 
!  A total of 87 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.05     FD        1.00*    GG        1.00*    HN        0.97     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.09     NL        0.97     ON        1.14     OV        1.00*    
!   PT        1.00*    SC        1.01     TC        0.63     TS        1.09     
!   WF        0.99     WZ        1.00*    
! 
!  A total of 39 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.03     FD        1.02     GG        1.00*    HN        1.08     
!   KK        1.00*    KP        0.98     LA        1.03     MA        1.00*    
!   MK        1.00*    NL        1.02     ON        1.11     OV        1.16     
!   PT        1.04     SC        0.94     TC        1.00*    TS        1.12     
!   WF        0.90     WZ        1.00*    
! 
!  A total of 69 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.97     FD        1.01     GG        1.00*    HN        0.99     
!   KK        1.00*    KP        1.06     LA        0.99     MA        1.00*    
!   MK        1.00*    NL        1.00     ON        1.00*    OV        0.99     
!   PT        0.99     SC        0.97     TC        0.71     TS        1.00*    
!   WF        1.08     WZ        1.00*    
! 
! 
! Correcting IF 3.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GG        0.00*    HN        0.00*    
!   KK        0.00*    KP        0.00*    LA        0.00*    MA        0.00*    
!   MK        0.00*    NL        0.00*    ON        0.00*    OV        0.00*    
!   PT        0.00*    SC        0.00*    TC        0.00*    TS        0.00*    
!   WF        0.00*    WZ        0.00*    
! 
!  A total of 15 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        0.95     GG        1.00*    HN        1.03     
!   KK        1.00*    KP        0.95     LA        0.90     MA        1.00*    
!   MK        0.99     NL        0.96     ON        0.77     OV        1.05     
!   PT        0.93     SC        1.07     TC        0.84     TS        1.00*    
!   WF        1.11     WZ        1.00*    
! 
!  A total of 93 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.96     FD        1.00*    GG        1.00*    HN        0.92     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.12     NL        0.97     ON        1.24     OV        1.00*    
!   PT        1.00*    SC        1.24     TC        0.47     TS        1.02     
!   WF        1.04     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.05     FD        1.00     GG        1.00*    HN        1.10     
!   KK        1.00*    KP        1.01     LA        0.99     MA        1.00*    
!   MK        1.00*    NL        1.02     ON        1.08     OV        1.00*    
!   PT        1.07     SC        1.14     TC        1.00*    TS        1.08     
!   WF        0.90     WZ        1.00*    
! 
!  A total of 69 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.99     FD        1.03     GG        1.00*    HN        1.02     
!   KK        1.00*    KP        1.03     LA        0.95     MA        1.00*    
!   MK        1.00*    NL        1.00     ON        1.00*    OV        1.03     
!   PT        1.00     SC        1.06     TC        0.50     TS        1.00*    
!   WF        1.08     WZ        1.00*    
! 
! 
! Correcting IF 4.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.00*    FD        0.00*    GG        0.00*    HN        0.00*    
!   KK        0.00*    KP        0.00*    LA        0.00*    MA        0.00*    
!   MK        0.00*    NL        0.00*    ON        0.00*    OV        0.00*    
!   PT        0.00*    SC        0.00*    TC        0.00*    TS        0.00*    
!   WF        0.00*    WZ        0.00*    
! 
!  A total of 15 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.93     GG        1.00*    HN        0.95     
!   KK        1.00*    KP        0.97     LA        0.94     MA        1.00*    
!   MK        0.95     NL        1.01     ON        0.84     OV        0.97     
!   PT        0.96     SC        1.05     TC        0.70     TS        1.00*    
!   WF        1.11     WZ        1.00*    
! 
!  A total of 81 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.99     FD        1.00*    GG        1.00*    HN        0.96     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.01     NL        0.99     ON        1.15     OV        1.00*    
!   PT        1.00*    SC        1.20     TC        0.61     TS        1.00     
!   WF        0.99     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.03     FD        1.02     GG        1.00*    HN        1.00     
!   KK        1.00*    KP        0.97     LA        1.03     MA        1.00*    
!   MK        1.00*    NL        1.07     ON        1.21     OV        1.00*    
!   PT        1.07     SC        1.17     TC        1.00*    TS        1.06     
!   WF        0.95     WZ        1.00*    
! 
!  A total of 69 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.97     FD        1.02     GG        1.00*    HN        1.03     
!   KK        1.00*    KP        1.05     LA        0.99     MA        1.00*    
!   MK        1.00*    NL        1.05     ON        1.00*    OV        0.93     
!   PT        1.05     SC        1.04     TC        0.43     TS        1.00*    
!   WF        1.07     WZ        1.00*    
! 
! 
! Fit before self-cal, rms=0.293434Jy  sigma=0.002341
! Fit after  self-cal, rms=0.278871Jy  sigma=0.002156
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=3.177 mas, bmaj=5.411 mas, bpa=-5.273 degrees
! Estimated noise=413.823 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 (11.5, -14.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0190707 Jy
! Component: 100  -  total flux cleaned = 0.0286258 Jy
! Component: 150  -  total flux cleaned = 0.0334071 Jy
! Component: 200  -  total flux cleaned = 0.037384 Jy
! Total flux subtracted in 200 components = 0.037384 Jy
! Clean residual min=-0.010752 max=0.010499 Jy/beam
! Clean residual mean=0.000543 rms=0.002723 Jy/beam
! Combined flux in latest and established models = 1.78989 Jy
! Performing phase self-cal
! Adding 32 model components to the UV plane model.
! The established model now contains 150 components and 1.78989 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.277193Jy  sigma=0.002135
! Fit after  self-cal, rms=0.277232Jy  sigma=0.002133
! 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.277232Jy  sigma=0.002133
! Fit after  self-cal, rms=0.268163Jy  sigma=0.001988
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.171 mas, bmaj=5.419 mas, bpa=-5.36 degrees
! Estimated noise=414.787 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00958659 Jy
! Component: 100  -  total flux cleaned = 0.016565 Jy
! Component: 150  -  total flux cleaned = 0.0197681 Jy
! Component: 200  -  total flux cleaned = 0.0215604 Jy
! Total flux subtracted in 200 components = 0.0215604 Jy
! Clean residual min=-0.005795 max=0.007987 Jy/beam
! Clean residual mean=0.000516 rms=0.001751 Jy/beam
! Combined flux in latest and established models = 1.81145 Jy
selfcal
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 168 components and 1.81145 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.267646Jy  sigma=0.001981
! Fit after  self-cal, rms=0.267734Jy  sigma=0.001980
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 (12, -40.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00587804 Jy
! Component: 100  -  total flux cleaned = 0.00949048 Jy
! Component: 150  -  total flux cleaned = 0.0125194 Jy
! Component: 200  -  total flux cleaned = 0.0141774 Jy
! Total flux subtracted in 200 components = 0.0141774 Jy
! Clean residual min=-0.005684 max=0.005923 Jy/beam
! Clean residual mean=0.000329 rms=0.001601 Jy/beam
! Combined flux in latest and established models = 1.82563 Jy
! Performing phase self-cal
! Adding 33 model components to the UV plane model.
! The established model now contains 187 components and 1.82563 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.267369Jy  sigma=0.001975
! Fit after  self-cal, rms=0.267302Jy  sigma=0.001974
! 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.267302Jy  sigma=0.001974
! Fit after  self-cal, rms=0.266447Jy  sigma=0.001945
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.184 mas, bmaj=5.406 mas, bpa=-5.296 degrees
! Estimated noise=414.598 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00399467 Jy
! Component: 100  -  total flux cleaned = 0.00582626 Jy
! Component: 150  -  total flux cleaned = 0.00745641 Jy
! Component: 200  -  total flux cleaned = 0.00844805 Jy
! Total flux subtracted in 200 components = 0.00844805 Jy
! Clean residual min=-0.004307 max=0.004882 Jy/beam
! Clean residual mean=0.000448 rms=0.001308 Jy/beam
! Combined flux in latest and established models = 1.83407 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 195 components and 1.83407 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.266148Jy  sigma=0.001941
! Fit after  self-cal, rms=0.266153Jy  sigma=0.001941
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.00082536 Jy
! Component: 100  -  total flux cleaned = 0.00192401 Jy
! Component: 150  -  total flux cleaned = 0.00278659 Jy
! Component: 200  -  total flux cleaned = 0.00373345 Jy
! Total flux subtracted in 200 components = 0.00373345 Jy
! Clean residual min=-0.004318 max=0.004562 Jy/beam
! Clean residual mean=0.000399 rms=0.001250 Jy/beam
! Combined flux in latest and established models = 1.83781 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 200 components and 1.83781 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.265968Jy  sigma=0.001938
! Fit after  self-cal, rms=0.265930Jy  sigma=0.001938
! 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.265930Jy  sigma=0.001938
! Fit after  self-cal, rms=0.265945Jy  sigma=0.001938
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=9.327 mas, bmaj=9.836 mas, bpa=38.3 degrees
! Estimated noise=469.012 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00497578 Jy
! Component: 100  -  total flux cleaned = 0.0083571 Jy
! Component: 150  -  total flux cleaned = 0.00991832 Jy
! Component: 200  -  total flux cleaned = 0.0104493 Jy
! Total flux subtracted in 200 components = 0.0104493 Jy
! Clean residual min=-0.003543 max=0.004758 Jy/beam
! Clean residual mean=0.000642 rms=0.001380 Jy/beam
! Combined flux in latest and established models = 1.84826 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 221 components and 1.84826 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.265865Jy  sigma=0.001936
! Fit after  self-cal, rms=0.265838Jy  sigma=0.001936
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.00074099 Jy
! Component: 100  -  total flux cleaned = 0.00143492 Jy
! Component: 150  -  total flux cleaned = 0.00190069 Jy
! Component: 200  -  total flux cleaned = 0.00239645 Jy
! Total flux subtracted in 200 components = 0.00239646 Jy
! Clean residual min=-0.003619 max=0.004793 Jy/beam
! Clean residual mean=0.000585 rms=0.001357 Jy/beam
! Combined flux in latest and established models = 1.85065 Jy
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 229 components and 1.85065 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.265779Jy  sigma=0.001936
! Fit after  self-cal, rms=0.265759Jy  sigma=0.001935
! 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=3.19 mas, bmaj=5.402 mas, bpa=-5.328 degrees
! Estimated noise=414.719 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.19 x 5.402 at -5.328 degrees (North through East)
! Clean map  min=-0.0041758  max=1.0205 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.265759Jy  sigma=0.001935
! Fit after  self-cal, rms=0.308355Jy  sigma=0.001684
! Inverting map and beam 
! Estimated beam: bmin=3.19 mas, bmaj=5.328 mas, bpa=-5.28 degrees
! Estimated noise=414.158 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00100021 Jy
! Component: 100  -  total flux cleaned = -0.000361386 Jy
! Component: 150  -  total flux cleaned = 9.87766e-05 Jy
! Component: 200  -  total flux cleaned = 0.000632404 Jy
! Total flux subtracted in 200 components = 0.000632404 Jy
! Clean residual min=-0.003501 max=0.004022 Jy/beam
! Clean residual mean=0.000189 rms=0.000978 Jy/beam
! Combined flux in latest and established models = 1.85129 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 235 components and 1.85129 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308223Jy  sigma=0.001683
! Fit after  self-cal, rms=0.308173Jy  sigma=0.001682
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000153912 Jy
! Component: 100  -  total flux cleaned = 0.000556777 Jy
! Component: 150  -  total flux cleaned = 0.00103304 Jy
! Component: 200  -  total flux cleaned = 0.00139246 Jy
! Total flux subtracted in 200 components = 0.00139246 Jy
! Clean residual min=-0.003378 max=0.003662 Jy/beam
! Clean residual mean=0.000171 rms=0.000954 Jy/beam
! Combined flux in latest and established models = 1.85268 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 239 components and 1.85268 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308090Jy  sigma=0.001681
! Fit after  self-cal, rms=0.308066Jy  sigma=0.001681
! 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.308066Jy  sigma=0.001681
! Fit after  self-cal, rms=0.295315Jy  sigma=0.001681
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.212 mas, bmaj=3.527 mas, bpa=-9.315 degrees
! Estimated noise=975.366 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.741634 Jy
! Component: 100  -  total flux cleaned = 1.03727 Jy
! Component: 150  -  total flux cleaned = 1.20086 Jy
! Component: 200  -  total flux cleaned = 1.31155 Jy
! Total flux subtracted in 200 components = 1.31155 Jy
! Clean residual min=-0.019430 max=0.062652 Jy/beam
! Clean residual mean=0.000434 rms=0.007577 Jy/beam
! Combined flux in latest and established models = 1.31155 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 48 model components to the UV plane model.
! The established model now contains 48 components and 1.31155 Jy
! Inverting map and beam 
! Estimated beam: bmin=3.197 mas, bmaj=5.317 mas, bpa=-5.321 degrees
! Estimated noise=414.086 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.155188 Jy
! Component: 100  -  total flux cleaned = 0.246209 Jy
! Component: 150  -  total flux cleaned = 0.308065 Jy
! Component: 200  -  total flux cleaned = 0.352676 Jy
! Total flux subtracted in 200 components = 0.352676 Jy
! Clean residual min=-0.010148 max=0.026457 Jy/beam
! Clean residual mean=0.002679 rms=0.006866 Jy/beam
! Combined flux in latest and established models = 1.66422 Jy
! Adding 86 model components to the UV plane model.
! The established model now contains 121 components and 1.66422 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=9.331 mas, bmaj=9.832 mas, bpa=38.2 degrees
! Estimated noise=469 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0522136 Jy
! Component: 100  -  total flux cleaned = 0.08672 Jy
! Component: 150  -  total flux cleaned = 0.111459 Jy
! Component: 200  -  total flux cleaned = 0.129808 Jy
! Total flux subtracted in 200 components = 0.129808 Jy
! Clean residual min=-0.005298 max=0.011254 Jy/beam
! Clean residual mean=0.001813 rms=0.003829 Jy/beam
! Combined flux in latest and established models = 1.79403 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.0139484 Jy
! Component: 100  -  total flux cleaned = 0.0246863 Jy
! Component: 150  -  total flux cleaned = 0.0330331 Jy
! Component: 200  -  total flux cleaned = 0.0395609 Jy
! Total flux subtracted in 200 components = 0.0395609 Jy
! Clean residual min=-0.003812 max=0.005812 Jy/beam
! Clean residual mean=0.000844 rms=0.001698 Jy/beam
! Combined flux in latest and established models = 1.83359 Jy
! Adding 152 model components to the UV plane model.
! The established model now contains 255 components and 1.83359 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=3.197 mas, bmaj=5.317 mas, bpa=-5.321 degrees
! Estimated noise=414.086 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00118151 Jy
! Component: 100  -  total flux cleaned = 0.000824707 Jy
! Component: 150  -  total flux cleaned = 0.00265034 Jy
! Component: 200  -  total flux cleaned = 0.00432695 Jy
! Total flux subtracted in 200 components = 0.00432695 Jy
! Clean residual min=-0.004336 max=0.006354 Jy/beam
! Clean residual mean=0.000392 rms=0.001271 Jy/beam
! Combined flux in latest and established models = 1.83792 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 268 components and 1.83792 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.296201Jy  sigma=0.001693
! Fit after  self-cal, rms=0.295326Jy  sigma=0.001689
wmodel J2202+4216_S_2003_06_18_pus_map.mod
! Writing 268 model components to file: J2202+4216_S_2003_06_18_pus_map.mod
wobs J2202+4216_S_2003_06_18_pus_uvs.fits
! Writing UV FITS file: J2202+4216_S_2003_06_18_pus_uvs.fits
wwins J2202+4216_S_2003_06_18_pus_map.win
! wwins: Wrote 6 windows to J2202+4216_S_2003_06_18_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.00297176 Jy
! Component: 100  -  total flux cleaned = 0.00537394 Jy
! Component: 150  -  total flux cleaned = 0.00661974 Jy
! Component: 200  -  total flux cleaned = 0.00739564 Jy
! Component: 250  -  total flux cleaned = 0.00828053 Jy
! Component: 300  -  total flux cleaned = 0.00912212 Jy
! Component: 350  -  total flux cleaned = 0.00999293 Jy
! Component: 400  -  total flux cleaned = 0.0108269 Jy
! Component: 450  -  total flux cleaned = 0.011568 Jy
! Component: 500  -  total flux cleaned = 0.0121076 Jy
! Component: 550  -  total flux cleaned = 0.0125151 Jy
! Component: 600  -  total flux cleaned = 0.0127426 Jy
! Component: 650  -  total flux cleaned = 0.0129664 Jy
! Component: 700  -  total flux cleaned = 0.0131862 Jy
! Component: 750  -  total flux cleaned = 0.0133489 Jy
! Component: 800  -  total flux cleaned = 0.0135089 Jy
! Component: 850  -  total flux cleaned = 0.0136664 Jy
! Component: 900  -  total flux cleaned = 0.0139263 Jy
! Component: 950  -  total flux cleaned = 0.0142336 Jy
! Component: 1000  -  total flux cleaned = 0.0145374 Jy
! Component: 1050  -  total flux cleaned = 0.0148874 Jy
! Component: 1100  -  total flux cleaned = 0.0150844 Jy
! Component: 1150  -  total flux cleaned = 0.0153291 Jy
! Component: 1200  -  total flux cleaned = 0.015571 Jy
! Component: 1250  -  total flux cleaned = 0.0159056 Jy
! Component: 1300  -  total flux cleaned = 0.0161421 Jy
! Component: 1350  -  total flux cleaned = 0.0163752 Jy
! Component: 1400  -  total flux cleaned = 0.0166533 Jy
! Component: 1450  -  total flux cleaned = 0.0169742 Jy
! Component: 1500  -  total flux cleaned = 0.0171555 Jy
! Component: 1550  -  total flux cleaned = 0.0174701 Jy
! Component: 1600  -  total flux cleaned = 0.0176927 Jy
! Component: 1650  -  total flux cleaned = 0.0179572 Jy
! Component: 1700  -  total flux cleaned = 0.0181753 Jy
! Component: 1750  -  total flux cleaned = 0.0183487 Jy
! Component: 1800  -  total flux cleaned = 0.0185629 Jy
! Component: 1850  -  total flux cleaned = 0.0188176 Jy
! Component: 1900  -  total flux cleaned = 0.0189436 Jy
! Component: 1950  -  total flux cleaned = 0.0191517 Jy
! Component: 2000  -  total flux cleaned = 0.0191514 Jy
! Total flux subtracted in 2048 components = 0.0193152 Jy
! Clean residual min=-0.002520 max=0.002045 Jy/beam
! Clean residual mean=0.000112 rms=0.000755 Jy/beam
! Combined flux in latest and established models = 1.85723 Jy
keep
! Adding 122 model components to the UV plane model.
! The established model now contains 386 components and 1.85723 Jy
wmap "J2202+4216_S_2003_06_18_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.197 x 5.317 at -5.321 degrees (North through East)
! Clean map  min=-0.0029431  max=1.0245 Jy/beam
! Writing clean map to FITS file: J2202+4216_S_2003_06_18_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.02455 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000755433 
device "J2202+4216_S_2003_06_18_pus\_map.eps/VPS"
! Attempting to open device: 'J2202+4216_S_2003_06_18_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.2212 0.2212 0.4424 0.8848 1.7696 3.5392 7.0784 14.1568 28.3136 56.6272
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0022 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.024 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.197 x 5.317 at -5.321 degrees (North through East)
! Clean map  min=-0.0029431  max=1.0245 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J2202+4216_S_2003_06_18_pus\_map.gif/vgif"
! Attempting to open device: 'J2202+4216_S_2003_06_18_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J2202+4216_S_2003_06_18_pus_uvs.log closed on Wed Jan 24 19:12:33 2007