code: def wrsamp(self, write_dir=''):
          
          # Perform field validity and cohesion checks, and write the
          # header file.
          self.wrheader(write_dir=write_dir)
          # Perform record validity and cohesion checks, and write the
          # associated segments.
          for seg in self.segments:
              seg.wrsamp(write_dir=write_dir)
docs: Write a multi-segment header, along with headers and dat files
          for all segments, from this object.