Conversely a plain FITS file (FITS image, single-extension FITS binary table) can be converted into a XAS file. This is assumed mainly to re-import files manipulated in other packages.
See elsewhere for conversions using OGIP conventions.
tofits [fileconverts a XAS file (the filetype part of the name may be omitted if it can be derived from the context) into a FITS file. The name of the output file is obtained replacing the filetype dot with an underscore and adding a .fits extension (thus e.g. pinco.image gives origin to pinco_image.fits.
fromfits [fitsfile logflag commentflagconverts a FITS file (whose name MUST include any filetype extension) into a XAS file. The name of the output file is derived "inverting" the naming convention used by tofits, if at all possible, otherwise it will do its best to assign a XAS file type (e.g. pinco_image.fits recreates pinco.image, but an image with name pinco_panco.fits creates pinco_panco.image)