! Started logfile: J1222+0413_S_2003_06_18_pus_uvs.log on Tue Jan 23 22:45:28 2007
obs J1222+0413_S_2003_06_18_pus_uva.fits
! Reading UV FITS file: J1222+0413_S_2003_06_18_pus_uva.fits
! AN table 1: 173 integrations on 153 of 153 possible baselines.
! AN table 2: 93 integrations on 153 of 153 possible baselines.
! AN table 3: 78 integrations on 153 of 153 possible baselines.
! AN table 4: 56 integrations on 153 of 153 possible baselines.
! AN table 5: 19 integrations on 153 of 153 possible baselines.
! Apparent sampling: 0.0723166 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1222+0413
! 
! 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 18544 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 2727 telescope corrections were flagged in sub-array 1.
!  A total of 976 telescope corrections were flagged in sub-array 2.
!  A total of 1197 telescope corrections were flagged in sub-array 3.
!  A total of 752 telescope corrections were flagged in sub-array 4.
!  A total of 342 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 2.
!  A total of 2727 telescope corrections were flagged in sub-array 1.
!  A total of 976 telescope corrections were flagged in sub-array 2.
!  A total of 1197 telescope corrections were flagged in sub-array 3.
!  A total of 752 telescope corrections were flagged in sub-array 4.
!  A total of 342 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 3.
!  A total of 2787 telescope corrections were flagged in sub-array 1.
!  A total of 976 telescope corrections were flagged in sub-array 2.
!  A total of 1197 telescope corrections were flagged in sub-array 3.
!  A total of 752 telescope corrections were flagged in sub-array 4.
!  A total of 342 telescope corrections were flagged in sub-array 5.
! 
! Correcting IF 4.
!  A total of 2787 telescope corrections were flagged in sub-array 1.
!  A total of 976 telescope corrections were flagged in sub-array 2.
!  A total of 1197 telescope corrections were flagged in sub-array 3.
!  A total of 752 telescope corrections were flagged in sub-array 4.
!  A total of 342 telescope corrections were flagged in sub-array 5.
! 
! Fit before self-cal, rms=0.886539Jy  sigma=0.010086
! Fit after  self-cal, rms=0.595454Jy  sigma=0.006850
! 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.092 mas, bmaj=6.646 mas, bpa=-2.138 degrees
! Estimated noise=797.13 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.315974 Jy
! Component: 100  -  total flux cleaned = 0.393133 Jy
! Total flux subtracted in 100 components = 0.393133 Jy
! Clean residual min=-0.014121 max=0.031074 Jy/beam
! Clean residual mean=0.000242 rms=0.004343 Jy/beam
! Combined flux in latest and established models = 0.393133 Jy
! Performing phase self-cal
! Adding 7 model components to the UV plane model.
! The established model now contains 7 components and 0.393133 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.210172Jy  sigma=0.002052
! Fit after  self-cal, rms=0.210091Jy  sigma=0.002052
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0324978 Jy
! Component: 100  -  total flux cleaned = 0.051307 Jy
! Total flux subtracted in 100 components = 0.051307 Jy
! Clean residual min=-0.012064 max=0.016455 Jy/beam
! Clean residual mean=0.000142 rms=0.003528 Jy/beam
! Combined flux in latest and established models = 0.44444 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 27 components and 0.44444 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.201272Jy  sigma=0.001941
! Fit after  self-cal, rms=0.201122Jy  sigma=0.001941
! 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.851 mas, bmaj=7.594 mas, bpa=-6.202 degrees
! Estimated noise=476.81 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.0225963 Jy
! Component: 100  -  total flux cleaned = 0.0336544 Jy
! Component: 150  -  total flux cleaned = 0.0393311 Jy
! Component: 200  -  total flux cleaned = 0.0422947 Jy
! Total flux subtracted in 200 components = 0.0422947 Jy
! Clean residual min=-0.010091 max=0.011298 Jy/beam
! Clean residual mean=0.000170 rms=0.003035 Jy/beam
! Combined flux in latest and established models = 0.486735 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 46 components and 0.486735 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.198750Jy  sigma=0.001912
! Fit after  self-cal, rms=0.198567Jy  sigma=0.001912
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 21 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.92     FD        1.00*    GG        1.00*    HN        1.05     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.00*    NL        1.14     ON        1.10     OV        1.00*    
!   PT        1.00*    SC        0.94     TC        1.00*    TS        1.08     
!   WF        1.09     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        0.96     GG        1.00*    HN        1.00*    
!   KK        1.12     KP        0.96     LA        0.99     MA        1.00*    
!   MK        0.96     NL        1.07     ON        1.00*    OV        0.83     
!   PT        0.97     SC        1.00*    TC        1.00*    TS        1.08     
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.09     FD        1.04     GG        1.00*    HN        0.73     
!   KK        1.00*    KP        1.00*    LA        1.03     MA        1.00*    
!   MK        1.00*    NL        1.08     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        0.92     TC        1.00*    TS        1.00*    
!   WF        1.00*    WZ        1.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.02     GG        1.00*    HN        0.96     
!   KK        1.00*    KP        1.03     LA        0.93     MA        1.00*    
!   MK        1.00*    NL        1.04     ON        1.00*    OV        1.00*    
!   PT        1.00     SC        0.86     TC        1.00*    TS        1.00*    
!   WF        1.00     WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 5:
!   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*    
! 
! 
! Correcting IF 2.
!  A total of 21 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.87     FD        1.00*    GG        1.00*    HN        1.21     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.00*    NL        1.07     ON        1.05     OV        1.00*    
!   PT        1.00*    SC        0.96     TC        1.00*    TS        1.02     
!   WF        1.08     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        1.00     GG        1.00*    HN        1.00*    
!   KK        1.11     KP        1.02     LA        0.98     MA        1.00*    
!   MK        0.99     NL        1.01     ON        1.00*    OV        0.87     
!   PT        0.97     SC        1.00*    TC        1.00*    TS        1.02     
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.11     FD        1.04     GG        1.00*    HN        0.98     
!   KK        1.00*    KP        1.00*    LA        1.04     MA        1.00*    
!   MK        1.00*    NL        1.00     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        0.88     TC        1.00*    TS        1.00*    
!   WF        1.00*    WZ        1.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.06     GG        1.00*    HN        1.06     
!   KK        1.00*    KP        1.06     LA        0.95     MA        1.00*    
!   MK        1.00*    NL        0.98     ON        1.00*    OV        1.00*    
!   PT        0.97     SC        0.96     TC        1.00*    TS        1.00*    
!   WF        0.97     WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 5:
!   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*    
! 
! 
! Correcting IF 3.
!  A total of 51 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.97     FD        1.00*    GG        1.00*    HN        1.20     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.00*    NL        1.06     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.18     TC        1.00*    TS        1.02     
!   WF        0.94     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.95     FD        0.99     GG        1.00*    HN        1.00*    
!   KK        1.12     KP        1.02     LA        0.96     MA        1.00*    
!   MK        0.98     NL        1.05     ON        1.00*    OV        0.98     
!   PT        0.98     SC        1.00*    TC        1.00*    TS        1.02     
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.06     FD        1.04     GG        1.00*    HN        0.93     
!   KK        1.00*    KP        1.00*    LA        0.99     MA        1.00*    
!   MK        1.00*    NL        1.07     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        0.98     TC        1.00*    TS        1.00*    
!   WF        1.00*    WZ        1.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.03     GG        1.00*    HN        1.02     
!   KK        1.00*    KP        1.11     LA        0.90     MA        1.00*    
!   MK        1.00*    NL        1.00     ON        1.00*    OV        1.00*    
!   PT        1.02     SC        1.07     TC        1.00*    TS        1.00*    
!   WF        1.01     WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 5:
!   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*    
! 
! 
! Correcting IF 4.
!  A total of 51 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.93     FD        1.00*    GG        1.00*    HN        1.10     
!   KK        1.00*    KP        1.00*    LA        1.00*    MA        1.00*    
!   MK        1.00*    NL        1.12     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.04     TC        1.00*    TS        1.03     
!   WF        0.98     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.93     FD        0.99     GG        1.00*    HN        1.00*    
!   KK        1.14     KP        1.07     LA        0.97     MA        1.00*    
!   MK        0.92     NL        1.05     ON        1.00*    OV        0.96     
!   PT        1.03     SC        1.00*    TC        1.00*    TS        1.03     
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.07     FD        1.00     GG        1.00*    HN        0.80     
!   KK        1.00*    KP        1.00*    LA        1.04     MA        1.00*    
!   MK        1.00*    NL        1.09     ON        1.00*    OV        1.00*    
!   PT        1.00*    SC        1.01     TC        1.00*    TS        1.00*    
!   WF        1.00*    WZ        1.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.04     GG        1.00*    HN        0.99     
!   KK        1.00*    KP        1.12     LA        0.90     MA        1.00*    
!   MK        1.00*    NL        1.08     ON        1.00*    OV        1.00*    
!   PT        1.05     SC        1.03     TC        1.00*    TS        1.00*    
!   WF        1.00     WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 5:
!   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*    
! 
! 
! Fit before self-cal, rms=0.198567Jy  sigma=0.001912
! Fit after  self-cal, rms=0.202419Jy  sigma=0.001852
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.904 mas, bmaj=7.64 mas, bpa=-6.411 degrees
! Estimated noise=482.01 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.000883116 Jy
! Component: 100  -  total flux cleaned = -0.000779901 Jy
! Component: 150  -  total flux cleaned = -0.000694475 Jy
! Component: 200  -  total flux cleaned = -0.000629998 Jy
! Total flux subtracted in 200 components = -0.000629999 Jy
! Clean residual min=-0.007253 max=0.007278 Jy/beam
! Clean residual mean=0.000522 rms=0.001800 Jy/beam
! Combined flux in latest and established models = 0.486105 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 64 components and 0.486105 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.202247Jy  sigma=0.001851
! Fit after  self-cal, rms=0.202399Jy  sigma=0.001850
! 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.202399Jy  sigma=0.001850
! Fit after  self-cal, rms=0.206302Jy  sigma=0.001845
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.913 mas, bmaj=7.635 mas, bpa=-6.379 degrees
! Estimated noise=483.968 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000902271 Jy
! Component: 100  -  total flux cleaned = 0.000994785 Jy
! Component: 150  -  total flux cleaned = 0.00106389 Jy
! Component: 200  -  total flux cleaned = 0.00106106 Jy
! Total flux subtracted in 200 components = 0.00106106 Jy
! Clean residual min=-0.007003 max=0.006473 Jy/beam
! Clean residual mean=0.000269 rms=0.001596 Jy/beam
! Combined flux in latest and established models = 0.487166 Jy
selfcal
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 67 components and 0.487166 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.206191Jy  sigma=0.001845
! Fit after  self-cal, rms=0.206585Jy  sigma=0.001844
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.000145694 Jy
! Component: 100  -  total flux cleaned = 0.000144692 Jy
! Component: 150  -  total flux cleaned = 0.000101453 Jy
! Component: 200  -  total flux cleaned = 6.34671e-05 Jy
! Total flux subtracted in 200 components = 6.34671e-05 Jy
! Clean residual min=-0.006888 max=0.006384 Jy/beam
! Clean residual mean=0.000313 rms=0.001594 Jy/beam
! Combined flux in latest and established models = 0.487229 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 71 components and 0.487229 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.206555Jy  sigma=0.001844
! Fit after  self-cal, rms=0.206545Jy  sigma=0.001844
! 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.206545Jy  sigma=0.001844
! Fit after  self-cal, rms=0.204074Jy  sigma=0.001791
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.914 mas, bmaj=7.637 mas, bpa=-6.509 degrees
! Estimated noise=484.056 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000373729 Jy
! Component: 100  -  total flux cleaned = 0.00040913 Jy
! Component: 150  -  total flux cleaned = 0.000441488 Jy
! Component: 200  -  total flux cleaned = 0.000468868 Jy
! Total flux subtracted in 200 components = 0.000468868 Jy
! Clean residual min=-0.002785 max=0.003138 Jy/beam
! Clean residual mean=0.000274 rms=0.000815 Jy/beam
! Combined flux in latest and established models = 0.487698 Jy
selfcal
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 79 components and 0.487698 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.204063Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204149Jy  sigma=0.001791
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 = 1.96414e-06 Jy
! Component: 100  -  total flux cleaned = 4.50538e-05 Jy
! Component: 150  -  total flux cleaned = 8.43739e-05 Jy
! Component: 200  -  total flux cleaned = 0.000102464 Jy
! Total flux subtracted in 200 components = 0.000102464 Jy
! Clean residual min=-0.002768 max=0.003123 Jy/beam
! Clean residual mean=0.000278 rms=0.000813 Jy/beam
! Combined flux in latest and established models = 0.487801 Jy
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 85 components and 0.487801 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.204146Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204149Jy  sigma=0.001791
! 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.204149Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204248Jy  sigma=0.001791
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=8.694 mas, bmaj=10.93 mas, bpa=1.96 degrees
! Estimated noise=621.857 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000353204 Jy
! Component: 100  -  total flux cleaned = 0.000467365 Jy
! Component: 150  -  total flux cleaned = 0.000531877 Jy
! Component: 200  -  total flux cleaned = 0.000615784 Jy
! Total flux subtracted in 200 components = 0.000615784 Jy
! Clean residual min=-0.002485 max=0.003456 Jy/beam
! Clean residual mean=0.000547 rms=0.000992 Jy/beam
! Combined flux in latest and established models = 0.488416 Jy
selfcal
! Performing phase self-cal
! Adding 5 model components to the UV plane model.
! The established model now contains 86 components and 0.488416 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.204255Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204259Jy  sigma=0.001791
flux_cutoff = imstat(rms) * dynam
! Inverting map 
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -8.14252e-06 Jy
! Component: 100  -  total flux cleaned = 7.72435e-05 Jy
! Component: 150  -  total flux cleaned = 0.000125383 Jy
! Component: 200  -  total flux cleaned = 0.000167067 Jy
! Total flux subtracted in 200 components = 0.000167067 Jy
! Clean residual min=-0.002487 max=0.003452 Jy/beam
! Clean residual mean=0.000546 rms=0.000990 Jy/beam
! Combined flux in latest and established models = 0.488583 Jy
! Performing phase self-cal
! Adding 4 model components to the UV plane model.
! The established model now contains 87 components and 0.488583 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.204269Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204265Jy  sigma=0.001791
! 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.918 mas, bmaj=7.639 mas, bpa=-6.578 degrees
! Estimated noise=484.494 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.918 x 7.639 at -6.578 degrees (North through East)
! Clean map  min=-0.0025092  max=0.4367 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
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.123 mas, bmaj=6.614 mas, bpa=-2.597 degrees
! Estimated noise=830.577 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.326305 Jy
! Component: 100  -  total flux cleaned = 0.404034 Jy
! Component: 150  -  total flux cleaned = 0.436458 Jy
! Component: 200  -  total flux cleaned = 0.453898 Jy
! Total flux subtracted in 200 components = 0.453898 Jy
! Clean residual min=-0.007469 max=0.009200 Jy/beam
! Clean residual mean=0.000123 rms=0.001999 Jy/beam
! Combined flux in latest and established models = 0.453898 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 23 model components to the UV plane model.
! The established model now contains 23 components and 0.453899 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.918 mas, bmaj=7.639 mas, bpa=-6.578 degrees
! Estimated noise=484.494 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.017403 Jy
! Component: 100  -  total flux cleaned = 0.0260663 Jy
! Component: 150  -  total flux cleaned = 0.0305076 Jy
! Component: 200  -  total flux cleaned = 0.03282 Jy
! Total flux subtracted in 200 components = 0.03282 Jy
! Clean residual min=-0.002711 max=0.003224 Jy/beam
! Clean residual mean=0.000299 rms=0.000818 Jy/beam
! Combined flux in latest and established models = 0.486719 Jy
! Adding 21 model components to the UV plane model.
! The established model now contains 37 components and 0.486719 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.694 mas, bmaj=10.93 mas, bpa=1.96 degrees
! Estimated noise=621.857 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00163651 Jy
! Component: 100  -  total flux cleaned = 0.00189266 Jy
! Component: 150  -  total flux cleaned = 0.00193616 Jy
! Component: 200  -  total flux cleaned = 0.0019738 Jy
! Total flux subtracted in 200 components = 0.0019738 Jy
! Clean residual min=-0.002494 max=0.003449 Jy/beam
! Clean residual mean=0.000543 rms=0.000994 Jy/beam
! Combined flux in latest and established models = 0.488692 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.80394e-05 Jy
! Component: 100  -  total flux cleaned = 7.52529e-05 Jy
! Component: 150  -  total flux cleaned = 9.88571e-05 Jy
! Component: 200  -  total flux cleaned = 0.000119856 Jy
! Total flux subtracted in 200 components = 0.000119856 Jy
! Clean residual min=-0.002483 max=0.003446 Jy/beam
! Clean residual mean=0.000538 rms=0.000991 Jy/beam
! Combined flux in latest and established models = 0.488812 Jy
! Adding 9 model components to the UV plane model.
! The established model now contains 43 components and 0.488812 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.918 mas, bmaj=7.639 mas, bpa=-6.578 degrees
! Estimated noise=484.494 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000160508 Jy
! Component: 100  -  total flux cleaned = -1.78417e-05 Jy
! Component: 150  -  total flux cleaned = -0.000122656 Jy
! Component: 200  -  total flux cleaned = -0.000207995 Jy
! Total flux subtracted in 200 components = -0.000207995 Jy
! Clean residual min=-0.002606 max=0.003203 Jy/beam
! Clean residual mean=0.000266 rms=0.000810 Jy/beam
! Combined flux in latest and established models = 0.488604 Jy
selfcal
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 49 components and 0.488604 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.204271Jy  sigma=0.001791
! Fit after  self-cal, rms=0.204280Jy  sigma=0.001791
wmodel J1222+0413_S_2003_06_18_pus_map.mod
! Writing 49 model components to file: J1222+0413_S_2003_06_18_pus_map.mod
wobs J1222+0413_S_2003_06_18_pus_uvs.fits
! Writing UV FITS file: J1222+0413_S_2003_06_18_pus_uvs.fits
wwins J1222+0413_S_2003_06_18_pus_map.win
! wwins: Wrote 1 windows to J1222+0413_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.00140197 Jy
! Component: 100  -  total flux cleaned = 0.00257596 Jy
! Component: 150  -  total flux cleaned = 0.00348914 Jy
! Component: 200  -  total flux cleaned = 0.00417669 Jy
! Component: 250  -  total flux cleaned = 0.00479411 Jy
! Component: 300  -  total flux cleaned = 0.00522015 Jy
! Component: 350  -  total flux cleaned = 0.00575753 Jy
! Component: 400  -  total flux cleaned = 0.00620049 Jy
! Component: 450  -  total flux cleaned = 0.00663315 Jy
! Component: 500  -  total flux cleaned = 0.00705592 Jy
! Component: 550  -  total flux cleaned = 0.00743248 Jy
! Component: 600  -  total flux cleaned = 0.0077649 Jy
! Component: 650  -  total flux cleaned = 0.00805446 Jy
! Component: 700  -  total flux cleaned = 0.0083036 Jy
! Component: 750  -  total flux cleaned = 0.00858338 Jy
! Component: 800  -  total flux cleaned = 0.00885882 Jy
! Component: 850  -  total flux cleaned = 0.00906213 Jy
! Component: 900  -  total flux cleaned = 0.00932909 Jy
! Component: 950  -  total flux cleaned = 0.00962437 Jy
! Component: 1000  -  total flux cleaned = 0.0098182 Jy
! Component: 1050  -  total flux cleaned = 0.0101365 Jy
! Component: 1100  -  total flux cleaned = 0.0103244 Jy
! Component: 1150  -  total flux cleaned = 0.01051 Jy
! Component: 1200  -  total flux cleaned = 0.0107234 Jy
! Component: 1250  -  total flux cleaned = 0.0109639 Jy
! Component: 1300  -  total flux cleaned = 0.0111415 Jy
! Component: 1350  -  total flux cleaned = 0.0113463 Jy
! Component: 1400  -  total flux cleaned = 0.0114907 Jy
! Component: 1450  -  total flux cleaned = 0.0116909 Jy
! Component: 1500  -  total flux cleaned = 0.0118606 Jy
! Component: 1550  -  total flux cleaned = 0.0120561 Jy
! Component: 1600  -  total flux cleaned = 0.0122219 Jy
! Component: 1650  -  total flux cleaned = 0.0123855 Jy
! Component: 1700  -  total flux cleaned = 0.0125474 Jy
! Component: 1750  -  total flux cleaned = 0.012654 Jy
! Component: 1800  -  total flux cleaned = 0.0128127 Jy
! Component: 1850  -  total flux cleaned = 0.0129431 Jy
! Component: 1900  -  total flux cleaned = 0.013124 Jy
! Component: 1950  -  total flux cleaned = 0.0132263 Jy
! Component: 2000  -  total flux cleaned = 0.0134035 Jy
! Total flux subtracted in 2048 components = 0.0134787 Jy
! Clean residual min=-0.001529 max=0.001755 Jy/beam
! Clean residual mean=0.000057 rms=0.000510 Jy/beam
! Combined flux in latest and established models = 0.502083 Jy
keep
! Adding 145 model components to the UV plane model.
! The established model now contains 194 components and 0.502083 Jy
wmap "J1222+0413_S_2003_06_18_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.918 x 7.639 at -6.578 degrees (North through East)
! Clean map  min=-0.0021809  max=0.43727 Jy/beam
! Writing clean map to FITS file: J1222+0413_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 0.437273 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000509607 
device "J1222+0413_S_2003_06_18_pus\_map.eps/VPS"
! Attempting to open device: 'J1222+0413_S_2003_06_18_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.349626 0.349626 0.699251 1.3985 2.79701 5.59401 11.188 22.376 44.7521 89.5042
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0015 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.437 
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.918 x 7.639 at -6.578 degrees (North through East)
! Clean map  min=-0.0021809  max=0.43727 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1222+0413_S_2003_06_18_pus\_map.gif/vgif"
! Attempting to open device: 'J1222+0413_S_2003_06_18_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1222+0413_S_2003_06_18_pus_uvs.log closed on Tue Jan 23 22:47:07 2007