! Started logfile: J0948+4039_X_2006_02_16_yyk_uvs.log on Wed Jul  5 11:53:57 2006
obs J0948+4039_X_2006_02_16_yyk_uva.fits
! Reading UV FITS file: J0948+4039_X_2006_02_16_yyk_uva.fits
! AN table 1: 296 integrations on 45 of 45 possible baselines.
! Apparent sampling: 0.760435 visibilities/baseline/integration-bin.
! Found source: J0948+4039
! 
! 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  8.40997e+09        8e+06          1        8e+06
!  02        2  8.47997e+09        8e+06          1        8e+06
!  03        3  8.79497e+09        8e+06          1        8e+06
!  04        4  8.89997e+09        8e+06          1        8e+06
! 
! Polarization(s): RR
! 
! Read 2421 lines of history.
! 
! Reading 40516 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
![@muppet J0948+4039_X_2006_02_16_yyk]
integer clean_niter
clean_niter = 100
float clean_gain
clean_gain = 0.04
float dynam
dynam = 6.0
float amp_soltime1
amp_soltime1 = 10
float amp_soltime2
amp_soltime2 = 1
float phase_soltime1
phase_soltime1=10
float phase_soltime2
phase_soltime2=0.5
float phase_soltime
phase_soltime=phase_soltime1
float ampcor_selflim
ampcor_selflim=1.20
float thresh
thresh = 0.10
float win_mult
win_mult = 1.8
float time_av
time_av = 30
float old_peak
float new_peak
float flux_cutoff
mapsize field_size, field_cell
! Map grid = 512x512 pixels with 0.200x0.200 milli-arcsec cellsize.
uvav time_av, true
! Averaging into 30 second bins.
! 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
phase_soltime=phase_soltime1
print "uvstat(rms)=",uvstat(rms),"Jy"
! uvstat(rms)= 0.650379 Jy 
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=0.672 mas, bmaj=2.22 mas, bpa=8.233 degrees
! Estimated noise=1.75114 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal false,false,phase_soltime
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (0, 0).
! clean: niter=100  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.432789 Jy
! Component: 100  -  total flux cleaned = 0.60823 Jy
! Total flux subtracted in 100 components = 0.60823 Jy
! Clean residual min=-0.071178 max=0.125741 Jy/beam
! Clean residual mean=-0.000534 rms=0.022058 Jy/beam
! Combined flux in latest and established models = 0.60823 Jy
! Performing phase self-cal over 10 minute time intervals
! Adding 21 model components to the UV plane model.
! The established model now contains 21 components and 0.60823 Jy
! 
! Correcting IF 1.
!  A total of 5 telescope corrections were flagged in sub-array 1.
! 
! Correcting IF 2.
!  A total of 5 telescope corrections were flagged in sub-array 1.
! 
! Correcting IF 3.
!  A total of 5 telescope corrections were flagged in sub-array 1.
! 
! Correcting IF 4.
!  A total of 5 telescope corrections were flagged in sub-array 1.
! 
! Fit before self-cal, rms=0.356253Jy  sigma=6.704238
! Fit after  self-cal, rms=0.356620Jy  sigma=6.675179
! Inverting map and beam 
! Estimated beam: bmin=0.672 mas, bmaj=2.22 mas, bpa=8.233 degrees
! Estimated noise=1.75114 mJy/beam.
print "************** FINISHED UNIFORM WEIGHTING CLEAN **************"
! ************** FINISHED UNIFORM WEIGHTING CLEAN ************** 
! 
uvw 0,-2
! Uniform weighting is not currently selected.
! Gridding weights will be scaled by errors raised to the power -2.
! 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=0.8178 mas, bmaj=2.32 mas, bpa=7.717 degrees
! Estimated noise=1.22187 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal false,false,phase_soltime
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.183027 Jy
! Component: 100  -  total flux cleaned = 0.279038 Jy
! Component: 150  -  total flux cleaned = 0.333765 Jy
! Component: 200  -  total flux cleaned = 0.366068 Jy
! Total flux subtracted in 200 components = 0.366068 Jy
! Clean residual min=-0.070251 max=0.119435 Jy/beam
! Clean residual mean=-0.000299 rms=0.021708 Jy/beam
! Combined flux in latest and established models = 0.974297 Jy
! Performing phase self-cal over 10 minute time intervals
! Adding 24 model components to the UV plane model.
! The established model now contains 37 components and 0.974297 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.293767Jy  sigma=5.241336
! Fit after  self-cal, rms=0.294116Jy  sigma=5.225525
! Inverting map 
! Added new window around map position (-1.4, 0.6).
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.120549 Jy
! Component: 100  -  total flux cleaned = 0.131946 Jy
! Component: 150  -  total flux cleaned = 0.144015 Jy
! Component: 200  -  total flux cleaned = 0.151309 Jy
! Total flux subtracted in 200 components = 0.151309 Jy
! Clean residual min=-0.056583 max=0.106246 Jy/beam
! Clean residual mean=-0.000133 rms=0.016873 Jy/beam
! Combined flux in latest and established models = 1.12561 Jy
! Performing phase self-cal over 10 minute time intervals
! Adding 24 model components to the UV plane model.
! The established model now contains 59 components and 1.12561 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.251850Jy  sigma=4.344935
! Fit after  self-cal, rms=0.238476Jy  sigma=4.018012
! Inverting map 
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
restore
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.8178 x 2.32 at 7.717 degrees (North through East)
! Clean map  min=-0.052454  max=0.487 Jy/beam
if(peak(flux) < thresh*2)
  selflims ampcor_selflim
  end if
gscale
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  Amplitude normalization factor in sub-array 1: 0.907778
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.94     FD        1.00     HN        2.01     KP        0.91     
!   LA        0.95     MK        0.88     NL        1.36     OV        1.03     
!   PT        0.94     SC        0.99     
! 
! 
! Correcting IF 2.
!  Amplitude normalization factor in sub-array 1: 0.93193
!  Telescope amplitude corrections in sub-array 1:
!   BR        0.95     FD        0.99     HN        1.95     KP        0.86     
!   LA        0.91     MK        0.85     NL        1.28     OV        1.01     
!   PT        0.97     SC        0.94     
! 
! 
! Correcting IF 3.
!  Amplitude normalization factor in sub-array 1: 0.795053
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        1.05     HN        3.53     KP        0.79     
!   LA        0.94     MK        0.85     NL        1.30     OV        1.07     
!   PT        1.00     SC        1.00     
! 
! 
! Correcting IF 4.
!  Amplitude normalization factor in sub-array 1: 0.914958
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.01     FD        1.09     HN        1.78     KP        0.84     
!   LA        0.92     MK        0.86     NL        1.22     OV        1.12     
!   PT        1.07     SC        1.01     
! 
! 
! Fit before self-cal, rms=0.238476Jy  sigma=4.018012
! Fit after  self-cal, rms=0.325083Jy  sigma=5.121186
selfcal false, false, phase_soltime
! Performing phase self-cal over 10 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.325083Jy  sigma=5.121186
! Fit after  self-cal, rms=0.325641Jy  sigma=5.117088
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=0.7905 mas, bmaj=2.558 mas, bpa=10.88 degrees
! Estimated noise=0.994455 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal false,false,phase_soltime
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = -0.140275 Jy
! Component: 100  -  total flux cleaned = -0.198202 Jy
! Component: 150  -  total flux cleaned = -0.22182 Jy
! Component: 200  -  total flux cleaned = -0.235753 Jy
! Total flux subtracted in 200 components = -0.235753 Jy
! Clean residual min=-0.019610 max=0.037789 Jy/beam
! Clean residual mean=0.000080 rms=0.007019 Jy/beam
! Combined flux in latest and established models = 0.889853 Jy
! Performing phase self-cal over 10 minute time intervals
! Adding 40 model components to the UV plane model.
! The established model now contains 81 components and 0.889853 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.286624Jy  sigma=3.340296
! Fit after  self-cal, rms=0.285275Jy  sigma=3.313604
! Inverting map 
! Added new window around map position (0.6, 11.6).
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.0330967 Jy
! Component: 100  -  total flux cleaned = 0.031351 Jy
! Component: 150  -  total flux cleaned = 0.0255993 Jy
! Component: 200  -  total flux cleaned = 0.0225378 Jy
! Total flux subtracted in 200 components = 0.0225378 Jy
! Clean residual min=-0.016637 max=0.022378 Jy/beam
! Clean residual mean=0.000043 rms=0.005194 Jy/beam
! Combined flux in latest and established models = 0.912391 Jy
! Performing phase self-cal over 10 minute time intervals
! Adding 38 model components to the UV plane model.
! The established model now contains 107 components and 0.912391 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.276096Jy  sigma=3.075824
! Fit after  self-cal, rms=0.275632Jy  sigma=3.063308
! Inverting map 
print "************** FINISHED AMPLITUDE GSCALE SELF-CAL **************"
! ************** FINISHED AMPLITUDE GSCALE SELF-CAL ************** 
! 
phase_soltime=phase_soltime2
selfcal false, false, phase_soltime
! Performing phase self-cal over 0.5 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.275632Jy  sigma=3.063308
! Fit after  self-cal, rms=0.228997Jy  sigma=2.792485
dynam = dynam - 0.5
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 false,false,phase_soltime
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! Added new window around map position (-0.2, 17.8).
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.0243924 Jy
! Component: 100  -  total flux cleaned = 0.0317431 Jy
! Component: 150  -  total flux cleaned = 0.0347248 Jy
! Component: 200  -  total flux cleaned = 0.0347494 Jy
! Total flux subtracted in 200 components = 0.0347494 Jy
! Clean residual min=-0.016387 max=0.017364 Jy/beam
! Clean residual mean=0.000023 rms=0.004588 Jy/beam
! Combined flux in latest and established models = 0.94714 Jy
! Performing phase self-cal over 0.5 minute time intervals
! Adding 34 model components to the UV plane model.
! The established model now contains 130 components and 0.94714 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.216658Jy  sigma=2.635171
! Fit after  self-cal, rms=0.213904Jy  sigma=2.614599
! Inverting map 
print "*** FINISHED NATURAL WEIGHTING CLEAN with shorter phase_soltime ***"
! *** FINISHED NATURAL WEIGHTING CLEAN with shorter phase_soltime *** 
! 
dynam = dynam - 0.25
restore
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.7905 x 2.558 at 10.88 degrees (North through East)
! Clean map  min=-0.030522  max=0.3885 Jy/beam
if(peak(flux) > thresh)
  selfcal true, true, amp_soltime1
  selfcal false, false, phase_soltime
  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 false,false,phase_soltime
    new_peak = peak(flux)
    until(new_peak<=flux_cutoff)
  selfcal true, true, amp_soltime2
  selfcal false, false, phase_soltime
  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 false,false,phase_soltime
    new_peak = peak(flux)
    until(new_peak<=flux_cutoff)
  print "************** FINISHED AMPLITUDE SELF-CAL **************"
  end if
! Performing amp+phase self-cal over 10 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.213904Jy  sigma=2.614599
! Fit after  self-cal, rms=0.108673Jy  sigma=1.860380
! Performing phase self-cal over 0.5 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.108673Jy  sigma=1.860380
! Fit after  self-cal, rms=0.108480Jy  sigma=1.858783
! Inverting map and beam 
! Estimated beam: bmin=0.7877 mas, bmaj=2.424 mas, bpa=9.545 degrees
! Estimated noise=0.964594 mJy/beam.
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.00412012 Jy
! Component: 100  -  total flux cleaned = 0.000728348 Jy
! Component: 150  -  total flux cleaned = -0.00127956 Jy
! Component: 200  -  total flux cleaned = -0.00126254 Jy
! Total flux subtracted in 200 components = -0.00126254 Jy
! Clean residual min=-0.014148 max=0.015150 Jy/beam
! Clean residual mean=0.000025 rms=0.003532 Jy/beam
! Combined flux in latest and established models = 0.945878 Jy
! Performing phase self-cal over 0.5 minute time intervals
! Adding 36 model components to the UV plane model.
! The established model now contains 151 components and 0.945878 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.100588Jy  sigma=1.714989
! Fit after  self-cal, rms=0.098881Jy  sigma=1.695902
! Inverting map 
! Added new window around map position (1.6, 6.6).
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.0130626 Jy
! Component: 100  -  total flux cleaned = 0.012095 Jy
! Component: 150  -  total flux cleaned = 0.0108578 Jy
! Component: 200  -  total flux cleaned = 0.00932702 Jy
! Total flux subtracted in 200 components = 0.00932702 Jy
! Clean residual min=-0.012199 max=0.011650 Jy/beam
! Clean residual mean=0.000027 rms=0.003080 Jy/beam
! Combined flux in latest and established models = 0.955205 Jy
! Performing phase self-cal over 0.5 minute time intervals
! Adding 32 model components to the UV plane model.
! The established model now contains 169 components and 0.955205 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.092290Jy  sigma=1.570334
! Fit after  self-cal, rms=0.091174Jy  sigma=1.556895
! Inverting map 
! Performing amp+phase self-cal over 1 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.091174Jy  sigma=1.556895
! Fit after  self-cal, rms=0.085699Jy  sigma=1.532577
! Performing phase self-cal over 0.5 minute time intervals
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.085699Jy  sigma=1.532577
! Fit after  self-cal, rms=0.085707Jy  sigma=1.532470
! Inverting map and beam 
! Estimated beam: bmin=0.7881 mas, bmaj=2.397 mas, bpa=9.155 degrees
! Estimated noise=0.961145 mJy/beam.
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.00383285 Jy
! Component: 100  -  total flux cleaned = 0.00118176 Jy
! Component: 150  -  total flux cleaned = 0.000845793 Jy
! Component: 200  -  total flux cleaned = 0.00022159 Jy
! Total flux subtracted in 200 components = 0.00022159 Jy
! Clean residual min=-0.011878 max=0.010978 Jy/beam
! Clean residual mean=0.000026 rms=0.002858 Jy/beam
! Combined flux in latest and established models = 0.955426 Jy
! Performing phase self-cal over 0.5 minute time intervals
! Adding 46 model components to the UV plane model.
! The established model now contains 187 components and 0.955426 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.081520Jy  sigma=1.456323
! Fit after  self-cal, rms=0.080662Jy  sigma=1.445872
! Inverting map 
! ************** FINISHED AMPLITUDE SELF-CAL ************** 
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
win_mult = win_mult * 1.4
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.212 mas, bmaj=2.942 mas, bpa=10.62 degrees
! Estimated noise=1.31304 mJy/beam.
repeat
  if (peak(flux) > flux_cutoff) peakwin win_mult
  clean clean_niter,clean_gain
  flux_cutoff = imstat(rms) * dynam
  selfcal false,false,phase_soltime
  new_peak = peak(flux)
  until(new_peak<=flux_cutoff)
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.000768854 Jy
! Component: 100  -  total flux cleaned = 0.00114376 Jy
! Component: 150  -  total flux cleaned = 0.000902478 Jy
! Component: 200  -  total flux cleaned = 0.000463359 Jy
! Total flux subtracted in 200 components = 0.000463359 Jy
! Clean residual min=-0.013576 max=0.009407 Jy/beam
! Clean residual mean=0.000065 rms=0.003733 Jy/beam
! Combined flux in latest and established models = 0.95589 Jy
! Performing phase self-cal over 0.5 minute time intervals
! Adding 35 model components to the UV plane model.
! The established model now contains 210 components and 0.95589 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.079348Jy  sigma=1.422118
! Fit after  self-cal, rms=0.078600Jy  sigma=1.412640
! Inverting map 
uvtaper 0
! No UV-taper is currently set.
win_mult = win_mult / 1.4
print "************** FINISHED TAPERING SELF-CAL CLEAN **************"
! ************** FINISHED TAPERING SELF-CAL CLEAN ************** 
! 
print "************** CLEARING MODEL AND STARTING OVER **********"
! ************** CLEARING MODEL AND STARTING OVER ********** 
clrmod true,true,true
! clrmod: Cleared the established, tentative and continuum 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=0.6564 mas, bmaj=2.261 mas, bpa=8.74 degrees
! Estimated noise=1.40106 mJy/beam.
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.376321 Jy
! Component: 100  -  total flux cleaned = 0.555529 Jy
! Component: 150  -  total flux cleaned = 0.664585 Jy
! Component: 200  -  total flux cleaned = 0.732786 Jy
! Total flux subtracted in 200 components = 0.732786 Jy
! Clean residual min=-0.020980 max=0.028285 Jy/beam
! Clean residual mean=-0.000116 rms=0.006776 Jy/beam
! Combined flux in latest and established models = 0.732786 Jy
uvw 0,-2
! Uniform weighting is not currently selected.
! Gridding weights will be scaled by errors raised to the power -2.
! Radial weighting is not currently selected.
flux_cutoff = imstat(rms) * dynam
! Adding 26 model components to the UV plane model.
! The established model now contains 26 components and 0.732786 Jy
! Inverting map and beam 
! Estimated beam: bmin=0.7881 mas, bmaj=2.397 mas, bpa=9.155 degrees
! Estimated noise=0.961145 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.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.068565 Jy
! Component: 100  -  total flux cleaned = 0.0961695 Jy
! Component: 150  -  total flux cleaned = 0.117149 Jy
! Component: 200  -  total flux cleaned = 0.13574 Jy
! Total flux subtracted in 200 components = 0.13574 Jy
! Clean residual min=-0.013350 max=0.020032 Jy/beam
! Clean residual mean=-0.000019 rms=0.004465 Jy/beam
! Combined flux in latest and established models = 0.868526 Jy
! Adding 38 model components to the UV plane model.
! The established model now contains 56 components and 0.868526 Jy
! Inverting map 
! Added new window around map position (1.4, -0.4).
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.0239317 Jy
! Component: 100  -  total flux cleaned = 0.0353048 Jy
! Component: 150  -  total flux cleaned = 0.043209 Jy
! Component: 200  -  total flux cleaned = 0.0504966 Jy
! Total flux subtracted in 200 components = 0.0504966 Jy
! Clean residual min=-0.011018 max=0.011592 Jy/beam
! Clean residual mean=0.000014 rms=0.002978 Jy/beam
! Combined flux in latest and established models = 0.919022 Jy
! Adding 43 model components to the UV plane model.
! The established model now contains 90 components and 0.919022 Jy
! Inverting map 
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Estimated beam: bmin=2.212 mas, bmaj=2.942 mas, bpa=10.62 degrees
! Estimated noise=1.31304 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.04  cutoff=0
! Component: 050  -  total flux cleaned = 0.0125772 Jy
! Component: 100  -  total flux cleaned = 0.0185375 Jy
! Component: 150  -  total flux cleaned = 0.0208182 Jy
! Component: 200  -  total flux cleaned = 0.0230742 Jy
! Total flux subtracted in 200 components = 0.0230742 Jy
! Clean residual min=-0.011397 max=0.009422 Jy/beam
! Clean residual mean=0.000048 rms=0.003621 Jy/beam
! Combined flux in latest and established models = 0.942097 Jy
! Adding 40 model components to the UV plane model.
! The established model now contains 121 components and 0.942097 Jy
! Inverting map 
uvtaper 0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Estimated beam: bmin=0.7881 mas, bmaj=2.397 mas, bpa=9.155 degrees
! Estimated noise=0.961145 mJy/beam.
! clean: niter=200  gain=0.04  cutoff=0
! Component: 050  -  total flux cleaned = -0.00151773 Jy
! Component: 100  -  total flux cleaned = -0.000500379 Jy
! Component: 150  -  total flux cleaned = 0.0010077 Jy
! Component: 200  -  total flux cleaned = 0.00154866 Jy
! Total flux subtracted in 200 components = 0.00154866 Jy
! Clean residual min=-0.010732 max=0.008716 Jy/beam
! Clean residual mean=0.000019 rms=0.002344 Jy/beam
! Combined flux in latest and established models = 0.943645 Jy
selfcal false, false, phase_soltime
! Performing phase self-cal over 0.5 minute time intervals
! Adding 34 model components to the UV plane model.
! The established model now contains 147 components and 0.943645 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.075146Jy  sigma=1.325631
! Fit after  self-cal, rms=0.072283Jy  sigma=1.267527
wmodel J0948+4039_X_2006_02_16_yyk\_map.mod
! Writing 147 model components to file: J0948+4039_X_2006_02_16_yyk_map.mod
wobs J0948+4039_X_2006_02_16_yyk\_uvs.fits
! Writing UV FITS file: J0948+4039_X_2006_02_16_yyk_uvs.fits
wwins J0948+4039_X_2006_02_16_yyk\_map.win
! wwins: Wrote 6 windows to J0948+4039_X_2006_02_16_yyk_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.00204101 Jy
! Component: 100  -  total flux cleaned = -0.00428869 Jy
! Component: 150  -  total flux cleaned = -0.00590206 Jy
! Component: 200  -  total flux cleaned = -0.00605286 Jy
! Component: 250  -  total flux cleaned = -0.00554931 Jy
! Component: 300  -  total flux cleaned = -0.00495912 Jy
! Component: 350  -  total flux cleaned = -0.0049603 Jy
! Component: 400  -  total flux cleaned = -0.00495899 Jy
! Component: 450  -  total flux cleaned = -0.00464445 Jy
! Component: 500  -  total flux cleaned = -0.00403822 Jy
! Component: 550  -  total flux cleaned = -0.00384158 Jy
! Component: 600  -  total flux cleaned = -0.00355424 Jy
! Component: 650  -  total flux cleaned = -0.00318183 Jy
! Component: 700  -  total flux cleaned = -0.00263976 Jy
! Component: 750  -  total flux cleaned = -0.00237776 Jy
! Component: 800  -  total flux cleaned = -0.00203332 Jy
! Component: 850  -  total flux cleaned = -0.00178094 Jy
! Component: 900  -  total flux cleaned = -0.00169908 Jy
! Component: 950  -  total flux cleaned = -0.00169881 Jy
! Component: 1000  -  total flux cleaned = -0.0015406 Jy
! Component: 1050  -  total flux cleaned = -0.00154259 Jy
! Component: 1100  -  total flux cleaned = -0.00161918 Jy
! Component: 1150  -  total flux cleaned = -0.00139626 Jy
! Component: 1200  -  total flux cleaned = -0.00125004 Jy
! Component: 1250  -  total flux cleaned = -0.00117749 Jy
! Component: 1300  -  total flux cleaned = -0.000823279 Jy
! Component: 1350  -  total flux cleaned = -0.000683331 Jy
! Component: 1400  -  total flux cleaned = -0.000476428 Jy
! Component: 1450  -  total flux cleaned = -0.000341 Jy
! Component: 1500  -  total flux cleaned = -0.00027463 Jy
! Component: 1550  -  total flux cleaned = -0.000141083 Jy
! Component: 1600  -  total flux cleaned = 5.53342e-05 Jy
! Component: 1650  -  total flux cleaned = 0.000249483 Jy
! Component: 1700  -  total flux cleaned = 0.000503645 Jy
! Component: 1750  -  total flux cleaned = 0.000692539 Jy
! Component: 1800  -  total flux cleaned = 0.000755717 Jy
! Component: 1850  -  total flux cleaned = 0.00106387 Jy
! Component: 1900  -  total flux cleaned = 0.0011246 Jy
! Component: 1950  -  total flux cleaned = 0.00130615 Jy
! Component: 2000  -  total flux cleaned = 0.00160487 Jy
! Total flux subtracted in 2048 components = 0.00190071 Jy
! Clean residual min=-0.003650 max=0.003371 Jy/beam
! Clean residual mean=-0.000003 rms=0.001105 Jy/beam
! Combined flux in latest and established models = 0.945546 Jy
keep
! Adding 130 model components to the UV plane model.
! The established model now contains 275 components and 0.945546 Jy
![Exited script file: muppet]
wmap "J0948+4039_X_2006_02_16_yyk\_map.fits"
! Inverting map 
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.7881 x 2.397 at 9.155 degrees (North through East)
! Clean map  min=-0.018155  max=0.35631 Jy/beam
! Writing clean map to FITS file: J0948+4039_X_2006_02_16_yyk_map.fits
float peak_flux
peak_flux = peak(flux,max)
print "The peak flux is",peak_flux
! The peak flux is 0.356313 
invert
! Inverting map 
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.00108798 
device "J0948+4039_X_2006_02_16_yyk\_map.eps/VPS"
! Attempting to open device: 'J0948+4039_X_2006_02_16_yyk_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.916032 0.916032 1.83206 3.66413 7.32826 14.6565 29.313 58.6261
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0032 
print "peak=",int(peak_flux*1000)/1000
! peak= 0.356 
mapcolor none
! Mapplot colormap: none, contrast: 1 brightness: 0.5.
mapplot cln
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.7881 x 2.397 at 9.155 degrees (North through East)
! Clean map  min=-0.018155  max=0.35631 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J0948+4039_X_2006_02_16_yyk\_map.gif/gif"
! Attempting to open device: 'J0948+4039_X_2006_02_16_yyk_map.gif/gif'
mapplot cln
quit
! Quitting program
! Log file J0948+4039_X_2006_02_16_yyk_uvs.log closed on Wed Jul  5 11:54:24 2006