     @stretch = value
     @wfits.setStretch(value)
 
+  getExtent: (value) ->
+    return (@max - @min) * value / 1000
+
+  updateExtent: (min, max) =>
+    min = @getExtent(min)
+    max = @getExtent(max)
+    @wfits.setExtent(min, max)
+
 
 window.Ubret.SpacewarpViewer = SpacewarpViewer

    console.log 'allChannelsReceived'
    @dfs = undefined
    
    @computeNormalizedScales()
    scales = @collection.getColorScales()
    
    @wfits.setCalibrations(1, 1, 1)

  start: =>
    console.log 'start'

  setBand: (band) =>
    if band is 'gri'
      @wfits.drawColor('i', 'r', 'g')
    else
