code: def tofits(self, filename, overwrite=True, velocity=True,
                 optical=True, bitpix=-32, minpix=1, maxpix=-1):
          
          return self._tofits(filename, overwrite, velocity, optical,
                              bitpix, minpix, maxpix)
docs: Write the image to a file in FITS format.
  
          `filename`
            FITS file name
          `overwrite`
            If False, an exception is raised if the new image file already exists.
            Default is True.
          `velocity`
            By default a velocity primary spectral axis is written if possible.
          `optical`
            If writing a velocity, use the optical definition
            (otherwise use radio).
          `bitpix`
            can be set to -32 (float) or 16 (short) only. When `bitpix` is
            16 it will write BSCALE and BZERO into the FITS file. If minPix
          `minpix` and `maxpix`
            are used to determine BSCALE and BZERO if `bitpix=16`.
            If `minpix` is greater than `maxpix` (which is the default),
            the minimum and maximum pixel values will be determined from the ddta.
            Oherwise the supplied values will be used and pixels outside that
            range will be clipped to the minimum and maximum pixel values.
            Note that this truncation does not occur for `bitpix=-32`.