! Started logfile: J1104+3812_X_2001_07_05_pus_uvs.log on Thu Jul  5 15:18:06 2007
obs J1104+3812_X_2001_07_05_pus_uva.fits
! Reading UV FITS file: J1104+3812_X_2001_07_05_pus_uva.fits
! AN table 1: 93 integrations on 171 of 171 possible baselines.
! AN table 2: 81 integrations on 171 of 171 possible baselines.
! AN table 3: 103 integrations on 171 of 171 possible baselines.
! Apparent sampling: 0.186733 visibilities/baseline/integration-bin.
! *** This seems a bit low - see "help observe" on the binwid argument.
! Found source: J1104+3812
! 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  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 2374 lines of history.
! 
! Reading 35380 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 = 256 
print "field_cell =",field_cell
! field_cell = 0.2 
print "taper_size =",taper_size
! taper_size = 70 
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 = 256x256 pixels with 0.200x0.200 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 856 telescope corrections were flagged in sub-array 1.
!  A total of 995 telescope corrections were flagged in sub-array 2.
!  A total of 1546 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 2.
!  A total of 857 telescope corrections were flagged in sub-array 1.
!  A total of 995 telescope corrections were flagged in sub-array 2.
!  A total of 1546 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 3.
!  A total of 857 telescope corrections were flagged in sub-array 1.
!  A total of 995 telescope corrections were flagged in sub-array 2.
!  A total of 1546 telescope corrections were flagged in sub-array 3.
! 
! Correcting IF 4.
!  A total of 857 telescope corrections were flagged in sub-array 1.
!  A total of 995 telescope corrections were flagged in sub-array 2.
!  A total of 1546 telescope corrections were flagged in sub-array 3.
! 
! Fit before self-cal, rms=0.903230Jy  sigma=0.007186
! Fit after  self-cal, rms=0.705262Jy  sigma=0.005613
! 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 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
! Estimated beam: bmin=0.5414 mas, bmaj=0.7909 mas, bpa=-15.62 degrees
! Estimated noise=850.426 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.239625 Jy
! Component: 100  -  total flux cleaned = 0.304478 Jy
! Total flux subtracted in 100 components = 0.304478 Jy
! Clean residual min=-0.008584 max=0.028590 Jy/beam
! Clean residual mean=0.000186 rms=0.003099 Jy/beam
! Combined flux in latest and established models = 0.304478 Jy
! Performing phase self-cal
! Adding 5 model components to the UV plane model.
! The established model now contains 5 components and 0.304477 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.195803Jy  sigma=0.001368
! Fit after  self-cal, rms=0.195570Jy  sigma=0.001367
! Inverting map 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
! clean: niter=100  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0322126 Jy
! Component: 100  -  total flux cleaned = 0.0508916 Jy
! Total flux subtracted in 100 components = 0.0508916 Jy
! Clean residual min=-0.007593 max=0.013737 Jy/beam
! Clean residual mean=0.000134 rms=0.002261 Jy/beam
! Combined flux in latest and established models = 0.355369 Jy
! Performing phase self-cal
! Adding 11 model components to the UV plane model.
! The established model now contains 13 components and 0.355369 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188837Jy  sigma=0.001287
! Fit after  self-cal, rms=0.188705Jy  sigma=0.001286
! Inverting map 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
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 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
! Estimated beam: bmin=0.6429 mas, bmaj=0.9408 mas, bpa=-17.8 degrees
! Estimated noise=493.542 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.2, 0.8).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.0246755 Jy
! Component: 100  -  total flux cleaned = 0.0406517 Jy
! Component: 150  -  total flux cleaned = 0.052046 Jy
! Component: 200  -  total flux cleaned = 0.060586 Jy
! Total flux subtracted in 200 components = 0.060586 Jy
! Clean residual min=-0.005104 max=0.009094 Jy/beam
! Clean residual mean=0.000327 rms=0.001673 Jy/beam
! Combined flux in latest and established models = 0.415955 Jy
! Performing phase self-cal
! Adding 28 model components to the UV plane model.
! The established model now contains 34 components and 0.415955 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.185765Jy  sigma=0.001248
! Fit after  self-cal, rms=0.185507Jy  sigma=0.001246
! Inverting map 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
! Added new window around map position (-1.4, 1.2).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00979987 Jy
! Component: 100  -  total flux cleaned = 0.0163147 Jy
! Component: 150  -  total flux cleaned = 0.0212717 Jy
! Component: 200  -  total flux cleaned = 0.0252483 Jy
! Total flux subtracted in 200 components = 0.0252483 Jy
! Clean residual min=-0.004525 max=0.005342 Jy/beam
! Clean residual mean=0.000201 rms=0.001292 Jy/beam
! Combined flux in latest and established models = 0.441204 Jy
! Performing phase self-cal
! Adding 35 model components to the UV plane model.
! The established model now contains 57 components and 0.441204 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.184934Jy  sigma=0.001240
! Fit after  self-cal, rms=0.184893Jy  sigma=0.001240
! Inverting map 
! Your choice of large map pixels excluded 6.23% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1582 milli-arcsec
print "************** FINISHED NATURAL WEIGHTING CLEAN **************"
! ************** FINISHED NATURAL WEIGHTING CLEAN ************** 
! 
gscale true
! Performing overall amplitude self-cal
! 
! Correcting IF 1.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.02     FD        0.99     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00     KP        0.96     
!   LA        0.98     MC        1.18     MK        1.01     NL        1.00     
!   NY        0.99     OV        1.02     PT        1.00     SC        1.02     
!   TS        1.00*    WF        1.09     WZ        0.97     
! 
!  A total of 39 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.96     FD        0.93     GC        1.05     GG        1.00*    
!   HH        1.00*    HN        0.91     KK        1.00*    KP        0.92     
!   LA        0.95     MC        1.00*    MK        0.94     NL        1.02     
!   NY        0.97     OV        1.02     PT        0.96     SC        1.00*    
!   TS        0.92     WF        1.04     WZ        1.00*    
! 
!  A total of 21 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.12     GG        1.00*    
!   HH        1.02     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.00*    MK        1.00*    NL        1.00*    
!   NY        0.98     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.12     WF        1.00*    WZ        0.98     
! 
! 
! Correcting IF 2.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.03     FD        1.00     GC        0.99     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.01     KP        0.95     
!   LA        0.95     MC        1.21     MK        1.01     NL        0.97     
!   NY        1.07     OV        1.00     PT        0.96     SC        0.98     
!   TS        1.00*    WF        1.11     WZ        1.00     
! 
!  A total of 39 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.97     FD        0.94     GC        0.98     GG        1.00*    
!   HH        1.00*    HN        0.92     KK        1.00*    KP        0.93     
!   LA        0.95     MC        1.00*    MK        0.95     NL        0.97     
!   NY        1.01     OV        1.01     PT        0.93     SC        1.00*    
!   TS        0.92     WF        1.02     WZ        1.00*    
! 
!  A total of 21 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.08     GG        1.00*    
!   HH        1.00     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.00*    MK        1.00*    NL        1.00*    
!   NY        1.07     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.07     WF        1.00*    WZ        0.95     
! 
! 
! Correcting IF 3.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.07     FD        1.00     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.96     KK        1.01     KP        1.00     
!   LA        0.98     MC        1.21     MK        1.01     NL        1.02     
!   NY        1.08     OV        1.04     PT        0.97     SC        1.00     
!   TS        1.00*    WF        1.04     WZ        1.01     
! 
!  A total of 39 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        1.03     FD        0.94     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00*    KP        0.93     
!   LA        0.98     MC        1.00*    MK        0.98     NL        1.00     
!   NY        1.03     OV        1.05     PT        0.97     SC        1.00*    
!   TS        0.92     WF        0.98     WZ        1.00*    
! 
!  A total of 21 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.16     GG        1.00*    
!   HH        1.01     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.00*    MK        1.00*    NL        1.00*    
!   NY        1.02     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.17     WF        1.00*    WZ        0.98     
! 
! 
! Correcting IF 4.
!  A total of 24 telescope corrections were flagged in sub-array 1.
!  Telescope amplitude corrections in sub-array 1:
!   BR        1.04     FD        0.96     GC        1.03     GG        1.00*    
!   HH        1.00*    HN        0.95     KK        1.05     KP        0.95     
!   LA        0.95     MC        1.20     MK        1.06     NL        1.01     
!   NY        0.99     OV        1.01     PT        0.98     SC        1.08     
!   TS        1.00*    WF        1.07     WZ        1.01     
! 
!  A total of 39 telescope corrections were flagged in sub-array 2.
!  Telescope amplitude corrections in sub-array 2:
!   BR        0.97     FD        0.93     GC        1.00     GG        1.00*    
!   HH        1.00*    HN        0.94     KK        1.00*    KP        0.95     
!   LA        0.94     MC        1.00*    MK        0.99     NL        1.02     
!   NY        0.97     OV        1.05     PT        0.98     SC        1.00*    
!   TS        0.94     WF        0.98     WZ        1.00*    
! 
!  A total of 21 telescope corrections were flagged in sub-array 3.
!  Telescope amplitude corrections in sub-array 3:
!   BR        1.00*    FD        1.00*    GC        1.04     GG        1.00*    
!   HH        1.04     HN        1.00*    KK        1.00*    KP        1.00*    
!   LA        1.00*    MC        1.00*    MK        1.00*    NL        1.00*    
!   NY        1.03     OV        1.00*    PT        1.00*    SC        1.00*    
!   TS        1.01     WF        1.00*    WZ        1.03     
! 
! 
! Fit before self-cal, rms=0.184893Jy  sigma=0.001240
! Fit after  self-cal, rms=0.187175Jy  sigma=0.001221
dynam = dynam - 0.5
flux_cutoff = imstat(rms) * dynam
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6519 mas, bmaj=0.9451 mas, bpa=-17.27 degrees
! Estimated noise=495.151 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.00179836 Jy
! Component: 100  -  total flux cleaned = -0.00131112 Jy
! Component: 150  -  total flux cleaned = -0.00100493 Jy
! Component: 200  -  total flux cleaned = -0.000916595 Jy
! Total flux subtracted in 200 components = -0.000916595 Jy
! Clean residual min=-0.002988 max=0.002959 Jy/beam
! Clean residual mean=0.000114 rms=0.000719 Jy/beam
! Combined flux in latest and established models = 0.440287 Jy
! Performing phase self-cal
! Adding 19 model components to the UV plane model.
! The established model now contains 70 components and 0.440287 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187041Jy  sigma=0.001220
! Fit after  self-cal, rms=0.187090Jy  sigma=0.001220
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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.187090Jy  sigma=0.001220
! Fit after  self-cal, rms=0.187364Jy  sigma=0.001220
dynam = dynam - 0.75
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6537 mas, bmaj=0.9466 mas, bpa=-17.23 degrees
! Estimated noise=495.457 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.00152556 Jy
! Component: 100  -  total flux cleaned = -0.00143711 Jy
! Component: 150  -  total flux cleaned = -0.00143401 Jy
! Component: 200  -  total flux cleaned = -0.00143243 Jy
! Total flux subtracted in 200 components = -0.00143243 Jy
! Clean residual min=-0.002633 max=0.002931 Jy/beam
! Clean residual mean=0.000107 rms=0.000682 Jy/beam
! Combined flux in latest and established models = 0.438854 Jy
selfcal
! Performing phase self-cal
! Adding 25 model components to the UV plane model.
! The established model now contains 73 components and 0.438854 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187299Jy  sigma=0.001219
! Fit after  self-cal, rms=0.187300Jy  sigma=0.001219
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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 (-3.4, 2.4).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00311533 Jy
! Component: 100  -  total flux cleaned = 0.00469897 Jy
! Component: 150  -  total flux cleaned = 0.00539218 Jy
! Component: 200  -  total flux cleaned = 0.00593905 Jy
! Total flux subtracted in 200 components = 0.00593905 Jy
! Clean residual min=-0.002314 max=0.002558 Jy/beam
! Clean residual mean=0.000069 rms=0.000618 Jy/beam
! Combined flux in latest and established models = 0.444793 Jy
! Performing phase self-cal
! Adding 20 model components to the UV plane model.
! The established model now contains 86 components and 0.444793 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187249Jy  sigma=0.001218
! Fit after  self-cal, rms=0.187242Jy  sigma=0.001218
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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.187242Jy  sigma=0.001218
! Fit after  self-cal, rms=0.187810Jy  sigma=0.001218
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6552 mas, bmaj=0.9478 mas, bpa=-17.17 degrees
! Estimated noise=495.925 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = -0.000570805 Jy
! Component: 100  -  total flux cleaned = -0.000311928 Jy
! Component: 150  -  total flux cleaned = -2.43884e-05 Jy
! Component: 200  -  total flux cleaned = 2.95448e-05 Jy
! Total flux subtracted in 200 components = 2.95448e-05 Jy
! Clean residual min=-0.002110 max=0.002366 Jy/beam
! Clean residual mean=0.000060 rms=0.000590 Jy/beam
! Combined flux in latest and established models = 0.444823 Jy
selfcal
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 91 components and 0.444823 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187776Jy  sigma=0.001218
! Fit after  self-cal, rms=0.187784Jy  sigma=0.001218
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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.000368243 Jy
! Component: 100  -  total flux cleaned = 0.000516671 Jy
! Component: 150  -  total flux cleaned = 0.00065417 Jy
! Component: 200  -  total flux cleaned = 0.000781964 Jy
! Total flux subtracted in 200 components = 0.000781964 Jy
! Clean residual min=-0.002023 max=0.002326 Jy/beam
! Clean residual mean=0.000055 rms=0.000577 Jy/beam
! Combined flux in latest and established models = 0.445605 Jy
! Performing phase self-cal
! Adding 27 model components to the UV plane model.
! The established model now contains 93 components and 0.445605 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.187765Jy  sigma=0.001218
! Fit after  self-cal, rms=0.187767Jy  sigma=0.001218
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 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.187767Jy  sigma=0.001218
! Fit after  self-cal, rms=0.188244Jy  sigma=0.001218
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=2.12 mas, bmaj=2.335 mas, bpa=11.63 degrees
! Estimated noise=765.181 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000452077 Jy
! Component: 100  -  total flux cleaned = 0.000488641 Jy
! Component: 150  -  total flux cleaned = 0.000457859 Jy
! Component: 200  -  total flux cleaned = 0.000431461 Jy
! Total flux subtracted in 200 components = 0.000431461 Jy
! Clean residual min=-0.002847 max=0.003203 Jy/beam
! Clean residual mean=0.000164 rms=0.001031 Jy/beam
! Combined flux in latest and established models = 0.446036 Jy
selfcal
! Performing phase self-cal
! Adding 15 model components to the UV plane model.
! The established model now contains 102 components and 0.446036 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188246Jy  sigma=0.001218
! Fit after  self-cal, rms=0.188240Jy  sigma=0.001218
flux_cutoff = imstat(rms) * dynam
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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.000130829 Jy
! Component: 100  -  total flux cleaned = 0.000110482 Jy
! Component: 150  -  total flux cleaned = 0.000130569 Jy
! Component: 200  -  total flux cleaned = 0.000113001 Jy
! Total flux subtracted in 200 components = 0.000113001 Jy
! Clean residual min=-0.002763 max=0.003161 Jy/beam
! Clean residual mean=0.000162 rms=0.001016 Jy/beam
! Combined flux in latest and established models = 0.446149 Jy
! Performing phase self-cal
! Adding 17 model components to the UV plane model.
! The established model now contains 110 components and 0.446149 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188244Jy  sigma=0.001218
! Fit after  self-cal, rms=0.188240Jy  sigma=0.001218
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
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 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6562 mas, bmaj=0.9488 mas, bpa=-17.13 degrees
! Estimated noise=496.544 mJy/beam.
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6562 x 0.9488 at -17.13 degrees (North through East)
! Clean map  min=-0.0017758  max=0.32399 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
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 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.5506 mas, bmaj=0.7941 mas, bpa=-14.32 degrees
! Estimated noise=870.595 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.244523 Jy
! Component: 100  -  total flux cleaned = 0.309542 Jy
! Component: 150  -  total flux cleaned = 0.341104 Jy
! Component: 200  -  total flux cleaned = 0.359885 Jy
! Total flux subtracted in 200 components = 0.359885 Jy
! Clean residual min=-0.005014 max=0.010362 Jy/beam
! Clean residual mean=0.000108 rms=0.001670 Jy/beam
! Combined flux in latest and established models = 0.359885 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 13 model components to the UV plane model.
! The established model now contains 13 components and 0.359885 Jy
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6562 mas, bmaj=0.9488 mas, bpa=-17.13 degrees
! Estimated noise=496.544 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.0206542 Jy
! Component: 100  -  total flux cleaned = 0.0339396 Jy
! Component: 150  -  total flux cleaned = 0.0433587 Jy
! Component: 200  -  total flux cleaned = 0.0505273 Jy
! Total flux subtracted in 200 components = 0.0505273 Jy
! Clean residual min=-0.002519 max=0.004291 Jy/beam
! Clean residual mean=0.000250 rms=0.000990 Jy/beam
! Combined flux in latest and established models = 0.410412 Jy
! Adding 36 model components to the UV plane model.
! The established model now contains 41 components and 0.410412 Jy
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Added new window around map position (-2.4, 2.2).
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00566846 Jy
! Component: 100  -  total flux cleaned = 0.0102825 Jy
! Component: 150  -  total flux cleaned = 0.0141191 Jy
! Component: 200  -  total flux cleaned = 0.017373 Jy
! Total flux subtracted in 200 components = 0.017373 Jy
! Clean residual min=-0.002171 max=0.002418 Jy/beam
! Clean residual mean=0.000151 rms=0.000688 Jy/beam
! Combined flux in latest and established models = 0.427785 Jy
! Adding 41 model components to the UV plane model.
! The established model now contains 64 components and 0.427785 Jy
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
uvtaper 0.3,taper_size
! Gaussian taper: value 0.3 at UV radius = 70 mega-wavelengths.
clean clean_niter,clean_gain
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=2.12 mas, bmaj=2.335 mas, bpa=11.63 degrees
! Estimated noise=765.181 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.00731245 Jy
! Component: 100  -  total flux cleaned = 0.0114367 Jy
! Component: 150  -  total flux cleaned = 0.0139911 Jy
! Component: 200  -  total flux cleaned = 0.0156256 Jy
! Total flux subtracted in 200 components = 0.0156256 Jy
! Clean residual min=-0.002848 max=0.003138 Jy/beam
! Clean residual mean=0.000224 rms=0.001040 Jy/beam
! Combined flux in latest and established models = 0.443411 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.00105861 Jy
! Component: 100  -  total flux cleaned = 0.00174809 Jy
! Component: 150  -  total flux cleaned = 0.00204104 Jy
! Component: 200  -  total flux cleaned = 0.00210522 Jy
! Total flux subtracted in 200 components = 0.00210522 Jy
! Clean residual min=-0.002771 max=0.003168 Jy/beam
! Clean residual mean=0.000174 rms=0.001018 Jy/beam
! Combined flux in latest and established models = 0.445516 Jy
! Adding 58 model components to the UV plane model.
! The established model now contains 110 components and 0.445516 Jy
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
uvtaper 0,0
! No UV-taper is currently set.
clean
! Inverting map and beam 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! Estimated beam: bmin=0.6562 mas, bmaj=0.9488 mas, bpa=-17.13 degrees
! Estimated noise=496.544 mJy/beam.
! clean: niter=200  gain=0.03  cutoff=0
! Component: 050  -  total flux cleaned = 0.000361289 Jy
! Component: 100  -  total flux cleaned = 0.000316092 Jy
! Component: 150  -  total flux cleaned = 0.000275547 Jy
! Component: 200  -  total flux cleaned = 0.000238146 Jy
! Total flux subtracted in 200 components = 0.000238146 Jy
! Clean residual min=-0.001851 max=0.002226 Jy/beam
! Clean residual mean=0.000047 rms=0.000555 Jy/beam
! Combined flux in latest and established models = 0.445754 Jy
selfcal
! Performing phase self-cal
! Adding 18 model components to the UV plane model.
! The established model now contains 121 components and 0.445754 Jy
! 
! Correcting IF 1.
! 
! Correcting IF 2.
! 
! Correcting IF 3.
! 
! Correcting IF 4.
! 
! Fit before self-cal, rms=0.188256Jy  sigma=0.001217
! Fit after  self-cal, rms=0.188181Jy  sigma=0.001217
wmodel J1104+3812_X_2001_07_05_pus_map.mod
! Writing 121 model components to file: J1104+3812_X_2001_07_05_pus_map.mod
wobs J1104+3812_X_2001_07_05_pus_uvs.fits
! Writing UV FITS file: J1104+3812_X_2001_07_05_pus_uvs.fits
wwins J1104+3812_X_2001_07_05_pus_map.win
! wwins: Wrote 5 windows to J1104+3812_X_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 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! clean: niter=1024  gain=0.01  cutoff=0
! Component: 050  -  total flux cleaned = 0.000989592 Jy
! Component: 100  -  total flux cleaned = 0.00164016 Jy
! Component: 150  -  total flux cleaned = 0.00218928 Jy
! Component: 200  -  total flux cleaned = 0.00261561 Jy
! Component: 250  -  total flux cleaned = 0.0029634 Jy
! Component: 300  -  total flux cleaned = 0.00323966 Jy
! Component: 350  -  total flux cleaned = 0.00338999 Jy
! Component: 400  -  total flux cleaned = 0.00344896 Jy
! Component: 450  -  total flux cleaned = 0.00356407 Jy
! Component: 500  -  total flux cleaned = 0.00362032 Jy
! Component: 550  -  total flux cleaned = 0.00367588 Jy
! Component: 600  -  total flux cleaned = 0.0037305 Jy
! Component: 650  -  total flux cleaned = 0.00375735 Jy
! Component: 700  -  total flux cleaned = 0.00375777 Jy
! Component: 750  -  total flux cleaned = 0.00378381 Jy
! Component: 800  -  total flux cleaned = 0.00380906 Jy
! Component: 850  -  total flux cleaned = 0.00380891 Jy
! Component: 900  -  total flux cleaned = 0.00380871 Jy
! Component: 950  -  total flux cleaned = 0.00380887 Jy
! Component: 1000  -  total flux cleaned = 0.00376096 Jy
! Total flux subtracted in 1024 components = 0.00380892 Jy
! Clean residual min=-0.001547 max=0.001495 Jy/beam
! Clean residual mean=0.000015 rms=0.000448 Jy/beam
! Combined flux in latest and established models = 0.449563 Jy
keep
! Adding 79 model components to the UV plane model.
! The established model now contains 200 components and 0.449563 Jy
wmap "J1104+3812_X_2001_07_05_pus\_map.fits"
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
! restore: Substituting estimate of restoring beam from last 'invert'.
! Restoring with beam: 0.6562 x 0.9488 at -17.13 degrees (North through East)
! Clean map  min=-0.0015918  max=0.32529 Jy/beam
! Writing clean map to FITS file: J1104+3812_X_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.32529 
invert
! Inverting map 
! Your choice of large map pixels excluded 6.13% of the data.
!  The x-axis pixel size should ideally be below 0.1646 milli-arcsec
!  The y-axis pixel size should ideally be below 0.1583 milli-arcsec
float image_rms
image_rms = imstat(rms)
print "The final image rms is",image_rms
! The final image rms is 0.000448293 
device "J1104+3812_X_2001_07_05_pus\_map.eps/VPS"
! Attempting to open device: 'J1104+3812_X_2001_07_05_pus_map.eps/VPS'
loglevs 100*3*image_rms/peak_flux
! The new contour levels are:
!  -0.41344 0.41344 0.826881 1.65376 3.30752 6.61504 13.2301 26.4602 52.9204
print "clev=",int(3*image_rms*10000)/10000
! clev= 0.0013 
print "peak=",int(1000*peak_flux)/1000
! peak= 0.325 
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.6562 x 0.9488 at -17.13 degrees (North through East)
! Clean map  min=-0.0015918  max=0.32529 Jy/beam
mapcolor color, 0.9
! Mapplot colormap: rainbow, contrast: 0.9 brightness: 0.5.
device "J1104+3812_X_2001_07_05_pus\_map.gif/vgif"
! Attempting to open device: 'J1104+3812_X_2001_07_05_pus_map.gif/vgif'
mapplot cln
quit
! Quitting program
! Log file J1104+3812_X_2001_07_05_pus_uvs.log closed on Thu Jul  5 15:19:17 2007