! Started logfile: J0530+1331_S_1999_03_08_pus_uvs.log on Tue Jan  8 18:02:09 2008
obs J0530+1331_S_1999_03_08_pus_uva.fits
! Reading UV FITS file: J0530+1331_S_1999_03_08_pus_uva.fits
! AN table 1: 69 integrations on 190 of 190 possible baselines.
! AN table 2: 108 integrations on 190 of 190 possible baselines.
! AN table 3: 403 integrations on 190 of 190 possible baselines.
! Apparent sampling: 0.128566 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J0530+1331
! 
! 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 2332 lines of history.
! 
! Reading 56672 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 J0530+1331_S_1999_03_08_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 645 telescope corrections were flagged in sub-array 1.
!  A total of 1602 telescope corrections were flagged in sub-array 2.
!  A total of 6294 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 645 telescope corrections were flagged in sub-array 1.
!  A total of 1602 telescope corrections were flagged in sub-array 2.
!  A total of 6294 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 645 telescope corrections were flagged in sub-array 1.
!  A total of 1602 telescope corrections were flagged in sub-array 2.
!  A total of 6129 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 645 telescope corrections were flagged in sub-array 1.
!  A total of 1602 telescope corrections were flagged in sub-array 2.
!  A total of 6128 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=1.475540Jy  sigma=0.012322
! Fit after  self-cal, rms=1.059307Jy  sigma=0.009353
! 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.279 mas, bmaj=4.131 mas, bpa=-7.718 degrees
! Estimated noise=751.455 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (0, 0).
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.29998 Jy
! Component: 100  -  total flux cleaned = 1.73837 Jy
! Total flux subtracted in 100 components = 1.73837 Jy
! Clean residual min=-0.043379 max=0.196121 Jy/beam
! Clean residual mean=0.000802 rms=0.014213 Jy/beam
! Combined flux in latest and established models = 1.73837 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 11 components and 1.73837 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.572832Jy  sigma=0.004544
! Fit after  self-cal, rms=0.571989Jy  sigma=0.004540
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.222619 Jy
! Component: 100  -  total flux cleaned = 0.35626 Jy
! Total flux subtracted in 100 components = 0.35626 Jy
! Clean residual min=-0.032753 max=0.071352 Jy/beam
! Clean residual mean=0.000369 rms=0.008715 Jy/beam
! Combined flux in latest and established models = 2.09463 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 30 components and 2.09463 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.439429Jy  sigma=0.002909
! Fit after  self-cal, rms=0.438215Jy  sigma=0.002903
! Inverting map 
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0918847 Jy
! Component: 100  -  total flux cleaned = 0.154214 Jy
! Total flux subtracted in 100 components = 0.154214 Jy
! Clean residual min=-0.031466 max=0.038239 Jy/beam
! Clean residual mean=0.000186 rms=0.007234 Jy/beam
! Combined flux in latest and established models = 2.24885 Jy
! Performing phase self-cal
! Adding 13 model components to the UV plane model.
! The established model now contains 34 components and 2.24885 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.411625Jy  sigma=0.002485
! Fit after  self-cal, rms=0.411418Jy  sigma=0.002482
! 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.982 mas, bmaj=5.545 mas, bpa=-6.036 degrees
! Estimated noise=370.003 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 (2.5, 4.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0713034 Jy
! Component: 100  -  total flux cleaned = 0.113924 Jy
! Component: 150  -  total flux cleaned = 0.143086 Jy
! Component: 200  -  total flux cleaned = 0.160642 Jy
! Total flux subtracted in 200 components = 0.160642 Jy
! Clean residual min=-0.024355 max=0.027295 Jy/beam
! Clean residual mean=-0.000745 rms=0.005760 Jy/beam
! Combined flux in latest and established models = 2.40949 Jy
! Performing phase self-cal
! Adding 36 model components to the UV plane model.
! The established model now contains 68 components and 2.40949 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.402142Jy  sigma=0.002274
! Fit after  self-cal, rms=0.401693Jy  sigma=0.002269
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.94     FD        0.98     GC        0.99     GG        1.00*    
!   HN        1.01     KP        1.00     LA        0.99     NL        0.91     
!   OV        0.97     PT        1.03     SC        0.98     WF        0.97     
!   GN        0.95     HH        1.00*    KK        1.00     MC        1.00*    
!   MK        0.97     NY        1.08     ON        1.00*    WZ        1.00*    
! 
!  A total of 84 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.98     GC        0.96     GG        1.00*    
!   HN        1.00     KP        1.01     LA        0.98     NL        0.99     
!   OV        0.97     PT        1.02     SC        1.00*    WF        1.10     
!   GN        1.01     HH        1.00*    KK        0.98     MC        1.14     
!   MK        0.95     NY        1.12     ON        1.01     WZ        1.09     
! 
!  A total of 279 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.96     FD        0.97     GC        0.99     GG        1.00*    
!   HN        1.00     KP        0.98     LA        0.98     NL        0.97     
!   OV        0.98     PT        1.02     SC        1.01     WF        1.01     
!   GN        0.96     HH        1.00*    KK        0.95     MC        1.02     
!   MK        0.95     NY        1.08     ON        1.07     WZ        3.07     
! 
! 
! Correcting IF 2.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.99     FD        1.00     GC        1.02     GG        1.00*    
!   HN        0.95     KP        0.99     LA        0.97     NL        1.08     
!   OV        0.95     PT        0.97     SC        1.04     WF        0.98     
!   GN        0.95     HH        1.00*    KK        0.98     MC        1.00*    
!   MK        0.99     NY        1.07     ON        1.00*    WZ        1.00*    
! 
!  A total of 84 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.00     FD        1.00     GC        0.99     GG        1.00*    
!   HN        0.98     KP        0.98     LA        0.93     NL        1.04     
!   OV        0.88     PT        0.99     SC        1.00*    WF        1.14     
!   GN        1.02     HH        1.00*    KK        0.94     MC        0.96     
!   MK        0.90     NY        1.08     ON        0.99     WZ        1.11     
! 
!  A total of 279 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.98     FD        1.02     GC        1.03     GG        1.00*    
!   HN        0.96     KP        0.99     LA        0.97     NL        1.08     
!   OV        0.95     PT        0.98     SC        1.05     WF        0.99     
!   GN        0.97     HH        1.00*    KK        0.92     MC        1.09     
!   MK        0.98     NY        1.07     ON        0.94     WZ        2.90     
! 
! 
! Correcting IF 3.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.98     FD        0.98     GC        0.99     GG        1.00*    
!   HN        1.22     KP        0.99     LA        1.00     NL        0.95     
!   OV        0.98     PT        0.95     SC        1.00     WF        0.97     
!   GN        0.95     HH        1.00*    KK        0.99     MC        1.00*    
!   MK        0.95     NY        1.08     ON        1.00*    WZ        1.00*    
! 
!  A total of 84 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.99     FD        0.97     GC        0.97     GG        1.00*    
!   HN        1.26     KP        0.97     LA        0.96     NL        1.00     
!   OV        0.91     PT        0.96     SC        1.00*    WF        1.13     
!   GN        1.02     HH        1.00*    KK        0.96     MC        0.87     
!   MK        0.87     NY        0.92     ON        1.26     WZ        1.09     
! 
!  A total of 258 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00     FD        1.00     GC        1.01     GG        1.00*    
!   HN        1.23     KP        1.00     LA        0.99     NL        0.98     
!   OV        0.98     PT        0.95     SC        1.02     WF        1.02     
!   GN        0.97     HH        0.93     KK        0.93     MC        1.22     
!   MK        0.95     NY        1.05     ON        0.89     WZ        2.16     
! 
! 
! Correcting IF 4.
!  A total of 9 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.96     FD        0.98     GC        1.00     GG        1.00*    
!   HN        1.15     KP        1.00     LA        0.98     NL        1.05     
!   OV        0.99     PT        1.10     SC        1.00     WF        0.97     
!   GN        0.94     HH        1.00*    KK        1.01     MC        1.00*    
!   MK        0.98     NY        1.22     ON        1.00*    WZ        1.00*    
! 
!  A total of 84 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.97     FD        0.97     GC        0.99     GG        1.00*    
!   HN        1.19     KP        1.01     LA        0.96     NL        1.04     
!   OV        0.93     PT        0.96     SC        1.00*    WF        1.10     
!   GN        1.01     HH        1.00*    KK        0.99     MC        0.70     
!   MK        0.88     NY        0.98     ON        1.05     WZ        1.15     
! 
!  A total of 258 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        0.95     FD        0.99     GC        1.03     GG        1.00*    
!   HN        1.16     KP        1.00     LA        1.00     NL        1.07     
!   OV        1.00     PT        0.95     SC        1.02     WF        1.02     
!   GN        0.96     HH        1.02     KK        0.97     MC        1.51     
!   MK        0.97     NY        1.03     ON        0.88     WZ        2.14     
! 
! 
! Fit before self-cal, rms=0.401693Jy  sigma=0.002269
! Fit after  self-cal, rms=0.518372Jy  sigma=0.001672
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=3.067 mas, bmaj=5.672 mas, bpa=-5.665 degrees
! Estimated noise=374.578 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.00321078 Jy
! Component: 100  -  total flux cleaned = 0.00271611 Jy
! Component: 150  -  total flux cleaned = 0.00239958 Jy
! Component: 200  -  total flux cleaned = 0.00241005 Jy
! Total flux subtracted in 200 components = 0.00241005 Jy
! Clean residual min=-0.008794 max=0.008961 Jy/beam
! Clean residual mean=0.000054 rms=0.002530 Jy/beam
! Combined flux in latest and established models = 2.4119 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 83 components and 2.4119 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.517489Jy  sigma=0.001659
! Fit after  self-cal, rms=0.518149Jy  sigma=0.001658
! 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.518149Jy  sigma=0.001658
! Fit after  self-cal, rms=0.530512Jy  sigma=0.001592
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.084 mas, bmaj=5.69 mas, bpa=-5.628 degrees
! Estimated noise=375.995 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000506937 Jy
! Component: 100  -  total flux cleaned = 0.000877101 Jy
! Component: 150  -  total flux cleaned = 0.00086654 Jy
! Component: 200  -  total flux cleaned = 0.000572761 Jy
! Total flux subtracted in 200 components = 0.000572761 Jy
! Clean residual min=-0.007394 max=0.007960 Jy/beam
! Clean residual mean=0.000118 rms=0.002050 Jy/beam
! Combined flux in latest and established models = 2.41247 Jy
selfcal
! Performing phase self-cal
! Adding 14 model components to the UV plane model.
! The established model now contains 91 components and 2.41247 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.529690Jy  sigma=0.001585
! Fit after  self-cal, rms=0.529894Jy  sigma=0.001585
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.000404109 Jy
! Component: 100  -  total flux cleaned = 0.00039858 Jy
! Component: 150  -  total flux cleaned = 0.000392965 Jy
! Component: 200  -  total flux cleaned = 0.000386455 Jy
! Total flux subtracted in 200 components = 0.000386455 Jy
! Clean residual min=-0.007388 max=0.007892 Jy/beam
! Clean residual mean=0.000115 rms=0.002009 Jy/beam
! Combined flux in latest and established models = 2.41286 Jy
! Performing phase self-cal
! Adding 16 model components to the UV plane model.
! The established model now contains 94 components and 2.41286 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.529477Jy  sigma=0.001581
! Fit after  self-cal, rms=0.529467Jy  sigma=0.001581
! 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.529467Jy  sigma=0.001581
! Fit after  self-cal, rms=0.415316Jy  sigma=0.001524
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=3.088 mas, bmaj=5.668 mas, bpa=-5.624 degrees
! Estimated noise=375.936 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00386712 Jy
! Component: 100  -  total flux cleaned = -0.00429706 Jy
! Component: 150  -  total flux cleaned = -0.00469189 Jy
! Component: 200  -  total flux cleaned = -0.00505399 Jy
! Total flux subtracted in 200 components = -0.00505398 Jy
! Clean residual min=-0.004518 max=0.004957 Jy/beam
! Clean residual mean=0.000180 rms=0.001042 Jy/beam
! Combined flux in latest and established models = 2.4078 Jy
selfcal
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 106 components and 2.4078 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.415083Jy  sigma=0.001520
! Fit after  self-cal, rms=0.415085Jy  sigma=0.001520
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 (8.5, 14).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00218317 Jy
! Component: 100  -  total flux cleaned = 0.00235243 Jy
! Component: 150  -  total flux cleaned = 0.00250957 Jy
! Component: 200  -  total flux cleaned = 0.00265202 Jy
! Total flux subtracted in 200 components = 0.00265202 Jy
! Clean residual min=-0.004036 max=0.003512 Jy/beam
! Clean residual mean=0.000164 rms=0.000967 Jy/beam
! Combined flux in latest and established models = 2.41045 Jy
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 118 components and 2.41046 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.414951Jy  sigma=0.001517
! Fit after  self-cal, rms=0.414952Jy  sigma=0.001517
! 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.414952Jy  sigma=0.001517
! Fit after  self-cal, rms=0.417507Jy  sigma=0.001517
clean clean_niter,clean_gain
! Inverting map and beam 
! Estimated beam: bmin=7.18 mas, bmaj=9.816 mas, bpa=-2.491 degrees
! Estimated noise=472.29 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000283359 Jy
! Component: 100  -  total flux cleaned = -0.000378021 Jy
! Component: 150  -  total flux cleaned = -0.000538172 Jy
! Component: 200  -  total flux cleaned = -0.000608439 Jy
! Total flux subtracted in 200 components = -0.000608439 Jy
! Clean residual min=-0.002904 max=0.003726 Jy/beam
! Clean residual mean=0.000425 rms=0.001151 Jy/beam
! Combined flux in latest and established models = 2.40985 Jy
selfcal
! Performing phase self-cal
! Adding 24 model components to the UV plane model.
! The established model now contains 135 components and 2.40985 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.417472Jy  sigma=0.001516
! Fit after  self-cal, rms=0.417470Jy  sigma=0.001516
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.000202873 Jy
! Component: 100  -  total flux cleaned = 0.000604573 Jy
! Component: 150  -  total flux cleaned = 0.000647637 Jy
! Component: 200  -  total flux cleaned = 0.00072634 Jy
! Total flux subtracted in 200 components = 0.00072634 Jy
! Clean residual min=-0.002940 max=0.003759 Jy/beam
! Clean residual mean=0.000416 rms=0.001151 Jy/beam
! Combined flux in latest and established models = 2.41057 Jy
! Performing phase self-cal
! Adding 22 model components to the UV plane model.
! The established model now contains 144 components and 2.41057 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.417463Jy  sigma=0.001516
! Fit after  self-cal, rms=0.417454Jy  sigma=0.001515
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
win_mult = win_mult / 1.2
print "************** FINISHED AMPLITUDE SELF-CAL **************"
! ************** FINISHED AMPLITUDE SELF-CAL ************** 
restore
! Inverting map and beam 
! Estimated beam: bmin=3.093 mas, bmaj=5.669 mas, bpa=-5.58 degrees
! Estimated noise=376.123 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.093 x 5.669 at -5.58 degrees (North through East)
! Clean map  min=-0.0035912  max=1.8656 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.417454Jy  sigma=0.001515
! Fit after  self-cal, rms=0.365554Jy  sigma=0.001225
! Inverting map and beam 
! Estimated beam: bmin=3.096 mas, bmaj=5.668 mas, bpa=-5.568 degrees
! Estimated noise=375.888 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00304294 Jy
! Component: 100  -  total flux cleaned = -0.0030491 Jy
! Component: 150  -  total flux cleaned = -0.00318906 Jy
! Component: 200  -  total flux cleaned = -0.00318905 Jy
! Total flux subtracted in 200 components = -0.00318905 Jy
! Clean residual min=-0.003384 max=0.003243 Jy/beam
! Clean residual mean=0.000144 rms=0.000819 Jy/beam
! Combined flux in latest and established models = 2.40738 Jy
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 149 components and 2.40738 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.365414Jy  sigma=0.001223
! Fit after  self-cal, rms=0.365439Jy  sigma=0.001223
! Inverting map 
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000130517 Jy
! Component: 100  -  total flux cleaned = 0.000132923 Jy
! Component: 150  -  total flux cleaned = 0.000246302 Jy
! Component: 200  -  total flux cleaned = 0.000131567 Jy
! Total flux subtracted in 200 components = 0.000131567 Jy
! Clean residual min=-0.003172 max=0.003123 Jy/beam
! Clean residual mean=0.000143 rms=0.000795 Jy/beam
! Combined flux in latest and established models = 2.40752 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 154 components and 2.40752 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.365361Jy  sigma=0.001222
! Fit after  self-cal, rms=0.365371Jy  sigma=0.001222
! 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.365371Jy  sigma=0.001222
! Fit after  self-cal, rms=0.367276Jy  sigma=0.001222
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.381 mas, bmaj=4.151 mas, bpa=-7.473 degrees
! Estimated noise=783.826 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 1.34283 Jy
! Component: 100  -  total flux cleaned = 1.76967 Jy
! Component: 150  -  total flux cleaned = 1.97309 Jy
! Component: 200  -  total flux cleaned = 2.0883 Jy
! Total flux subtracted in 200 components = 2.0883 Jy
! Clean residual min=-0.013533 max=0.059875 Jy/beam
! Clean residual mean=0.000383 rms=0.004908 Jy/beam
! Combined flux in latest and established models = 2.0883 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 23 model components to the UV plane model.
! The established model now contains 23 components and 2.0883 Jy
! Inverting map and beam 
! Estimated beam: bmin=3.099 mas, bmaj=5.671 mas, bpa=-5.541 degrees
! Estimated noise=375.983 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.119579 Jy
! Component: 100  -  total flux cleaned = 0.18525 Jy
! Component: 150  -  total flux cleaned = 0.225867 Jy
! Component: 200  -  total flux cleaned = 0.253013 Jy
! Total flux subtracted in 200 components = 0.253013 Jy
! Clean residual min=-0.005705 max=0.015474 Jy/beam
! Clean residual mean=0.000619 rms=0.002224 Jy/beam
! Combined flux in latest and established models = 2.34131 Jy
! Adding 63 model components to the UV plane model.
! The established model now contains 81 components and 2.34131 Jy
! Inverting map 
! Added new window around map position (-2.5, -0.5).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0188222 Jy
! Component: 100  -  total flux cleaned = 0.0321071 Jy
! Component: 150  -  total flux cleaned = 0.0417696 Jy
! Component: 200  -  total flux cleaned = 0.046537 Jy
! Total flux subtracted in 200 components = 0.046537 Jy
! Clean residual min=-0.004482 max=0.004473 Jy/beam
! Clean residual mean=0.000272 rms=0.000979 Jy/beam
! Combined flux in latest and established models = 2.38785 Jy
! Adding 36 model components to the UV plane model.
! The established model now contains 109 components and 2.38785 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.181 mas, bmaj=9.821 mas, bpa=-2.463 degrees
! Estimated noise=471.353 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00796674 Jy
! Component: 100  -  total flux cleaned = 0.0120225 Jy
! Component: 150  -  total flux cleaned = 0.0144252 Jy
! Component: 200  -  total flux cleaned = 0.0156915 Jy
! Total flux subtracted in 200 components = 0.0156915 Jy
! Clean residual min=-0.002700 max=0.003441 Jy/beam
! Clean residual mean=0.000401 rms=0.000971 Jy/beam
! Combined flux in latest and established models = 2.40354 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.000333395 Jy
! Component: 100  -  total flux cleaned = 0.00053187 Jy
! Component: 150  -  total flux cleaned = 0.000602389 Jy
! Component: 200  -  total flux cleaned = 0.000667609 Jy
! Total flux subtracted in 200 components = 0.000667609 Jy
! Clean residual min=-0.002662 max=0.003428 Jy/beam
! Clean residual mean=0.000390 rms=0.000959 Jy/beam
! Combined flux in latest and established models = 2.40421 Jy
! Adding 60 model components to the UV plane model.
! The established model now contains 165 components and 2.40421 Jy
! Inverting map 
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=3.099 mas, bmaj=5.671 mas, bpa=-5.541 degrees
! Estimated noise=375.983 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00215779 Jy
! Component: 100  -  total flux cleaned = -0.00112751 Jy
! Component: 150  -  total flux cleaned = -0.000372544 Jy
! Component: 200  -  total flux cleaned = 4.09854e-05 Jy
! Total flux subtracted in 200 components = 4.09854e-05 Jy
! Clean residual min=-0.002800 max=0.003163 Jy/beam
! Clean residual mean=0.000156 rms=0.000772 Jy/beam
! Combined flux in latest and established models = 2.40425 Jy
selfcal
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 173 components and 2.40425 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.367474Jy  sigma=0.001223
! Fit after  self-cal, rms=0.367493Jy  sigma=0.001222
wmodel J0530+1331_S_1999_03_08_pus_map.mod
! Writing 173 model components to file: J0530+1331_S_1999_03_08_pus_map.mod
wobs J0530+1331_S_1999_03_08_pus_uvs.fits
! Writing UV FITS file: J0530+1331_S_1999_03_08_pus_uvs.fits
wwins J0530+1331_S_1999_03_08_pus_map.win
! wwins: Wrote 4 windows to J0530+1331_S_1999_03_08_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.00103382 Jy
! Component: 100  -  total flux cleaned = 0.00157421 Jy
! Component: 150  -  total flux cleaned = 0.00198497 Jy
! Component: 200  -  total flux cleaned = 0.00232852 Jy
! Component: 250  -  total flux cleaned = 0.00266101 Jy
! Component: 300  -  total flux cleaned = 0.00293803 Jy
! Component: 350  -  total flux cleaned = 0.00316248 Jy
! Component: 400  -  total flux cleaned = 0.00338288 Jy
! Component: 450  -  total flux cleaned = 0.00364298 Jy
! Component: 500  -  total flux cleaned = 0.00385594 Jy
! Component: 550  -  total flux cleaned = 0.00402421 Jy
! Component: 600  -  total flux cleaned = 0.00431523 Jy
! Component: 650  -  total flux cleaned = 0.0045205 Jy
! Component: 700  -  total flux cleaned = 0.00472385 Jy
! Component: 750  -  total flux cleaned = 0.00500505 Jy
! Component: 800  -  total flux cleaned = 0.00520348 Jy
! Component: 850  -  total flux cleaned = 0.00540014 Jy
! Component: 900  -  total flux cleaned = 0.00563364 Jy
! Component: 950  -  total flux cleaned = 0.00582649 Jy
! Component: 1000  -  total flux cleaned = 0.00601745 Jy
! Component: 1050  -  total flux cleaned = 0.00624459 Jy
! Component: 1100  -  total flux cleaned = 0.00643248 Jy
! Component: 1150  -  total flux cleaned = 0.0067303 Jy
! Component: 1200  -  total flux cleaned = 0.00691461 Jy
! Component: 1250  -  total flux cleaned = 0.00724358 Jy
! Component: 1300  -  total flux cleaned = 0.00731612 Jy
! Component: 1350  -  total flux cleaned = 0.00760462 Jy
! Component: 1400  -  total flux cleaned = 0.0078189 Jy
! Component: 1450  -  total flux cleaned = 0.00792563 Jy
! Component: 1500  -  total flux cleaned = 0.00813709 Jy
! Component: 1550  -  total flux cleaned = 0.00838212 Jy
! Component: 1600  -  total flux cleaned = 0.00852149 Jy
! Component: 1650  -  total flux cleaned = 0.00883224 Jy
! Component: 1700  -  total flux cleaned = 0.00896957 Jy
! Component: 1750  -  total flux cleaned = 0.00927614 Jy
! Component: 1800  -  total flux cleaned = 0.00944547 Jy
! Component: 1850  -  total flux cleaned = 0.00974807 Jy
! Component: 1900  -  total flux cleaned = 0.00994835 Jy
! Component: 1950  -  total flux cleaned = 0.0101477 Jy
! Component: 2000  -  total flux cleaned = 0.0103787 Jy
! Total flux subtracted in 2048 components = 0.0105099 Jy
! Clean residual min=-0.001754 max=0.001639 Jy/beam
! Clean residual mean=0.000097 rms=0.000616 Jy/beam
! Combined flux in latest and established models = 2.41476 Jy
keep
! Adding 126 model components to the UV plane model.
! The established model now contains 289 components and 2.41476 Jy
![Exited script file: muppet]
wmap "J0530+1331_S_1999_03_08_pus\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.099 x 5.671 at -5.541 degrees (North through East)
! Clean map  min=-0.0023027  max=1.8729 Jy/beam
! Writing clean map to FITS file: J0530+1331_S_1999_03_08_pus_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 1.87291 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000614801 
device "J0530+1331_S_1999_03_08_pus\_map.eps/VPS"
! Attempting to open device: 'J0530+1331_S_1999_03_08_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.0984782 0.0984782 0.196956 0.393913 0.787825 1.57565 3.1513 6.3026 12.6052 25.2104 50.4208
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0018 
print "peak=",int(1000*peak_flux)/1000
! peak= 1.872 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 3.099 x 5.671 at -5.541 degrees (North through East)
! Clean map  min=-0.0023027  max=1.8729 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0530+1331_S_1999_03_08_pus\_map.gif/vgif"
! Attempting to open device: 'J0530+1331_S_1999_03_08_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J0530+1331_S_1999_03_08_pus_uvs.log closed on Tue Jan  8 18:03:19 2008