   
   # Call when all FITS received and WebFITS library is received
   allChannelsReceived: (e) =>
+    @ready = true
     
     # Get extent for each layer and add to settings
     mins = @collection.map( (d) -> return d.get('minimum') )

  
  # Request FITS files for each channel
  requestChannels: ->
    @dfsWebfits.then =>
      @initWebFITS()
      

        @wfits.setStretch(@opts.stretch)
  
  updateAlpha: =>
    @wfits?.setAlpha(@opts.alpha) if @ready
    
  updateQ: =>
    @wfits?.setQ(@opts.q) if @ready
    
  updateScale: =>
    @wfits?.setScales.apply(@wfits, @opts.scales) if @ready
  
  updateStretch: =>
    @stretch = @opts.stretch
    @wfits?.setStretch(@stretch) if @ready

  updateExtent: =>
    @wfits?.setExtent(@opts.extent.min, @opts.extent.max) if @ready


window.Ubret.SpacewarpViewer = SpacewarpViewer
