       nscale = d.get('scale') / avg or 1
       d.set('nscale', nscale)
       
-      # Send to web fits object
       @trigger 'fits:scale', band, nscale
-      @wfits.setScale band, nscale
     )
     
   setBand: (band) =>
+    console.log 'setBand'
     if band is 'gri'
       fn = 'drawColor'
     else

    $.when.apply(this, dfs)
      .done( (e) =>
        @computeNormalizedScales()
        
        @wfits.setAlpha(@defaultAlpha)
        @wfits.setQ(@defaultQ)
        @wfits.setupMouseInteraction()
        
        # Set color composite as default
        @setBand('gri')

    
  updateScale: (band, value) =>
    @wfits.setScale(band, value)
  
  updateStretch: (value) =>
    @wfits.setStretch(value)


window.Ubret.SpacewarpViewer = SpacewarpViewer
