docs: def	adGet(file_id, archive="CFHT", extno=None, cutout=None ):
      """Use get a fits image from the CADC."""
      
      import os, string, re,urllib
  
  
      #proxy="http://www1.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/authProxy/getData"
      proxy="http://test.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/authProxy/getData"
  
      if file_id is None:
          return(-1)
  
      if  extno is None:
          filename=file_id+".fits"
      else:
          filename="%s%s.fits" % (file_id, string.zfill(extno,2))
      print filename
  
      if os.access(filename,os.R_OK):
      	return filename
  
      args={
          "file_id": file_id,
          "archive": archive
          }
  
      if extno is not None:
          args['cutout']="["+str(extno+1)+"]"
      else:
          args['cutout']=''
  
      if cutout is not None:
          args['cutout']=args['cutout']+cutout
          
      argline=""
      sep=""
      import sys
  
      ### get the directory that may contain the data
      mop_data_path=os.curdir
      if os.environ.has_key('MOP_DATA_PATH'):
          mop_data_path=os.environ['MOP_DATA_PATH']
  
      suffix="fits"
      basefile=mop_data_path+"/"+file_id+".fits"
      print basefile
      if not os.access(basefile,os.R_OK):
      	argdict={}
  	argline=''
  	sep=''
          for arg in args:
              if not args[arg]:
                  continue
  	    argline+=sep+"%s=%s" % ( arg, args[arg])
  	    sep='&'
  
  
          url=proxy+"?"+argline
          command="curl --silent -g  --fail --max-time 1800 --user jkavelaars:newone '"+url+"' | gunzip > "+filename
      else:
          command="imcopy %s%s %s" % ( basefile,args['cutout'],filename)
  
  
      print command
      try:
          status=os.system(command)
      except:
          sys.stderr.write("Failed to execute command: %s\n" % ( command))
      	raise TaskError, "getData failed"
      if status!=0:
          sys.stderr.write("Failed while executing command: %s\n" % ( command))
      	raise TaskError, "getData failed"
  
      return filename