! Started logfile: J2246-1206_X_2001_07_05_pus_uvs.log on Wed Jul  4 22:06:56 2007
obs J2246-1206_X_2001_07_05_pus_uva.fits
! Reading UV FITS file: J2246-1206_X_2001_07_05_pus_uva.fits
! AN table 1: 65 integrations on 171 of 171 possible baselines.
! AN table 2: 212 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.154665 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J2246-1206
! 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  8.40997e+09        8e+06          1        8e+06
!  02        2  8.47997e+09        8e+06          1        8e+06
!  03        3  8.79497e+09        8e+06          1        8e+06
!  04        4  8.89997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 2370 lines of history.
! 
! Reading 29304 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 = 256 
print "field_cell =",field_cell
! field_cell = 0.2 
print "taper_size =",taper_size
! taper_size = 70 
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 = 256x256 pixels with 0.200x0.200 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 1194 telescope corrections were flagged in sub-array 1.
!  A total of 2421 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 2.
!  A total of 1194 telescope corrections were flagged in sub-array 1.
!  A total of 2420 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 3.
!  A total of 1194 telescope corrections were flagged in sub-array 1.
!  A total of 2420 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 4.
!  A total of 1194 telescope corrections were flagged in sub-array 1.
!  A total of 2420 telescope corrections were flagged in sub-array 2.
! 
! Fit before self-cal, rms=1.462563Jy  sigma=0.013151
! Fit after  self-cal, rms=0.851907Jy  sigma=0.007578
! 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 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.5137 mas, bmaj=1.287 mas, bpa=-2.694 degrees
! Estimated noise=1040.08 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (0, 0).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.15687 Jy
! Component: 100  -  total flux cleaned = 1.52467 Jy
! Total flux subtracted in 100 components = 1.52467 Jy
! Clean residual min=-0.070370 max=0.221145 Jy/beam
! Clean residual mean=0.003920 rms=0.024674 Jy/beam
! Combined flux in latest and established models = 1.52467 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 16 components and 1.52467 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.519131Jy  sigma=0.004569
! Fit after  self-cal, rms=0.519220Jy  sigma=0.004565
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Added new window around map position (-0.2, 1.6).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.224341 Jy
! Component: 100  -  total flux cleaned = 0.362812 Jy
! Total flux subtracted in 100 components = 0.362812 Jy
! Clean residual min=-0.054164 max=0.088038 Jy/beam
! Clean residual mean=0.001981 rms=0.015927 Jy/beam
! Combined flux in latest and established models = 1.88748 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 23 components and 1.88748 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.353876Jy  sigma=0.003054
! Fit after  self-cal, rms=0.350304Jy  sigma=0.003028
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.101429 Jy
! Component: 100  -  total flux cleaned = 0.169245 Jy
! Total flux subtracted in 100 components = 0.169245 Jy
! Clean residual min=-0.046332 max=0.072434 Jy/beam
! Clean residual mean=0.001057 rms=0.012769 Jy/beam
! Combined flux in latest and established models = 2.05673 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 28 components and 2.05673 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.303645Jy  sigma=0.002597
! Fit after  self-cal, rms=0.302187Jy  sigma=0.002589
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.6714 mas, bmaj=2.105 mas, bpa=-6.014 degrees
! Estimated noise=494.803 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 (1, 3).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0898016 Jy
! Component: 100  -  total flux cleaned = 0.141005 Jy
! Component: 150  -  total flux cleaned = 0.174149 Jy
! Component: 200  -  total flux cleaned = 0.188631 Jy
! Total flux subtracted in 200 components = 0.188631 Jy
! Clean residual min=-0.044892 max=0.043490 Jy/beam
! Clean residual mean=0.001501 rms=0.011995 Jy/beam
! Combined flux in latest and established models = 2.24536 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 52 components and 2.24536 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.273538Jy  sigma=0.002327
! Fit after  self-cal, rms=0.271625Jy  sigma=0.002311
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        0.73     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.25     MK        1.00*    NL        1.00*    
!   NY        1.00*    OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.37     WF        1.00*    WZ        1.08     
! 
!  A total of 36 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.93     FD        1.00     GC        1.00*    GG        1.00*    
!   HH        0.97     HN        0.97     KK        1.02     KP        1.00     
!   LA        0.97     MC        1.12     MK        0.98     NL        1.03     
!   NY        1.00*    OV        1.02     PT        0.99     SC        1.03     
!   TS        0.99     WF        1.01     WZ        0.95     
! 
! 
! Correcting IF 2.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        0.70     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.30     MK        1.00*    NL        1.00*    
!   NY        1.00*    OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.38     WF        1.00*    WZ        1.08     
! 
!  A total of 36 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.94     FD        0.99     GC        1.00*    GG        1.00*    
!   HH        4.37     HN        0.97     KK        1.00     KP        1.00     
!   LA        0.96     MC        1.13     MK        0.96     NL        0.99     
!   NY        1.00*    OV        1.02     PT        0.96     SC        0.98     
!   TS        1.00     WF        0.99     WZ        0.97     
! 
! 
! Correcting IF 3.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        0.92     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.48     MK        1.00*    NL        1.00*    
!   NY        1.00*    OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.27     WF        1.00*    WZ        0.99     
! 
!  A total of 36 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        0.98     GC        1.00*    GG        1.00*    
!   HH        1.05     HN        0.98     KK        0.99     KP        1.05     
!   LA        0.99     MC        1.13     MK        0.97     NL        1.03     
!   NY        1.00*    OV        1.07     PT        0.98     SC        0.99     
!   TS        0.99     WF        0.99     WZ        0.94     
! 
! 
! Correcting IF 4.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    GG        1.00*    
!   HH        1.01     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.43     MK        1.00*    NL        1.00*    
!   NY        1.00*    OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.40     WF        1.00*    WZ        0.98     
! 
!  A total of 36 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.96     GC        1.00*    GG        1.00*    
!   HH        1.24     HN        1.00     KK        1.00     KP        1.01     
!   LA        0.97     MC        1.12     MK        1.00     NL        1.04     
!   NY        1.00*    OV        1.04     PT        0.99     SC        1.04     
!   TS        0.99     WF        1.00     WZ        0.95     
! 
! 
! Fit before self-cal, rms=0.271625Jy  sigma=0.002311
! Fit after  self-cal, rms=0.264737Jy  sigma=0.002160
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.677 mas, bmaj=2.136 mas, bpa=-6.41 degrees
! Estimated noise=493.991 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.0188387 Jy
! Component: 100  -  total flux cleaned = 0.0202285 Jy
! Component: 150  -  total flux cleaned = 0.020226 Jy
! Component: 200  -  total flux cleaned = 0.0207512 Jy
! Total flux subtracted in 200 components = 0.0207512 Jy
! Clean residual min=-0.042853 max=0.033525 Jy/beam
! Clean residual mean=-0.000581 rms=0.011697 Jy/beam
! Combined flux in latest and established models = 2.26611 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 69 components and 2.26611 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.261827Jy  sigma=0.002134
! Fit after  self-cal, rms=0.261496Jy  sigma=0.002133
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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.261496Jy  sigma=0.002133
! Fit after  self-cal, rms=0.205198Jy  sigma=0.001510
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.6804 mas, bmaj=2.118 mas, bpa=-6.117 degrees
! Estimated noise=494.42 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0166401 Jy
! Component: 100  -  total flux cleaned = 0.0177862 Jy
! Component: 150  -  total flux cleaned = 0.0191286 Jy
! Component: 200  -  total flux cleaned = 0.0198748 Jy
! Total flux subtracted in 200 components = 0.0198748 Jy
! Clean residual min=-0.013013 max=0.016560 Jy/beam
! Clean residual mean=0.000541 rms=0.003432 Jy/beam
! Combined flux in latest and established models = 2.28599 Jy
selfcal
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 85 components and 2.28599 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.202179Jy  sigma=0.001478
! Fit after  self-cal, rms=0.201948Jy  sigma=0.001475
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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 (4.8, 8.4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0176501 Jy
! Component: 100  -  total flux cleaned = 0.0258824 Jy
! Component: 150  -  total flux cleaned = 0.0296209 Jy
! Component: 200  -  total flux cleaned = 0.0322357 Jy
! Total flux subtracted in 200 components = 0.0322357 Jy
! Clean residual min=-0.013812 max=0.009801 Jy/beam
! Clean residual mean=-0.000037 rms=0.002644 Jy/beam
! Combined flux in latest and established models = 2.31822 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 105 components and 2.31822 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.200265Jy  sigma=0.001454
! Fit after  self-cal, rms=0.200201Jy  sigma=0.001454
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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.200201Jy  sigma=0.001454
! Fit after  self-cal, rms=0.200508Jy  sigma=0.001449
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.6816 mas, bmaj=2.113 mas, bpa=-6.029 degrees
! Estimated noise=494.477 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00391717 Jy
! Component: 100  -  total flux cleaned = 0.00668741 Jy
! Component: 150  -  total flux cleaned = 0.00881973 Jy
! Component: 200  -  total flux cleaned = 0.0104848 Jy
! Total flux subtracted in 200 components = 0.0104848 Jy
! Clean residual min=-0.010696 max=0.009131 Jy/beam
! Clean residual mean=0.000065 rms=0.002164 Jy/beam
! Combined flux in latest and established models = 2.32871 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 113 components and 2.32871 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.199642Jy  sigma=0.001440
! Fit after  self-cal, rms=0.199596Jy  sigma=0.001439
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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.00254338 Jy
! Component: 100  -  total flux cleaned = 0.00404998 Jy
! Component: 150  -  total flux cleaned = 0.00541203 Jy
! Component: 200  -  total flux cleaned = 0.00630375 Jy
! Total flux subtracted in 200 components = 0.00630375 Jy
! Clean residual min=-0.010816 max=0.008604 Jy/beam
! Clean residual mean=-0.000060 rms=0.002061 Jy/beam
! Combined flux in latest and established models = 2.33501 Jy
! Performing phase self-cal
! Adding 35 model components to the UV plane model.
! The established model now contains 121 components and 2.33501 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.199221Jy  sigma=0.001435
! Fit after  self-cal, rms=0.199207Jy  sigma=0.001435
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 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.199207Jy  sigma=0.001435
! Fit after  self-cal, rms=0.198871Jy  sigma=0.001433
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=2.058 mas, bmaj=3.651 mas, bpa=-3.181 degrees
! Estimated noise=670.978 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00668364 Jy
! Component: 100  -  total flux cleaned = 0.00796745 Jy
! Component: 150  -  total flux cleaned = 0.00877478 Jy
! Component: 200  -  total flux cleaned = 0.00955827 Jy
! Total flux subtracted in 200 components = 0.00955827 Jy
! Clean residual min=-0.007471 max=0.007920 Jy/beam
! Clean residual mean=-0.000100 rms=0.002363 Jy/beam
! Combined flux in latest and established models = 2.34457 Jy
selfcal
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 141 components and 2.34457 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.198761Jy  sigma=0.001432
! Fit after  self-cal, rms=0.198723Jy  sigma=0.001431
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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.000597894 Jy
! Component: 100  -  total flux cleaned = 0.0011587 Jy
! Component: 150  -  total flux cleaned = 0.00184683 Jy
! Component: 200  -  total flux cleaned = 0.00231928 Jy
! Total flux subtracted in 200 components = 0.00231928 Jy
! Clean residual min=-0.007773 max=0.007799 Jy/beam
! Clean residual mean=-0.000209 rms=0.002369 Jy/beam
! Combined flux in latest and established models = 2.34689 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 148 components and 2.34689 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.198697Jy  sigma=0.001431
! Fit after  self-cal, rms=0.198673Jy  sigma=0.001431
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
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 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.6825 mas, bmaj=2.108 mas, bpa=-5.958 degrees
! Estimated noise=494.457 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6825 x 2.108 at -5.958 degrees (North through East)
! Clean map  min=-0.0082994  max=1.5463 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.198673Jy  sigma=0.001431
! Fit after  self-cal, rms=0.185522Jy  sigma=0.001164
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.6832 mas, bmaj=2.106 mas, bpa=-5.936 degrees
! Estimated noise=493.683 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.0021736 Jy
! Component: 100  -  total flux cleaned = -0.00178378 Jy
! Component: 150  -  total flux cleaned = -0.00161555 Jy
! Component: 200  -  total flux cleaned = -0.00161626 Jy
! Total flux subtracted in 200 components = -0.00161626 Jy
! Clean residual min=-0.008265 max=0.007893 Jy/beam
! Clean residual mean=-0.000009 rms=0.001652 Jy/beam
! Combined flux in latest and established models = 2.34527 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 157 components and 2.34527 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.185147Jy  sigma=0.001160
! Fit after  self-cal, rms=0.185139Jy  sigma=0.001160
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -2.54134e-05 Jy
! Component: 100  -  total flux cleaned = 0.00027299 Jy
! Component: 150  -  total flux cleaned = 0.000409409 Jy
! Component: 200  -  total flux cleaned = 0.000417637 Jy
! Total flux subtracted in 200 components = 0.000417637 Jy
! Clean residual min=-0.008316 max=0.007638 Jy/beam
! Clean residual mean=-0.000016 rms=0.001593 Jy/beam
! Combined flux in latest and established models = 2.34569 Jy
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 161 components and 2.34569 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.184925Jy  sigma=0.001157
! Fit after  self-cal, rms=0.184919Jy  sigma=0.001157
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.184919Jy  sigma=0.001157
! Fit after  self-cal, rms=0.184661Jy  sigma=0.001157
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 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.5252 mas, bmaj=1.305 mas, bpa=-3.197 degrees
! Estimated noise=1071.7 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.17355 Jy
! Component: 100  -  total flux cleaned = 1.57544 Jy
! Component: 150  -  total flux cleaned = 1.7865 Jy
! Component: 200  -  total flux cleaned = 1.91003 Jy
! Total flux subtracted in 200 components = 1.91003 Jy
! Clean residual min=-0.025372 max=0.067830 Jy/beam
! Clean residual mean=0.001942 rms=0.009834 Jy/beam
! Combined flux in latest and established models = 1.91003 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 17 model components to the UV plane model.
! The established model now contains 17 components and 1.91003 Jy
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.684 mas, bmaj=2.104 mas, bpa=-5.907 degrees
! Estimated noise=493.37 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.134697 Jy
! Component: 100  -  total flux cleaned = 0.21756 Jy
! Component: 150  -  total flux cleaned = 0.271877 Jy
! Component: 200  -  total flux cleaned = 0.308576 Jy
! Total flux subtracted in 200 components = 0.308576 Jy
! Clean residual min=-0.009326 max=0.020216 Jy/beam
! Clean residual mean=0.002612 rms=0.004683 Jy/beam
! Combined flux in latest and established models = 2.2186 Jy
! Adding 42 model components to the UV plane model.
! The established model now contains 50 components and 2.2186 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0261072 Jy
! Component: 100  -  total flux cleaned = 0.0460522 Jy
! Component: 150  -  total flux cleaned = 0.0620099 Jy
! Component: 200  -  total flux cleaned = 0.0749551 Jy
! Total flux subtracted in 200 components = 0.0749551 Jy
! Clean residual min=-0.006290 max=0.010518 Jy/beam
! Clean residual mean=0.001039 rms=0.002318 Jy/beam
! Combined flux in latest and established models = 2.29356 Jy
! Adding 40 model components to the UV plane model.
! The established model now contains 80 components and 2.29356 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Added new window around map position (6.6, 9.4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.011457 Jy
! Component: 100  -  total flux cleaned = 0.0205874 Jy
! Component: 150  -  total flux cleaned = 0.0282227 Jy
! Component: 200  -  total flux cleaned = 0.0346169 Jy
! Total flux subtracted in 200 components = 0.0346169 Jy
! Clean residual min=-0.005840 max=0.005737 Jy/beam
! Clean residual mean=0.000369 rms=0.001529 Jy/beam
! Combined flux in latest and established models = 2.32818 Jy
! Adding 36 model components to the UV plane model.
! The established model now contains 95 components and 2.32818 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=2.058 mas, bmaj=3.646 mas, bpa=-3.137 degrees
! Estimated noise=668.192 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00830903 Jy
! Component: 100  -  total flux cleaned = 0.0132475 Jy
! Component: 150  -  total flux cleaned = 0.016484 Jy
! Component: 200  -  total flux cleaned = 0.0174 Jy
! Total flux subtracted in 200 components = 0.0174 Jy
! Clean residual min=-0.004451 max=0.004177 Jy/beam
! Clean residual mean=0.000095 rms=0.001539 Jy/beam
! Combined flux in latest and established models = 2.34558 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.000436684 Jy
! Component: 100  -  total flux cleaned = 0.000816185 Jy
! Component: 150  -  total flux cleaned = 0.00108898 Jy
! Component: 200  -  total flux cleaned = 0.00144753 Jy
! Total flux subtracted in 200 components = 0.00144753 Jy
! Clean residual min=-0.004549 max=0.004019 Jy/beam
! Clean residual mean=0.000026 rms=0.001491 Jy/beam
! Combined flux in latest and established models = 2.34702 Jy
! Adding 44 model components to the UV plane model.
! The established model now contains 132 components and 2.34702 Jy
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! Estimated beam: bmin=0.684 mas, bmaj=2.104 mas, bpa=-5.907 degrees
! Estimated noise=493.37 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00209251 Jy
! Component: 100  -  total flux cleaned = -0.00224344 Jy
! Component: 150  -  total flux cleaned = -0.00197892 Jy
! Component: 200  -  total flux cleaned = -0.00185833 Jy
! Total flux subtracted in 200 components = -0.00185833 Jy
! Clean residual min=-0.005107 max=0.003818 Jy/beam
! Clean residual mean=0.000037 rms=0.001223 Jy/beam
! Combined flux in latest and established models = 2.34517 Jy
selfcal
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 149 components and 2.34516 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.184223Jy  sigma=0.001152
! Fit after  self-cal, rms=0.183794Jy  sigma=0.001150
wmodel J2246-1206_X_2001_07_05_pus_map.mod
! Writing 149 model components to file: J2246-1206_X_2001_07_05_pus_map.mod
wobs J2246-1206_X_2001_07_05_pus_uvs.fits
! Writing UV FITS file: J2246-1206_X_2001_07_05_pus_uvs.fits
wwins J2246-1206_X_2001_07_05_pus_map.win
! wwins: Wrote 5 windows to J2246-1206_X_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 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! clean: niter=1024  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = -0.00200335 Jy
! Component: 100  -  total flux cleaned = -0.0028443 Jy
! Component: 150  -  total flux cleaned = -0.00319834 Jy
! Component: 200  -  total flux cleaned = -0.00346492 Jy
! Component: 250  -  total flux cleaned = -0.00378296 Jy
! Component: 300  -  total flux cleaned = -0.00408674 Jy
! Component: 350  -  total flux cleaned = -0.00420486 Jy
! Component: 400  -  total flux cleaned = -0.00420527 Jy
! Component: 450  -  total flux cleaned = -0.00426126 Jy
! Component: 500  -  total flux cleaned = -0.00420725 Jy
! Component: 550  -  total flux cleaned = -0.00420712 Jy
! Component: 600  -  total flux cleaned = -0.00410377 Jy
! Component: 650  -  total flux cleaned = -0.00400355 Jy
! Component: 700  -  total flux cleaned = -0.00405306 Jy
! Component: 750  -  total flux cleaned = -0.00405281 Jy
! Component: 800  -  total flux cleaned = -0.00405239 Jy
! Component: 850  -  total flux cleaned = -0.00409846 Jy
! Component: 900  -  total flux cleaned = -0.00409779 Jy
! Component: 950  -  total flux cleaned = -0.00405271 Jy
! Component: 1000  -  total flux cleaned = -0.00396466 Jy
! Total flux subtracted in 1024 components = -0.00396466 Jy
! Clean residual min=-0.002253 max=0.002258 Jy/beam
! Clean residual mean=0.000155 rms=0.000854 Jy/beam
! Combined flux in latest and established models = 2.3412 Jy
keep
! Adding 63 model components to the UV plane model.
! The established model now contains 209 components and 2.3412 Jy
wmap "J2246-1206_X_2001_07_05_pus\_map.fits"
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.684 x 2.104 at -5.907 degrees (North through East)
! Clean map  min=-0.0041788  max=1.5502 Jy/beam
! Writing clean map to FITS file: J2246-1206_X_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 1.55021 
invert
! Inverting map 
! Your choice of large map pixels excluded 2.96% of the data.
!  The x-axis pixel size should ideally be below 0.1613 milli-arcsec
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000850651 
device "J2246-1206_X_2001_07_05_pus\_map.eps/VPS"
! Attempting to open device: 'J2246-1206_X_2001_07_05_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.16462 0.16462 0.32924 0.658481 1.31696 2.63392 5.26785 10.5357 21.0714 42.1428 84.2855
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0025 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.55 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.684 x 2.104 at -5.907 degrees (North through East)
! Clean map  min=-0.0041788  max=1.5502 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J2246-1206_X_2001_07_05_pus\_map.gif/vgif"
! Attempting to open device: 'J2246-1206_X_2001_07_05_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J2246-1206_X_2001_07_05_pus_uvs.log closed on Wed Jul  4 22:08:17 2007