code: def image2fits(mspath, fitspath, velocity=False, optical=False, bitpix=-32,
                  minpix=0, maxpix=-1, overwrite=False, dropstokes=False, stokeslast=True,
                  history=True, **kwargs):
      
      ia = util.tools.image()
      ia.open(b(mspath))
      ia.tofits(outfile=b(fitspath), velocity=velocity, optical=optical, bitpix=bitpix,
                 minpix=minpix, maxpix=maxpix, overwrite=overwrite, dropstokes=dropstokes,
                 stokeslast=stokeslast, history=history, **kwargs)
      ia.close()
docs: Convert an image in MS format to FITS format.
  
      mspath (str)
        The path to the input MS.
      fitspath (str)
        The path to the output FITS file.
      velocity (boolean)
        (To be documented.)
      optical (boolean)
        (To be documented.)
      bitpix (integer)
        (To be documented.)
      minpix (integer)
        (To be documented.)
      maxpix (integer)
        (To be documented.)
      overwrite (boolean)
        Whether the task is allowed to overwrite an existing destination file.
      dropstokes (boolean)
        Whether the "Stokes" (polarization) axis of the image should be dropped.
      stokeslast (boolean)
        Whether the "Stokes" (polarization) axis of the image should be placed as the last
        (innermost?) axis of the image cube.
      history (boolean)
        (To be documented.)
      ``**kwargs``
        Forwarded on to the ``tofits`` function of the CASA ``image`` tool.