code: def to_file(self, filename, binary=False, **kwargs):
          
          if binary is False:
              _np.savetxt(filename, self.data, **kwargs)
          elif binary is True:
              _np.save(filename, self.data, **kwargs)
          else:
              raise ValueError('binary must be True or False. '
                               'Input value is {:s}'.format(binary))
docs: Save gridded data to a file.
  
          Usage
          -----
          x.to_file(filename, [binary, **kwargs])
  
          Parameters
          ----------
          filename : str
              Name of output file. For text files (default), the file will be
              saved automatically in gzip compressed format if the filename ends
              in .gz.
          binary : bool, optional, default = False
              If False, save as text using numpy.savetxt(). If True, save as a
              'npy' binary file using numpy.save().
          **kwargs : keyword arguments, optional
              Keyword arguments of numpy.savetxt() and numpy.save().