         @wfits.setStretch(@opts.stretch)
   
   updateAlpha: =>
-    @wfits?.setAlpha(@opts.alpha)
+    @wfits?.setAlpha(@opts.alpha) if @ready
     
   updateQ: =>
-    @wfits?.setQ(@opts.q)
+    @wfits?.setQ(@opts.q) if @ready
     
   updateScale: =>
-    @wfits?.setScales.apply(@wfits, @opts.scales)
+    @wfits?.setScales.apply(@wfits, @opts.scales) if @ready
   
   updateStretch: =>
     @stretch = @opts.stretch
-    @wfits?.setStretch(@stretch)
+    @wfits?.setStretch(@stretch) if @ready
 
   updateExtent: =>
-    @wfits?.setExtent(@opts.extent.min, @opts.extent.max)
+    @wfits?.setExtent(@opts.extent.min, @opts.extent.max) if @ready
 
 
 window.Ubret.SpacewarpViewer = SpacewarpViewer

  # Initialize a WebFITS object
  initWebFITS: =>
    @wfits?.teardown()
    
    @wfits = new astro.WebFITS(@el, @dimension)
    
    unless @wfits.ctx?
      alert 'Something went wrong initializing the context'
    

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