 
   # Normalize scales for color bands
   computeNormalizedScales: =>
-    gri = @collection.getColorLayers()
-    
-    sum = gri.reduce( (memo, value) ->
+    colors = @collection.getColorLayers()
+    
+    sum = colors.reduce( (memo, value) ->
       return memo + value.get('scale')
     , 0)
     avg = sum / 3
     
-    _.each(gri, (d) =>
+    _.each(colors, (d) =>
       band = d.get('band')
       
       # Compute and set normalized scale

    context = canvas.getContext('webgl')
    context = canvas.getContext('experimental-webgl') unless context?

    # Load appropriate webfits library asynchronously
    lib = if context? then 'gl' else 'canvas'
    url = "javascripts/webfits-#{lib}.js"
    $.getScript(url, =>

  
  getColorLayers: ->
    layers = []
    layers.push @where({band: 'i'})[0]
    layers.push @where({band: 'r'})[0]
    layers.push @where({band: 'g'})[0]
    return layers
    
  getColorScales: ->
    colors = @getColorLayers()
    return colors.map( (d) -> d.get('nscale'))


# Model representing a single FITS image.  Used to store computed and state parameters
class Layer extends Backbone.Model
