     @wfits?.setStretch(@stretch)
 
   updateExtent: =>
-    console.log 'updateExtent'
-    min = @opts.extent.min
-    max = @opts.extent.max
-    @wfits?.setExtent(min, max)
+    @wfits?.setExtent(@opts.extent.min, @opts.extent.max)
 
 
 window.Ubret.SpacewarpViewer = SpacewarpViewer

    @dfs = undefined
    
    @wfits.setCalibrations(1, 1, 1)
    scales = @opts.scales or @defaultScales
    @wfits.setScales.apply(@wfits, scales)
    @wfits.setAlpha(@opts.alpha or @defaultAlpha)
    @wfits.setQ(@opts.q or @defaultQ)
    @wfits.setExtent(gMin, gMax)
    
    # Enable mouse controls
    @wfits.setupControls({

        })
    })
    
    band = @opts.band
    if band?
      if band is 'gri'
        @wfits.drawColor('i', 'r', 'g')
      else
        @wfits.setImage(band)
        @wfits.setStretch(@opts.stretch or 'linear')
    else
      # Default to color composite
      @wfits.drawColor('i', 'r', 'g')
    
    @trigger 'swviewer:loaded'
  
  updateBand: =>
    band = @opts.band
    
    if @wfits?
      if band is 'gri'
        @wfits.drawColor('i', 'r', 'g')
      else
        @wfits.setImage(band)
        @wfits.setStretch(@opts.stretch)
  
