! Started logfile: J2331-1556_S_2001_07_05_pus_uvs.log on Sat Aug 11 22:18:57 2007
obs J2331-1556_S_2001_07_05_pus_uva.fits
! Reading UV FITS file: J2331-1556_S_2001_07_05_pus_uva.fits
! AN table 1: 33 integrations on 171 of 171 possible baselines.
! AN table 2: 11 integrations on 171 of 171 possible baselines.
! AN table 3: 219 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.0824939 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J2331-1556
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! 
! 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.22997e+09        8e+06          1        8e+06
!  02        2  2.25997e+09        8e+06          1        8e+06
!  03        3  2.34997e+09        8e+06          1        8e+06
!  04        4  2.36997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 1774 lines of history.
! 
! Reading 14840 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
print "field_size =",field_size
! field_size = 1024 
print "field_cell =",field_cell
! field_cell = 0.5 
print "taper_size =",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 = 1024x1024 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 452 telescope corrections were flagged in sub-array 1.
!  A total of 209 telescope corrections were flagged in sub-array 2.
!  A total of 3363 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 452 telescope corrections were flagged in sub-array 1.
!  A total of 209 telescope corrections were flagged in sub-array 2.
!  A total of 3363 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 452 telescope corrections were flagged in sub-array 1.
!  A total of 209 telescope corrections were flagged in sub-array 2.
!  A total of 3363 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 452 telescope corrections were flagged in sub-array 1.
!  A total of 209 telescope corrections were flagged in sub-array 2.
!  A total of 3363 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=0.692327Jy  sigma=0.005695
! Fit after  self-cal, rms=0.391834Jy  sigma=0.003038
! 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.256 mas, bmaj=6.812 mas, bpa=0.2197 degrees
! Estimated noise=1130.92 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.636106 Jy
! Component: 100  -  total flux cleaned = 0.888928 Jy
! Total flux subtracted in 100 components = 0.888928 Jy
! Clean residual min=-0.032105 max=0.112441 Jy/beam
! Clean residual mean=0.000113 rms=0.008817 Jy/beam
! Combined flux in latest and established models = 0.888928 Jy
! Performing phase self-cal
! Adding 6 model components to the UV plane model.
! The established model now contains 6 components and 0.888928 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.285558Jy  sigma=0.002178
! Fit after  self-cal, rms=0.283757Jy  sigma=0.002164
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.122426 Jy
! Component: 100  -  total flux cleaned = 0.181215 Jy
! Total flux subtracted in 100 components = 0.181215 Jy
! Clean residual min=-0.018435 max=0.027574 Jy/beam
! Clean residual mean=0.000102 rms=0.004045 Jy/beam
! Combined flux in latest and established models = 1.07014 Jy
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 13 components and 1.07014 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.221161Jy  sigma=0.001588
! Fit after  self-cal, rms=0.220874Jy  sigma=0.001585
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0303879 Jy
! Component: 100  -  total flux cleaned = 0.04133 Jy
! Total flux subtracted in 100 components = 0.04133 Jy
! Clean residual min=-0.016793 max=0.022845 Jy/beam
! Clean residual mean=0.000100 rms=0.003514 Jy/beam
! Combined flux in latest and established models = 1.11147 Jy
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 23 components and 1.11147 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.216802Jy  sigma=0.001544
! Fit after  self-cal, rms=0.216801Jy  sigma=0.001544
! Inverting map 
! Added new window around map position (11.5, 5.5).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0226372 Jy
! Component: 100  -  total flux cleaned = 0.0347372 Jy
! Total flux subtracted in 100 components = 0.0347372 Jy
! Clean residual min=-0.017286 max=0.015675 Jy/beam
! Clean residual mean=0.000091 rms=0.003203 Jy/beam
! Combined flux in latest and established models = 1.14621 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 34 components and 1.14621 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.213942Jy  sigma=0.001519
! Fit after  self-cal, rms=0.213744Jy  sigma=0.001517
! 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.828 mas, bmaj=7.59 mas, bpa=-2.152 degrees
! Estimated noise=750.063 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 (51, 7.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0255568 Jy
! Component: 100  -  total flux cleaned = 0.0422573 Jy
! Component: 150  -  total flux cleaned = 0.054689 Jy
! Component: 200  -  total flux cleaned = 0.0641649 Jy
! Total flux subtracted in 200 components = 0.0641649 Jy
! Clean residual min=-0.014001 max=0.017751 Jy/beam
! Clean residual mean=0.000747 rms=0.003656 Jy/beam
! Combined flux in latest and established models = 1.21038 Jy
! Performing phase self-cal
! Adding 34 model components to the UV plane model.
! The established model now contains 63 components and 1.21038 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.209815Jy  sigma=0.001483
! Fit after  self-cal, rms=0.209444Jy  sigma=0.001479
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        1.08     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.97     KP        1.03     
!   LA        1.02     MC        1.00*    MK        0.96     NL        1.00*    
!   NY        1.00*    OV        1.04     PT        0.99     SC        1.00*    
!   TS        0.97     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MC        0.00*    MK        0.00*    NL        0.00*    
!   NY        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  A total of 150 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.03     FD        0.99     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.99     KK        1.01     KP        0.97     
!   LA        1.00     MC        1.00*    MK        0.99     NL        1.02     
!   NY        1.00*    OV        0.98     PT        0.99     SC        0.97     
!   TS        1.00*    WF        0.99     WZ        1.00*    
! 
! 
! Correcting IF 2.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.02     FD        1.10     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.95     KP        0.85     
!   LA        1.00     MC        1.00*    MK        0.94     NL        1.00*    
!   NY        1.00*    OV        1.02     PT        1.02     SC        1.00*    
!   TS        0.94     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MC        0.00*    MK        0.00*    NL        0.00*    
!   NY        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  A total of 150 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00     FD        1.01     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.98     KK        1.01     KP        1.01     
!   LA        0.96     MC        1.00*    MK        0.93     NL        0.99     
!   NY        1.00*    OV        1.02     PT        1.02     SC        0.97     
!   TS        1.00*    WF        1.01     WZ        1.00*    
! 
! 
! Correcting IF 3.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.06     FD        1.01     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.92     KP        1.07     
!   LA        1.02     MC        1.00*    MK        0.95     NL        1.00*    
!   NY        1.00*    OV        1.02     PT        1.00     SC        1.00*    
!   TS        0.90     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MC        0.00*    MK        0.00*    NL        0.00*    
!   NY        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  A total of 150 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.03     FD        0.95     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.02     KP        1.03     
!   LA        0.97     MC        1.00*    MK        0.97     NL        1.05     
!   NY        1.00*    OV        1.01     PT        0.97     SC        0.98     
!   TS        1.00*    WF        1.02     WZ        1.00*    
! 
! 
! Correcting IF 4.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.01     FD        1.06     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        1.00*    KK        0.97     KP        1.04     
!   LA        1.02     MC        1.00*    MK        0.92     NL        1.00*    
!   NY        1.00*    OV        0.99     PT        0.99     SC        1.00*    
!   TS        0.98     WF        1.00*    WZ        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.00*    FD        0.00*    GC        0.00*    GG        0.00*    
!   HH        0.00*    HN        0.00*    KK        0.00*    KP        0.00*    
!   LA        0.00*    MC        0.00*    MK        0.00*    NL        0.00*    
!   NY        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    WF        0.00*    WZ        0.00*    
! 
!  A total of 150 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.99     FD        0.98     GC        1.00*    GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.05     KP        1.07     
!   LA        0.98     MC        1.00*    MK        0.97     NL        1.02     
!   NY        1.00*    OV        1.01     PT        1.05     SC        0.95     
!   TS        1.00*    WF        0.99     WZ        1.00*    
! 
! 
! Fit before self-cal, rms=0.209444Jy  sigma=0.001479
! Fit after  self-cal, rms=0.196833Jy  sigma=0.001427
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.787 mas, bmaj=9.155 mas, bpa=-1.871 degrees
! Estimated noise=747.712 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 (15.5, 7).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0159211 Jy
! Component: 100  -  total flux cleaned = 0.0261495 Jy
! Component: 150  -  total flux cleaned = 0.0332711 Jy
! Component: 200  -  total flux cleaned = 0.0367685 Jy
! Total flux subtracted in 200 components = 0.0367685 Jy
! Clean residual min=-0.011212 max=0.009060 Jy/beam
! Clean residual mean=0.000441 rms=0.002681 Jy/beam
! Combined flux in latest and established models = 1.24714 Jy
! Performing phase self-cal
! Adding 38 model components to the UV plane model.
! The established model now contains 97 components and 1.24714 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.194937Jy  sigma=0.001413
! Fit after  self-cal, rms=0.194860Jy  sigma=0.001412
! 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.194860Jy  sigma=0.001412
! Fit after  self-cal, rms=0.190292Jy  sigma=0.001309
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.794 mas, bmaj=9.147 mas, bpa=-1.897 degrees
! Estimated noise=749.177 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00939794 Jy
! Component: 100  -  total flux cleaned = 0.0162811 Jy
! Component: 150  -  total flux cleaned = 0.0202239 Jy
! Component: 200  -  total flux cleaned = 0.0224366 Jy
! Total flux subtracted in 200 components = 0.0224366 Jy
! Clean residual min=-0.005326 max=0.008200 Jy/beam
! Clean residual mean=0.000369 rms=0.001510 Jy/beam
! Combined flux in latest and established models = 1.26958 Jy
selfcal
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 120 components and 1.26958 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189595Jy  sigma=0.001302
! Fit after  self-cal, rms=0.189657Jy  sigma=0.001302
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 (7, -6).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00448801 Jy
! Component: 100  -  total flux cleaned = 0.0068542 Jy
! Component: 150  -  total flux cleaned = 0.00853283 Jy
! Component: 200  -  total flux cleaned = 0.00986094 Jy
! Total flux subtracted in 200 components = 0.00986094 Jy
! Clean residual min=-0.004638 max=0.006665 Jy/beam
! Clean residual mean=0.000320 rms=0.001385 Jy/beam
! Combined flux in latest and established models = 1.27944 Jy
! Performing phase self-cal
! Adding 34 model components to the UV plane model.
! The established model now contains 143 components and 1.27944 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.189172Jy  sigma=0.001298
! Fit after  self-cal, rms=0.189150Jy  sigma=0.001298
! Inverting map 
! Added new window around map position (57.5, 7.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00591335 Jy
! Component: 100  -  total flux cleaned = 0.00805904 Jy
! Component: 150  -  total flux cleaned = 0.00937705 Jy
! Component: 200  -  total flux cleaned = 0.0103243 Jy
! Total flux subtracted in 200 components = 0.0103243 Jy
! Clean residual min=-0.004706 max=0.005726 Jy/beam
! Clean residual mean=0.000269 rms=0.001273 Jy/beam
! Combined flux in latest and established models = 1.28977 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 163 components and 1.28977 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188837Jy  sigma=0.001295
! Fit after  self-cal, rms=0.188824Jy  sigma=0.001295
! Inverting map 
! Added new window around map position (100, -96.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00521008 Jy
! Component: 100  -  total flux cleaned = 0.0079472 Jy
! Component: 150  -  total flux cleaned = 0.00941539 Jy
! Component: 200  -  total flux cleaned = 0.01076 Jy
! Total flux subtracted in 200 components = 0.01076 Jy
! Clean residual min=-0.005107 max=0.004922 Jy/beam
! Clean residual mean=0.000252 rms=0.001172 Jy/beam
! Combined flux in latest and established models = 1.30053 Jy
! Performing phase self-cal
! Adding 41 model components to the UV plane model.
! The established model now contains 188 components and 1.30053 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188620Jy  sigma=0.001293
! Fit after  self-cal, rms=0.188609Jy  sigma=0.001293
! 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.188609Jy  sigma=0.001293
! Fit after  self-cal, rms=0.188415Jy  sigma=0.001292
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.795 mas, bmaj=9.137 mas, bpa=-1.915 degrees
! Estimated noise=749.03 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00429306 Jy
! Component: 100  -  total flux cleaned = 0.00681625 Jy
! Component: 150  -  total flux cleaned = 0.00831926 Jy
! Component: 200  -  total flux cleaned = 0.00959714 Jy
! Total flux subtracted in 200 components = 0.00959714 Jy
! Clean residual min=-0.003998 max=0.004817 Jy/beam
! Clean residual mean=0.000182 rms=0.001032 Jy/beam
! Combined flux in latest and established models = 1.31012 Jy
selfcal
! Performing phase self-cal
! Adding 53 model components to the UV plane model.
! The established model now contains 222 components and 1.31012 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188240Jy  sigma=0.001290
! Fit after  self-cal, rms=0.188231Jy  sigma=0.001290
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 (42.5, 3.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00445444 Jy
! Component: 100  -  total flux cleaned = 0.0065276 Jy
! Component: 150  -  total flux cleaned = 0.00764491 Jy
! Component: 200  -  total flux cleaned = 0.00849544 Jy
! Total flux subtracted in 200 components = 0.00849544 Jy
! Clean residual min=-0.004068 max=0.004398 Jy/beam
! Clean residual mean=0.000141 rms=0.000959 Jy/beam
! Combined flux in latest and established models = 1.31862 Jy
! Performing phase self-cal
! Adding 48 model components to the UV plane model.
! The established model now contains 258 components and 1.31862 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188071Jy  sigma=0.001289
! Fit after  self-cal, rms=0.188067Jy  sigma=0.001289
! Inverting map 
! Added new window around map position (-12.5, -50).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00395748 Jy
! Component: 100  -  total flux cleaned = 0.00592644 Jy
! Component: 150  -  total flux cleaned = 0.00756463 Jy
! Component: 200  -  total flux cleaned = 0.00847566 Jy
! Total flux subtracted in 200 components = 0.00847566 Jy
! Clean residual min=-0.004124 max=0.003718 Jy/beam
! Clean residual mean=0.000098 rms=0.000909 Jy/beam
! Combined flux in latest and established models = 1.32709 Jy
! Performing phase self-cal
! Adding 50 model components to the UV plane model.
! The established model now contains 290 components and 1.32709 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187948Jy  sigma=0.001288
! Fit after  self-cal, rms=0.187948Jy  sigma=0.001288
! 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.187948Jy  sigma=0.001288
! Fit after  self-cal, rms=0.188014Jy  sigma=0.001288
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.599 mas, bmaj=14.97 mas, bpa=0.8779 degrees
! Estimated noise=958.378 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00398019 Jy
! Component: 100  -  total flux cleaned = 0.00671425 Jy
! Component: 150  -  total flux cleaned = 0.0088736 Jy
! Component: 200  -  total flux cleaned = 0.01067 Jy
! Total flux subtracted in 200 components = 0.01067 Jy
! Clean residual min=-0.003729 max=0.003439 Jy/beam
! Clean residual mean=0.000103 rms=0.001022 Jy/beam
! Combined flux in latest and established models = 1.33776 Jy
selfcal
! Performing phase self-cal
! Adding 54 model components to the UV plane model.
! The established model now contains 334 components and 1.33776 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187952Jy  sigma=0.001287
! Fit after  self-cal, rms=0.187951Jy  sigma=0.001287
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.00185563 Jy
! Component: 100  -  total flux cleaned = 0.00292094 Jy
! Component: 150  -  total flux cleaned = 0.00374348 Jy
! Component: 200  -  total flux cleaned = 0.00428316 Jy
! Total flux subtracted in 200 components = 0.00428316 Jy
! Clean residual min=-0.003686 max=0.003430 Jy/beam
! Clean residual mean=0.000065 rms=0.000993 Jy/beam
! Combined flux in latest and established models = 1.34205 Jy
! Performing phase self-cal
! Adding 45 model components to the UV plane model.
! The established model now contains 359 components and 1.34205 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187936Jy  sigma=0.001287
! Fit after  self-cal, rms=0.187936Jy  sigma=0.001287
! 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.794 mas, bmaj=9.131 mas, bpa=-1.921 degrees
! Estimated noise=748.861 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.794 x 9.131 at -1.921 degrees (North through East)
! Clean map  min=-0.0038707  max=0.84627 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.187936Jy  sigma=0.001287
! Fit after  self-cal, rms=0.176505Jy  sigma=0.001168
! Inverting map and beam 
! Estimated beam: bmin=2.791 mas, bmaj=9.13 mas, bpa=-1.907 degrees
! Estimated noise=748.698 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000960482 Jy
! Component: 100  -  total flux cleaned = 0.00142116 Jy
! Component: 150  -  total flux cleaned = 0.00163259 Jy
! Component: 200  -  total flux cleaned = 0.0017614 Jy
! Total flux subtracted in 200 components = 0.0017614 Jy
! Clean residual min=-0.003764 max=0.003410 Jy/beam
! Clean residual mean=0.000015 rms=0.000805 Jy/beam
! Combined flux in latest and established models = 1.34381 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 379 components and 1.34381 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.176442Jy  sigma=0.001168
! Fit after  self-cal, rms=0.176441Jy  sigma=0.001168
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00025875 Jy
! Component: 100  -  total flux cleaned = 0.000436512 Jy
! Component: 150  -  total flux cleaned = 0.000547414 Jy
! Component: 200  -  total flux cleaned = 0.000708055 Jy
! Total flux subtracted in 200 components = 0.000708055 Jy
! Clean residual min=-0.003724 max=0.003441 Jy/beam
! Clean residual mean=0.000010 rms=0.000794 Jy/beam
! Combined flux in latest and established models = 1.34452 Jy
! Performing phase self-cal
! Adding 45 model components to the UV plane model.
! The established model now contains 393 components and 1.34452 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.176404Jy  sigma=0.001167
! Fit after  self-cal, rms=0.176403Jy  sigma=0.001167
! 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.176403Jy  sigma=0.001167
! Fit after  self-cal, rms=0.176363Jy  sigma=0.001167
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.236 mas, bmaj=7.906 mas, bpa=0.2883 degrees
! Estimated noise=1102.01 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.626374 Jy
! Component: 100  -  total flux cleaned = 0.882845 Jy
! Component: 150  -  total flux cleaned = 1.00526 Jy
! Component: 200  -  total flux cleaned = 1.06528 Jy
! Total flux subtracted in 200 components = 1.06528 Jy
! Clean residual min=-0.012522 max=0.027911 Jy/beam
! Clean residual mean=0.000086 rms=0.003471 Jy/beam
! Combined flux in latest and established models = 1.06528 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 11 model components to the UV plane model.
! The established model now contains 11 components and 1.06528 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.79 mas, bmaj=9.127 mas, bpa=-1.916 degrees
! Estimated noise=748.548 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.0485479 Jy
! Component: 100  -  total flux cleaned = 0.0838275 Jy
! Component: 150  -  total flux cleaned = 0.111389 Jy
! Component: 200  -  total flux cleaned = 0.133507 Jy
! Total flux subtracted in 200 components = 0.133507 Jy
! Clean residual min=-0.007048 max=0.013514 Jy/beam
! Clean residual mean=0.000691 rms=0.002756 Jy/beam
! Combined flux in latest and established models = 1.19878 Jy
! Adding 75 model components to the UV plane model.
! The established model now contains 84 components and 1.19878 Jy
! Inverting map 
! Added new window around map position (9, 10).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0181601 Jy
! Component: 100  -  total flux cleaned = 0.0333407 Jy
! Component: 150  -  total flux cleaned = 0.0462746 Jy
! Component: 200  -  total flux cleaned = 0.0573877 Jy
! Total flux subtracted in 200 components = 0.0573877 Jy
! Clean residual min=-0.005360 max=0.007000 Jy/beam
! Clean residual mean=0.000408 rms=0.001729 Jy/beam
! Combined flux in latest and established models = 1.25617 Jy
! Adding 87 model components to the UV plane model.
! The established model now contains 152 components and 1.25617 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=7.593 mas, bmaj=14.97 mas, bpa=0.8669 degrees
! Estimated noise=959.338 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0172793 Jy
! Component: 100  -  total flux cleaned = 0.0299275 Jy
! Component: 150  -  total flux cleaned = 0.0397181 Jy
! Component: 200  -  total flux cleaned = 0.0474168 Jy
! Total flux subtracted in 200 components = 0.0474168 Jy
! Clean residual min=-0.004575 max=0.005154 Jy/beam
! Clean residual mean=0.000388 rms=0.001584 Jy/beam
! Combined flux in latest and established models = 1.30359 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.00627608 Jy
! Component: 100  -  total flux cleaned = 0.0115491 Jy
! Component: 150  -  total flux cleaned = 0.016018 Jy
! Component: 200  -  total flux cleaned = 0.0198508 Jy
! Total flux subtracted in 200 components = 0.0198508 Jy
! Clean residual min=-0.003583 max=0.003765 Jy/beam
! Clean residual mean=0.000194 rms=0.001145 Jy/beam
! Combined flux in latest and established models = 1.32344 Jy
! Adding 186 model components to the UV plane model.
! The established model now contains 328 components and 1.32344 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.79 mas, bmaj=9.127 mas, bpa=-1.916 degrees
! Estimated noise=748.548 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000758761 Jy
! Component: 100  -  total flux cleaned = 0.00192066 Jy
! Component: 150  -  total flux cleaned = 0.00329008 Jy
! Component: 200  -  total flux cleaned = 0.004854 Jy
! Total flux subtracted in 200 components = 0.004854 Jy
! Clean residual min=-0.003810 max=0.003376 Jy/beam
! Clean residual mean=0.000063 rms=0.000884 Jy/beam
! Combined flux in latest and established models = 1.32829 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 348 components and 1.32829 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.176611Jy  sigma=0.001170
! Fit after  self-cal, rms=0.176596Jy  sigma=0.001169
wmodel J2331-1556_S_2001_07_05_pus_map.mod
! Writing 348 model components to file: J2331-1556_S_2001_07_05_pus_map.mod
wobs J2331-1556_S_2001_07_05_pus_uvs.fits
! Writing UV FITS file: J2331-1556_S_2001_07_05_pus_uvs.fits
wwins J2331-1556_S_2001_07_05_pus_map.win
! wwins: Wrote 10 windows to J2331-1556_S_2001_07_05_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=4096  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = -0.000188921 Jy
! Component: 100  -  total flux cleaned = -0.000549367 Jy
! Component: 150  -  total flux cleaned = -0.000606638 Jy
! Component: 200  -  total flux cleaned = -0.000825234 Jy
! Component: 250  -  total flux cleaned = -0.000878527 Jy
! Component: 300  -  total flux cleaned = -0.000930678 Jy
! Component: 350  -  total flux cleaned = -0.000982361 Jy
! Component: 400  -  total flux cleaned = -0.00103243 Jy
! Component: 450  -  total flux cleaned = -0.00103247 Jy
! Component: 500  -  total flux cleaned = -0.000985072 Jy
! Component: 550  -  total flux cleaned = -0.000938279 Jy
! Component: 600  -  total flux cleaned = -0.000985672 Jy
! Component: 650  -  total flux cleaned = -0.000984867 Jy
! Component: 700  -  total flux cleaned = -0.000893303 Jy
! Component: 750  -  total flux cleaned = -0.000714145 Jy
! Component: 800  -  total flux cleaned = -0.000625768 Jy
! Component: 850  -  total flux cleaned = -0.000494064 Jy
! Component: 900  -  total flux cleaned = -0.000364933 Jy
! Component: 950  -  total flux cleaned = -0.000365341 Jy
! Component: 1000  -  total flux cleaned = -0.000239213 Jy
! Component: 1050  -  total flux cleaned = -0.000239321 Jy
! Component: 1100  -  total flux cleaned = -0.000157201 Jy
! Component: 1150  -  total flux cleaned = -7.51222e-05 Jy
! Component: 1200  -  total flux cleaned = -7.52781e-05 Jy
! Component: 1250  -  total flux cleaned = 4.52316e-05 Jy
! Component: 1300  -  total flux cleaned = 0.000164308 Jy
! Component: 1350  -  total flux cleaned = 0.000204087 Jy
! Component: 1400  -  total flux cleaned = 0.000358883 Jy
! Component: 1450  -  total flux cleaned = 0.000320299 Jy
! Component: 1500  -  total flux cleaned = 0.000473298 Jy
! Component: 1550  -  total flux cleaned = 0.000700051 Jy
! Component: 1600  -  total flux cleaned = 0.00084956 Jy
! Component: 1650  -  total flux cleaned = 0.000998139 Jy
! Component: 1700  -  total flux cleaned = 0.00121921 Jy
! Component: 1750  -  total flux cleaned = 0.0011832 Jy
! Component: 1800  -  total flux cleaned = 0.00147341 Jy
! Component: 1850  -  total flux cleaned = 0.00158149 Jy
! Component: 1900  -  total flux cleaned = 0.00175973 Jy
! Component: 1950  -  total flux cleaned = 0.00190123 Jy
! Component: 2000  -  total flux cleaned = 0.00214665 Jy
! Component: 2050  -  total flux cleaned = 0.00214611 Jy
! Component: 2100  -  total flux cleaned = 0.00231886 Jy
! Component: 2150  -  total flux cleaned = 0.00252427 Jy
! Component: 2200  -  total flux cleaned = 0.00262632 Jy
! Component: 2250  -  total flux cleaned = 0.00276137 Jy
! Component: 2300  -  total flux cleaned = 0.00289572 Jy
! Component: 2350  -  total flux cleaned = 0.00316202 Jy
! Component: 2400  -  total flux cleaned = 0.00319521 Jy
! Component: 2450  -  total flux cleaned = 0.00342518 Jy
! Component: 2500  -  total flux cleaned = 0.00365329 Jy
! Component: 2550  -  total flux cleaned = 0.00378292 Jy
! Component: 2600  -  total flux cleaned = 0.00397592 Jy
! Component: 2650  -  total flux cleaned = 0.00423156 Jy
! Component: 2700  -  total flux cleaned = 0.00432686 Jy
! Component: 2750  -  total flux cleaned = 0.00445297 Jy
! Component: 2800  -  total flux cleaned = 0.00476643 Jy
! Component: 2850  -  total flux cleaned = 0.00492203 Jy
! Component: 2900  -  total flux cleaned = 0.00507703 Jy
! Component: 2950  -  total flux cleaned = 0.00532325 Jy
! Component: 3000  -  total flux cleaned = 0.00544579 Jy
! Component: 3050  -  total flux cleaned = 0.00565838 Jy
! Component: 3100  -  total flux cleaned = 0.0057795 Jy
! Component: 3150  -  total flux cleaned = 0.00607977 Jy
! Component: 3200  -  total flux cleaned = 0.00610949 Jy
! Component: 3250  -  total flux cleaned = 0.00631738 Jy
! Component: 3300  -  total flux cleaned = 0.0064649 Jy
! Component: 3350  -  total flux cleaned = 0.00661171 Jy
! Component: 3400  -  total flux cleaned = 0.00681587 Jy
! Component: 3450  -  total flux cleaned = 0.00687405 Jy
! Component: 3500  -  total flux cleaned = 0.00707596 Jy
! Component: 3550  -  total flux cleaned = 0.00716211 Jy
! Component: 3600  -  total flux cleaned = 0.00730491 Jy
! Component: 3650  -  total flux cleaned = 0.00736204 Jy
! Component: 3700  -  total flux cleaned = 0.0075318 Jy
! Component: 3750  -  total flux cleaned = 0.00758813 Jy
! Component: 3800  -  total flux cleaned = 0.00789585 Jy
! Component: 3850  -  total flux cleaned = 0.00797927 Jy
! Component: 3900  -  total flux cleaned = 0.00803464 Jy
! Component: 3950  -  total flux cleaned = 0.00819976 Jy
! Component: 4000  -  total flux cleaned = 0.00830967 Jy
! Component: 4050  -  total flux cleaned = 0.00844588 Jy
! Total flux subtracted in 4096 components = 0.00863613 Jy
! Clean residual min=-0.001533 max=0.001700 Jy/beam
! Clean residual mean=0.000049 rms=0.000514 Jy/beam
! Combined flux in latest and established models = 1.33693 Jy
keep
! Adding 324 model components to the UV plane model.
! The established model now contains 672 components and 1.33693 Jy
wmap "J2331-1556_S_2001_07_05_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.79 x 9.127 at -1.916 degrees (North through East)
! Clean map  min=-0.0026977  max=0.84424 Jy/beam
! Writing clean map to FITS file: J2331-1556_S_2001_07_05_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.844237 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000510375 
device "J2331-1556_S_2001_07_05_pus\_map.eps/VPS"
! Attempting to open device: 'J2331-1556_S_2001_07_05_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.181362 0.181362 0.362723 0.725447 1.45089 2.90179 5.80358 11.6072 23.2143 46.4286 92.8572
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0015 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.844 
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.79 x 9.127 at -1.916 degrees (North through East)
! Clean map  min=-0.0026977  max=0.84424 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J2331-1556_S_2001_07_05_pus\_map.gif/vgif"
! Attempting to open device: 'J2331-1556_S_2001_07_05_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J2331-1556_S_2001_07_05_pus_uvs.log closed on Sat Aug 11 22:23:58 2007