! Started logfile: J0136+4751_S_2003_09_17_pus_uvs.log on Tue May 22 17:04:59 2007
obs J0136+4751_S_2003_09_17_pus_uva.fits
! Reading UV FITS file: J0136+4751_S_2003_09_17_pus_uva.fits
! AN table 1: 12 integrations on 120 of 120 possible baselines.
! AN table 2: 54 integrations on 120 of 120 possible baselines.
! AN table 3: 57 integrations on 120 of 120 possible baselines.
! AN table 4: 44 integrations on 120 of 120 possible baselines.
! AN table 5: 51 integrations on 120 of 120 possible baselines.
! AN table 6: 89 integrations on 120 of 120 possible baselines.
! Apparent sampling: 0.22253 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0136+4751
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! 
! There are 4 IFs, and a total of 4 channels:
! 
!  IF  Channel    Frequency  Freq offset  Number of   Overall IF
!       origin    at origin  per channel   channels    bandwidth
!  ------------------------------------------------------------- (Hz)
!  01        1  2.23697e+09        8e+06          1        8e+06
!  02        2  2.26697e+09        8e+06          1        8e+06
!  03        3  2.35697e+09        8e+06          1        8e+06
!  04        4  2.37697e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 1736 lines of history.
! 
! Reading 32792 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 
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 192 telescope corrections were flagged in sub-array 1.
!  A total of 723 telescope corrections were flagged in sub-array 2.
!  A total of 768 telescope corrections were flagged in sub-array 3.
!  A total of 315 telescope corrections were flagged in sub-array 4.
!  A total of 792 telescope corrections were flagged in sub-array 5.
!  A total of 500 telescope corrections were flagged in sub-array 6.
! 
! Correcting IF 2.
!  A total of 192 telescope corrections were flagged in sub-array 1.
!  A total of 723 telescope corrections were flagged in sub-array 2.
!  A total of 768 telescope corrections were flagged in sub-array 3.
!  A total of 315 telescope corrections were flagged in sub-array 4.
!  A total of 792 telescope corrections were flagged in sub-array 5.
!  A total of 500 telescope corrections were flagged in sub-array 6.
! 
! Correcting IF 3.
!  A total of 192 telescope corrections were flagged in sub-array 1.
!  A total of 723 telescope corrections were flagged in sub-array 2.
!  A total of 768 telescope corrections were flagged in sub-array 3.
!  A total of 315 telescope corrections were flagged in sub-array 4.
!  A total of 792 telescope corrections were flagged in sub-array 5.
!  A total of 500 telescope corrections were flagged in sub-array 6.
! 
! Correcting IF 4.
!  A total of 192 telescope corrections were flagged in sub-array 1.
!  A total of 723 telescope corrections were flagged in sub-array 2.
!  A total of 768 telescope corrections were flagged in sub-array 3.
!  A total of 315 telescope corrections were flagged in sub-array 4.
!  A total of 792 telescope corrections were flagged in sub-array 5.
!  A total of 500 telescope corrections were flagged in sub-array 6.
! 
! Fit before self-cal, rms=1.212054Jy  sigma=0.007677
! Fit after  self-cal, rms=0.640812Jy  sigma=0.004605
! 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.094 mas, bmaj=2.45 mas, bpa=-6.77 degrees
! Estimated noise=1265.75 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.965917 Jy
! Component: 100  -  total flux cleaned = 1.29566 Jy
! Total flux subtracted in 100 components = 1.29566 Jy
! Clean residual min=-0.040582 max=0.154782 Jy/beam
! Clean residual mean=0.001090 rms=0.014677 Jy/beam
! Combined flux in latest and established models = 1.29566 Jy
! Performing phase self-cal
! Adding 9 model components to the UV plane model.
! The established model now contains 9 components and 1.29566 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486230Jy  sigma=0.003360
! Fit after  self-cal, rms=0.484940Jy  sigma=0.003354
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.17876 Jy
! Component: 100  -  total flux cleaned = 0.292577 Jy
! Total flux subtracted in 100 components = 0.292577 Jy
! Clean residual min=-0.032773 max=0.068238 Jy/beam
! Clean residual mean=0.000466 rms=0.009096 Jy/beam
! Combined flux in latest and established models = 1.58824 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 24 components and 1.58824 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.383159Jy  sigma=0.002414
! Fit after  self-cal, rms=0.382072Jy  sigma=0.002408
! Inverting map 
! Added new window around map position (-1, 3).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0837917 Jy
! Component: 100  -  total flux cleaned = 0.143942 Jy
! Total flux subtracted in 100 components = 0.143942 Jy
! Clean residual min=-0.028787 max=0.036615 Jy/beam
! Clean residual mean=0.000161 rms=0.006998 Jy/beam
! Combined flux in latest and established models = 1.73218 Jy
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 33 components and 1.73218 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.352226Jy  sigma=0.002078
! Fit after  self-cal, rms=0.351710Jy  sigma=0.002076
! 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.37 mas, bmaj=2.797 mas, bpa=-17.53 degrees
! Estimated noise=641.254 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.0923967 Jy
! Component: 100  -  total flux cleaned = 0.152499 Jy
! Component: 150  -  total flux cleaned = 0.194235 Jy
! Component: 200  -  total flux cleaned = 0.223678 Jy
! Total flux subtracted in 200 components = 0.223678 Jy
! Clean residual min=-0.019259 max=0.032929 Jy/beam
! Clean residual mean=-0.000353 rms=0.006943 Jy/beam
! Combined flux in latest and established models = 1.95586 Jy
! Performing phase self-cal
! Adding 40 model components to the UV plane model.
! The established model now contains 57 components and 1.95586 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.332411Jy  sigma=0.001788
! Fit after  self-cal, rms=0.331712Jy  sigma=0.001783
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  Telescope amplitude corrections in sub-array 1:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 27 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   FD        1.00*    GC        1.06     HN        1.12     KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.03     
!   ON        1.13     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.03     KK        1.00*    WZ        1.01     WF        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   FD        1.00*    GC        1.08     HN        1.00*    KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.04     
!   ON        1.08     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.06     KK        1.00*    WZ        1.00*    WF        1.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   FD        1.06     GC        1.05     HN        1.00     KP        1.19     
!   LA        1.00     MK        1.00*    NL        1.07     NY        1.03     
!   ON        0.98     OV        1.06     PT        1.02     SC        1.00     
!   TS        1.00*    KK        1.00*    WZ        1.00     WF        1.08     
! 
!  A total of 24 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 6.
!  Telescope amplitude corrections in sub-array 6:
!   FD        0.93     GC        1.03     HN        1.03     KP        0.92     
!   LA        0.96     MK        0.99     NL        0.96     NY        1.02     
!   ON        1.08     OV        1.07     PT        0.90     SC        1.04     
!   TS        1.11     KK        1.01     WZ        1.12     WF        1.00     
! 
! 
! Correcting IF 2.
!  Telescope amplitude corrections in sub-array 1:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 27 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   FD        1.00*    GC        0.97     HN        1.22     KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.04     
!   ON        1.05     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.04     KK        1.00*    WZ        0.94     WF        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   FD        1.00*    GC        1.00     HN        1.00*    KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.08     
!   ON        1.10     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        0.99     KK        1.00*    WZ        1.00*    WF        1.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   FD        1.04     GC        1.01     HN        1.07     KP        1.12     
!   LA        1.00     MK        1.00*    NL        1.06     NY        1.04     
!   ON        0.96     OV        1.08     PT        0.99     SC        1.06     
!   TS        1.00*    KK        1.00*    WZ        0.96     WF        1.07     
! 
!  A total of 24 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 6.
!  Telescope amplitude corrections in sub-array 6:
!   FD        0.97     GC        1.00     HN        1.05     KP        1.02     
!   LA        0.96     MK        1.08     NL        1.00     NY        1.03     
!   ON        1.06     OV        0.96     PT        0.93     SC        1.06     
!   TS        1.10     KK        1.03     WZ        1.10     WF        1.00     
! 
! 
! Correcting IF 3.
!  Telescope amplitude corrections in sub-array 1:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 27 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   FD        1.00*    GC        1.02     HN        1.17     KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        0.99     
!   ON        1.07     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.02     KK        1.00*    WZ        0.97     WF        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   FD        1.00*    GC        1.10     HN        1.00*    KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.00     
!   ON        1.04     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.00     KK        1.00*    WZ        1.00*    WF        1.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   FD        1.01     GC        1.04     HN        1.06     KP        1.13     
!   LA        0.95     MK        1.00*    NL        0.99     NY        0.96     
!   ON        0.97     OV        1.14     PT        1.02     SC        1.04     
!   TS        1.00*    KK        1.00*    WZ        0.94     WF        0.97     
! 
!  A total of 24 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 6.
!  Telescope amplitude corrections in sub-array 6:
!   FD        0.95     GC        1.03     HN        1.04     KP        1.00     
!   LA        0.92     MK        1.02     NL        0.94     NY        0.96     
!   ON        1.01     OV        0.96     PT        0.97     SC        1.07     
!   TS        1.08     KK        1.00     WZ        1.05     WF        1.00     
! 
! 
! Correcting IF 4.
!  Telescope amplitude corrections in sub-array 1:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 27 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   FD        1.00*    GC        1.03     HN        1.05     KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.00     
!   ON        1.01     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.03     KK        1.00*    WZ        0.97     WF        1.00*    
! 
!  A total of 36 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   FD        1.00*    GC        1.10     HN        1.00*    KP        1.00*    
!   LA        1.00*    MK        1.00*    NL        1.00*    NY        1.00     
!   ON        1.03     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.01     KK        1.00*    WZ        1.00*    WF        1.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 4.
!  Telescope amplitude corrections in sub-array 4:
!   FD        0.99     GC        1.05     HN        0.95     KP        1.11     
!   LA        0.98     MK        1.00*    NL        1.03     NY        0.96     
!   ON        0.98     OV        1.14     PT        0.97     SC        1.01     
!   TS        1.00*    KK        1.00*    WZ        0.96     WF        1.08     
! 
!  A total of 24 telescope corrections were flagged in sub-array 5.
!  Telescope amplitude corrections in sub-array 5:
!   FD        0.00*    GC        0.00*    HN        0.00*    KP        0.00*    
!   LA        0.00*    MK        0.00*    NL        0.00*    NY        0.00*    
!   ON        0.00*    OV        0.00*    PT        0.00*    SC        0.00*    
!   TS        0.00*    KK        0.00*    WZ        0.00*    WF        0.00*    
! 
!  A total of 9 telescope corrections were flagged in sub-array 6.
!  Telescope amplitude corrections in sub-array 6:
!   FD        0.94     GC        1.04     HN        1.06     KP        1.01     
!   LA        0.95     MK        0.97     NL        0.96     NY        0.95     
!   ON        1.02     OV        0.96     PT        0.91     SC        1.09     
!   TS        1.04     KK        1.06     WZ        1.07     WF        1.00     
! 
! 
! Fit before self-cal, rms=0.331712Jy  sigma=0.001783
! Fit after  self-cal, rms=0.319825Jy  sigma=0.001587
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.401 mas, bmaj=2.83 mas, bpa=-18.08 degrees
! Estimated noise=647.174 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, 7).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0104059 Jy
! Component: 100  -  total flux cleaned = 0.0116724 Jy
! Component: 150  -  total flux cleaned = 0.0126872 Jy
! Component: 200  -  total flux cleaned = 0.0132429 Jy
! Total flux subtracted in 200 components = 0.0132429 Jy
! Clean residual min=-0.010839 max=0.011397 Jy/beam
! Clean residual mean=-0.000262 rms=0.002516 Jy/beam
! Combined flux in latest and established models = 1.9691 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 73 components and 1.9691 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.318825Jy  sigma=0.001579
! Fit after  self-cal, rms=0.318909Jy  sigma=0.001579
! 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.318909Jy  sigma=0.001579
! Fit after  self-cal, rms=0.319695Jy  sigma=0.001578
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.403 mas, bmaj=2.835 mas, bpa=-18 degrees
! Estimated noise=649.136 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000449055 Jy
! Component: 100  -  total flux cleaned = 0.000998688 Jy
! Component: 150  -  total flux cleaned = 0.00123963 Jy
! Component: 200  -  total flux cleaned = 0.00169154 Jy
! Total flux subtracted in 200 components = 0.00169154 Jy
! Clean residual min=-0.010504 max=0.011050 Jy/beam
! Clean residual mean=-0.000264 rms=0.002375 Jy/beam
! Combined flux in latest and established models = 1.97079 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 83 components and 1.97079 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.319248Jy  sigma=0.001575
! Fit after  self-cal, rms=0.319247Jy  sigma=0.001575
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 (-2, 15.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0101693 Jy
! Component: 100  -  total flux cleaned = 0.0153848 Jy
! Component: 150  -  total flux cleaned = 0.016727 Jy
! Component: 200  -  total flux cleaned = 0.0174098 Jy
! Total flux subtracted in 200 components = 0.0174098 Jy
! Clean residual min=-0.010090 max=0.007664 Jy/beam
! Clean residual mean=-0.000336 rms=0.002141 Jy/beam
! Combined flux in latest and established models = 1.9882 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 97 components and 1.9882 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.318908Jy  sigma=0.001571
! Fit after  self-cal, rms=0.318889Jy  sigma=0.001571
! 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.318889Jy  sigma=0.001571
! Fit after  self-cal, rms=0.321594Jy  sigma=0.001570
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.405 mas, bmaj=2.838 mas, bpa=-17.55 degrees
! Estimated noise=653.38 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00906822 Jy
! Component: 100  -  total flux cleaned = 0.0108343 Jy
! Component: 150  -  total flux cleaned = 0.0109983 Jy
! Component: 200  -  total flux cleaned = 0.0109955 Jy
! Total flux subtracted in 200 components = 0.0109955 Jy
! Clean residual min=-0.010148 max=0.007976 Jy/beam
! Clean residual mean=-0.000433 rms=0.002171 Jy/beam
! Combined flux in latest and established models = 1.9992 Jy
selfcal
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 103 components and 1.9992 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.321264Jy  sigma=0.001568
! Fit after  self-cal, rms=0.321269Jy  sigma=0.001568
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.00109832 Jy
! Component: 100  -  total flux cleaned = 0.00136875 Jy
! Component: 150  -  total flux cleaned = 0.00174634 Jy
! Component: 200  -  total flux cleaned = 0.00197918 Jy
! Total flux subtracted in 200 components = 0.00197918 Jy
! Clean residual min=-0.010013 max=0.007812 Jy/beam
! Clean residual mean=-0.000441 rms=0.002136 Jy/beam
! Combined flux in latest and established models = 2.00118 Jy
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 105 components and 2.00118 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.321161Jy  sigma=0.001567
! Fit after  self-cal, rms=0.321163Jy  sigma=0.001567
! 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.321163Jy  sigma=0.001567
! Fit after  self-cal, rms=0.322908Jy  sigma=0.001562
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.283 mas, bmaj=9.677 mas, bpa=-15.63 degrees
! Estimated noise=1035.82 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00889006 Jy
! Component: 100  -  total flux cleaned = 0.0101191 Jy
! Component: 150  -  total flux cleaned = 0.010964 Jy
! Component: 200  -  total flux cleaned = 0.0113678 Jy
! Total flux subtracted in 200 components = 0.0113678 Jy
! Clean residual min=-0.014213 max=0.013517 Jy/beam
! Clean residual mean=-0.001980 rms=0.003569 Jy/beam
! Combined flux in latest and established models = 2.01254 Jy
selfcal
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 112 components and 2.01254 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.322970Jy  sigma=0.001563
! Fit after  self-cal, rms=0.322953Jy  sigma=0.001563
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.00233162 Jy
! Component: 100  -  total flux cleaned = 0.00256598 Jy
! Component: 150  -  total flux cleaned = 0.00241475 Jy
! Component: 200  -  total flux cleaned = 0.00227523 Jy
! Total flux subtracted in 200 components = 0.00227523 Jy
! Clean residual min=-0.014246 max=0.013826 Jy/beam
! Clean residual mean=-0.002015 rms=0.003503 Jy/beam
! Combined flux in latest and established models = 2.01482 Jy
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 117 components and 2.01482 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.323002Jy  sigma=0.001563
! Fit after  self-cal, rms=0.322992Jy  sigma=0.001563
! 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.407 mas, bmaj=2.842 mas, bpa=-17.41 degrees
! Estimated noise=657.77 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.407 x 2.842 at -17.41 degrees (North through East)
! Clean map  min=-0.00895  max=1.372 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.322992Jy  sigma=0.001563
! Fit after  self-cal, rms=0.301201Jy  sigma=0.001192
! Inverting map and beam 
! Estimated beam: bmin=2.41 mas, bmaj=2.842 mas, bpa=-17.34 degrees
! Estimated noise=655.092 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00346087 Jy
! Component: 100  -  total flux cleaned = -0.00410805 Jy
! Component: 150  -  total flux cleaned = -0.00466025 Jy
! Component: 200  -  total flux cleaned = -0.00497689 Jy
! Total flux subtracted in 200 components = -0.00497689 Jy
! Clean residual min=-0.007138 max=0.005161 Jy/beam
! Clean residual mean=-0.000380 rms=0.001427 Jy/beam
! Combined flux in latest and established models = 2.00984 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 122 components and 2.00984 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300873Jy  sigma=0.001189
! Fit after  self-cal, rms=0.300857Jy  sigma=0.001189
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000507922 Jy
! Component: 100  -  total flux cleaned = -0.000791265 Jy
! Component: 150  -  total flux cleaned = -0.00105387 Jy
! Component: 200  -  total flux cleaned = -0.00117538 Jy
! Total flux subtracted in 200 components = -0.00117538 Jy
! Clean residual min=-0.006769 max=0.004924 Jy/beam
! Clean residual mean=-0.000376 rms=0.001379 Jy/beam
! Combined flux in latest and established models = 2.00867 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 128 components and 2.00867 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300728Jy  sigma=0.001188
! Fit after  self-cal, rms=0.300724Jy  sigma=0.001188
! Inverting map 
! Performing amp+phase self-cal
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300724Jy  sigma=0.001188
! Fit after  self-cal, rms=0.300871Jy  sigma=0.001187
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.114 mas, bmaj=2.469 mas, bpa=-6.709 degrees
! Estimated noise=1306.18 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.00245 Jy
! Component: 100  -  total flux cleaned = 1.33867 Jy
! Component: 150  -  total flux cleaned = 1.51752 Jy
! Component: 200  -  total flux cleaned = 1.62666 Jy
! Total flux subtracted in 200 components = 1.62666 Jy
! Clean residual min=-0.017210 max=0.058909 Jy/beam
! Clean residual mean=0.000618 rms=0.006362 Jy/beam
! Combined flux in latest and established models = 1.62666 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 22 model components to the UV plane model.
! The established model now contains 22 components and 1.62666 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.413 mas, bmaj=2.846 mas, bpa=-17.52 degrees
! Estimated noise=655.508 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.110888 Jy
! Component: 100  -  total flux cleaned = 0.177318 Jy
! Component: 150  -  total flux cleaned = 0.219728 Jy
! Component: 200  -  total flux cleaned = 0.248913 Jy
! Total flux subtracted in 200 components = 0.248913 Jy
! Clean residual min=-0.007898 max=0.018995 Jy/beam
! Clean residual mean=0.000164 rms=0.003452 Jy/beam
! Combined flux in latest and established models = 1.87557 Jy
! Adding 40 model components to the UV plane model.
! The established model now contains 49 components and 1.87557 Jy
! Inverting map 
! Added new window around map position (-4, 3.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0215541 Jy
! Component: 100  -  total flux cleaned = 0.0379447 Jy
! Component: 150  -  total flux cleaned = 0.0512212 Jy
! Component: 200  -  total flux cleaned = 0.0621132 Jy
! Total flux subtracted in 200 components = 0.0621132 Jy
! Clean residual min=-0.006009 max=0.007893 Jy/beam
! Clean residual mean=-0.000094 rms=0.002002 Jy/beam
! Combined flux in latest and established models = 1.93769 Jy
! Adding 49 model components to the UV plane model.
! The established model now contains 87 components and 1.93769 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.285 mas, bmaj=9.701 mas, bpa=-15.63 degrees
! Estimated noise=1026.77 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0259411 Jy
! Component: 100  -  total flux cleaned = 0.0400938 Jy
! Component: 150  -  total flux cleaned = 0.0486655 Jy
! Component: 200  -  total flux cleaned = 0.0540431 Jy
! Total flux subtracted in 200 components = 0.0540431 Jy
! Clean residual min=-0.007613 max=0.005121 Jy/beam
! Clean residual mean=-0.001352 rms=0.002223 Jy/beam
! Combined flux in latest and established models = 1.99173 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.00342269 Jy
! Component: 100  -  total flux cleaned = 0.00562371 Jy
! Component: 150  -  total flux cleaned = 0.00654936 Jy
! Component: 200  -  total flux cleaned = 0.00670454 Jy
! Total flux subtracted in 200 components = 0.00670454 Jy
! Clean residual min=-0.007166 max=0.004552 Jy/beam
! Clean residual mean=-0.001472 rms=0.001946 Jy/beam
! Combined flux in latest and established models = 1.99843 Jy
! Adding 106 model components to the UV plane model.
! The established model now contains 178 components and 1.99843 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.413 mas, bmaj=2.846 mas, bpa=-17.52 degrees
! Estimated noise=655.508 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00263303 Jy
! Component: 100  -  total flux cleaned = -0.00248481 Jy
! Component: 150  -  total flux cleaned = -0.00249417 Jy
! Component: 200  -  total flux cleaned = -0.00214732 Jy
! Total flux subtracted in 200 components = -0.00214732 Jy
! Clean residual min=-0.005378 max=0.004757 Jy/beam
! Clean residual mean=-0.000335 rms=0.001246 Jy/beam
! Combined flux in latest and established models = 1.99629 Jy
selfcal
! Performing phase self-cal
! Adding 21 model components to the UV plane model.
! The established model now contains 189 components and 1.99629 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.300641Jy  sigma=0.001186
! Fit after  self-cal, rms=0.300596Jy  sigma=0.001185
wmodel J0136+4751_S_2003_09_17_pus_map.mod
! Writing 189 model components to file: J0136+4751_S_2003_09_17_pus_map.mod
wobs J0136+4751_S_2003_09_17_pus_uvs.fits
! Writing UV FITS file: J0136+4751_S_2003_09_17_pus_uvs.fits
wwins J0136+4751_S_2003_09_17_pus_map.win
! wwins: Wrote 5 windows to J0136+4751_S_2003_09_17_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.00235459 Jy
! Component: 100  -  total flux cleaned = -0.00398613 Jy
! Component: 150  -  total flux cleaned = -0.00562155 Jy
! Component: 200  -  total flux cleaned = -0.0073519 Jy
! Component: 250  -  total flux cleaned = -0.00895439 Jy
! Component: 300  -  total flux cleaned = -0.0103678 Jy
! Component: 350  -  total flux cleaned = -0.0118951 Jy
! Component: 400  -  total flux cleaned = -0.0133908 Jy
! Component: 450  -  total flux cleaned = -0.0148569 Jy
! Component: 500  -  total flux cleaned = -0.0161601 Jy
! Component: 550  -  total flux cleaned = -0.0173742 Jy
! Component: 600  -  total flux cleaned = -0.0185033 Jy
! Component: 650  -  total flux cleaned = -0.0196818 Jy
! Component: 700  -  total flux cleaned = -0.0206509 Jy
! Component: 750  -  total flux cleaned = -0.0218608 Jy
! Component: 800  -  total flux cleaned = -0.0229907 Jy
! Component: 850  -  total flux cleaned = -0.0241666 Jy
! Component: 900  -  total flux cleaned = -0.0252052 Jy
! Component: 950  -  total flux cleaned = -0.0262309 Jy
! Component: 1000  -  total flux cleaned = -0.0272458 Jy
! Component: 1050  -  total flux cleaned = -0.028308 Jy
! Component: 1100  -  total flux cleaned = -0.0292411 Jy
! Component: 1150  -  total flux cleaned = -0.03028 Jy
! Component: 1200  -  total flux cleaned = -0.0311932 Jy
! Component: 1250  -  total flux cleaned = -0.0322666 Jy
! Component: 1300  -  total flux cleaned = -0.0331616 Jy
! Component: 1350  -  total flux cleaned = -0.0341581 Jy
! Component: 1400  -  total flux cleaned = -0.035255 Jy
! Component: 1450  -  total flux cleaned = -0.0362319 Jy
! Component: 1500  -  total flux cleaned = -0.0370917 Jy
! Component: 1550  -  total flux cleaned = -0.0381569 Jy
! Component: 1600  -  total flux cleaned = -0.0390531 Jy
! Component: 1650  -  total flux cleaned = -0.0400457 Jy
! Component: 1700  -  total flux cleaned = -0.0409259 Jy
! Component: 1750  -  total flux cleaned = -0.0419008 Jy
! Component: 1800  -  total flux cleaned = -0.0428161 Jy
! Component: 1850  -  total flux cleaned = -0.0437235 Jy
! Component: 1900  -  total flux cleaned = -0.0445239 Jy
! Component: 1950  -  total flux cleaned = -0.0453672 Jy
! Component: 2000  -  total flux cleaned = -0.0462039 Jy
! Total flux subtracted in 2048 components = -0.0469362 Jy
! Clean residual min=-0.003169 max=0.003098 Jy/beam
! Clean residual mean=-0.000206 rms=0.000900 Jy/beam
! Combined flux in latest and established models = 1.94935 Jy
keep
! Adding 174 model components to the UV plane model.
! The established model now contains 363 components and 1.94935 Jy
wmap "J0136+4751_S_2003_09_17_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.413 x 2.846 at -17.52 degrees (North through East)
! Clean map  min=-0.0037545  max=1.3747 Jy/beam
! Writing clean map to FITS file: J0136+4751_S_2003_09_17_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.37467 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000901743 
device "J0136+4751_S_2003_09_17_pus\_map.eps/VPS"
! Attempting to open device: 'J0136+4751_S_2003_09_17_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.196791 0.196791 0.393582 0.787164 1.57433 3.14866 6.29731 12.5946 25.1892 50.3785
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0027 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.374 
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.413 x 2.846 at -17.52 degrees (North through East)
! Clean map  min=-0.0037545  max=1.3747 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0136+4751_S_2003_09_17_pus\_map.gif/vgif"
! Attempting to open device: 'J0136+4751_S_2003_09_17_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0136+4751_S_2003_09_17_pus_uvs.log closed on Tue May 22 17:06:39 2007