! Started logfile: J0121+0422_S_1999_05_10_pus_uvs.log on Mon Jan 21 17:23:08 2008
obs J0121+0422_S_1999_05_10_pus_uva.fits
! Reading UV FITS file: J0121+0422_S_1999_05_10_pus_uva.fits
! AN table 1: 77 integrations on 153 of 153 possible baselines.
! AN table 2: 18 integrations on 153 of 153 possible baselines.
! AN table 3: 99 integrations on 153 of 153 possible baselines.
! Apparent sampling: 0.217506 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0121+0422
! 
! 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.22497e+09        8e+06          1        8e+06
!  02        2  2.24497e+09        8e+06          1        8e+06
!  03        3  2.33497e+09        8e+06          1        8e+06
!  04        4  2.36497e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 1998 lines of history.
! 
! Reading 25824 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 = 512 
print "field_cell =",field_cell
! field_cell = 0.5 
print "taper_size =",taper_size
! taper_size = 20 
![@muppet J0121+0422_S_1999_05_10_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 = 512x512 pixels with 0.500x0.500 milli-arcsec cellsize.
startmod
! Applying default point source starting model.
! Performing phase self-cal
! Adding 1 model components to the UV plane model.
! The established model now contains 1 components and 1 Jy
! 
! Correcting IF 1.
!  A total of 947 telescope corrections were flagged in sub-array 1.
!  A total of 254 telescope corrections were flagged in sub-array 2.
!  A total of 773 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 947 telescope corrections were flagged in sub-array 1.
!  A total of 254 telescope corrections were flagged in sub-array 2.
!  A total of 773 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 947 telescope corrections were flagged in sub-array 1.
!  A total of 254 telescope corrections were flagged in sub-array 2.
!  A total of 773 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 1028 telescope corrections were flagged in sub-array 1.
!  A total of 254 telescope corrections were flagged in sub-array 2.
!  A total of 773 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=1.033025Jy  sigma=0.007292
! Fit after  self-cal, rms=0.343914Jy  sigma=0.002751
! 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.409 mas, bmaj=3.932 mas, bpa=1.128 degrees
! Estimated noise=991.565 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.93963 Jy
! Component: 100  -  total flux cleaned = 1.15469 Jy
! Total flux subtracted in 100 components = 1.15469 Jy
! Clean residual min=-0.024728 max=0.078489 Jy/beam
! Clean residual mean=0.000082 rms=0.008609 Jy/beam
! Combined flux in latest and established models = 1.15469 Jy
! Performing phase self-cal
! Adding 6 model components to the UV plane model.
! The established model now contains 6 components and 1.15469 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.270495Jy  sigma=0.001860
! Fit after  self-cal, rms=0.270599Jy  sigma=0.001860
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0824919 Jy
! Component: 100  -  total flux cleaned = 0.122975 Jy
! Total flux subtracted in 100 components = 0.122975 Jy
! Clean residual min=-0.016570 max=0.022071 Jy/beam
! Clean residual mean=-0.000014 rms=0.004595 Jy/beam
! Combined flux in latest and established models = 1.27766 Jy
! Performing phase self-cal
! Adding 10 model components to the UV plane model.
! The established model now contains 13 components and 1.27766 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.246488Jy  sigma=0.001487
! Fit after  self-cal, rms=0.246636Jy  sigma=0.001486
! 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.857 mas, bmaj=5.079 mas, bpa=-1.39 degrees
! Estimated noise=535.132 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.0299964 Jy
! Component: 100  -  total flux cleaned = 0.0443661 Jy
! Component: 150  -  total flux cleaned = 0.0519811 Jy
! Component: 200  -  total flux cleaned = 0.0562337 Jy
! Total flux subtracted in 200 components = 0.0562337 Jy
! Clean residual min=-0.014188 max=0.015545 Jy/beam
! Clean residual mean=-0.000067 rms=0.003537 Jy/beam
! Combined flux in latest and established models = 1.33389 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 34 components and 1.33389 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.244572Jy  sigma=0.001434
! Fit after  self-cal, rms=0.244577Jy  sigma=0.001434
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 12 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    HH        0.97     
!   HN        0.98     KK        1.00*    KP        1.00*    LA        1.00*    
!   MC        0.95     MK        1.00*    NL        1.00*    NY        1.00     
!   ON        1.00     OV        1.00*    PT        1.00*    SC        1.11     
!   WF        1.01     WZ        0.97     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        1.00*    GC        1.01     HH        1.00*    
!   HN        1.00*    KK        0.97     KP        1.00*    LA        1.00*    
!   MC        1.00*    MK        0.94     NL        1.00*    NY        1.00*    
!   ON        1.00*    OV        1.04     PT        1.00*    SC        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 33 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        0.99     GC        1.00     HH        1.00*    
!   HN        1.03     KK        0.98     KP        1.01     LA        1.00     
!   MC        1.00*    MK        0.97     NL        0.98     NY        1.00*    
!   ON        1.00*    OV        1.02     PT        1.01     SC        1.01     
!   WF        1.04     WZ        1.00*    
! 
! 
! Correcting IF 2.
!  A total of 12 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    HH        0.98     
!   HN        1.03     KK        1.00*    KP        1.00*    LA        1.00*    
!   MC        0.93     MK        1.00*    NL        1.00*    NY        0.99     
!   ON        1.05     OV        1.00*    PT        1.00*    SC        1.10     
!   WF        1.02     WZ        0.96     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.02     FD        1.00*    GC        0.96     HH        1.00*    
!   HN        1.00*    KK        1.01     KP        1.00*    LA        1.00*    
!   MC        1.00*    MK        1.03     NL        1.00*    NY        1.00*    
!   ON        1.00*    OV        1.02     PT        1.00*    SC        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 33 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.97     FD        1.02     GC        0.98     HH        1.00*    
!   HN        1.03     KK        0.97     KP        1.01     LA        0.97     
!   MC        1.00*    MK        1.03     NL        1.00     NY        1.00*    
!   ON        1.00*    OV        0.99     PT        1.00     SC        1.04     
!   WF        1.03     WZ        1.00*    
! 
! 
! Correcting IF 3.
!  A total of 12 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    HH        0.92     
!   HN        1.00     KK        1.00*    KP        1.00*    LA        1.00*    
!   MC        2.49     MK        1.00*    NL        1.00*    NY        1.04     
!   ON        1.02     OV        1.00*    PT        1.00*    SC        1.10     
!   WF        1.05     WZ        0.91     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.03     FD        1.00*    GC        0.95     HH        1.00*    
!   HN        1.00*    KK        0.98     KP        1.00*    LA        1.00*    
!   MC        1.00*    MK        0.97     NL        1.00*    NY        1.00*    
!   ON        1.00*    OV        1.00     PT        1.00*    SC        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 33 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        1.00     GC        1.00     HH        1.00*    
!   HN        1.05     KK        0.97     KP        0.99     LA        1.00     
!   MC        1.00*    MK        0.98     NL        1.01     NY        1.00*    
!   ON        1.00*    OV        0.99     PT        0.96     SC        1.04     
!   WF        1.06     WZ        1.00*    
! 
! 
! Correcting IF 4.
!  A total of 45 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.00*    FD        1.00*    GC        1.00*    HH        0.97     
!   HN        1.03     KK        1.00*    KP        1.00*    LA        1.00*    
!   MC        1.53     MK        1.00*    NL        1.00*    NY        1.12     
!   ON        1.01     OV        1.00*    PT        1.00*    SC        1.02     
!   WF        1.03     WZ        1.00*    
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00     FD        1.00*    GC        1.00     HH        1.00*    
!   HN        1.00*    KK        0.96     KP        1.00*    LA        1.00*    
!   MC        1.00*    MK        1.00     NL        1.00*    NY        1.00*    
!   ON        1.00*    OV        0.94     PT        1.00*    SC        1.00*    
!   WF        1.00*    WZ        1.00*    
! 
!  A total of 33 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.95     FD        0.98     GC        1.00     HH        1.00*    
!   HN        1.04     KK        0.98     KP        1.00     LA        0.99     
!   MC        1.00*    MK        1.01     NL        1.03     NY        1.00*    
!   ON        1.00*    OV        0.95     PT        1.00     SC        1.04     
!   WF        1.04     WZ        1.00*    
! 
! 
! Fit before self-cal, rms=0.244577Jy  sigma=0.001434
! Fit after  self-cal, rms=0.284591Jy  sigma=0.001291
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.085 mas, bpa=-1.451 degrees
! Estimated noise=537.605 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.00251451 Jy
! Component: 100  -  total flux cleaned = -0.00266048 Jy
! Component: 150  -  total flux cleaned = -0.00278089 Jy
! Component: 200  -  total flux cleaned = -0.00287446 Jy
! Total flux subtracted in 200 components = -0.00287446 Jy
! Clean residual min=-0.004860 max=0.006137 Jy/beam
! Clean residual mean=-0.000005 rms=0.001113 Jy/beam
! Combined flux in latest and established models = 1.33102 Jy
! Performing phase self-cal
! Adding 8 model components to the UV plane model.
! The established model now contains 39 components and 1.33102 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.284412Jy  sigma=0.001289
! Fit after  self-cal, rms=0.286870Jy  sigma=0.001287
! Inverting map 
! Added new window around map position (4.5, -1.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00328642 Jy
! Component: 100  -  total flux cleaned = 0.00257138 Jy
! Component: 150  -  total flux cleaned = 0.00267237 Jy
! Component: 200  -  total flux cleaned = 0.00285774 Jy
! Total flux subtracted in 200 components = 0.00285774 Jy
! Clean residual min=-0.003837 max=0.003452 Jy/beam
! Clean residual mean=-0.000014 rms=0.000938 Jy/beam
! Combined flux in latest and established models = 1.33388 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 52 components and 1.33388 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.286715Jy  sigma=0.001284
! Fit after  self-cal, rms=0.286701Jy  sigma=0.001284
! 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.286701Jy  sigma=0.001284
! Fit after  self-cal, rms=0.293721Jy  sigma=0.001284
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.082 mas, bpa=-1.494 degrees
! Estimated noise=537.375 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000388973 Jy
! Component: 100  -  total flux cleaned = -9.87929e-05 Jy
! Component: 150  -  total flux cleaned = 6.28705e-05 Jy
! Component: 200  -  total flux cleaned = 0.000209588 Jy
! Total flux subtracted in 200 components = 0.000209588 Jy
! Clean residual min=-0.003436 max=0.003073 Jy/beam
! Clean residual mean=-0.000030 rms=0.000844 Jy/beam
! Combined flux in latest and established models = 1.33409 Jy
selfcal
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 58 components and 1.33409 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.293644Jy  sigma=0.001283
! Fit after  self-cal, rms=0.293818Jy  sigma=0.001283
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.000351883 Jy
! Component: 100  -  total flux cleaned = 0.000616578 Jy
! Component: 150  -  total flux cleaned = 0.000677943 Jy
! Component: 200  -  total flux cleaned = 0.000731711 Jy
! Total flux subtracted in 200 components = 0.000731711 Jy
! Clean residual min=-0.003343 max=0.002981 Jy/beam
! Clean residual mean=-0.000034 rms=0.000815 Jy/beam
! Combined flux in latest and established models = 1.33482 Jy
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 64 components and 1.33482 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.293779Jy  sigma=0.001283
! Fit after  self-cal, rms=0.293775Jy  sigma=0.001283
! 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.293775Jy  sigma=0.001283
! Fit after  self-cal, rms=0.294375Jy  sigma=0.001283
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.084 mas, bpa=-1.548 degrees
! Estimated noise=537.28 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000536203 Jy
! Component: 100  -  total flux cleaned = -0.000413676 Jy
! Component: 150  -  total flux cleaned = -0.000305285 Jy
! Component: 200  -  total flux cleaned = -0.000207012 Jy
! Total flux subtracted in 200 components = -0.000207012 Jy
! Clean residual min=-0.003244 max=0.002825 Jy/beam
! Clean residual mean=-0.000037 rms=0.000772 Jy/beam
! Combined flux in latest and established models = 1.33461 Jy
selfcal
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 69 components and 1.33461 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294336Jy  sigma=0.001282
! Fit after  self-cal, rms=0.294340Jy  sigma=0.001282
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.000122083 Jy
! Component: 100  -  total flux cleaned = 0.000296201 Jy
! Component: 150  -  total flux cleaned = 0.000295232 Jy
! Component: 200  -  total flux cleaned = 0.000332674 Jy
! Total flux subtracted in 200 components = 0.000332674 Jy
! Clean residual min=-0.003210 max=0.002757 Jy/beam
! Clean residual mean=-0.000039 rms=0.000761 Jy/beam
! Combined flux in latest and established models = 1.33495 Jy
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 74 components and 1.33495 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294317Jy  sigma=0.001282
! Fit after  self-cal, rms=0.294318Jy  sigma=0.001282
! 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.294318Jy  sigma=0.001282
! Fit after  self-cal, rms=0.294511Jy  sigma=0.001282
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.342 mas, bmaj=10.77 mas, bpa=10.52 degrees
! Estimated noise=707.459 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00039493 Jy
! Component: 100  -  total flux cleaned = 0.000505688 Jy
! Component: 150  -  total flux cleaned = 0.000594674 Jy
! Component: 200  -  total flux cleaned = 0.000594387 Jy
! Total flux subtracted in 200 components = 0.000594387 Jy
! Clean residual min=-0.003210 max=0.002686 Jy/beam
! Clean residual mean=-0.000127 rms=0.000941 Jy/beam
! Combined flux in latest and established models = 1.33554 Jy
selfcal
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 83 components and 1.33554 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294500Jy  sigma=0.001282
! Fit after  self-cal, rms=0.294497Jy  sigma=0.001282
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 = -4.54456e-05 Jy
! Component: 100  -  total flux cleaned = 1.11956e-05 Jy
! Component: 150  -  total flux cleaned = 2.38328e-05 Jy
! Component: 200  -  total flux cleaned = 2.3678e-05 Jy
! Total flux subtracted in 200 components = 2.3678e-05 Jy
! Clean residual min=-0.003204 max=0.002683 Jy/beam
! Clean residual mean=-0.000127 rms=0.000941 Jy/beam
! Combined flux in latest and established models = 1.33556 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 90 components and 1.33556 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.294492Jy  sigma=0.001282
! Fit after  self-cal, rms=0.294490Jy  sigma=0.001282
! 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.862 mas, bmaj=5.086 mas, bpa=-1.605 degrees
! Estimated noise=537.234 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.862 x 5.086 at -1.605 degrees (North through East)
! Clean map  min=-0.0043581  max=1.2243 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.294490Jy  sigma=0.001282
! Fit after  self-cal, rms=1.264872Jy  sigma=0.001150
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.081 mas, bpa=-1.581 degrees
! Estimated noise=537.088 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00110343 Jy
! Component: 100  -  total flux cleaned = -0.00130229 Jy
! Component: 150  -  total flux cleaned = -0.00138881 Jy
! Component: 200  -  total flux cleaned = -0.00150661 Jy
! Total flux subtracted in 200 components = -0.00150661 Jy
! Clean residual min=-0.003150 max=0.002540 Jy/beam
! Clean residual mean=-0.000031 rms=0.000738 Jy/beam
! Combined flux in latest and established models = 1.33406 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 97 components and 1.33406 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.264869Jy  sigma=0.001150
! Fit after  self-cal, rms=1.264871Jy  sigma=0.001150
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000180693 Jy
! Component: 100  -  total flux cleaned = -0.000249867 Jy
! Component: 150  -  total flux cleaned = -0.000312221 Jy
! Component: 200  -  total flux cleaned = -0.000427383 Jy
! Total flux subtracted in 200 components = -0.000427383 Jy
! Clean residual min=-0.003148 max=0.002568 Jy/beam
! Clean residual mean=-0.000028 rms=0.000735 Jy/beam
! Combined flux in latest and established models = 1.33363 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 101 components and 1.33363 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=1.264866Jy  sigma=0.001150
! Fit after  self-cal, rms=1.264866Jy  sigma=0.001150
! 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.264866Jy  sigma=0.001150
! Fit after  self-cal, rms=2.128554Jy  sigma=0.001150
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.425 mas, bmaj=3.935 mas, bpa=1.185 degrees
! Estimated noise=1012.9 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.942413 Jy
! Component: 100  -  total flux cleaned = 1.15622 Jy
! Component: 150  -  total flux cleaned = 1.23318 Jy
! Component: 200  -  total flux cleaned = 1.27003 Jy
! Total flux subtracted in 200 components = 1.27003 Jy
! Clean residual min=-0.008974 max=0.017037 Jy/beam
! Clean residual mean=0.000045 rms=0.002472 Jy/beam
! Combined flux in latest and established models = 1.27003 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 12 model components to the UV plane model.
! The established model now contains 12 components and 1.27003 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.082 mas, bpa=-1.62 degrees
! Estimated noise=537.028 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.0268333 Jy
! Component: 100  -  total flux cleaned = 0.0415724 Jy
! Component: 150  -  total flux cleaned = 0.05065 Jy
! Component: 200  -  total flux cleaned = 0.0554659 Jy
! Total flux subtracted in 200 components = 0.0554659 Jy
! Clean residual min=-0.003764 max=0.004135 Jy/beam
! Clean residual mean=0.000014 rms=0.000958 Jy/beam
! Combined flux in latest and established models = 1.32549 Jy
! Adding 31 model components to the UV plane model.
! The established model now contains 39 components and 1.32549 Jy
! Inverting map 
! Added new window around map position (41, -45).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00247824 Jy
! Component: 100  -  total flux cleaned = 0.00405651 Jy
! Component: 150  -  total flux cleaned = 0.00523671 Jy
! Component: 200  -  total flux cleaned = 0.00611617 Jy
! Total flux subtracted in 200 components = 0.00611617 Jy
! Clean residual min=-0.003329 max=0.003059 Jy/beam
! Clean residual mean=-0.000025 rms=0.000770 Jy/beam
! Combined flux in latest and established models = 1.33161 Jy
! Adding 21 model components to the UV plane model.
! The established model now contains 51 components and 1.33161 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.344 mas, bmaj=10.78 mas, bpa=10.47 degrees
! Estimated noise=707.164 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0023064 Jy
! Component: 100  -  total flux cleaned = 0.00282912 Jy
! Component: 150  -  total flux cleaned = 0.00313631 Jy
! Component: 200  -  total flux cleaned = 0.00324483 Jy
! Total flux subtracted in 200 components = 0.00324483 Jy
! Clean residual min=-0.003536 max=0.003183 Jy/beam
! Clean residual mean=-0.000116 rms=0.000966 Jy/beam
! Combined flux in latest and established models = 1.33486 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 = 3.10396e-05 Jy
! Component: 100  -  total flux cleaned = 3.12426e-05 Jy
! Component: 150  -  total flux cleaned = 3.25415e-05 Jy
! Component: 200  -  total flux cleaned = 3.34869e-05 Jy
! Total flux subtracted in 200 components = 3.34869e-05 Jy
! Clean residual min=-0.003461 max=0.003187 Jy/beam
! Clean residual mean=-0.000115 rms=0.000957 Jy/beam
! Combined flux in latest and established models = 1.33489 Jy
! Adding 45 model components to the UV plane model.
! The established model now contains 90 components and 1.33489 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.861 mas, bmaj=5.082 mas, bpa=-1.62 degrees
! Estimated noise=537.028 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000103429 Jy
! Component: 100  -  total flux cleaned = 4.56911e-06 Jy
! Component: 150  -  total flux cleaned = 6.89108e-06 Jy
! Component: 200  -  total flux cleaned = 7.17193e-06 Jy
! Total flux subtracted in 200 components = 7.17193e-06 Jy
! Clean residual min=-0.003074 max=0.002752 Jy/beam
! Clean residual mean=-0.000042 rms=0.000711 Jy/beam
! Combined flux in latest and established models = 1.3349 Jy
selfcal
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 102 components and 1.3349 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=2.128552Jy  sigma=0.001150
! Fit after  self-cal, rms=2.128575Jy  sigma=0.001149
wmodel J0121+0422_S_1999_05_10_pus_map.mod
! Writing 102 model components to file: J0121+0422_S_1999_05_10_pus_map.mod
wobs J0121+0422_S_1999_05_10_pus_uvs.fits
! Writing UV FITS file: J0121+0422_S_1999_05_10_pus_uvs.fits
wwins J0121+0422_S_1999_05_10_pus_map.win
! wwins: Wrote 3 windows to J0121+0422_S_1999_05_10_pus_map.win
x = (field_size-8) * field_cell / 4
addwin -x,x,-x,x
clean (field_size*4),0.01
! Inverting map 
! clean: niter=2048  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = -0.000336247 Jy
! Component: 100  -  total flux cleaned = -2.64657e-05 Jy
! Component: 150  -  total flux cleaned = 0.000223997 Jy
! Component: 200  -  total flux cleaned = 0.000304148 Jy
! Component: 250  -  total flux cleaned = 0.000304873 Jy
! Component: 300  -  total flux cleaned = 0.000342033 Jy
! Component: 350  -  total flux cleaned = 0.000304824 Jy
! Component: 400  -  total flux cleaned = 0.000128899 Jy
! Component: 450  -  total flux cleaned = -7.96446e-06 Jy
! Component: 500  -  total flux cleaned = -0.000142367 Jy
! Component: 550  -  total flux cleaned = -0.000339606 Jy
! Component: 600  -  total flux cleaned = -0.000403899 Jy
! Component: 650  -  total flux cleaned = -0.000562292 Jy
! Component: 700  -  total flux cleaned = -0.000687311 Jy
! Component: 750  -  total flux cleaned = -0.000841615 Jy
! Component: 800  -  total flux cleaned = -0.00105465 Jy
! Component: 850  -  total flux cleaned = -0.00114475 Jy
! Component: 900  -  total flux cleaned = -0.00138139 Jy
! Component: 950  -  total flux cleaned = -0.00149806 Jy
! Component: 1000  -  total flux cleaned = -0.00169905 Jy
! Component: 1050  -  total flux cleaned = -0.00184031 Jy
! Component: 1100  -  total flux cleaned = -0.00198 Jy
! Component: 1150  -  total flux cleaned = -0.00220073 Jy
! Component: 1200  -  total flux cleaned = -0.00233688 Jy
! Component: 1250  -  total flux cleaned = -0.00252576 Jy
! Component: 1300  -  total flux cleaned = -0.00281863 Jy
! Component: 1350  -  total flux cleaned = -0.00297633 Jy
! Component: 1400  -  total flux cleaned = -0.00323654 Jy
! Component: 1450  -  total flux cleaned = -0.00336537 Jy
! Component: 1500  -  total flux cleaned = -0.0035181 Jy
! Component: 1550  -  total flux cleaned = -0.00371978 Jy
! Component: 1600  -  total flux cleaned = -0.00394452 Jy
! Component: 1650  -  total flux cleaned = -0.00411706 Jy
! Component: 1700  -  total flux cleaned = -0.00428803 Jy
! Component: 1750  -  total flux cleaned = -0.00440911 Jy
! Component: 1800  -  total flux cleaned = -0.00462497 Jy
! Component: 1850  -  total flux cleaned = -0.0047437 Jy
! Component: 1900  -  total flux cleaned = -0.0049084 Jy
! Component: 1950  -  total flux cleaned = -0.00514179 Jy
! Component: 2000  -  total flux cleaned = -0.00523433 Jy
! Total flux subtracted in 2048 components = -0.0054638 Jy
! Clean residual min=-0.001655 max=0.001357 Jy/beam
! Clean residual mean=-0.000036 rms=0.000443 Jy/beam
! Combined flux in latest and established models = 1.32943 Jy
keep
! Adding 135 model components to the UV plane model.
! The established model now contains 237 components and 1.32943 Jy
![Exited script file: muppet]
wmap "J0121+0422_S_1999_05_10_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.861 x 5.082 at -1.62 degrees (North through East)
! Clean map  min=-0.0049238  max=1.2263 Jy/beam
! Writing clean map to FITS file: J0121+0422_S_1999_05_10_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.22632 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000441099 
device "J0121+0422_S_1999_05_10_pus\_map.eps/VPS"
! Attempting to open device: 'J0121+0422_S_1999_05_10_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.107908 0.107908 0.215816 0.431632 0.863263 1.72653 3.45305 6.90611 13.8122 27.6244 55.2489
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0013 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.226 
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.861 x 5.082 at -1.62 degrees (North through East)
! Clean map  min=-0.0049238  max=1.2263 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0121+0422_S_1999_05_10_pus\_map.gif/vgif"
! Attempting to open device: 'J0121+0422_S_1999_05_10_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0121+0422_S_1999_05_10_pus_uvs.log closed on Mon Jan 21 17:23:19 2008