         @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

      r: new $.Deferred()
      i: new $.Deferred()
      z: new $.Deferred()


    @dfsWebfits = new $.Deferred()
    
    @getApi()
  
  # Request the appropriate WebFITS API (WebGL or Canvas)

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