! Started logfile: J1608+1029_S_2003_06_18_pus_uvs.log on Tue Jan 23 23:26:52 2007
obs J1608+1029_S_2003_06_18_pus_uva.fits
! Reading UV FITS file: J1608+1029_S_2003_06_18_pus_uva.fits
! AN table 1: 14 integrations on 153 of 153 possible baselines.
! AN table 2: 204 integrations on 153 of 153 possible baselines.
! AN table 3: 66 integrations on 153 of 153 possible baselines.
! AN table 4: 128 integrations on 153 of 153 possible baselines.
! AN table 5: 103 integrations on 153 of 153 possible baselines.
! Apparent sampling: 0.0980392 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1608+1029
! 
! 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 2425 lines of history.
! 
! Reading 30900 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 252 telescope corrections were flagged in sub-array 1.
!  A total of 2542 telescope corrections were flagged in sub-array 2.
!  A total of 951 telescope corrections were flagged in sub-array 3.
!  A total of 1885 telescope corrections were flagged in sub-array 4.
!  A total of 1415 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 252 telescope corrections were flagged in sub-array 1.
!  A total of 2542 telescope corrections were flagged in sub-array 2.
!  A total of 951 telescope corrections were flagged in sub-array 3.
!  A total of 1885 telescope corrections were flagged in sub-array 4.
!  A total of 1415 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 252 telescope corrections were flagged in sub-array 1.
!  A total of 2542 telescope corrections were flagged in sub-array 2.
!  A total of 951 telescope corrections were flagged in sub-array 3.
!  A total of 1885 telescope corrections were flagged in sub-array 4.
!  A total of 1415 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 252 telescope corrections were flagged in sub-array 1.
!  A total of 2542 telescope corrections were flagged in sub-array 2.
!  A total of 951 telescope corrections were flagged in sub-array 3.
!  A total of 1885 telescope corrections were flagged in sub-array 4.
!  A total of 1415 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=1.724293Jy  sigma=0.016346
! Fit after  self-cal, rms=1.347607Jy  sigma=0.013262
! 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.024 mas, bmaj=4.299 mas, bpa=0.1896 degrees
! Estimated noise=707.771 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.46613 Jy
! Component: 100  -  total flux cleaned = 1.93193 Jy
! Total flux subtracted in 100 components = 1.93193 Jy
! Clean residual min=-0.077349 max=0.199732 Jy/beam
! Clean residual mean=0.001739 rms=0.021190 Jy/beam
! Combined flux in latest and established models = 1.93193 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 8 components and 1.93193 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.817174Jy  sigma=0.006568
! Fit after  self-cal, rms=0.816384Jy  sigma=0.006566
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.217032 Jy
! Component: 100  -  total flux cleaned = 0.327011 Jy
! Total flux subtracted in 100 components = 0.327011 Jy
! Clean residual min=-0.085225 max=0.064187 Jy/beam
! Clean residual mean=0.000977 rms=0.016246 Jy/beam
! Combined flux in latest and established models = 2.25894 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 28 components and 2.25894 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.740585Jy  sigma=0.005411
! Fit after  self-cal, rms=0.740230Jy  sigma=0.005406
! 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.788 mas, bmaj=5.242 mas, bpa=-0.4204 degrees
! Estimated noise=435.25 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.10527 Jy
! Component: 100  -  total flux cleaned = 0.155192 Jy
! Component: 150  -  total flux cleaned = 0.180335 Jy
! Component: 200  -  total flux cleaned = 0.193376 Jy
! Total flux subtracted in 200 components = 0.193376 Jy
! Clean residual min=-0.074610 max=0.066093 Jy/beam
! Clean residual mean=0.001404 rms=0.016354 Jy/beam
! Combined flux in latest and established models = 2.45232 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 45 components and 2.45232 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.728633Jy  sigma=0.005209
! Fit after  self-cal, rms=0.728592Jy  sigma=0.005209
! 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 30 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.08     FD        1.01     GG        1.00*    HN        1.21     
!   KK        1.06     KP        0.90     LA        1.01     MA        1.00*    
!   MK        1.01     NL        1.06     ON        1.00*    OV        0.69     
!   PT        0.99     SC        0.93     TC        1.12     TS        1.12     
!   WF        1.14     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.03     FD        1.00     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.05     LA        0.96     MA        1.00*    
!   MK        1.00*    NL        0.92     ON        1.00*    OV        1.40     
!   PT        0.95     SC        1.00*    TC        1.20     TS        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 87 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.15     FD        1.05     GG        1.00*    HN        0.89     
!   KK        1.00*    KP        0.99     LA        1.09     MA        1.00*    
!   MK        1.00*    NL        1.12     ON        1.09     OV        1.36     
!   PT        1.15     SC        1.00*    TC        1.00*    TS        1.00*    
!   WF        1.05     WZ        1.00*    
! 
!  A total of 66 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.12     FD        1.03     GG        1.00*    HN        0.83     
!   KK        1.00*    KP        1.07     LA        1.06     MA        1.00*    
!   MK        1.00*    NL        0.98     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.00*    TC        1.12     TS        1.00*    
!   WF        1.11     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 30 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.04     FD        1.01     GG        1.00*    HN        1.13     
!   KK        1.05     KP        1.02     LA        1.01     MA        1.00*    
!   MK        1.09     NL        1.01     ON        1.00*    OV        0.77     
!   PT        0.98     SC        0.96     TC        1.03     TS        1.10     
!   WF        1.06     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.99     FD        0.96     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.01     LA        0.96     MA        1.00*    
!   MK        1.00*    NL        0.87     ON        1.00*    OV        1.08     
!   PT        0.95     SC        1.00*    TC        1.03     TS        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 87 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.07     FD        1.07     GG        1.00*    HN        1.05     
!   KK        1.00*    KP        1.15     LA        1.09     MA        1.00*    
!   MK        1.00*    NL        1.04     ON        1.02     OV        1.15     
!   PT        1.14     SC        1.00*    TC        1.00*    TS        1.00*    
!   WF        1.07     WZ        1.00*    
! 
!  A total of 66 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.05     FD        1.03     GG        1.00*    HN        1.00     
!   KK        1.00*    KP        1.14     LA        1.05     MA        1.00*    
!   MK        1.00*    NL        0.94     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.00*    TC        1.10     TS        1.00*    
!   WF        1.07     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 30 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.05     FD        1.01     GG        1.00*    HN        1.15     
!   KK        1.05     KP        1.01     LA        0.97     MA        1.00*    
!   MK        1.05     NL        1.02     ON        1.00*    OV        0.92     
!   PT        1.00     SC        1.12     TC        0.99     TS        1.10     
!   WF        1.09     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.01     FD        0.97     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        0.99     LA        0.94     MA        1.00*    
!   MK        1.00*    NL        0.88     ON        1.00*    OV        1.15     
!   PT        0.97     SC        1.00*    TC        1.00     TS        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 87 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.10     FD        1.06     GG        1.00*    HN        1.07     
!   KK        1.00*    KP        1.14     LA        1.05     MA        1.00*    
!   MK        1.00*    NL        1.04     ON        0.97     OV        1.24     
!   PT        1.15     SC        1.00*    TC        1.00*    TS        1.00*    
!   WF        1.09     WZ        1.00*    
! 
!  A total of 66 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.06     FD        1.02     GG        1.00*    HN        1.02     
!   KK        1.00*    KP        1.13     LA        1.01     MA        1.00*    
!   MK        1.00*    NL        0.93     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.00*    TC        1.04     TS        1.00*    
!   WF        1.07     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 30 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        1.00     GG        1.00*    HN        0.79     
!   KK        1.03     KP        1.04     LA        1.02     MA        1.00*    
!   MK        0.99     NL        1.07     ON        1.00*    OV        0.78     
!   PT        1.04     SC        1.15     TC        1.04     TS        1.05     
!   WF        1.01     WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.96     FD        0.97     GG        1.00*    HN        1.00*    
!   KK        1.00*    KP        1.00     LA        0.97     MA        1.00*    
!   MK        1.00*    NL        0.92     ON        1.00*    OV        1.15     
!   PT        1.01     SC        1.00*    TC        0.98     TS        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 87 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.05     FD        1.05     GG        1.00*    HN        0.76     
!   KK        1.00*    KP        1.16     LA        1.08     MA        1.00*    
!   MK        1.00*    NL        1.13     ON        1.04     OV        1.15     
!   PT        1.20     SC        1.00*    TC        1.00*    TS        1.00*    
!   WF        1.09     WZ        1.00*    
! 
!  A total of 66 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.03     FD        1.03     GG        1.00*    HN        0.70     
!   KK        1.00*    KP        1.12     LA        1.04     MA        1.00*    
!   MK        1.00*    NL        0.99     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.00*    TC        1.01     TS        1.00*    
!   WF        1.05     WZ        1.00*    
! 
! 
! Fit before self-cal, rms=0.728592Jy  sigma=0.005209
! Fit after  self-cal, rms=0.590714Jy  sigma=0.004192
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.827 mas, bmaj=5.385 mas, bpa=-0.5684 degrees
! Estimated noise=441.802 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 (19, -37).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0226254 Jy
! Component: 100  -  total flux cleaned = 0.0219606 Jy
! Component: 150  -  total flux cleaned = 0.0206446 Jy
! Component: 200  -  total flux cleaned = 0.0194695 Jy
! Total flux subtracted in 200 components = 0.0194695 Jy
! Clean residual min=-0.024317 max=0.032641 Jy/beam
! Clean residual mean=0.000929 rms=0.006997 Jy/beam
! Combined flux in latest and established models = 2.47178 Jy
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 67 components and 2.47178 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.588901Jy  sigma=0.004157
! Fit after  self-cal, rms=0.589044Jy  sigma=0.004153
! 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.589044Jy  sigma=0.004153
! Fit after  self-cal, rms=0.523103Jy  sigma=0.003280
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.836 mas, bmaj=5.385 mas, bpa=-0.5618 degrees
! Estimated noise=442.62 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00170863 Jy
! Component: 100  -  total flux cleaned = -0.00358983 Jy
! Component: 150  -  total flux cleaned = -0.00321966 Jy
! Component: 200  -  total flux cleaned = -0.00289098 Jy
! Total flux subtracted in 200 components = -0.00289098 Jy
! Clean residual min=-0.012758 max=0.017350 Jy/beam
! Clean residual mean=0.000558 rms=0.003101 Jy/beam
! Combined flux in latest and established models = 2.46889 Jy
selfcal
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 73 components and 2.46889 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.522355Jy  sigma=0.003269
! Fit after  self-cal, rms=0.523214Jy  sigma=0.003261
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 (-5.5, 8.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0125439 Jy
! Component: 100  -  total flux cleaned = 0.0109453 Jy
! Component: 150  -  total flux cleaned = 0.00995696 Jy
! Component: 200  -  total flux cleaned = 0.00967532 Jy
! Total flux subtracted in 200 components = 0.00967532 Jy
! Clean residual min=-0.012131 max=0.010946 Jy/beam
! Clean residual mean=0.000561 rms=0.002870 Jy/beam
! Combined flux in latest and established models = 2.47857 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 89 components and 2.47857 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.522597Jy  sigma=0.003250
! Fit after  self-cal, rms=0.522532Jy  sigma=0.003249
! 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.522532Jy  sigma=0.003249
! Fit after  self-cal, rms=0.519290Jy  sigma=0.003216
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.846 mas, bmaj=5.384 mas, bpa=-0.5711 degrees
! Estimated noise=443.714 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00599173 Jy
! Component: 100  -  total flux cleaned = 0.00564428 Jy
! Component: 150  -  total flux cleaned = 0.00563735 Jy
! Component: 200  -  total flux cleaned = 0.00535169 Jy
! Total flux subtracted in 200 components = 0.00535169 Jy
! Clean residual min=-0.011303 max=0.009944 Jy/beam
! Clean residual mean=0.000502 rms=0.002395 Jy/beam
! Combined flux in latest and established models = 2.48392 Jy
selfcal
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 95 components and 2.48392 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.518806Jy  sigma=0.003210
! Fit after  self-cal, rms=0.519069Jy  sigma=0.003209
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.00140428 Jy
! Component: 100  -  total flux cleaned = 0.00164542 Jy
! Component: 150  -  total flux cleaned = 0.00164893 Jy
! Component: 200  -  total flux cleaned = 0.0018695 Jy
! Total flux subtracted in 200 components = 0.0018695 Jy
! Clean residual min=-0.010843 max=0.009729 Jy/beam
! Clean residual mean=0.000503 rms=0.002346 Jy/beam
! Combined flux in latest and established models = 2.48579 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 100 components and 2.48579 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.518799Jy  sigma=0.003206
! Fit after  self-cal, rms=0.518785Jy  sigma=0.003206
! 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.518785Jy  sigma=0.003206
! Fit after  self-cal, rms=0.519678Jy  sigma=0.003205
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=8.145 mas, bmaj=12.39 mas, bpa=-8.975 degrees
! Estimated noise=534.486 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00669836 Jy
! Component: 100  -  total flux cleaned = 0.00814668 Jy
! Component: 150  -  total flux cleaned = 0.00892706 Jy
! Component: 200  -  total flux cleaned = 0.00920403 Jy
! Total flux subtracted in 200 components = 0.00920403 Jy
! Clean residual min=-0.008969 max=0.010532 Jy/beam
! Clean residual mean=0.000899 rms=0.002798 Jy/beam
! Combined flux in latest and established models = 2.49499 Jy
selfcal
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 125 components and 2.49499 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.519628Jy  sigma=0.003204
! Fit after  self-cal, rms=0.519617Jy  sigma=0.003204
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.000481805 Jy
! Component: 100  -  total flux cleaned = 0.000916313 Jy
! Component: 150  -  total flux cleaned = 0.00109483 Jy
! Component: 200  -  total flux cleaned = 0.0011737 Jy
! Total flux subtracted in 200 components = 0.0011737 Jy
! Clean residual min=-0.009165 max=0.010310 Jy/beam
! Clean residual mean=0.000883 rms=0.002782 Jy/beam
! Combined flux in latest and established models = 2.49617 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 127 components and 2.49617 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.519621Jy  sigma=0.003204
! Fit after  self-cal, rms=0.519610Jy  sigma=0.003204
! 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.856 mas, bmaj=5.383 mas, bpa=-0.5641 degrees
! Estimated noise=444.897 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.856 x 5.383 at -0.5641 degrees (North through East)
! Clean map  min=-0.0099023  max=2.0496 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.519610Jy  sigma=0.003204
! Fit after  self-cal, rms=0.790194Jy  sigma=0.002437
! Inverting map and beam 
! Estimated beam: bmin=2.852 mas, bmaj=5.381 mas, bpa=-0.5883 degrees
! Estimated noise=443.967 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00672479 Jy
! Component: 100  -  total flux cleaned = -0.00701723 Jy
! Component: 150  -  total flux cleaned = -0.00654581 Jy
! Component: 200  -  total flux cleaned = -0.00634293 Jy
! Total flux subtracted in 200 components = -0.00634293 Jy
! Clean residual min=-0.010139 max=0.006329 Jy/beam
! Clean residual mean=0.000148 rms=0.001713 Jy/beam
! Combined flux in latest and established models = 2.48982 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 138 components and 2.48983 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.789958Jy  sigma=0.002431
! Fit after  self-cal, rms=0.789942Jy  sigma=0.002431
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000301191 Jy
! Component: 100  -  total flux cleaned = 0.000258065 Jy
! Component: 150  -  total flux cleaned = 0.000425866 Jy
! Component: 200  -  total flux cleaned = 0.000744252 Jy
! Total flux subtracted in 200 components = 0.000744252 Jy
! Clean residual min=-0.009689 max=0.006393 Jy/beam
! Clean residual mean=0.000140 rms=0.001671 Jy/beam
! Combined flux in latest and established models = 2.49057 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 142 components and 2.49057 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.789811Jy  sigma=0.002429
! Fit after  self-cal, rms=0.789801Jy  sigma=0.002429
! 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.789801Jy  sigma=0.002429
! Fit after  self-cal, rms=0.790690Jy  sigma=0.002427
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.087 mas, bmaj=4.366 mas, bpa=-0.1437 degrees
! Estimated noise=781.81 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.5278 Jy
! Component: 100  -  total flux cleaned = 1.98128 Jy
! Component: 150  -  total flux cleaned = 2.18333 Jy
! Component: 200  -  total flux cleaned = 2.28113 Jy
! Total flux subtracted in 200 components = 2.28113 Jy
! Clean residual min=-0.014116 max=0.044882 Jy/beam
! Clean residual mean=0.000476 rms=0.004757 Jy/beam
! Combined flux in latest and established models = 2.28113 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 20 model components to the UV plane model.
! The established model now contains 20 components and 2.28113 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.859 mas, bmaj=5.39 mas, bpa=-0.5782 degrees
! Estimated noise=444.177 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.0850985 Jy
! Component: 100  -  total flux cleaned = 0.126669 Jy
! Component: 150  -  total flux cleaned = 0.151207 Jy
! Component: 200  -  total flux cleaned = 0.167483 Jy
! Total flux subtracted in 200 components = 0.167483 Jy
! Clean residual min=-0.006727 max=0.011368 Jy/beam
! Clean residual mean=0.000431 rms=0.002117 Jy/beam
! Combined flux in latest and established models = 2.44861 Jy
! Adding 58 model components to the UV plane model.
! The established model now contains 73 components and 2.44861 Jy
! Inverting map 
! Added new window around map position (0, 6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0121063 Jy
! Component: 100  -  total flux cleaned = 0.0205346 Jy
! Component: 150  -  total flux cleaned = 0.0268142 Jy
! Component: 200  -  total flux cleaned = 0.0301643 Jy
! Total flux subtracted in 200 components = 0.0301643 Jy
! Clean residual min=-0.005878 max=0.006134 Jy/beam
! Clean residual mean=0.000164 rms=0.001547 Jy/beam
! Combined flux in latest and established models = 2.47877 Jy
! Adding 35 model components to the UV plane model.
! The established model now contains 96 components and 2.47877 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.147 mas, bmaj=12.41 mas, bpa=-8.839 degrees
! Estimated noise=532.677 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00418173 Jy
! Component: 100  -  total flux cleaned = 0.00570669 Jy
! Component: 150  -  total flux cleaned = 0.00622931 Jy
! Component: 200  -  total flux cleaned = 0.00645725 Jy
! Total flux subtracted in 200 components = 0.00645725 Jy
! Clean residual min=-0.005547 max=0.005875 Jy/beam
! Clean residual mean=0.000236 rms=0.001886 Jy/beam
! Combined flux in latest and established models = 2.48523 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.000207524 Jy
! Component: 100  -  total flux cleaned = 0.000394898 Jy
! Component: 150  -  total flux cleaned = 0.000567396 Jy
! Component: 200  -  total flux cleaned = 0.00067441 Jy
! Total flux subtracted in 200 components = 0.00067441 Jy
! Clean residual min=-0.005541 max=0.005790 Jy/beam
! Clean residual mean=0.000226 rms=0.001872 Jy/beam
! Combined flux in latest and established models = 2.48591 Jy
! Adding 42 model components to the UV plane model.
! The established model now contains 135 components and 2.48591 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.859 mas, bmaj=5.39 mas, bpa=-0.5782 degrees
! Estimated noise=444.177 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.0021239 Jy
! Component: 100  -  total flux cleaned = -0.00225858 Jy
! Component: 150  -  total flux cleaned = -0.00213524 Jy
! Component: 200  -  total flux cleaned = -0.00201953 Jy
! Total flux subtracted in 200 components = -0.00201953 Jy
! Clean residual min=-0.005800 max=0.005854 Jy/beam
! Clean residual mean=0.000124 rms=0.001467 Jy/beam
! Combined flux in latest and established models = 2.48389 Jy
selfcal
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 147 components and 2.48389 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.790340Jy  sigma=0.002421
! Fit after  self-cal, rms=0.790299Jy  sigma=0.002420
wmodel J1608+1029_S_2003_06_18_pus_map.mod
! Writing 147 model components to file: J1608+1029_S_2003_06_18_pus_map.mod
wobs J1608+1029_S_2003_06_18_pus_uvs.fits
! Writing UV FITS file: J1608+1029_S_2003_06_18_pus_uvs.fits
wwins J1608+1029_S_2003_06_18_pus_map.win
! wwins: Wrote 4 windows to J1608+1029_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.00100444 Jy
! Component: 100  -  total flux cleaned = -0.00169126 Jy
! Component: 150  -  total flux cleaned = -0.00151315 Jy
! Component: 200  -  total flux cleaned = -0.00151494 Jy
! Component: 250  -  total flux cleaned = -0.00134769 Jy
! Component: 300  -  total flux cleaned = -0.00102066 Jy
! Component: 350  -  total flux cleaned = -0.000940013 Jy
! Component: 400  -  total flux cleaned = -0.000861804 Jy
! Component: 450  -  total flux cleaned = -0.000711361 Jy
! Component: 500  -  total flux cleaned = -0.000712042 Jy
! Component: 550  -  total flux cleaned = -0.000640078 Jy
! Component: 600  -  total flux cleaned = -0.000568763 Jy
! Component: 650  -  total flux cleaned = -8.17996e-05 Jy
! Component: 700  -  total flux cleaned = -1.58918e-05 Jy
! Component: 750  -  total flux cleaned = 0.000118029 Jy
! Component: 800  -  total flux cleaned = 0.00038238 Jy
! Component: 850  -  total flux cleaned = 0.000512647 Jy
! Component: 900  -  total flux cleaned = 0.000642233 Jy
! Component: 950  -  total flux cleaned = 0.000832968 Jy
! Component: 1000  -  total flux cleaned = 0.00108354 Jy
! Component: 1050  -  total flux cleaned = 0.00133084 Jy
! Component: 1100  -  total flux cleaned = 0.00145297 Jy
! Component: 1150  -  total flux cleaned = 0.00163432 Jy
! Component: 1200  -  total flux cleaned = 0.00181361 Jy
! Component: 1250  -  total flux cleaned = 0.00199035 Jy
! Component: 1300  -  total flux cleaned = 0.00216528 Jy
! Component: 1350  -  total flux cleaned = 0.00228111 Jy
! Component: 1400  -  total flux cleaned = 0.00245348 Jy
! Component: 1450  -  total flux cleaned = 0.00262372 Jy
! Component: 1500  -  total flux cleaned = 0.0029044 Jy
! Component: 1550  -  total flux cleaned = 0.00295947 Jy
! Component: 1600  -  total flux cleaned = 0.00318 Jy
! Component: 1650  -  total flux cleaned = 0.0032347 Jy
! Component: 1700  -  total flux cleaned = 0.00339768 Jy
! Component: 1750  -  total flux cleaned = 0.00366662 Jy
! Component: 1800  -  total flux cleaned = 0.00377303 Jy
! Component: 1850  -  total flux cleaned = 0.00393205 Jy
! Component: 1900  -  total flux cleaned = 0.0042464 Jy
! Component: 1950  -  total flux cleaned = 0.0044018 Jy
! Component: 2000  -  total flux cleaned = 0.00450508 Jy
! Total flux subtracted in 2048 components = 0.00465906 Jy
! Clean residual min=-0.003647 max=0.003150 Jy/beam
! Clean residual mean=0.000063 rms=0.000996 Jy/beam
! Combined flux in latest and established models = 2.48854 Jy
keep
! Adding 136 model components to the UV plane model.
! The established model now contains 283 components and 2.48854 Jy
wmap "J1608+1029_S_2003_06_18_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.859 x 5.39 at -0.5782 degrees (North through East)
! Clean map  min=-0.0047182  max=2.0636 Jy/beam
! Writing clean map to FITS file: J1608+1029_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 2.06365 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000994195 
device "J1608+1029_S_2003_06_18_pus\_map.eps/VPS"
! Attempting to open device: 'J1608+1029_S_2003_06_18_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.14453 0.14453 0.28906 0.578119 1.15624 2.31248 4.62495 9.24991 18.4998 36.9996 73.9993
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0029 
print "peak=",int(1000*peak_flux)/1000
! peak= 2.063 
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.859 x 5.39 at -0.5782 degrees (North through East)
! Clean map  min=-0.0047182  max=2.0636 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1608+1029_S_2003_06_18_pus\_map.gif/vgif"
! Attempting to open device: 'J1608+1029_S_2003_06_18_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1608+1029_S_2003_06_18_pus_uvs.log closed on Tue Jan 23 23:31:28 2007