! Started logfile: J1740+5211_S_2003_05_07_pus_uvs.log on Sun Dec 24 11:45:10 2006
obs J1740+5211_S_2003_05_07_pus_uva.fits
! Reading UV FITS file: J1740+5211_S_2003_05_07_pus_uva.fits
! AN table 1: 152 integrations on 171 of 171 possible baselines.
! AN table 2: 17 integrations on 171 of 171 possible baselines.
! AN table 3: 38 integrations on 171 of 171 possible baselines.
! AN table 4: 112 integrations on 171 of 171 possible baselines.
! AN table 5: 168 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.113837 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1740+5211
! 
! 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 37920 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 1903 telescope corrections were flagged in sub-array 1.
!  A total of 323 telescope corrections were flagged in sub-array 2.
!  A total of 439 telescope corrections were flagged in sub-array 3.
!  A total of 1528 telescope corrections were flagged in sub-array 4.
!  A total of 2759 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 1903 telescope corrections were flagged in sub-array 1.
!  A total of 323 telescope corrections were flagged in sub-array 2.
!  A total of 439 telescope corrections were flagged in sub-array 3.
!  A total of 1561 telescope corrections were flagged in sub-array 4.
!  A total of 2814 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 1903 telescope corrections were flagged in sub-array 1.
!  A total of 323 telescope corrections were flagged in sub-array 2.
!  A total of 439 telescope corrections were flagged in sub-array 3.
!  A total of 1558 telescope corrections were flagged in sub-array 4.
!  A total of 2814 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 1916 telescope corrections were flagged in sub-array 1.
!  A total of 323 telescope corrections were flagged in sub-array 2.
!  A total of 439 telescope corrections were flagged in sub-array 3.
!  A total of 1525 telescope corrections were flagged in sub-array 4.
!  A total of 2759 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=0.950398Jy  sigma=0.006915
! Fit after  self-cal, rms=0.332252Jy  sigma=0.001839
! 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.864 mas, bmaj=2.473 mas, bpa=-9.084 degrees
! Estimated noise=1212.03 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.735714 Jy
! Component: 100  -  total flux cleaned = 0.902499 Jy
! Total flux subtracted in 100 components = 0.902499 Jy
! Clean residual min=-0.023444 max=0.062434 Jy/beam
! Clean residual mean=0.000124 rms=0.006169 Jy/beam
! Combined flux in latest and established models = 0.902499 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 8 components and 0.902499 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.344955Jy  sigma=0.002060
! Fit after  self-cal, rms=0.344899Jy  sigma=0.002060
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0750593 Jy
! Component: 100  -  total flux cleaned = 0.123451 Jy
! Total flux subtracted in 100 components = 0.123451 Jy
! Clean residual min=-0.020538 max=0.026383 Jy/beam
! Clean residual mean=0.000014 rms=0.004928 Jy/beam
! Combined flux in latest and established models = 1.02595 Jy
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 22 components and 1.02595 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.321759Jy  sigma=0.001750
! Fit after  self-cal, rms=0.321598Jy  sigma=0.001750
! 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.611 mas, bmaj=3.115 mas, bpa=-26.92 degrees
! Estimated noise=554 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.0479354 Jy
! Component: 100  -  total flux cleaned = 0.0704464 Jy
! Component: 150  -  total flux cleaned = 0.0816936 Jy
! Component: 200  -  total flux cleaned = 0.0873976 Jy
! Total flux subtracted in 200 components = 0.0873976 Jy
! Clean residual min=-0.018638 max=0.021067 Jy/beam
! Clean residual mean=-0.000982 rms=0.005383 Jy/beam
! Combined flux in latest and established models = 1.11335 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 31 components and 1.11335 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.318623Jy  sigma=0.001659
! Fit after  self-cal, rms=0.318477Jy  sigma=0.001658
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 48 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.97     FD        0.97     GG        1.00*    HN        1.05     
!   KK        0.96     KP        0.97     LA        1.01     MA        0.86     
!   MC        0.99     MK        1.08     NL        0.86     ON        1.00     
!   OV        0.96     PT        0.97     SC        0.91     TC        1.00*    
!   TS        1.05     WF        1.00     WZ        1.08     
! 
!  Telescope amplitude corrections in sub-array 2:
!   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 3:
!   BR        1.04     FD        1.09     GG        1.00*    HN        0.68     
!   KK        1.00*    KP        1.24     LA        1.07     MA        1.00*    
!   MC        1.00*    MK        1.00*    NL        1.01     ON        1.02     
!   OV        1.14     PT        1.07     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  A total of 15 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.00     FD        1.04     GG        1.00*    HN        0.89     
!   KK        1.00*    KP        1.18     LA        1.08     MA        1.86     
!   MC        0.95     MK        1.00*    NL        0.99     ON        1.01     
!   OV        1.19     PT        1.07     SC        0.94     TC        1.00*    
!   TS        1.09     WF        1.06     WZ        1.01     
! 
!  A total of 54 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.06     FD        1.00*    GG        1.00*    HN        0.92     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        0.92     
!   MC        0.99     MK        1.00*    NL        1.00     ON        1.00     
!   OV        1.00*    PT        1.00*    SC        0.97     TC        1.00*    
!   TS        0.95     WF        1.04     WZ        0.97     
! 
! 
! Correcting IF 2.
!  A total of 48 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        0.99     GG        1.00*    HN        1.08     
!   KK        1.34     KP        0.91     LA        0.94     MA        1.05     
!   MC        1.06     MK        1.31     NL        0.89     ON        1.10     
!   OV        0.85     PT        0.93     SC        0.94     TC        1.00*    
!   TS        1.13     WF        1.11     WZ        1.05     
! 
!  Telescope amplitude corrections in sub-array 2:
!   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 3:
!   BR        1.10     FD        1.11     GG        1.00*    HN        0.88     
!   KK        1.00*    KP        1.08     LA        1.01     MA        1.00*    
!   MC        1.00*    MK        1.00*    NL        1.01     ON        1.01     
!   OV        1.08     PT        1.04     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  A total of 39 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.08     FD        1.07     GG        1.00*    HN        1.01     
!   KK        1.00*    KP        1.11     LA        1.04     MA        1.15     
!   MC        0.94     MK        1.00*    NL        1.03     ON        1.09     
!   OV        1.01     PT        1.06     SC        0.97     TC        1.00*    
!   TS        1.00*    WF        1.04     WZ        1.00     
! 
!  A total of 42 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.10     FD        1.00*    GG        1.00*    HN        0.97     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.07     
!   MC        1.09     MK        1.00*    NL        1.03     ON        1.10     
!   OV        1.00*    PT        1.00*    SC        0.97     TC        1.00*    
!   TS        1.00*    WF        1.02     WZ        1.09     
! 
! 
! Correcting IF 3.
!  A total of 48 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.99     FD        0.94     GG        1.00*    HN        1.09     
!   KK        0.99     KP        0.93     LA        0.95     MA        1.09     
!   MC        0.98     MK        0.91     NL        0.89     ON        1.08     
!   OV        0.84     PT        0.96     SC        1.05     TC        1.00*    
!   TS        1.07     WF        1.08     WZ        1.10     
! 
!  Telescope amplitude corrections in sub-array 2:
!   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 3:
!   BR        1.05     FD        1.04     GG        1.00*    HN        0.88     
!   KK        1.00*    KP        1.09     LA        1.01     MA        1.00*    
!   MC        1.00*    MK        1.00*    NL        1.02     ON        1.04     
!   OV        0.94     PT        1.07     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  A total of 42 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.02     FD        1.03     GG        1.00*    HN        1.00     
!   KK        1.00*    KP        1.11     LA        1.03     MA        1.19     
!   MC        1.03     MK        1.00*    NL        1.04     ON        1.05     
!   OV        1.01     PT        1.08     SC        1.08     TC        1.00*    
!   TS        1.00*    WF        1.03     WZ        1.01     
! 
!  A total of 42 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.04     FD        1.00*    GG        1.00*    HN        0.98     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.01     
!   MC        0.92     MK        1.00*    NL        1.04     ON        1.07     
!   OV        1.00*    PT        1.00*    SC        1.15     TC        1.00*    
!   TS        1.00*    WF        1.00     WZ        1.04     
! 
! 
! Correcting IF 4.
!  A total of 51 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.98     FD        0.95     GG        1.00*    HN        1.09     
!   KK        0.96     KP        0.91     LA        0.94     MA        1.16     
!   MC        1.06     MK        0.93     NL        0.83     ON        1.00     
!   OV        0.86     PT        0.91     SC        1.06     TC        1.00*    
!   TS        1.05     WF        1.07     WZ        1.07     
! 
!  Telescope amplitude corrections in sub-array 2:
!   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 3:
!   BR        1.05     FD        1.04     GG        1.00*    HN        0.92     
!   KK        1.00*    KP        1.05     LA        1.01     MA        1.00*    
!   MC        1.00*    MK        1.00*    NL        0.95     ON        0.93     
!   OV        0.78     PT        0.99     SC        1.00*    TC        1.00*    
!   TS        1.00*    WF        1.00*    WZ        1.00*    
! 
!  A total of 18 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   BR        1.01     FD        1.02     GG        1.00*    HN        0.98     
!   KK        1.00*    KP        1.08     LA        1.03     MA        0.93     
!   MC        0.85     MK        1.00*    NL        0.96     ON        0.95     
!   OV        1.23     PT        1.03     SC        1.08     TC        1.00*    
!   TS        1.09     WF        1.05     WZ        0.98     
! 
!  A total of 54 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   BR        1.03     FD        1.00*    GG        1.00*    HN        0.92     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        0.92     
!   MC        1.28     MK        1.00*    NL        1.00     ON        0.97     
!   OV        1.00*    PT        1.00*    SC        1.13     TC        1.00*    
!   TS        0.95     WF        1.00     WZ        0.99     
! 
! 
! Fit before self-cal, rms=0.318477Jy  sigma=0.001658
! Fit after  self-cal, rms=0.312571Jy  sigma=0.001398
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.642 mas, bmaj=3.151 mas, bpa=-29.53 degrees
! Estimated noise=554.374 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.00660093 Jy
! Component: 100  -  total flux cleaned = -0.00833055 Jy
! Component: 150  -  total flux cleaned = -0.00872054 Jy
! Component: 200  -  total flux cleaned = -0.00913151 Jy
! Total flux subtracted in 200 components = -0.00913151 Jy
! Clean residual min=-0.006437 max=0.008274 Jy/beam
! Clean residual mean=0.000818 rms=0.001972 Jy/beam
! Combined flux in latest and established models = 1.10422 Jy
! Performing phase self-cal
! Adding 10 model components to the UV plane model.
! The established model now contains 38 components and 1.10422 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.312340Jy  sigma=0.001397
! Fit after  self-cal, rms=0.312617Jy  sigma=0.001397
! 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.312617Jy  sigma=0.001397
! Fit after  self-cal, rms=0.309236Jy  sigma=0.001334
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.647 mas, bmaj=3.156 mas, bpa=-29.76 degrees
! Estimated noise=553.996 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00279872 Jy
! Component: 100  -  total flux cleaned = -0.00308477 Jy
! Component: 150  -  total flux cleaned = -0.0031634 Jy
! Component: 200  -  total flux cleaned = -0.00330673 Jy
! Total flux subtracted in 200 components = -0.00330673 Jy
! Clean residual min=-0.003836 max=0.009686 Jy/beam
! Clean residual mean=0.000575 rms=0.001222 Jy/beam
! Combined flux in latest and established models = 1.10091 Jy
selfcal
! Performing phase self-cal
! Adding 10 model components to the UV plane model.
! The established model now contains 40 components and 1.10091 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.309164Jy  sigma=0.001333
! Fit after  self-cal, rms=0.309243Jy  sigma=0.001333
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 (2.5, 5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00889204 Jy
! Component: 100  -  total flux cleaned = 0.0123449 Jy
! Component: 150  -  total flux cleaned = 0.0132549 Jy
! Component: 200  -  total flux cleaned = 0.0137903 Jy
! Total flux subtracted in 200 components = 0.0137903 Jy
! Clean residual min=-0.004037 max=0.004388 Jy/beam
! Clean residual mean=0.000301 rms=0.001070 Jy/beam
! Combined flux in latest and established models = 1.1147 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 59 components and 1.1147 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308943Jy  sigma=0.001330
! Fit after  self-cal, rms=0.308899Jy  sigma=0.001330
! 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.308899Jy  sigma=0.001330
! Fit after  self-cal, rms=0.308308Jy  sigma=0.001316
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.646 mas, bmaj=3.158 mas, bpa=-29.98 degrees
! Estimated noise=553.885 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00324594 Jy
! Component: 100  -  total flux cleaned = 0.00358961 Jy
! Component: 150  -  total flux cleaned = 0.00395696 Jy
! Component: 200  -  total flux cleaned = 0.00410854 Jy
! Total flux subtracted in 200 components = 0.00410854 Jy
! Clean residual min=-0.003160 max=0.003752 Jy/beam
! Clean residual mean=0.000344 rms=0.000894 Jy/beam
! Combined flux in latest and established models = 1.11881 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 71 components and 1.11881 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308196Jy  sigma=0.001315
! Fit after  self-cal, rms=0.308179Jy  sigma=0.001315
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 (9.5, 12.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00415134 Jy
! Component: 100  -  total flux cleaned = 0.00526507 Jy
! Component: 150  -  total flux cleaned = 0.00582254 Jy
! Component: 200  -  total flux cleaned = 0.00582303 Jy
! Total flux subtracted in 200 components = 0.00582303 Jy
! Clean residual min=-0.003178 max=0.003579 Jy/beam
! Clean residual mean=0.000231 rms=0.000852 Jy/beam
! Combined flux in latest and established models = 1.12463 Jy
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 86 components and 1.12463 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308075Jy  sigma=0.001314
! Fit after  self-cal, rms=0.308082Jy  sigma=0.001314
! 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.308082Jy  sigma=0.001314
! Fit after  self-cal, rms=0.308219Jy  sigma=0.001314
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=8.749 mas, bmaj=10.13 mas, bpa=-57.4 degrees
! Estimated noise=761.691 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00298383 Jy
! Component: 100  -  total flux cleaned = 0.00362003 Jy
! Component: 150  -  total flux cleaned = 0.00408616 Jy
! Component: 200  -  total flux cleaned = 0.0044316 Jy
! Total flux subtracted in 200 components = 0.0044316 Jy
! Clean residual min=-0.002841 max=0.003176 Jy/beam
! Clean residual mean=0.000500 rms=0.001038 Jy/beam
! Combined flux in latest and established models = 1.12906 Jy
selfcal
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 106 components and 1.12906 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308194Jy  sigma=0.001314
! Fit after  self-cal, rms=0.308201Jy  sigma=0.001314
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.000501713 Jy
! Component: 100  -  total flux cleaned = 0.000838542 Jy
! Component: 150  -  total flux cleaned = 0.00112652 Jy
! Component: 200  -  total flux cleaned = 0.00131646 Jy
! Total flux subtracted in 200 components = 0.00131646 Jy
! Clean residual min=-0.002810 max=0.003135 Jy/beam
! Clean residual mean=0.000432 rms=0.001035 Jy/beam
! Combined flux in latest and established models = 1.13038 Jy
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 121 components and 1.13038 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.308194Jy  sigma=0.001314
! Fit after  self-cal, rms=0.308199Jy  sigma=0.001314
! 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.646 mas, bmaj=3.16 mas, bpa=-30.05 degrees
! Estimated noise=553.652 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.646 x 3.16 at -30.05 degrees (North through East)
! Clean map  min=-0.0030022  max=0.99375 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.308199Jy  sigma=0.001314
! Fit after  self-cal, rms=0.325692Jy  sigma=0.001202
! Inverting map and beam 
! Estimated beam: bmin=2.647 mas, bmaj=3.162 mas, bpa=-29.95 degrees
! Estimated noise=553.418 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000439615 Jy
! Component: 100  -  total flux cleaned = -0.000356668 Jy
! Component: 150  -  total flux cleaned = -0.000288509 Jy
! Component: 200  -  total flux cleaned = -0.000288794 Jy
! Total flux subtracted in 200 components = -0.000288794 Jy
! Clean residual min=-0.002968 max=0.003192 Jy/beam
! Clean residual mean=0.000214 rms=0.000732 Jy/beam
! Combined flux in latest and established models = 1.13009 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 139 components and 1.13009 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.325644Jy  sigma=0.001202
! Fit after  self-cal, rms=0.325650Jy  sigma=0.001202
! Inverting map 
! Added new window around map position (-14, 46).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.002443 Jy
! Component: 100  -  total flux cleaned = 0.0030581 Jy
! Component: 150  -  total flux cleaned = 0.00318996 Jy
! Component: 200  -  total flux cleaned = 0.00319047 Jy
! Total flux subtracted in 200 components = 0.00319047 Jy
! Clean residual min=-0.003036 max=0.003037 Jy/beam
! Clean residual mean=0.000170 rms=0.000724 Jy/beam
! Combined flux in latest and established models = 1.13328 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 152 components and 1.13328 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.325583Jy  sigma=0.001202
! Fit after  self-cal, rms=0.325578Jy  sigma=0.001202
! 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.325578Jy  sigma=0.001202
! Fit after  self-cal, rms=0.325434Jy  sigma=0.001202
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.893 mas, bmaj=2.505 mas, bpa=-11.09 degrees
! Estimated noise=1240.54 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.745456 Jy
! Component: 100  -  total flux cleaned = 0.910063 Jy
! Component: 150  -  total flux cleaned = 0.970791 Jy
! Component: 200  -  total flux cleaned = 1.00817 Jy
! Total flux subtracted in 200 components = 1.00817 Jy
! Clean residual min=-0.008470 max=0.019905 Jy/beam
! Clean residual mean=0.000088 rms=0.002400 Jy/beam
! Combined flux in latest and established models = 1.00817 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 22 model components to the UV plane model.
! The established model now contains 22 components and 1.00817 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.648 mas, bmaj=3.165 mas, bpa=-30.08 degrees
! Estimated noise=553.063 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.0472616 Jy
! Component: 100  -  total flux cleaned = 0.0707846 Jy
! Component: 150  -  total flux cleaned = 0.0846405 Jy
! Component: 200  -  total flux cleaned = 0.0942691 Jy
! Total flux subtracted in 200 components = 0.0942691 Jy
! Clean residual min=-0.002804 max=0.005583 Jy/beam
! Clean residual mean=0.000738 rms=0.001052 Jy/beam
! Combined flux in latest and established models = 1.10244 Jy
! Adding 55 model components to the UV plane model.
! The established model now contains 66 components and 1.10244 Jy
! Inverting map 
! Added new window around map position (10, 7.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00703323 Jy
! Component: 100  -  total flux cleaned = 0.0123743 Jy
! Component: 150  -  total flux cleaned = 0.0166017 Jy
! Component: 200  -  total flux cleaned = 0.0200021 Jy
! Total flux subtracted in 200 components = 0.0200021 Jy
! Clean residual min=-0.002752 max=0.003137 Jy/beam
! Clean residual mean=0.000359 rms=0.000765 Jy/beam
! Combined flux in latest and established models = 1.12244 Jy
! Adding 46 model components to the UV plane model.
! The established model now contains 96 components and 1.12244 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.741 mas, bmaj=10.13 mas, bpa=-57.38 degrees
! Estimated noise=760.273 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00469156 Jy
! Component: 100  -  total flux cleaned = 0.00732335 Jy
! Component: 150  -  total flux cleaned = 0.00906623 Jy
! Component: 200  -  total flux cleaned = 0.0102976 Jy
! Total flux subtracted in 200 components = 0.0102976 Jy
! Clean residual min=-0.002604 max=0.003023 Jy/beam
! Clean residual mean=0.000429 rms=0.000896 Jy/beam
! Combined flux in latest and established models = 1.13274 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.000890272 Jy
! Component: 100  -  total flux cleaned = 0.00137387 Jy
! Component: 150  -  total flux cleaned = 0.00146491 Jy
! Component: 200  -  total flux cleaned = 0.0015712 Jy
! Total flux subtracted in 200 components = 0.0015712 Jy
! Clean residual min=-0.002654 max=0.003057 Jy/beam
! Clean residual mean=0.000356 rms=0.000890 Jy/beam
! Combined flux in latest and established models = 1.13431 Jy
! Adding 57 model components to the UV plane model.
! The established model now contains 140 components and 1.13431 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.648 mas, bmaj=3.165 mas, bpa=-30.08 degrees
! Estimated noise=553.063 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.44623e-05 Jy
! Component: 100  -  total flux cleaned = -0.000262577 Jy
! Component: 150  -  total flux cleaned = -0.00051092 Jy
! Component: 200  -  total flux cleaned = -0.000568307 Jy
! Total flux subtracted in 200 components = -0.000568307 Jy
! Clean residual min=-0.002813 max=0.003140 Jy/beam
! Clean residual mean=0.000148 rms=0.000702 Jy/beam
! Combined flux in latest and established models = 1.13374 Jy
selfcal
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 156 components and 1.13374 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.325302Jy  sigma=0.001201
! Fit after  self-cal, rms=0.325322Jy  sigma=0.001201
wmodel J1740+5211_S_2003_05_07_pus_map.mod
! Writing 156 model components to file: J1740+5211_S_2003_05_07_pus_map.mod
wobs J1740+5211_S_2003_05_07_pus_uvs.fits
! Writing UV FITS file: J1740+5211_S_2003_05_07_pus_uvs.fits
wwins J1740+5211_S_2003_05_07_pus_map.win
! wwins: Wrote 5 windows to J1740+5211_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.000999155 Jy
! Component: 100  -  total flux cleaned = 0.00159775 Jy
! Component: 150  -  total flux cleaned = 0.00225864 Jy
! Component: 200  -  total flux cleaned = 0.00294143 Jy
! Component: 250  -  total flux cleaned = 0.00365027 Jy
! Component: 300  -  total flux cleaned = 0.00429923 Jy
! Component: 350  -  total flux cleaned = 0.00493527 Jy
! Component: 400  -  total flux cleaned = 0.00547705 Jy
! Component: 450  -  total flux cleaned = 0.0059685 Jy
! Component: 500  -  total flux cleaned = 0.00637201 Jy
! Component: 550  -  total flux cleaned = 0.00673011 Jy
! Component: 600  -  total flux cleaned = 0.0070836 Jy
! Component: 650  -  total flux cleaned = 0.00743224 Jy
! Component: 700  -  total flux cleaned = 0.00769991 Jy
! Component: 750  -  total flux cleaned = 0.00788919 Jy
! Component: 800  -  total flux cleaned = 0.00815159 Jy
! Component: 850  -  total flux cleaned = 0.00829986 Jy
! Component: 900  -  total flux cleaned = 0.00848375 Jy
! Component: 950  -  total flux cleaned = 0.00866632 Jy
! Component: 1000  -  total flux cleaned = 0.00888327 Jy
! Component: 1050  -  total flux cleaned = 0.00902678 Jy
! Component: 1100  -  total flux cleaned = 0.00916909 Jy
! Component: 1150  -  total flux cleaned = 0.0092752 Jy
! Component: 1200  -  total flux cleaned = 0.00941577 Jy
! Component: 1250  -  total flux cleaned = 0.00955526 Jy
! Component: 1300  -  total flux cleaned = 0.00965908 Jy
! Component: 1350  -  total flux cleaned = 0.00983067 Jy
! Component: 1400  -  total flux cleaned = 0.00986468 Jy
! Component: 1450  -  total flux cleaned = 0.00996633 Jy
! Component: 1500  -  total flux cleaned = 0.010101 Jy
! Component: 1550  -  total flux cleaned = 0.010201 Jy
! Component: 1600  -  total flux cleaned = 0.0103339 Jy
! Component: 1650  -  total flux cleaned = 0.0104658 Jy
! Component: 1700  -  total flux cleaned = 0.0105313 Jy
! Component: 1750  -  total flux cleaned = 0.0105967 Jy
! Component: 1800  -  total flux cleaned = 0.010694 Jy
! Component: 1850  -  total flux cleaned = 0.0107909 Jy
! Component: 1900  -  total flux cleaned = 0.0109191 Jy
! Component: 1950  -  total flux cleaned = 0.0110463 Jy
! Component: 2000  -  total flux cleaned = 0.0110779 Jy
! Total flux subtracted in 2048 components = 0.011141 Jy
! Clean residual min=-0.001825 max=0.001740 Jy/beam
! Clean residual mean=-0.000014 rms=0.000575 Jy/beam
! Combined flux in latest and established models = 1.14488 Jy
keep
! Adding 143 model components to the UV plane model.
! The established model now contains 299 components and 1.14488 Jy
wmap "J1740+5211_S_2003_05_07_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.648 x 3.165 at -30.08 degrees (North through East)
! Clean map  min=-0.0024076  max=0.99253 Jy/beam
! Writing clean map to FITS file: J1740+5211_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 0.992527 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000573245 
device "J1740+5211_S_2003_05_07_pus\_map.eps/VPS"
! Attempting to open device: 'J1740+5211_S_2003_05_07_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.173268 0.173268 0.346537 0.693073 1.38615 2.77229 5.54459 11.0892 22.1784 44.3567 88.7134
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0017 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.992 
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.648 x 3.165 at -30.08 degrees (North through East)
! Clean map  min=-0.0024076  max=0.99253 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1740+5211_S_2003_05_07_pus\_map.gif/vgif"
! Attempting to open device: 'J1740+5211_S_2003_05_07_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1740+5211_S_2003_05_07_pus_uvs.log closed on Sun Dec 24 11:47:38 2006