code: def fromfile(self, path='filters'):
          r
  
          # Get name of filter
          name = self.savename
  
          # Get absolute path
          path = os.path.abspath(path)
  
          # Get filter base
          basefile = os.path.join(path, name + '_base.txt')
          with open(basefile, 'r') as f:
              self.base = np.fromfile(f, sep="\n")
  
          # Get filter coefficients
          for val in ['j0', 'j1', 'sin', 'cos']:
              attrfile = os.path.join(path, name + '_' + val + '.txt')
              if os.path.isfile(attrfile):
                  with open(attrfile, 'r') as f:
                      setattr(self, val, np.fromfile(f, sep="\n"))
  
          # Add factor
          self.factor = np.around(np.average(self.base[1:]/self.base[:-1]), 15)
docs: r"""Load filter values from ascii-files.
  
          Load filter base and filter coefficients from ascii files in the
          directory `path`; `path` can be a relative or absolute path.
  
          Examples
          --------
          >>> import empymod
          >>> # Create an empty filter;
          >>> # Name has to be the base of the text files
          >>> filt = empymod.filters.DigitalFilter('my-filter')
          >>> # Load the ascii-files
          >>> filt.fromfile()
          >>> # This will load the following three files:
          >>> #    ./filters/my-filter_base.txt
          >>> #    ./filters/my-filter_j0.txt
          >>> #    ./filters/my-filter_j1.txt
          >>> # and store them in filt.base, filt.j0, and filt.j1.