! Started logfile: J2236+2828_S_2003_05_07_pus_uvs.log on Sun Dec 24 18:01:06 2006
obs J2236+2828_S_2003_05_07_pus_uva.fits
! Reading UV FITS file: J2236+2828_S_2003_05_07_pus_uva.fits
! AN table 1: 11 integrations on 171 of 171 possible baselines.
! AN table 2: 43 integrations on 171 of 171 possible baselines.
! AN table 3: 11 integrations on 171 of 171 possible baselines.
! AN table 4: 48 integrations on 171 of 171 possible baselines.
! AN table 5: 502 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.0918937 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J2236+2828
! 
! 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 1680 lines of history.
! 
! Reading 38656 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
float field_size
field_size = 512
float field_cell
field_cell = 0.5
float taper_size
taper_size = 20.
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 209 telescope corrections were flagged in sub-array 1.
!  A total of 571 telescope corrections were flagged in sub-array 2.
!  A total of 179 telescope corrections were flagged in sub-array 3.
!  A total of 798 telescope corrections were flagged in sub-array 4.
!  A total of 7297 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 209 telescope corrections were flagged in sub-array 1.
!  A total of 587 telescope corrections were flagged in sub-array 2.
!  A total of 209 telescope corrections were flagged in sub-array 3.
!  A total of 837 telescope corrections were flagged in sub-array 4.
!  A total of 7378 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 209 telescope corrections were flagged in sub-array 1.
!  A total of 587 telescope corrections were flagged in sub-array 2.
!  A total of 209 telescope corrections were flagged in sub-array 3.
!  A total of 837 telescope corrections were flagged in sub-array 4.
!  A total of 7372 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 209 telescope corrections were flagged in sub-array 1.
!  A total of 571 telescope corrections were flagged in sub-array 2.
!  A total of 209 telescope corrections were flagged in sub-array 3.
!  A total of 798 telescope corrections were flagged in sub-array 4.
!  A total of 7297 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=1.357321Jy  sigma=0.010679
! Fit after  self-cal, rms=0.744174Jy  sigma=0.005979
! 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.912 mas, bmaj=4.205 mas, bpa=-10.84 degrees
! Estimated noise=1113.5 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 = 1.23895 Jy
! Component: 100  -  total flux cleaned = 1.53101 Jy
! Total flux subtracted in 100 components = 1.53101 Jy
! Clean residual min=-0.031331 max=0.115144 Jy/beam
! Clean residual mean=-0.000061 rms=0.009796 Jy/beam
! Combined flux in latest and established models = 1.53101 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 8 components and 1.53101 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.436567Jy  sigma=0.002684
! Fit after  self-cal, rms=0.436441Jy  sigma=0.002683
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.121695 Jy
! Component: 100  -  total flux cleaned = 0.179736 Jy
! Total flux subtracted in 100 components = 0.179736 Jy
! Clean residual min=-0.025459 max=0.027045 Jy/beam
! Clean residual mean=-0.000130 rms=0.007023 Jy/beam
! Combined flux in latest and established models = 1.71075 Jy
! Performing phase self-cal
! Adding 10 model components to the UV plane model.
! The established model now contains 12 components and 1.71075 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.405148Jy  sigma=0.002145
! Fit after  self-cal, rms=0.405010Jy  sigma=0.002144
! 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.483 mas, bmaj=5.349 mas, bpa=-15.7 degrees
! Estimated noise=504.134 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.0405782 Jy
! Component: 100  -  total flux cleaned = 0.0573623 Jy
! Component: 150  -  total flux cleaned = 0.0651985 Jy
! Component: 200  -  total flux cleaned = 0.0682471 Jy
! Total flux subtracted in 200 components = 0.0682471 Jy
! Clean residual min=-0.036115 max=0.027641 Jy/beam
! Clean residual mean=-0.000921 rms=0.008233 Jy/beam
! Combined flux in latest and established models = 1.77899 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 26 components and 1.77899 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.404421Jy  sigma=0.002088
! Fit after  self-cal, rms=0.404346Jy  sigma=0.002087
! 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*    
!   MC        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*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.90     FD        1.03     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        0.96     LA        1.08     MA        1.00*    
!   MC        1.00*    MK        0.80     NL        1.04     ON        1.00*    
!   OV        1.16     PT        1.05     SC        1.00*    TC        1.00*    
!   TS        0.94     WF        1.00*    WZ        1.00*    
! 
!  A total of 30 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.00*    FD        0.00*    GG        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*    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 21 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.00*    FD        1.00*    GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.25     
!   MC        0.97     MK        1.00*    NL        1.00*    ON        1.08     
!   OV        1.00*    PT        1.00*    SC        1.00*    TC        1.00*    
!   TS        1.03     WF        1.00*    WZ        0.97     
! 
!  A total of 228 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.97     FD        1.00     GG        1.00*    HN        0.99     
!   KK        1.02     KP        0.97     LA        1.06     MA        1.55     
!   MC        1.00     MK        0.97     NL        0.96     ON        1.13     
!   OV        0.82     PT        1.03     SC        0.93     TC        1.07     
!   TS        1.08     WF        0.92     WZ        1.04     
! 
! 
! 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*    
!   MC        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*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        1.08     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.02     LA        1.04     MA        1.00*    
!   MC        1.00*    MK        0.93     NL        1.08     ON        1.00*    
!   OV        0.76     PT        1.06     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.00*    FD        0.00*    GG        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*    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 3 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.00*    FD        1.00*    GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.06     
!   MC        1.03     MK        1.00*    NL        1.00*    ON        1.12     
!   OV        1.00*    PT        1.00*    SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        0.95     
! 
!  A total of 237 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.03     FD        1.04     GG        1.00*    HN        1.01     
!   KK        1.05     KP        0.97     LA        1.00     MA        1.20     
!   MC        1.03     MK        1.04     NL        1.00     ON        1.07     
!   OV        0.89     PT        1.01     SC        0.95     TC        1.08     
!   TS        1.00*    WF        1.08     WZ        0.98     
! 
! 
! 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*    
!   MC        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*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.94     FD        1.02     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.04     LA        1.04     MA        1.00*    
!   MC        1.00*    MK        0.92     NL        1.07     ON        1.00*    
!   OV        1.18     PT        1.07     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.00*    FD        0.00*    GG        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*    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 3 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.00*    FD        1.00*    GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.15     
!   MC        0.98     MK        1.00*    NL        1.00*    ON        1.16     
!   OV        1.00*    PT        1.00*    SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.01     
! 
!  A total of 243 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.99     FD        0.99     GG        1.00*    HN        1.04     
!   KK        1.03     KP        0.99     LA        1.01     MA        1.07     
!   MC        1.00     MK        1.02     NL        1.01     ON        1.08     
!   OV        0.85     PT        1.04     SC        1.10     TC        1.01     
!   TS        1.00*    WF        1.09     WZ        1.02     
! 
! 
! 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*    
!   MC        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*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.92     FD        1.04     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        0.99     LA        1.05     MA        1.00*    
!   MC        1.00*    MK        0.97     NL        1.01     ON        1.00*    
!   OV        1.22     PT        1.03     SC        1.00*    TC        1.00*    
!   TS        0.95     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.00*    FD        0.00*    GG        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*    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 21 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.00*    FD        1.00*    GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.13     
!   MC        0.94     MK        1.00*    NL        1.00*    ON        1.11     
!   OV        1.00*    PT        1.00*    SC        1.00*    TC        1.00*    
!   TS        1.05     WF        1.00*    WZ        0.99     
! 
!  A total of 228 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        0.98     FD        0.99     GG        1.00*    HN        1.03     
!   KK        1.04     KP        0.98     LA        1.01     MA        1.10     
!   MC        0.97     MK        1.06     NL        0.95     ON        1.03     
!   OV        0.81     PT        0.99     SC        1.09     TC        1.05     
!   TS        1.09     WF        1.10     WZ        1.01     
! 
! 
! Fit before self-cal, rms=0.404346Jy  sigma=0.002087
! Fit after  self-cal, rms=0.408981Jy  sigma=0.001732
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.523 mas, bmaj=5.392 mas, bpa=-15.89 degrees
! Estimated noise=507.072 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.0136285 Jy
! Component: 100  -  total flux cleaned = -0.0151428 Jy
! Component: 150  -  total flux cleaned = -0.0162809 Jy
! Component: 200  -  total flux cleaned = -0.0171818 Jy
! Total flux subtracted in 200 components = -0.0171818 Jy
! Clean residual min=-0.019952 max=0.019196 Jy/beam
! Clean residual mean=-0.000287 rms=0.004323 Jy/beam
! Combined flux in latest and established models = 1.76181 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 30 components and 1.76181 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.407876Jy  sigma=0.001725
! Fit after  self-cal, rms=0.408449Jy  sigma=0.001725
! 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.408449Jy  sigma=0.001725
! Fit after  self-cal, rms=0.392399Jy  sigma=0.001666
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.539 mas, bmaj=5.388 mas, bpa=-15.58 degrees
! Estimated noise=506.386 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.0100556 Jy
! Component: 100  -  total flux cleaned = -0.0108924 Jy
! Component: 150  -  total flux cleaned = -0.0115585 Jy
! Component: 200  -  total flux cleaned = -0.0119274 Jy
! Total flux subtracted in 200 components = -0.0119274 Jy
! Clean residual min=-0.016186 max=0.018772 Jy/beam
! Clean residual mean=0.000160 rms=0.003877 Jy/beam
! Combined flux in latest and established models = 1.74989 Jy
selfcal
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 33 components and 1.74989 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.391710Jy  sigma=0.001662
! Fit after  self-cal, rms=0.391774Jy  sigma=0.001662
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 (-21.5, 42.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0053466 Jy
! Component: 100  -  total flux cleaned = 0.00502777 Jy
! Component: 150  -  total flux cleaned = 0.00378848 Jy
! Component: 200  -  total flux cleaned = 0.00300908 Jy
! Total flux subtracted in 200 components = 0.00300908 Jy
! Clean residual min=-0.014365 max=0.015047 Jy/beam
! Clean residual mean=0.000130 rms=0.003571 Jy/beam
! Combined flux in latest and established models = 1.75289 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 56 components and 1.75289 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.391127Jy  sigma=0.001644
! Fit after  self-cal, rms=0.391089Jy  sigma=0.001643
! 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.391089Jy  sigma=0.001643
! Fit after  self-cal, rms=0.386642Jy  sigma=0.001391
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.546 mas, bmaj=5.388 mas, bpa=-15.46 degrees
! Estimated noise=507.122 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00299927 Jy
! Component: 100  -  total flux cleaned = -0.00398374 Jy
! Component: 150  -  total flux cleaned = -0.00379782 Jy
! Component: 200  -  total flux cleaned = -0.00345319 Jy
! Total flux subtracted in 200 components = -0.00345319 Jy
! Clean residual min=-0.005551 max=0.005749 Jy/beam
! Clean residual mean=0.000070 rms=0.001232 Jy/beam
! Combined flux in latest and established models = 1.74944 Jy
selfcal
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 68 components and 1.74944 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.386309Jy  sigma=0.001387
! Fit after  self-cal, rms=0.386465Jy  sigma=0.001386
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 (-3, -0.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000772779 Jy
! Component: 100  -  total flux cleaned = 0.000440998 Jy
! Component: 150  -  total flux cleaned = 0.000444839 Jy
! Component: 200  -  total flux cleaned = 0.00058575 Jy
! Total flux subtracted in 200 components = 0.00058575 Jy
! Clean residual min=-0.005779 max=0.003989 Jy/beam
! Clean residual mean=0.000072 rms=0.001159 Jy/beam
! Combined flux in latest and established models = 1.75003 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 81 components and 1.75003 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.386271Jy  sigma=0.001384
! Fit after  self-cal, rms=0.386252Jy  sigma=0.001384
! 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.386252Jy  sigma=0.001384
! Fit after  self-cal, rms=0.387373Jy  sigma=0.001383
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=8.096 mas, bmaj=10.84 mas, bpa=7.623 degrees
! Estimated noise=636.462 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00151259 Jy
! Component: 100  -  total flux cleaned = -0.000924357 Jy
! Component: 150  -  total flux cleaned = -0.000635466 Jy
! Component: 200  -  total flux cleaned = -0.000386596 Jy
! Total flux subtracted in 200 components = -0.000386596 Jy
! Clean residual min=-0.006511 max=0.004523 Jy/beam
! Clean residual mean=0.000162 rms=0.001601 Jy/beam
! Combined flux in latest and established models = 1.74964 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 103 components and 1.74964 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.387307Jy  sigma=0.001382
! Fit after  self-cal, rms=0.387315Jy  sigma=0.001382
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 = -5.48187e-05 Jy
! Component: 100  -  total flux cleaned = 0.000157887 Jy
! Component: 150  -  total flux cleaned = 0.000346425 Jy
! Component: 200  -  total flux cleaned = 0.000566184 Jy
! Total flux subtracted in 200 components = 0.000566184 Jy
! Clean residual min=-0.006376 max=0.004549 Jy/beam
! Clean residual mean=0.000160 rms=0.001566 Jy/beam
! Combined flux in latest and established models = 1.75021 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 114 components and 1.75021 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.387294Jy  sigma=0.001382
! Fit after  self-cal, rms=0.387292Jy  sigma=0.001382
! 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.549 mas, bmaj=5.389 mas, bpa=-15.39 degrees
! Estimated noise=507.007 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.549 x 5.389 at -15.39 degrees (North through East)
! Clean map  min=-0.0048153  max=1.6377 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.387292Jy  sigma=0.001382
! Fit after  self-cal, rms=0.383276Jy  sigma=0.001186
! Inverting map and beam 
! Estimated beam: bmin=2.55 mas, bmaj=5.388 mas, bpa=-15.37 degrees
! Estimated noise=506.738 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00106083 Jy
! Component: 100  -  total flux cleaned = -0.000769008 Jy
! Component: 150  -  total flux cleaned = -0.000500663 Jy
! Component: 200  -  total flux cleaned = -0.00037771 Jy
! Total flux subtracted in 200 components = -0.00037771 Jy
! Clean residual min=-0.004278 max=0.003269 Jy/beam
! Clean residual mean=0.000113 rms=0.000851 Jy/beam
! Combined flux in latest and established models = 1.74983 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 116 components and 1.74983 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.383104Jy  sigma=0.001184
! Fit after  self-cal, rms=0.383100Jy  sigma=0.001184
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000413634 Jy
! Component: 100  -  total flux cleaned = 0.000514126 Jy
! Component: 150  -  total flux cleaned = 0.000609592 Jy
! Component: 200  -  total flux cleaned = 0.00087582 Jy
! Total flux subtracted in 200 components = 0.00087582 Jy
! Clean residual min=-0.004298 max=0.003239 Jy/beam
! Clean residual mean=0.000110 rms=0.000830 Jy/beam
! Combined flux in latest and established models = 1.7507 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 121 components and 1.7507 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.383026Jy  sigma=0.001184
! Fit after  self-cal, rms=0.383023Jy  sigma=0.001184
! 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.383023Jy  sigma=0.001184
! Fit after  self-cal, rms=0.383669Jy  sigma=0.001183
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.946 mas, bmaj=4.226 mas, bpa=-10.5 degrees
! Estimated noise=1142.7 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.25133 Jy
! Component: 100  -  total flux cleaned = 1.53255 Jy
! Component: 150  -  total flux cleaned = 1.63643 Jy
! Component: 200  -  total flux cleaned = 1.68562 Jy
! Total flux subtracted in 200 components = 1.68562 Jy
! Clean residual min=-0.007447 max=0.022429 Jy/beam
! Clean residual mean=0.000038 rms=0.002090 Jy/beam
! Combined flux in latest and established models = 1.68562 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 10 model components to the UV plane model.
! The established model now contains 10 components and 1.68562 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.553 mas, bmaj=5.388 mas, bpa=-15.31 degrees
! Estimated noise=506.495 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.0343972 Jy
! Component: 100  -  total flux cleaned = 0.0488809 Jy
! Component: 150  -  total flux cleaned = 0.0562543 Jy
! Component: 200  -  total flux cleaned = 0.0603965 Jy
! Total flux subtracted in 200 components = 0.0603965 Jy
! Clean residual min=-0.003729 max=0.003281 Jy/beam
! Clean residual mean=0.000122 rms=0.000810 Jy/beam
! Combined flux in latest and established models = 1.74602 Jy
! Adding 34 model components to the UV plane model.
! The established model now contains 38 components and 1.74602 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=8.091 mas, bmaj=10.84 mas, bpa=7.638 degrees
! Estimated noise=635.594 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00373331 Jy
! Component: 100  -  total flux cleaned = 0.00525204 Jy
! Component: 150  -  total flux cleaned = 0.00548611 Jy
! Component: 200  -  total flux cleaned = 0.00563187 Jy
! Total flux subtracted in 200 components = 0.00563187 Jy
! Clean residual min=-0.003886 max=0.003542 Jy/beam
! Clean residual mean=0.000239 rms=0.001179 Jy/beam
! Combined flux in latest and established models = 1.75165 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 = 4.15609e-05 Jy
! Component: 100  -  total flux cleaned = 8.01734e-05 Jy
! Component: 150  -  total flux cleaned = 8.09673e-05 Jy
! Component: 200  -  total flux cleaned = 0.000112356 Jy
! Total flux subtracted in 200 components = 0.000112356 Jy
! Clean residual min=-0.003810 max=0.003478 Jy/beam
! Clean residual mean=0.000237 rms=0.001163 Jy/beam
! Combined flux in latest and established models = 1.75176 Jy
! Adding 52 model components to the UV plane model.
! The established model now contains 84 components and 1.75176 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.553 mas, bmaj=5.388 mas, bpa=-15.31 degrees
! Estimated noise=506.495 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000179685 Jy
! Component: 100  -  total flux cleaned = -5.63437e-05 Jy
! Component: 150  -  total flux cleaned = 6.00816e-05 Jy
! Component: 200  -  total flux cleaned = 0.000114456 Jy
! Total flux subtracted in 200 components = 0.000114456 Jy
! Clean residual min=-0.003659 max=0.003052 Jy/beam
! Clean residual mean=0.000099 rms=0.000749 Jy/beam
! Combined flux in latest and established models = 1.75188 Jy
selfcal
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 99 components and 1.75188 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.383463Jy  sigma=0.001181
! Fit after  self-cal, rms=0.383445Jy  sigma=0.001181
wmodel J2236+2828_S_2003_05_07_pus_map.mod
! Writing 99 model components to file: J2236+2828_S_2003_05_07_pus_map.mod
wobs J2236+2828_S_2003_05_07_pus_uvs.fits
! Writing UV FITS file: J2236+2828_S_2003_05_07_pus_uvs.fits
wwins J2236+2828_S_2003_05_07_pus_map.win
! wwins: Wrote 3 windows to J2236+2828_S_2003_05_07_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.000572429 Jy
! Component: 100  -  total flux cleaned = -0.000422305 Jy
! Component: 150  -  total flux cleaned = -0.000185656 Jy
! Component: 200  -  total flux cleaned = 0.000213731 Jy
! Component: 250  -  total flux cleaned = 0.000640416 Jy
! Component: 300  -  total flux cleaned = 0.000928349 Jy
! Component: 350  -  total flux cleaned = 0.0011282 Jy
! Component: 400  -  total flux cleaned = 0.00143962 Jy
! Component: 450  -  total flux cleaned = 0.00178167 Jy
! Component: 500  -  total flux cleaned = 0.00215385 Jy
! Component: 550  -  total flux cleaned = 0.00248252 Jy
! Component: 600  -  total flux cleaned = 0.00277016 Jy
! Component: 650  -  total flux cleaned = 0.00308906 Jy
! Component: 700  -  total flux cleaned = 0.00340337 Jy
! Component: 750  -  total flux cleaned = 0.003679 Jy
! Component: 800  -  total flux cleaned = 0.00388317 Jy
! Component: 850  -  total flux cleaned = 0.0041181 Jy
! Component: 900  -  total flux cleaned = 0.00435071 Jy
! Component: 950  -  total flux cleaned = 0.00464599 Jy
! Component: 1000  -  total flux cleaned = 0.00480824 Jy
! Component: 1050  -  total flux cleaned = 0.00512973 Jy
! Component: 1100  -  total flux cleaned = 0.00535237 Jy
! Component: 1150  -  total flux cleaned = 0.00557295 Jy
! Component: 1200  -  total flux cleaned = 0.00591592 Jy
! Component: 1250  -  total flux cleaned = 0.00616255 Jy
! Component: 1300  -  total flux cleaned = 0.00628528 Jy
! Component: 1350  -  total flux cleaned = 0.00652822 Jy
! Component: 1400  -  total flux cleaned = 0.0067984 Jy
! Component: 1450  -  total flux cleaned = 0.00697681 Jy
! Component: 1500  -  total flux cleaned = 0.00715357 Jy
! Component: 1550  -  total flux cleaned = 0.00735816 Jy
! Component: 1600  -  total flux cleaned = 0.00753228 Jy
! Component: 1650  -  total flux cleaned = 0.00770525 Jy
! Component: 1700  -  total flux cleaned = 0.0079909 Jy
! Component: 1750  -  total flux cleaned = 0.00807585 Jy
! Component: 1800  -  total flux cleaned = 0.00832915 Jy
! Component: 1850  -  total flux cleaned = 0.00844065 Jy
! Component: 1900  -  total flux cleaned = 0.00852409 Jy
! Component: 1950  -  total flux cleaned = 0.00877205 Jy
! Component: 2000  -  total flux cleaned = 0.00888144 Jy
! Total flux subtracted in 2048 components = 0.00899014 Jy
! Clean residual min=-0.001805 max=0.001510 Jy/beam
! Clean residual mean=0.000062 rms=0.000520 Jy/beam
! Combined flux in latest and established models = 1.76087 Jy
keep
! Adding 141 model components to the UV plane model.
! The established model now contains 240 components and 1.76087 Jy
wmap "J2236+2828_S_2003_05_07_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.553 x 5.388 at -15.31 degrees (North through East)
! Clean map  min=-0.0033408  max=1.637 Jy/beam
! Writing clean map to FITS file: J2236+2828_S_2003_05_07_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.637 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.00052038 
device "J2236+2828_S_2003_05_07_pus\_map.eps/VPS"
! Attempting to open device: 'J2236+2828_S_2003_05_07_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.0953659 0.0953659 0.190732 0.381464 0.762927 1.52585 3.05171 6.10342 12.2068 24.4137 48.8273 97.6547
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0015 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.637 
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.553 x 5.388 at -15.31 degrees (North through East)
! Clean map  min=-0.0033408  max=1.637 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J2236+2828_S_2003_05_07_pus\_map.gif/vgif"
! Attempting to open device: 'J2236+2828_S_2003_05_07_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J2236+2828_S_2003_05_07_pus_uvs.log closed on Sun Dec 24 18:03:58 2006