! Started logfile: J0530+1331_S_2001_07_05_pus_uvs.log on Fri Aug 10 00:19:48 2007
obs J0530+1331_S_2001_07_05_pus_uva.fits
! Reading UV FITS file: J0530+1331_S_2001_07_05_pus_uva.fits
! AN table 1: 230 integrations on 171 of 171 possible baselines.
! AN table 2: 52 integrations on 171 of 171 possible baselines.
! AN table 3: 25 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.115626 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0530+1331
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! Warning: Unknown AN-table MNTSTA value (3).
!          Will assume that it is ground-based.
! 
! There are 4 IFs, and a total of 4 channels:
! 
!  IF  Channel    Frequency  Freq offset  Number of   Overall IF
!       origin    at origin  per channel   channels    bandwidth
!  ------------------------------------------------------------- (Hz)
!  01        1  2.22997e+09        8e+06          1        8e+06
!  02        2  2.25997e+09        8e+06          1        8e+06
!  03        3  2.34997e+09        8e+06          1        8e+06
!  04        4  2.36997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 1774 lines of history.
! 
! Reading 24280 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 3396 telescope corrections were flagged in sub-array 1.
!  A total of 633 telescope corrections were flagged in sub-array 2.
!  A total of 232 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 3397 telescope corrections were flagged in sub-array 1.
!  A total of 633 telescope corrections were flagged in sub-array 2.
!  A total of 232 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 3398 telescope corrections were flagged in sub-array 1.
!  A total of 633 telescope corrections were flagged in sub-array 2.
!  A total of 232 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 3445 telescope corrections were flagged in sub-array 1.
!  A total of 633 telescope corrections were flagged in sub-array 2.
!  A total of 232 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=1.147474Jy  sigma=0.007027
! Fit after  self-cal, rms=0.777422Jy  sigma=0.003266
! 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=1.96 mas, bmaj=3.613 mas, bpa=1.852 degrees
! Estimated noise=949.437 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.658511 Jy
! Component: 100  -  total flux cleaned = 0.915223 Jy
! Total flux subtracted in 100 components = 0.915223 Jy
! Clean residual min=-0.035863 max=0.122824 Jy/beam
! Clean residual mean=0.000646 rms=0.009384 Jy/beam
! Combined flux in latest and established models = 0.915223 Jy
! Performing phase self-cal
! Adding 12 model components to the UV plane model.
! The established model now contains 12 components and 0.915223 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.740578Jy  sigma=0.002834
! Fit after  self-cal, rms=0.737565Jy  sigma=0.002825
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.145866 Jy
! Component: 100  -  total flux cleaned = 0.232676 Jy
! Total flux subtracted in 100 components = 0.232676 Jy
! Clean residual min=-0.024908 max=0.053541 Jy/beam
! Clean residual mean=0.000338 rms=0.005174 Jy/beam
! Combined flux in latest and established models = 1.1479 Jy
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 26 components and 1.1479 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.698092Jy  sigma=0.002004
! Fit after  self-cal, rms=0.697331Jy  sigma=0.002000
! Inverting map 
! Added new window around map position (1.5, 4).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0610777 Jy
! Component: 100  -  total flux cleaned = 0.10137 Jy
! Total flux subtracted in 100 components = 0.10137 Jy
! Clean residual min=-0.020695 max=0.022157 Jy/beam
! Clean residual mean=0.000205 rms=0.004015 Jy/beam
! Combined flux in latest and established models = 1.24927 Jy
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 31 components and 1.24927 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.689560Jy  sigma=0.001813
! Fit after  self-cal, rms=0.689357Jy  sigma=0.001811
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.029412 Jy
! Component: 100  -  total flux cleaned = 0.0506666 Jy
! Total flux subtracted in 100 components = 0.0506666 Jy
! Clean residual min=-0.019082 max=0.014689 Jy/beam
! Clean residual mean=0.000139 rms=0.003711 Jy/beam
! Combined flux in latest and established models = 1.29994 Jy
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 37 components and 1.29994 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.687332Jy  sigma=0.001765
! Fit after  self-cal, rms=0.687218Jy  sigma=0.001764
! 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.386 mas, bmaj=4.881 mas, bpa=-4.204 degrees
! Estimated noise=624.075 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.0220953 Jy
! Component: 100  -  total flux cleaned = 0.0348946 Jy
! Component: 150  -  total flux cleaned = 0.0396502 Jy
! Component: 200  -  total flux cleaned = 0.0414883 Jy
! Total flux subtracted in 200 components = 0.0414883 Jy
! Clean residual min=-0.016358 max=0.013408 Jy/beam
! Clean residual mean=0.000558 rms=0.003750 Jy/beam
! Combined flux in latest and established models = 1.34142 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 52 components and 1.34142 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.686250Jy  sigma=0.001747
! Fit after  self-cal, rms=0.686144Jy  sigma=0.001746
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 243 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.99     FD        1.06     GC        1.05     GG        1.00*    
!   HH        1.30     HN        0.92     KK        1.00*    KP        1.03     
!   LA        1.05     MC        0.95     MK        1.00*    NL        1.00     
!   NY        0.99     OV        0.97     PT        1.03     SC        1.00     
!   TS        1.07     WF        1.01     WZ        1.00     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        0.98     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        0.99     KP        1.00     
!   LA        0.99     MC        1.00*    MK        0.99     NL        1.01     
!   NY        1.00*    OV        0.99     PT        0.94     SC        1.00*    
!   TS        1.04     WF        1.04     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        0.96     GC        0.97     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        1.00*    KP        0.99     
!   LA        0.98     MC        1.00*    MK        1.05     NL        0.98     
!   NY        1.13     OV        0.94     PT        0.94     SC        1.05     
!   TS        1.00*    WF        0.99     WZ        1.00*    
! 
! 
! Correcting IF 2.
!  A total of 243 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.98     FD        1.07     GC        1.03     GG        1.00*    
!   HH        1.33     HN        0.92     KK        1.00*    KP        1.24     
!   LA        1.02     MC        0.96     MK        1.00*    NL        0.97     
!   NY        1.01     OV        1.01     PT        1.08     SC        1.02     
!   TS        1.03     WF        0.99     WZ        0.98     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.98     FD        1.00     GC        0.95     GG        1.00*    
!   HH        1.00*    HN        1.00     KK        0.99     KP        0.96     
!   LA        0.95     MC        1.00*    MK        0.97     NL        1.00     
!   NY        1.00*    OV        1.02     PT        0.98     SC        1.00*    
!   TS        0.99     WF        1.02     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.95     FD        0.99     GC        0.93     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.00*    KP        1.05     
!   LA        0.94     MC        1.00*    MK        1.04     NL        0.95     
!   NY        1.11     OV        0.96     PT        0.97     SC        1.06     
!   TS        1.00*    WF        1.00     WZ        1.00*    
! 
! 
! Correcting IF 3.
!  A total of 243 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        0.99     GC        1.04     GG        1.00*    
!   HH        1.09     HN        0.93     KK        1.00*    KP        1.04     
!   LA        1.05     MC        1.01     MK        1.00*    NL        1.02     
!   NY        1.01     OV        1.02     PT        1.02     SC        0.98     
!   TS        1.25     WF        0.98     WZ        0.96     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.01     FD        0.96     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        1.02     KK        0.77     KP        1.06     
!   LA        0.99     MC        1.00*    MK        1.00     NL        1.04     
!   NY        1.00*    OV        1.04     PT        0.97     SC        1.00*    
!   TS        0.99     WF        1.00     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.99     FD        0.95     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        1.01     KK        1.00*    KP        0.99     
!   LA        0.97     MC        1.00*    MK        1.02     NL        0.99     
!   NY        1.10     OV        0.98     PT        1.00     SC        1.05     
!   TS        1.00*    WF        0.96     WZ        1.00*    
! 
! 
! Correcting IF 4.
!  A total of 231 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.97     FD        1.06     GC        1.01     GG        1.00*    
!   HH        1.06     HN        0.90     KK        1.00*    KP        1.03     
!   LA        1.05     MC        1.16     MK        1.00*    NL        1.00     
!   NY        0.92     OV        1.02     PT        1.06     SC        0.99     
!   TS        1.08     WF        1.01     WZ        1.05     
! 
!  A total of 12 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.97     GC        0.98     GG        1.00*    
!   HH        1.00*    HN        0.97     KK        0.92     KP        1.05     
!   LA        0.99     MC        1.00*    MK        0.98     NL        1.01     
!   NY        1.00*    OV        0.96     PT        1.05     SC        1.00*    
!   TS        0.99     WF        1.04     WZ        1.00*    
! 
!  A total of 6 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.94     FD        0.96     GC        0.96     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00*    KP        1.07     
!   LA        0.97     MC        1.00*    MK        1.01     NL        0.96     
!   NY        1.11     OV        0.93     PT        1.04     SC        1.06     
!   TS        1.00*    WF        1.00     WZ        1.00*    
! 
! 
! Fit before self-cal, rms=0.686144Jy  sigma=0.001746
! Fit after  self-cal, rms=0.697846Jy  sigma=0.001641
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.411 mas, bmaj=5.034 mas, bpa=-5.009 degrees
! Estimated noise=630.6 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.00811866 Jy
! Component: 100  -  total flux cleaned = 0.009421 Jy
! Component: 150  -  total flux cleaned = 0.0103574 Jy
! Component: 200  -  total flux cleaned = 0.0111197 Jy
! Total flux subtracted in 200 components = 0.0111197 Jy
! Clean residual min=-0.014000 max=0.012170 Jy/beam
! Clean residual mean=0.000285 rms=0.003148 Jy/beam
! Combined flux in latest and established models = 1.35254 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 64 components and 1.35254 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.697752Jy  sigma=0.001639
! Fit after  self-cal, rms=0.697722Jy  sigma=0.001638
! 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.697722Jy  sigma=0.001638
! Fit after  self-cal, rms=0.486920Jy  sigma=0.001528
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.423 mas, bmaj=5.017 mas, bpa=-5.182 degrees
! Estimated noise=630.709 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00599665 Jy
! Component: 100  -  total flux cleaned = 0.00669804 Jy
! Component: 150  -  total flux cleaned = 0.00708839 Jy
! Component: 200  -  total flux cleaned = 0.00751537 Jy
! Total flux subtracted in 200 components = 0.00751537 Jy
! Clean residual min=-0.004335 max=0.007166 Jy/beam
! Clean residual mean=0.000476 rms=0.001358 Jy/beam
! Combined flux in latest and established models = 1.36006 Jy
selfcal
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 70 components and 1.36006 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486835Jy  sigma=0.001526
! Fit after  self-cal, rms=0.486689Jy  sigma=0.001525
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 (5, 9.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00722646 Jy
! Component: 100  -  total flux cleaned = 0.0100956 Jy
! Component: 150  -  total flux cleaned = 0.0110916 Jy
! Component: 200  -  total flux cleaned = 0.0115125 Jy
! Total flux subtracted in 200 components = 0.0115125 Jy
! Clean residual min=-0.004193 max=0.005118 Jy/beam
! Clean residual mean=0.000356 rms=0.001242 Jy/beam
! Combined flux in latest and established models = 1.37157 Jy
! Performing phase self-cal
! Adding 23 model components to the UV plane model.
! The established model now contains 87 components and 1.37157 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486557Jy  sigma=0.001523
! Fit after  self-cal, rms=0.486541Jy  sigma=0.001523
! Inverting map 
! Added new window around map position (-12, -44.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00327498 Jy
! Component: 100  -  total flux cleaned = 0.00377967 Jy
! Component: 150  -  total flux cleaned = 0.00411628 Jy
! Component: 200  -  total flux cleaned = 0.00442519 Jy
! Total flux subtracted in 200 components = 0.00442519 Jy
! Clean residual min=-0.004401 max=0.005199 Jy/beam
! Clean residual mean=0.000312 rms=0.001215 Jy/beam
! Combined flux in latest and established models = 1.376 Jy
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 104 components and 1.376 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486425Jy  sigma=0.001522
! Fit after  self-cal, rms=0.486414Jy  sigma=0.001522
! Inverting map 
! Added new window around map position (51.5, 4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00276083 Jy
! Component: 100  -  total flux cleaned = 0.00325841 Jy
! Component: 150  -  total flux cleaned = 0.0039224 Jy
! Component: 200  -  total flux cleaned = 0.00464201 Jy
! Total flux subtracted in 200 components = 0.00464201 Jy
! Clean residual min=-0.004326 max=0.004981 Jy/beam
! Clean residual mean=0.000271 rms=0.001182 Jy/beam
! Combined flux in latest and established models = 1.38064 Jy
! Performing phase self-cal
! Adding 29 model components to the UV plane model.
! The established model now contains 122 components and 1.38064 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.486311Jy  sigma=0.001521
! Fit after  self-cal, rms=0.486305Jy  sigma=0.001521
! 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.486305Jy  sigma=0.001521
! Fit after  self-cal, rms=0.474535Jy  sigma=0.001520
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=2.427 mas, bmaj=5.013 mas, bpa=-5.285 degrees
! Estimated noise=631.409 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00327494 Jy
! Component: 100  -  total flux cleaned = 0.00383455 Jy
! Component: 150  -  total flux cleaned = 0.00414274 Jy
! Component: 200  -  total flux cleaned = 0.00414399 Jy
! Total flux subtracted in 200 components = 0.00414399 Jy
! Clean residual min=-0.004170 max=0.004916 Jy/beam
! Clean residual mean=0.000253 rms=0.001145 Jy/beam
! Combined flux in latest and established models = 1.38478 Jy
selfcal
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 126 components and 1.38478 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.474471Jy  sigma=0.001520
! Fit after  self-cal, rms=0.474440Jy  sigma=0.001519
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 (-36.5, 58.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00310555 Jy
! Component: 100  -  total flux cleaned = 0.00321312 Jy
! Component: 150  -  total flux cleaned = 0.00351193 Jy
! Component: 200  -  total flux cleaned = 0.00370083 Jy
! Total flux subtracted in 200 components = 0.00370083 Jy
! Clean residual min=-0.004110 max=0.004414 Jy/beam
! Clean residual mean=0.000213 rms=0.001120 Jy/beam
! Combined flux in latest and established models = 1.38848 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 136 components and 1.38848 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.474344Jy  sigma=0.001519
! Fit after  self-cal, rms=0.474319Jy  sigma=0.001519
! 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.474319Jy  sigma=0.001519
! Fit after  self-cal, rms=0.469244Jy  sigma=0.001519
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.749 mas, bmaj=9.377 mas, bpa=-12.98 degrees
! Estimated noise=842.9 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0041422 Jy
! Component: 100  -  total flux cleaned = 0.00615238 Jy
! Component: 150  -  total flux cleaned = 0.00741125 Jy
! Component: 200  -  total flux cleaned = 0.00843701 Jy
! Total flux subtracted in 200 components = 0.00843701 Jy
! Clean residual min=-0.002953 max=0.004514 Jy/beam
! Clean residual mean=0.000466 rms=0.001091 Jy/beam
! Combined flux in latest and established models = 1.39692 Jy
selfcal
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 155 components and 1.39692 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.469247Jy  sigma=0.001519
! Fit after  self-cal, rms=0.469244Jy  sigma=0.001518
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.00154053 Jy
! Component: 100  -  total flux cleaned = 0.00205192 Jy
! Component: 150  -  total flux cleaned = 0.00259931 Jy
! Component: 200  -  total flux cleaned = 0.00312108 Jy
! Total flux subtracted in 200 components = 0.00312108 Jy
! Clean residual min=-0.002880 max=0.004336 Jy/beam
! Clean residual mean=0.000388 rms=0.001070 Jy/beam
! Combined flux in latest and established models = 1.40004 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 166 components and 1.40004 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.469240Jy  sigma=0.001519
! Fit after  self-cal, rms=0.469247Jy  sigma=0.001519
! 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.428 mas, bmaj=5.008 mas, bpa=-5.31 degrees
! Estimated noise=632.026 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.428 x 5.008 at -5.31 degrees (North through East)
! Clean map  min=-0.0038032  max=0.91105 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.469247Jy  sigma=0.001519
! Fit after  self-cal, rms=0.545227Jy  sigma=0.001390
! Inverting map and beam 
! Estimated beam: bmin=2.419 mas, bmaj=5.012 mas, bpa=-5.346 degrees
! Estimated noise=630.754 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00132165 Jy
! Component: 100  -  total flux cleaned = 0.001322 Jy
! Component: 150  -  total flux cleaned = 0.00132373 Jy
! Component: 200  -  total flux cleaned = 0.00132277 Jy
! Total flux subtracted in 200 components = 0.00132277 Jy
! Clean residual min=-0.003590 max=0.004363 Jy/beam
! Clean residual mean=0.000128 rms=0.000993 Jy/beam
! Combined flux in latest and established models = 1.40136 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 178 components and 1.40136 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.545189Jy  sigma=0.001389
! Fit after  self-cal, rms=0.545169Jy  sigma=0.001389
! Inverting map 
! Added new window around map position (-61, 48.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00127393 Jy
! Component: 100  -  total flux cleaned = 0.000744986 Jy
! Component: 150  -  total flux cleaned = 0.000831094 Jy
! Component: 200  -  total flux cleaned = 0.000660814 Jy
! Total flux subtracted in 200 components = 0.000660814 Jy
! Clean residual min=-0.003723 max=0.004002 Jy/beam
! Clean residual mean=0.000120 rms=0.000978 Jy/beam
! Combined flux in latest and established models = 1.40202 Jy
! Performing phase self-cal
! Adding 31 model components to the UV plane model.
! The established model now contains 192 components and 1.40202 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.545107Jy  sigma=0.001388
! Fit after  self-cal, rms=0.545031Jy  sigma=0.001388
! 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.545031Jy  sigma=0.001388
! Fit after  self-cal, rms=0.595333Jy  sigma=0.001388
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=1.994 mas, bmaj=3.749 mas, bpa=0.7759 degrees
! Estimated noise=973.701 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.667493 Jy
! Component: 100  -  total flux cleaned = 0.931236 Jy
! Component: 150  -  total flux cleaned = 1.07285 Jy
! Component: 200  -  total flux cleaned = 1.15738 Jy
! Total flux subtracted in 200 components = 1.15738 Jy
! Clean residual min=-0.011953 max=0.044587 Jy/beam
! Clean residual mean=0.000307 rms=0.004052 Jy/beam
! Combined flux in latest and established models = 1.15738 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 24 model components to the UV plane model.
! The established model now contains 24 components and 1.15738 Jy
! Inverting map and beam 
! Estimated beam: bmin=2.419 mas, bmaj=5.009 mas, bpa=-5.36 degrees
! Estimated noise=630.781 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.0853151 Jy
! Component: 100  -  total flux cleaned = 0.134109 Jy
! Component: 150  -  total flux cleaned = 0.163826 Jy
! Component: 200  -  total flux cleaned = 0.182944 Jy
! Total flux subtracted in 200 components = 0.182944 Jy
! Clean residual min=-0.004104 max=0.011300 Jy/beam
! Clean residual mean=0.000803 rms=0.001805 Jy/beam
! Combined flux in latest and established models = 1.34033 Jy
! Adding 44 model components to the UV plane model.
! The established model now contains 61 components and 1.34033 Jy
! Inverting map 
! Added new window around map position (-2, -1).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.013575 Jy
! Component: 100  -  total flux cleaned = 0.0235624 Jy
! Component: 150  -  total flux cleaned = 0.0314456 Jy
! Component: 200  -  total flux cleaned = 0.0380212 Jy
! Total flux subtracted in 200 components = 0.0380212 Jy
! Clean residual min=-0.003726 max=0.004918 Jy/beam
! Clean residual mean=0.000384 rms=0.001199 Jy/beam
! Combined flux in latest and established models = 1.37835 Jy
! Adding 34 model components to the UV plane model.
! The established model now contains 90 components and 1.37835 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.742 mas, bmaj=9.369 mas, bpa=-13.03 degrees
! Estimated noise=844.945 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00887042 Jy
! Component: 100  -  total flux cleaned = 0.0139729 Jy
! Component: 150  -  total flux cleaned = 0.0169268 Jy
! Component: 200  -  total flux cleaned = 0.0188632 Jy
! Total flux subtracted in 200 components = 0.0188632 Jy
! Clean residual min=-0.003110 max=0.004523 Jy/beam
! Clean residual mean=0.000531 rms=0.001162 Jy/beam
! Combined flux in latest and established models = 1.39721 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.0011517 Jy
! Component: 100  -  total flux cleaned = 0.00225833 Jy
! Component: 150  -  total flux cleaned = 0.00325201 Jy
! Component: 200  -  total flux cleaned = 0.00415356 Jy
! Total flux subtracted in 200 components = 0.00415356 Jy
! Clean residual min=-0.002966 max=0.004170 Jy/beam
! Clean residual mean=0.000415 rms=0.001072 Jy/beam
! Combined flux in latest and established models = 1.40137 Jy
! Adding 60 model components to the UV plane model.
! The established model now contains 146 components and 1.40137 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=2.419 mas, bmaj=5.009 mas, bpa=-5.36 degrees
! Estimated noise=630.781 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00150741 Jy
! Component: 100  -  total flux cleaned = 0.000885649 Jy
! Component: 150  -  total flux cleaned = 0.000738213 Jy
! Component: 200  -  total flux cleaned = 0.000460731 Jy
! Total flux subtracted in 200 components = 0.000460731 Jy
! Clean residual min=-0.003692 max=0.004106 Jy/beam
! Clean residual mean=0.000147 rms=0.001036 Jy/beam
! Combined flux in latest and established models = 1.40183 Jy
selfcal
! Performing phase self-cal
! Adding 26 model components to the UV plane model.
! The established model now contains 166 components and 1.40183 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.595559Jy  sigma=0.001392
! Fit after  self-cal, rms=0.595616Jy  sigma=0.001391
wmodel J0530+1331_S_2001_07_05_pus_map.mod
! Writing 166 model components to file: J0530+1331_S_2001_07_05_pus_map.mod
wobs J0530+1331_S_2001_07_05_pus_uvs.fits
! Writing UV FITS file: J0530+1331_S_2001_07_05_pus_uvs.fits
wwins J0530+1331_S_2001_07_05_pus_map.win
! wwins: Wrote 8 windows to J0530+1331_S_2001_07_05_pus_map.win
x = (field_size-8) * field_cell / 4
addwin -x,x,-x,x
clean (field_size*4),0.01
! Inverting map 
! clean: niter=2048  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = 0.00183568 Jy
! Component: 100  -  total flux cleaned = 0.00318027 Jy
! Component: 150  -  total flux cleaned = 0.00399586 Jy
! Component: 200  -  total flux cleaned = 0.00472017 Jy
! Component: 250  -  total flux cleaned = 0.00549027 Jy
! Component: 300  -  total flux cleaned = 0.0062441 Jy
! Component: 350  -  total flux cleaned = 0.00673766 Jy
! Component: 400  -  total flux cleaned = 0.00728432 Jy
! Component: 450  -  total flux cleaned = 0.00752387 Jy
! Component: 500  -  total flux cleaned = 0.0078196 Jy
! Component: 550  -  total flux cleaned = 0.00793706 Jy
! Component: 600  -  total flux cleaned = 0.00822551 Jy
! Component: 650  -  total flux cleaned = 0.00839688 Jy
! Component: 700  -  total flux cleaned = 0.00867905 Jy
! Component: 750  -  total flux cleaned = 0.00884611 Jy
! Component: 800  -  total flux cleaned = 0.00901211 Jy
! Component: 850  -  total flux cleaned = 0.00917667 Jy
! Component: 900  -  total flux cleaned = 0.00944722 Jy
! Component: 950  -  total flux cleaned = 0.00944641 Jy
! Component: 1000  -  total flux cleaned = 0.00955296 Jy
! Component: 1050  -  total flux cleaned = 0.0097646 Jy
! Component: 1100  -  total flux cleaned = 0.0098694 Jy
! Component: 1150  -  total flux cleaned = 0.0101292 Jy
! Component: 1200  -  total flux cleaned = 0.010129 Jy
! Component: 1250  -  total flux cleaned = 0.0103848 Jy
! Component: 1300  -  total flux cleaned = 0.0104357 Jy
! Component: 1350  -  total flux cleaned = 0.0107384 Jy
! Component: 1400  -  total flux cleaned = 0.0108387 Jy
! Component: 1450  -  total flux cleaned = 0.0110376 Jy
! Component: 1500  -  total flux cleaned = 0.0112845 Jy
! Component: 1550  -  total flux cleaned = 0.0113337 Jy
! Component: 1600  -  total flux cleaned = 0.0114314 Jy
! Component: 1650  -  total flux cleaned = 0.011674 Jy
! Component: 1700  -  total flux cleaned = 0.0118184 Jy
! Component: 1750  -  total flux cleaned = 0.0119619 Jy
! Component: 1800  -  total flux cleaned = 0.0120573 Jy
! Component: 1850  -  total flux cleaned = 0.0122937 Jy
! Component: 1900  -  total flux cleaned = 0.0123877 Jy
! Component: 1950  -  total flux cleaned = 0.0124347 Jy
! Component: 2000  -  total flux cleaned = 0.012574 Jy
! Total flux subtracted in 2048 components = 0.0126203 Jy
! Clean residual min=-0.002376 max=0.003546 Jy/beam
! Clean residual mean=0.000023 rms=0.000857 Jy/beam
! Combined flux in latest and established models = 1.41445 Jy
keep
! Adding 145 model components to the UV plane model.
! The established model now contains 309 components and 1.41445 Jy
wmap "J0530+1331_S_2001_07_05_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 2.419 x 5.009 at -5.36 degrees (North through East)
! Clean map  min=-0.0035822  max=0.90951 Jy/beam
! Writing clean map to FITS file: J0530+1331_S_2001_07_05_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.909511 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000857678 
device "J0530+1331_S_2001_07_05_pus\_map.eps/VPS"
! Attempting to open device: 'J0530+1331_S_2001_07_05_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.282903 0.282903 0.565806 1.13161 2.26323 4.52645 9.0529 18.1058 36.2116 72.4232
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0025 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.909 
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.419 x 5.009 at -5.36 degrees (North through East)
! Clean map  min=-0.0035822  max=0.90951 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0530+1331_S_2001_07_05_pus\_map.gif/vgif"
! Attempting to open device: 'J0530+1331_S_2001_07_05_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0530+1331_S_2001_07_05_pus_uvs.log closed on Fri Aug 10 00:21:53 2007