! Started logfile: J1939-1002_S_1998_10_01_pus_uvs.log on Fri Feb  8 12:41:50 2008
obs J1939-1002_S_1998_10_01_pus_uva.fits
! Reading UV FITS file: J1939-1002_S_1998_10_01_pus_uva.fits
! AN table 1: 636 integrations on 136 of 136 possible baselines.
! AN table 2: 211 integrations on 136 of 136 possible baselines.
! Apparent sampling: 0.213991 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1939-1002
! 
! 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.22298e+09        4e+06          1        4e+06
!  02        2  2.24298e+09        4e+06          1        4e+06
!  03        3  2.33298e+09        4e+06          1        4e+06
!  04        4  2.36298e+09        4e+06          1        4e+06
! 
! Polarization(s): RR
! 
! Read 1537 lines of history.
! 
! Reading 98600 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 
![@muppet J1939-1002_S_1998_10_01_pus]
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 8315 telescope corrections were flagged in sub-array 1.
!  A total of 925 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 2.
!  A total of 8315 telescope corrections were flagged in sub-array 1.
!  A total of 925 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 3.
!  A total of 8315 telescope corrections were flagged in sub-array 1.
!  A total of 925 telescope corrections were flagged in sub-array 2.
! 
! Correcting IF 4.
!  A total of 8315 telescope corrections were flagged in sub-array 1.
!  A total of 925 telescope corrections were flagged in sub-array 2.
! 
! Fit before self-cal, rms=0.688714Jy  sigma=0.004736
! Fit after  self-cal, rms=0.567127Jy  sigma=0.003837
! 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.625 mas, bmaj=7.57 mas, bpa=-0.9239 degrees
! Estimated noise=639.419 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.447 Jy
! Component: 100  -  total flux cleaned = 0.55554 Jy
! Total flux subtracted in 100 components = 0.55554 Jy
! Clean residual min=-0.018128 max=0.045342 Jy/beam
! Clean residual mean=0.000081 rms=0.004751 Jy/beam
! Combined flux in latest and established models = 0.55554 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 14 components and 0.55554 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.409219Jy  sigma=0.002510
! Fit after  self-cal, rms=0.409229Jy  sigma=0.002510
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0524693 Jy
! Component: 100  -  total flux cleaned = 0.0836159 Jy
! Total flux subtracted in 100 components = 0.0836159 Jy
! Clean residual min=-0.012599 max=0.031228 Jy/beam
! Clean residual mean=0.000013 rms=0.003252 Jy/beam
! Combined flux in latest and established models = 0.639155 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 23 components and 0.639156 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.400204Jy  sigma=0.002416
! Fit after  self-cal, rms=0.400221Jy  sigma=0.002416
! Inverting map 
! Added new window around map position (11, 19).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0290192 Jy
! Component: 100  -  total flux cleaned = 0.0472596 Jy
! Total flux subtracted in 100 components = 0.0472596 Jy
! Clean residual min=-0.010527 max=0.014666 Jy/beam
! Clean residual mean=-0.000020 rms=0.002549 Jy/beam
! Combined flux in latest and established models = 0.686415 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 29 components and 0.686415 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.397749Jy  sigma=0.002388
! Fit after  self-cal, rms=0.397597Jy  sigma=0.002387
! 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=3.366 mas, bmaj=8.944 mas, bpa=-1.375 degrees
! Estimated noise=307.112 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 (8.5, 14.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0199691 Jy
! Component: 100  -  total flux cleaned = 0.0323544 Jy
! Component: 150  -  total flux cleaned = 0.0396739 Jy
! Component: 200  -  total flux cleaned = 0.0423517 Jy
! Total flux subtracted in 200 components = 0.0423517 Jy
! Clean residual min=-0.007934 max=0.010629 Jy/beam
! Clean residual mean=-0.000277 rms=0.002103 Jy/beam
! Combined flux in latest and established models = 0.728767 Jy
! Performing phase self-cal
! Adding 39 model components to the UV plane model.
! The established model now contains 64 components and 0.728767 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.396636Jy  sigma=0.002375
! Fit after  self-cal, rms=0.396563Jy  sigma=0.002375
! 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        0.95     FD        0.98     GC        1.00*    HN        1.00*    
!   KK        0.94     KP        0.99     LA        0.96     MK        0.94     
!   NL        0.98     NY        1.00*    ON        1.00*    OV        0.97     
!   PT        1.04     SC        0.98     WF        0.97     MC        1.00*    
!   GN        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.96     GC        1.00*    HN        1.01     
!   KK        0.95     KP        0.98     LA        0.96     MK        0.98     
!   NL        1.00     NY        1.00*    ON        1.00*    OV        0.96     
!   PT        1.02     SC        1.04     WF        1.18     MC        1.00*    
!   GN        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        0.95     FD        0.99     GC        1.00*    HN        1.00*    
!   KK        0.93     KP        0.97     LA        1.02     MK        0.99     
!   NL        0.95     NY        1.00*    ON        1.00*    OV        0.97     
!   PT        1.00     SC        1.01     WF        1.01     MC        1.00*    
!   GN        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.94     FD        0.97     GC        1.00*    HN        1.04     
!   KK        0.95     KP        0.96     LA        1.01     MK        1.04     
!   NL        0.98     NY        1.00*    ON        1.00*    OV        0.96     
!   PT        1.00     SC        1.04     WF        1.20     MC        1.00*    
!   GN        1.01     
! 
! 
! Correcting IF 3.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00     FD        1.04     GC        1.00*    HN        1.00*    
!   KK        0.95     KP        1.01     LA        1.02     MK        0.91     
!   NL        0.98     NY        1.00*    ON        1.00*    OV        0.99     
!   PT        0.99     SC        0.99     WF        1.00     MC        1.00*    
!   GN        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        1.02     GC        1.00*    HN        1.02     
!   KK        0.96     KP        0.99     LA        1.00     MK        0.99     
!   NL        0.99     NY        1.00*    ON        1.00*    OV        0.98     
!   PT        1.01     SC        1.05     WF        1.23     MC        1.00*    
!   GN        1.02     
! 
! 
! Correcting IF 4.
!  A total of 6 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00     FD        1.00     GC        1.00*    HN        1.00*    
!   KK        0.94     KP        1.02     LA        1.02     MK        0.91     
!   NL        0.96     NY        1.00*    ON        1.00*    OV        0.98     
!   PT        1.00     SC        1.01     WF        0.96     MC        1.00*    
!   GN        1.00*    
! 
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.01     FD        0.99     GC        1.00*    HN        1.02     
!   KK        0.99     KP        1.00     LA        1.00     MK        0.99     
!   NL        0.98     NY        1.00*    ON        1.00*    OV        0.99     
!   PT        1.09     SC        1.03     WF        1.15     MC        1.00*    
!   GN        1.00     
! 
! 
! Fit before self-cal, rms=0.396563Jy  sigma=0.002375
! Fit after  self-cal, rms=0.406735Jy  sigma=0.002362
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=3.373 mas, bmaj=8.984 mas, bpa=-1.587 degrees
! Estimated noise=305.805 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.00722697 Jy
! Component: 100  -  total flux cleaned = 0.00788851 Jy
! Component: 150  -  total flux cleaned = 0.00764698 Jy
! Component: 200  -  total flux cleaned = 0.00722377 Jy
! Total flux subtracted in 200 components = 0.00722377 Jy
! Clean residual min=-0.003920 max=0.006513 Jy/beam
! Clean residual mean=0.000092 rms=0.001198 Jy/beam
! Combined flux in latest and established models = 0.735991 Jy
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 87 components and 0.735991 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.406591Jy  sigma=0.002361
! Fit after  self-cal, rms=0.406744Jy  sigma=0.002360
! Inverting map 
! Added new window around map position (25, 62).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00620791 Jy
! Component: 100  -  total flux cleaned = 0.0102031 Jy
! Component: 150  -  total flux cleaned = 0.0133063 Jy
! Component: 200  -  total flux cleaned = 0.0154574 Jy
! Total flux subtracted in 200 components = 0.0154574 Jy
! Clean residual min=-0.003375 max=0.003920 Jy/beam
! Clean residual mean=0.000060 rms=0.001008 Jy/beam
! Combined flux in latest and established models = 0.751448 Jy
! Performing phase self-cal
! Adding 36 model components to the UV plane model.
! The established model now contains 116 components and 0.751448 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.406614Jy  sigma=0.002359
! Fit after  self-cal, rms=0.406605Jy  sigma=0.002359
! 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.406605Jy  sigma=0.002359
! Fit after  self-cal, rms=0.407835Jy  sigma=0.002359
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.371 mas, bmaj=8.986 mas, bpa=-1.64 degrees
! Estimated noise=306.125 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00296989 Jy
! Component: 100  -  total flux cleaned = 0.00395826 Jy
! Component: 150  -  total flux cleaned = 0.00446973 Jy
! Component: 200  -  total flux cleaned = 0.00493577 Jy
! Total flux subtracted in 200 components = 0.00493577 Jy
! Clean residual min=-0.003238 max=0.003422 Jy/beam
! Clean residual mean=0.000064 rms=0.000909 Jy/beam
! Combined flux in latest and established models = 0.756384 Jy
selfcal
! Performing phase self-cal
! Adding 29 model components to the UV plane model.
! The established model now contains 129 components and 0.756384 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.407788Jy  sigma=0.002358
! Fit after  self-cal, rms=0.407796Jy  sigma=0.002358
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.00125722 Jy
! Component: 100  -  total flux cleaned = 0.00154301 Jy
! Component: 150  -  total flux cleaned = 0.00180148 Jy
! Component: 200  -  total flux cleaned = 0.00198101 Jy
! Total flux subtracted in 200 components = 0.00198101 Jy
! Clean residual min=-0.003278 max=0.003283 Jy/beam
! Clean residual mean=0.000060 rms=0.000878 Jy/beam
! Combined flux in latest and established models = 0.758365 Jy
! Performing phase self-cal
! Adding 34 model components to the UV plane model.
! The established model now contains 144 components and 0.758365 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.407774Jy  sigma=0.002358
! Fit after  self-cal, rms=0.407773Jy  sigma=0.002358
! 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.407773Jy  sigma=0.002358
! Fit after  self-cal, rms=0.408595Jy  sigma=0.002358
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.369 mas, bmaj=8.99 mas, bpa=-1.699 degrees
! Estimated noise=306.468 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.001599 Jy
! Component: 100  -  total flux cleaned = 0.00166826 Jy
! Component: 150  -  total flux cleaned = 0.0019011 Jy
! Component: 200  -  total flux cleaned = 0.00200556 Jy
! Total flux subtracted in 200 components = 0.00200556 Jy
! Clean residual min=-0.003297 max=0.003199 Jy/beam
! Clean residual mean=0.000067 rms=0.000842 Jy/beam
! Combined flux in latest and established models = 0.760371 Jy
selfcal
! Performing phase self-cal
! Adding 35 model components to the UV plane model.
! The established model now contains 158 components and 0.760371 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.408572Jy  sigma=0.002358
! Fit after  self-cal, rms=0.408574Jy  sigma=0.002358
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.00054842 Jy
! Component: 100  -  total flux cleaned = 0.000647237 Jy
! Component: 150  -  total flux cleaned = 0.00078723 Jy
! Component: 200  -  total flux cleaned = 0.000875563 Jy
! Total flux subtracted in 200 components = 0.000875563 Jy
! Clean residual min=-0.003331 max=0.003193 Jy/beam
! Clean residual mean=0.000065 rms=0.000827 Jy/beam
! Combined flux in latest and established models = 0.761246 Jy
! Performing phase self-cal
! Adding 33 model components to the UV plane model.
! The established model now contains 166 components and 0.761247 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.408561Jy  sigma=0.002358
! Fit after  self-cal, rms=0.408558Jy  sigma=0.002358
! 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.408558Jy  sigma=0.002358
! Fit after  self-cal, rms=0.408958Jy  sigma=0.002358
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.771 mas, bmaj=14.55 mas, bpa=2.872 degrees
! Estimated noise=375.895 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0017967 Jy
! Component: 100  -  total flux cleaned = 0.00208316 Jy
! Component: 150  -  total flux cleaned = 0.00212188 Jy
! Component: 200  -  total flux cleaned = 0.00208734 Jy
! Total flux subtracted in 200 components = 0.00208734 Jy
! Clean residual min=-0.003624 max=0.004875 Jy/beam
! Clean residual mean=0.000138 rms=0.001041 Jy/beam
! Combined flux in latest and established models = 0.763334 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 187 components and 0.763334 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.408951Jy  sigma=0.002358
! Fit after  self-cal, rms=0.408950Jy  sigma=0.002358
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 (28.5, 90).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0041394 Jy
! Component: 100  -  total flux cleaned = 0.00508585 Jy
! Component: 150  -  total flux cleaned = 0.00502714 Jy
! Component: 200  -  total flux cleaned = 0.00518969 Jy
! Total flux subtracted in 200 components = 0.00518969 Jy
! Clean residual min=-0.003196 max=0.003089 Jy/beam
! Clean residual mean=0.000108 rms=0.000943 Jy/beam
! Combined flux in latest and established models = 0.768524 Jy
! Performing phase self-cal
! Adding 55 model components to the UV plane model.
! The established model now contains 238 components and 0.768524 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.408915Jy  sigma=0.002357
! Fit after  self-cal, rms=0.408912Jy  sigma=0.002357
! 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=3.368 mas, bmaj=8.993 mas, bpa=-1.747 degrees
! Estimated noise=306.685 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.368 x 8.993 at -1.747 degrees (North through East)
! Clean map  min=-0.0037239  max=0.59837 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.408912Jy  sigma=0.002357
! Fit after  self-cal, rms=1.471899Jy  sigma=0.002203
! Inverting map and beam 
! Estimated beam: bmin=3.367 mas, bmaj=8.987 mas, bpa=-1.749 degrees
! Estimated noise=306.885 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000695431 Jy
! Component: 100  -  total flux cleaned = 0.00111293 Jy
! Component: 150  -  total flux cleaned = 0.00136686 Jy
! Component: 200  -  total flux cleaned = 0.00160552 Jy
! Total flux subtracted in 200 components = 0.00160552 Jy
! Clean residual min=-0.003247 max=0.002837 Jy/beam
! Clean residual mean=0.000046 rms=0.000724 Jy/beam
! Combined flux in latest and established models = 0.770129 Jy
! Performing phase self-cal
! Adding 40 model components to the UV plane model.
! The established model now contains 271 components and 0.770129 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.471891Jy  sigma=0.002203
! Fit after  self-cal, rms=1.471901Jy  sigma=0.002203
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000427835 Jy
! Component: 100  -  total flux cleaned = 0.000650099 Jy
! Component: 150  -  total flux cleaned = 0.00080561 Jy
! Component: 200  -  total flux cleaned = 0.000803791 Jy
! Total flux subtracted in 200 components = 0.000803791 Jy
! Clean residual min=-0.003201 max=0.002804 Jy/beam
! Clean residual mean=0.000044 rms=0.000710 Jy/beam
! Combined flux in latest and established models = 0.770933 Jy
! Performing phase self-cal
! Adding 45 model components to the UV plane model.
! The established model now contains 287 components and 0.770933 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.471895Jy  sigma=0.002203
! Fit after  self-cal, rms=1.471895Jy  sigma=0.002203
! Inverting map 
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.471895Jy  sigma=0.002203
! Fit after  self-cal, rms=2.230997Jy  sigma=0.002203
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.629 mas, bmaj=7.614 mas, bpa=-1.321 degrees
! Estimated noise=637.63 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.444193 Jy
! Component: 100  -  total flux cleaned = 0.55415 Jy
! Component: 150  -  total flux cleaned = 0.609374 Jy
! Component: 200  -  total flux cleaned = 0.645819 Jy
! Total flux subtracted in 200 components = 0.645819 Jy
! Clean residual min=-0.010505 max=0.020422 Jy/beam
! Clean residual mean=0.000073 rms=0.002757 Jy/beam
! Combined flux in latest and established models = 0.645819 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 27 model components to the UV plane model.
! The established model now contains 27 components and 0.645819 Jy
! Inverting map and beam 
! Estimated beam: bmin=3.366 mas, bmaj=8.986 mas, bpa=-1.761 degrees
! Estimated noise=306.941 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.0378308 Jy
! Component: 100  -  total flux cleaned = 0.0607881 Jy
! Component: 150  -  total flux cleaned = 0.0753303 Jy
! Component: 200  -  total flux cleaned = 0.0848603 Jy
! Total flux subtracted in 200 components = 0.0848603 Jy
! Clean residual min=-0.004151 max=0.005666 Jy/beam
! Clean residual mean=0.000139 rms=0.001190 Jy/beam
! Combined flux in latest and established models = 0.730679 Jy
! Adding 50 model components to the UV plane model.
! The established model now contains 65 components and 0.730679 Jy
! Inverting map 
! Added new window around map position (15, 19.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00709354 Jy
! Component: 100  -  total flux cleaned = 0.0128563 Jy
! Component: 150  -  total flux cleaned = 0.0177028 Jy
! Component: 200  -  total flux cleaned = 0.0219262 Jy
! Total flux subtracted in 200 components = 0.0219262 Jy
! Clean residual min=-0.003521 max=0.003286 Jy/beam
! Clean residual mean=0.000084 rms=0.000907 Jy/beam
! Combined flux in latest and established models = 0.752606 Jy
! Adding 63 model components to the UV plane model.
! The established model now contains 115 components and 0.752606 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.767 mas, bmaj=14.54 mas, bpa=2.891 degrees
! Estimated noise=376.432 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00564577 Jy
! Component: 100  -  total flux cleaned = 0.00990684 Jy
! Component: 150  -  total flux cleaned = 0.0129465 Jy
! Component: 200  -  total flux cleaned = 0.015115 Jy
! Total flux subtracted in 200 components = 0.015115 Jy
! Clean residual min=-0.003565 max=0.003337 Jy/beam
! Clean residual mean=0.000104 rms=0.000981 Jy/beam
! Combined flux in latest and established models = 0.767721 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.00126997 Jy
! Component: 100  -  total flux cleaned = 0.00245163 Jy
! Component: 150  -  total flux cleaned = 0.00333389 Jy
! Component: 200  -  total flux cleaned = 0.00418322 Jy
! Total flux subtracted in 200 components = 0.00418322 Jy
! Clean residual min=-0.003376 max=0.003222 Jy/beam
! Clean residual mean=0.000086 rms=0.000909 Jy/beam
! Combined flux in latest and established models = 0.771904 Jy
! Adding 121 model components to the UV plane model.
! The established model now contains 234 components and 0.771904 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=3.366 mas, bmaj=8.986 mas, bpa=-1.761 degrees
! Estimated noise=306.941 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000836408 Jy
! Component: 100  -  total flux cleaned = -0.000655284 Jy
! Component: 150  -  total flux cleaned = -0.000163703 Jy
! Component: 200  -  total flux cleaned = 0.000280723 Jy
! Total flux subtracted in 200 components = 0.000280723 Jy
! Clean residual min=-0.003324 max=0.002604 Jy/beam
! Clean residual mean=0.000043 rms=0.000717 Jy/beam
! Combined flux in latest and established models = 0.772184 Jy
selfcal
! Performing phase self-cal
! Adding 33 model components to the UV plane model.
! The established model now contains 266 components and 0.772184 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=2.231011Jy  sigma=0.002203
! Fit after  self-cal, rms=2.231004Jy  sigma=0.002203
wmodel J1939-1002_S_1998_10_01_pus_map.mod
! Writing 266 model components to file: J1939-1002_S_1998_10_01_pus_map.mod
wobs J1939-1002_S_1998_10_01_pus_uvs.fits
! Writing UV FITS file: J1939-1002_S_1998_10_01_pus_uvs.fits
wwins J1939-1002_S_1998_10_01_pus_map.win
! wwins: Wrote 6 windows to J1939-1002_S_1998_10_01_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.000862771 Jy
! Component: 100  -  total flux cleaned = -0.00110196 Jy
! Component: 150  -  total flux cleaned = -0.00105751 Jy
! Component: 200  -  total flux cleaned = -0.000838742 Jy
! Component: 250  -  total flux cleaned = -0.000882434 Jy
! Component: 300  -  total flux cleaned = -0.000798842 Jy
! Component: 350  -  total flux cleaned = -0.000758293 Jy
! Component: 400  -  total flux cleaned = -0.000718272 Jy
! Component: 450  -  total flux cleaned = -0.000796462 Jy
! Component: 500  -  total flux cleaned = -0.000757448 Jy
! Component: 550  -  total flux cleaned = -0.000681163 Jy
! Component: 600  -  total flux cleaned = -0.000681009 Jy
! Component: 650  -  total flux cleaned = -0.000570131 Jy
! Component: 700  -  total flux cleaned = -0.000606623 Jy
! Component: 750  -  total flux cleaned = -0.000534434 Jy
! Component: 800  -  total flux cleaned = -0.000570206 Jy
! Component: 850  -  total flux cleaned = -0.000640401 Jy
! Component: 900  -  total flux cleaned = -0.000675307 Jy
! Component: 950  -  total flux cleaned = -0.000572594 Jy
! Component: 1000  -  total flux cleaned = -0.000573411 Jy
! Component: 1050  -  total flux cleaned = -0.00060758 Jy
! Component: 1100  -  total flux cleaned = -0.000541325 Jy
! Component: 1150  -  total flux cleaned = -0.000410712 Jy
! Component: 1200  -  total flux cleaned = -0.000540698 Jy
! Component: 1250  -  total flux cleaned = -0.000476567 Jy
! Component: 1300  -  total flux cleaned = -0.000540066 Jy
! Component: 1350  -  total flux cleaned = -0.000508333 Jy
! Component: 1400  -  total flux cleaned = -0.000477553 Jy
! Component: 1450  -  total flux cleaned = -0.000601308 Jy
! Component: 1500  -  total flux cleaned = -0.000600656 Jy
! Component: 1550  -  total flux cleaned = -0.000509411 Jy
! Component: 1600  -  total flux cleaned = -0.000449224 Jy
! Component: 1650  -  total flux cleaned = -0.000389924 Jy
! Component: 1700  -  total flux cleaned = -0.000330746 Jy
! Component: 1750  -  total flux cleaned = -0.000242983 Jy
! Component: 1800  -  total flux cleaned = -0.000185198 Jy
! Component: 1850  -  total flux cleaned = -0.000185731 Jy
! Component: 1900  -  total flux cleaned = -0.000157071 Jy
! Component: 1950  -  total flux cleaned = -0.000128875 Jy
! Component: 2000  -  total flux cleaned = -0.000128873 Jy
! Component: 2050  -  total flux cleaned = 1.05694e-05 Jy
! Component: 2100  -  total flux cleaned = 9.34691e-05 Jy
! Component: 2150  -  total flux cleaned = 0.000203378 Jy
! Component: 2200  -  total flux cleaned = 0.000203436 Jy
! Component: 2250  -  total flux cleaned = 0.000338812 Jy
! Component: 2300  -  total flux cleaned = 0.000499512 Jy
! Component: 2350  -  total flux cleaned = 0.000499204 Jy
! Component: 2400  -  total flux cleaned = 0.000578626 Jy
! Component: 2450  -  total flux cleaned = 0.000631183 Jy
! Component: 2500  -  total flux cleaned = 0.000814401 Jy
! Component: 2550  -  total flux cleaned = 0.000866197 Jy
! Component: 2600  -  total flux cleaned = 0.000943693 Jy
! Component: 2650  -  total flux cleaned = 0.000969513 Jy
! Component: 2700  -  total flux cleaned = 0.000995146 Jy
! Component: 2750  -  total flux cleaned = 0.00114713 Jy
! Component: 2800  -  total flux cleaned = 0.00124765 Jy
! Component: 2850  -  total flux cleaned = 0.00134766 Jy
! Component: 2900  -  total flux cleaned = 0.00149655 Jy
! Component: 2950  -  total flux cleaned = 0.00157035 Jy
! Component: 3000  -  total flux cleaned = 0.00169283 Jy
! Component: 3050  -  total flux cleaned = 0.00164431 Jy
! Component: 3100  -  total flux cleaned = 0.00174111 Jy
! Component: 3150  -  total flux cleaned = 0.00181346 Jy
! Component: 3200  -  total flux cleaned = 0.00193323 Jy
! Component: 3250  -  total flux cleaned = 0.00190931 Jy
! Component: 3300  -  total flux cleaned = 0.00195674 Jy
! Component: 3350  -  total flux cleaned = 0.00200371 Jy
! Component: 3400  -  total flux cleaned = 0.00202709 Jy
! Component: 3450  -  total flux cleaned = 0.00216654 Jy
! Component: 3500  -  total flux cleaned = 0.00216647 Jy
! Component: 3550  -  total flux cleaned = 0.00212044 Jy
! Component: 3600  -  total flux cleaned = 0.00225788 Jy
! Component: 3650  -  total flux cleaned = 0.00225806 Jy
! Component: 3700  -  total flux cleaned = 0.00234883 Jy
! Component: 3750  -  total flux cleaned = 0.0023715 Jy
! Component: 3800  -  total flux cleaned = 0.00248365 Jy
! Component: 3850  -  total flux cleaned = 0.002573 Jy
! Component: 3900  -  total flux cleaned = 0.00252871 Jy
! Component: 3950  -  total flux cleaned = 0.00263929 Jy
! Component: 4000  -  total flux cleaned = 0.00268345 Jy
! Component: 4050  -  total flux cleaned = 0.00283648 Jy
! Total flux subtracted in 4096 components = 0.00294524 Jy
! Clean residual min=-0.001616 max=0.001544 Jy/beam
! Clean residual mean=0.000040 rms=0.000418 Jy/beam
! Combined flux in latest and established models = 0.77513 Jy
keep
! Adding 340 model components to the UV plane model.
! The established model now contains 606 components and 0.775129 Jy
![Exited script file: muppet]
wmap "J1939-1002_S_1998_10_01_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.366 x 8.986 at -1.761 degrees (North through East)
! Clean map  min=-0.0024114  max=0.59688 Jy/beam
! Writing clean map to FITS file: J1939-1002_S_1998_10_01_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.596883 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000416418 
device "J1939-1002_S_1998_10_01_pus\_map.eps/VPS"
! Attempting to open device: 'J1939-1002_S_1998_10_01_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.209296 0.209296 0.418592 0.837184 1.67437 3.34874 6.69747 13.3949 26.7899 53.5798
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0012 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.596 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.366 x 8.986 at -1.761 degrees (North through East)
! Clean map  min=-0.0024114  max=0.59688 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1939-1002_S_1998_10_01_pus\_map.gif/vgif"
! Attempting to open device: 'J1939-1002_S_1998_10_01_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1939-1002_S_1998_10_01_pus_uvs.log closed on Fri Feb  8 12:42:56 2008