diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1bc87f19a75ebeec1b0f4efc381c15a59272730c..7e7082bea28cdf1f70e7264dbee11f371cd3c204 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,6 +20,14 @@ stages:
 before_script:
 - pip install -e .[dev]
 
+linting:
+  image: python:3.6
+  tags:
+  - passoft
+  stage: test
+  script:
+  - flake8 --ignore=F403,F405,F821,F841,W504 mseedpeek
+
 python3.6:
   image: python:3.6
   tags:
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index d55cfe8b452edd2a259ae3bd806e990c2c438489..560b77ef2ddc2b09cf06cf25345ffb9d3955e34c 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -45,7 +45,8 @@ articles, and such.
 Submit Feedback
 ~~~~~~~~~~~~~~~
 
-The best way to send feedback is to file an issue at https://git.passcal.nmt.edu/passoft/mseedpeek/issues.
+The best way to send feedback is to file an issue at
+https://git.passcal.nmt.edu/passoft/mseedpeek/issues.
 
 If you are proposing a feature:
 
@@ -59,31 +60,31 @@ Get Started!
 
 Ready to contribute? Here's how to set up `mseedpeek` for local development.
 
-1. Cone the `mseedpeek` repo::
+1. Clone the `mseedpeek` repo:
 
     $ git clone https://git.passcal.nmt.edu/passoft/mseedpeek.git
 
-3. Install your local copy::
+2. Install your local copy:
 
     $ pip install -e .[dev]
 
-4. Create a branch for local development::
+3. Create a branch for local development:
 
     $ git checkout -b name-of-your-bugfix-or-feature
 
    Now you can make your changes locally.
 
-5. When you're done making changes, check that your changes pass the
-   tests::
+4. When you're done making changes, check that your changes pass the
+   tests:
 
     $ python setup.py test
-6. Commit your changes and push your branch to GitHub::
+5. Commit your changes and push your branch to GitHub:
 
     $ git add .
     $ git commit -m "Your detailed description of your changes."
     $ git push origin name-of-your-bugfix-or-feature
 
-7. Submit a merge request through the Gitlab website.
+6. Submit a merge request through the Gitlab website.
 
 Pull Request Guidelines
 -----------------------
@@ -94,13 +95,13 @@ Before you submit a merge request, check that it meets these guidelines:
 2. If the merge request adds functionality, the docs should be updated. Put
    your new functionality into a function with a docstring, and add the
    feature to the list in README.rst.
-3. The pull request should work for Python 2.7
+3. The pull request should work for Python 3.[6,7,8]
 
 Tips
 ----
 
 To run a subset of tests::
-    $ python -m unittest tests.test_mseedpeek
+    $ python -m unittest
 
 Deploying
 ---------
@@ -111,4 +112,3 @@ Then run::
 
 $ git push
 $ git push --tags
-
diff --git a/HISTORY.rst b/HISTORY.rst
index ad2b7968f198fd8691234625b861e6176325595c..6a15f8807e518c13e25af2780387f8f835edd54a 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -6,3 +6,15 @@ History
 ------------------
 
 * First release on new build system.
+
+2020.204 (2020-07-22)
+------------------
+* Updated to work with Python 3
+* Added a unit test to test mseedpeek import
+* Updated list of platform specific dependencies to be installed when pip
+  installing mseedpeek (see setup.py)
+* Installed and tested mseedpeek against Python3.[6,7,8] using tox
+* Formatted Python code to conform to the PEP8 style guide
+* Created conda packages for mseedpeek that can run on Python3.[6,7,8]
+* Updated .gitlab-ci.yml to run a linter and unit tests for Python3.[6,7,8]
+  in GitLab CI pipeline
diff --git a/MANIFEST.in b/MANIFEST.in
index 965b2dda7db7c49f68857dc3aea9af37e30a745e..2387d6e279b924229fa0c8c485eeeebf49784996 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -5,7 +5,5 @@ include LICENSE
 include README.rst
 
 recursive-include tests *
-recursive-exclude * __pycache__
-recursive-exclude * *.py[co]
 
-recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
+recursive-include docs *.rst conf.py
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 76f0c7db17cc57a20cadc583bb8d41b4bcfaff25..0000000000000000000000000000000000000000
--- a/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-.PHONY: clean clean-test clean-pyc clean-build docs help
-.DEFAULT_GOAL := help
-
-define BROWSER_PYSCRIPT
-import os, webbrowser, sys
-
-try:
-	from urllib import pathname2url
-except:
-	from urllib.request import pathname2url
-
-webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
-endef
-export BROWSER_PYSCRIPT
-
-define PRINT_HELP_PYSCRIPT
-import re, sys
-
-for line in sys.stdin:
-	match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
-	if match:
-		target, help = match.groups()
-		print("%-20s %s" % (target, help))
-endef
-export PRINT_HELP_PYSCRIPT
-
-BROWSER := python -c "$$BROWSER_PYSCRIPT"
-
-help:
-	@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
-
-clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
-
-clean-build: ## remove build artifacts
-	rm -fr build/
-	rm -fr dist/
-	rm -fr .eggs/
-	find . -name '*.egg-info' -exec rm -fr {} +
-	find . -name '*.egg' -exec rm -f {} +
-
-clean-pyc: ## remove Python file artifacts
-	find . -name '*.pyc' -exec rm -f {} +
-	find . -name '*.pyo' -exec rm -f {} +
-	find . -name '*~' -exec rm -f {} +
-	find . -name '__pycache__' -exec rm -fr {} +
-
-clean-test: ## remove test and coverage artifacts
-	rm -fr .tox/
-	rm -f .coverage
-	rm -fr htmlcov/
-	rm -fr .pytest_cache
-
-lint: ## check style with flake8
-	flake8 mseedpeek tests
-
-test: ## run tests quickly with the default Python
-	python setup.py test
-
-
-test-all: ## run tests on every Python version with tox
-	tox
-
-coverage: ## check code coverage quickly with the default Python
-	coverage run --source mseedpeek setup.py test
-	coverage report -m
-	coverage html
-	$(BROWSER) htmlcov/index.html
-
-docs: ## generate Sphinx HTML documentation, including API docs
-	rm -f docs/mseedpeek.rst
-	rm -f docs/modules.rst
-	sphinx-apidoc -o docs/ mseedpeek
-	$(MAKE) -C docs clean
-	$(MAKE) -C docs html
-	$(BROWSER) docs/_build/html/index.html
-
-servedocs: docs ## compile the docs watching for changes
-	watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
-
-release: dist ## package and upload a release
-	twine upload dist/*
-
-dist: clean ## builds source and wheel package
-	python setup.py sdist
-	python setup.py bdist_wheel
-	ls -l dist
-
-install: clean ## install the package to the active Python's site-packages
-	python setup.py install
diff --git a/README.rst b/README.rst
index 77d004bcce434ae1a8893e3c6fd145ff5a86dd59..c33bdd08061a878114e2cd90116806b058242a23 100644
--- a/README.rst
+++ b/README.rst
@@ -2,23 +2,10 @@
 mseedpeek
 =========
 
+* Description: View mseed headers
 
-View mseed headers
-
+* Usage: mseeedpeek
+         mseedpeek -#
+         mseedpeek -f file(s)
 
 * Free software: GNU General Public License v3 (GPLv3)
-
-
-
-Features
---------
-
-* TODO
-
-Credits
--------
-
-This package was created with Cookiecutter_ and the `passoft/cookiecutter`_ project template.
-
-.. _Cookiecutter: https://github.com/audreyr/cookiecutter
-.. _`passoft/cookiecutter`: https://git.passcal.nmt.edu/passoft/cookiecutter
diff --git a/mseedpeek/__init__.py b/mseedpeek/__init__.py
index ffc182113278004b96a7b1f94caffca3af2aca5b..a1330607bd11478bd1f0b0fd63be6af18f773bd5 100644
--- a/mseedpeek/__init__.py
+++ b/mseedpeek/__init__.py
@@ -4,4 +4,4 @@
 
 __author__ = """IRIS PASSCAL"""
 __email__ = 'software-support@passcal.nmt.edu'
-__version__ = '2018.129'
+__version__ = '2020.204'
diff --git a/mseedpeek/libtrace.py b/mseedpeek/libtrace.py
index bd30878d0ab8c01e6e64589fee424e2f40348a50..dd91a84f4e2af1472b7353a507f12912089bc327 100755
--- a/mseedpeek/libtrace.py
+++ b/mseedpeek/libtrace.py
@@ -4,8 +4,8 @@
 # LibTrace
 #
 # classes for Segy & Mseed
-#	identify file types
-#	read mseed headers
+# identify file types
+# read mseed headers
 #
 # author: bcb
 
@@ -24,8 +24,8 @@
 # Author: bcb
 #
 # MSEED
-#	created UbytetoStr to decompose Ubyte to bit fields
-#	modified blks 200, 201, 300, 310, 320, 390 and fixhdr to utilize
+# created UbytetoStr to decompose Ubyte to bit fields
+# modified blks 200, 201, 300, 310, 320, 390 and fixhdr to utilize
 
 ##########################
 # 2004.295
@@ -41,8 +41,9 @@
 #
 # added blockette 2000 to Mseed class
 # Blockettes with BTime time definitions now pass the BTime
-#    as a tuple within the blk list
-# changed unpack formats to use native byte order with standard size & alignment
+# as a tuple within the blk list
+# changed unpack formats to use native byte order with standard size &
+# alignment
 
 ##########################
 # 2005.035
@@ -51,9 +52,9 @@
 #
 # added check for endianess in Mseed & Segy classes, self.ByteOrder
 # changed all unpack formats to reflect above change in Mseed & Segy classes
-# NOTE: for mseed it is possible to have mixed endianess (e.g. little-endian headers
-# 		and big-endian data). At this time, this library does not handle data and makes
-#		the determination of endianess based soley on the header.
+# NOTE: for mseed it is possible to have mixed endianess (e.g. little-endian
+# headers and big-endian data). At this time, this library does not handle
+# data and makes the determination of endianess based soley on the header.
 
 ##########################
 # 2005.138
@@ -61,7 +62,8 @@
 # Author: bcb
 #
 # added
-# Mseed.Pad, Mseed.FlagStrtoInt, Mseed.WriteFixedHdr and all of Mseed.Writeblk???
+# Mseed.Pad, Mseed.FlagStrtoInt, Mseed.WriteFixedHdr and all of
+# Mseed.Writeblk???
 # fixed improper casting of Time Correction in Mseed.fixedhdr to signed long
 ##########################
 # 2006.179
@@ -114,437 +116,485 @@
 #
 # corrected typo from DHQaul to DHQual
 # added local variables to class Mseed
-import os, sys, struct, time
+##########################
+
+import os
+import struct
+import sys
+import time
+
 SPACE = " "
 
-#VERSION = "2008.204"
+# VERSION = "2008.204"
+
 
 class futils:
-	"""
-	file utilities class
-	"""
-	def __init__(self,infile):
-		self.infile = open(infile, 'r+b')
+    """
+    file utilities class
+    """
 
-	def close(self):
-		self.infile.close()
+    def __init__(self, infile):
+        self.infile = open(infile, 'rb')
 
-	def where(self):
-		return self.infile.tell()
+    def close(self):
+        self.infile.close()
+
+    def where(self):
+        return self.infile.tell()
 
 #########################################################
+
+
 class FixedHeader:
-	"""
-	mseed fixhdr
-	"""
-	#first 20char
-	textblk=timeblk=sampblk=miscblk=[]
-	textblk=[]
-	Serial=DHQual=Res=Stat=Chan=Loc=Net=None
-	# 20:30
-	timeblk=[]
-	Year=Day=Hour=Min=Sec=Micro=None
-	# 30:36
-	sampblk=[]
-	NumSamp=SampFact=SampMult=None
-	# 36:48
-	miscblk=[]
-	act=io=DataDHQualFL=numblock=timcorr=bdata=bbblock=None
+    """
+    mseed fixhdr
+    """
+    # first 20char
+    textblk = timeblk = sampblk = miscblk = []
+    textblk = []
+    Serial = DHQual = Res = Stat = Chan = Loc = Net = None
+    # 20:30
+    timeblk = []
+    Year = Day = Hour = Min = Sec = Micro = None
+    # 30:36
+    sampblk = []
+    NumSamp = SampFact = SampMult = None
+    # 36:48
+    miscblk = []
+    act = io = DataDHQualFL = numblock = timcorr = bdata = bbblock = None
+
 #########################################################
+
+
 class Mseed(futils):
-	def __init__(self, infile):
-		"""
-		initialize file, determine byteorder, sizes, time, and load first fixed header
-		"""
-		self.type=self.rate=None
-		try:
-			futils.__init__(self,infile)
-			#local variable to class
-			self.infileseek=self.infile.seek
-			self.infilewrite=self.infile.write
-			self.infileread=self.infile.read
-			self.sunpack=struct.unpack
-			self.spack=struct.pack
-
-			self.byteorder = self.ByteOrder()
-			if self.byteorder != "unknown":
-				#otherwise it might be mseed
-				self.type = "mseed"
-				# read 1st fixed header in file
-				hdrs=self.fixedhdr()
-				(self.filesize,self.blksize)=self.sizes()
-				(self.numblocks, odd_size)=divmod(self.filesize,self.blksize)
-				if odd_size:
-					pass
-				# starttime of trace
-				self.time = str(list(map(str, (self.FH.Year, self.FH.Day, self.FH.Hour, self.FH.Min, self.FH.Sec)))).join(":")
-		except:
-			pass
+    def __init__(self, infile):
+        """
+        initialize file, determine byteorder, sizes, time, and load first fixed
+        header
+        """
+        self.type = self.rate = None
+        try:
+            futils.__init__(self, infile)
+            # local variable to class
+            self.infileseek = self.infile.seek
+            self.infilewrite = self.infile.write
+            self.infileread = self.infile.read
+            self.sunpack = struct.unpack
+            self.spack = struct.pack
+
+            self.byteorder = self.ByteOrder()
+            if self.byteorder != "unknown":
+                # otherwise it might be mseed
+                self.type = "mseed"
+                # read 1st fixed header in file
+                hdrs = self.fixedhdr()
+                (self.filesize, self.blksize) = self.sizes()
+                (self.numblocks, odd_size) = divmod(
+                    self.filesize, self.blksize)
+                if odd_size:
+                    pass
+                # starttime of trace
+                self.time = str(list(map(str, (self.FH.Year, self.FH.Day,
+                                               self.FH.Hour, self.FH.Min,
+                                               self.FH.Sec)))).join(":")
+        except Exception:
+            pass
 
 #########################################################
-	def isMseed(self) :
-		"""
-		determines if processed file is mseed (return 1) or unknown type (return 0)
-		"""
-		#if we don't know byteorder it must not be mseed
-		if self.byteorder == "unknown": return 0
-		else: return 1
+
+    def isMseed(self):
+        """
+        determines if processed file is mseed (return 1) or unknown type
+        (return 0)
+        """
+        # if we don't know byteorder it must not be mseed
+        if self.byteorder == "unknown":
+            return 0
+        else:
+            return 1
 
 #########################################################
-	def idhdr(self):
-		"""
-		trace id info
-		"""
-		return self.type, self.FH.Stat, self.FH.Chan, self.FH.Loc, self.FH.Net, self.time, self.rate
+
+    def idhdr(self):
+        """
+        trace id info
+        """
+        return (self.type, self.FH.Stat, self.FH.Chan, self.FH.Loc,
+                self.FH.Net, self.time, self.rate)
 
 #########################################################
-	def FirstLastTime(self):
-		"""
-		returns first and last block times in epoch
-		"""
-		try :
-			#get first fixed header and calculate beginning epoch
-			btime_str = time.strptime(self.time, '%Y:%j:%H:%M:%S')
-			bepoch = time.mktime(btime_str) + (self.FH.Micro * 0.0001)
-			#figure out where the end of the file is and read the last fixed header
-			# and calculate eepoch
-			(numblocks, odd_size)=divmod(self.filesize, self.blksize)
-			self.infileseek(-self.blksize,2)
-			loc = self.infile.tell()
-			etime=self.btime2time(loc)
-			etime_str = time.strptime(etime, '%Y:%j:%H:%M:%S')
-			eepoch = time.mktime(etime_str) + (self.FH.Micro * 0.0001)
-	#
-			return bepoch, eepoch
-		except Exception as e:
-			return e
+
+    def FirstLastTime(self):
+        """
+        returns first and last block times in epoch
+        """
+        try:
+            # get first fixed header and calculate beginning epoch
+            btime_str = time.strptime(self.time, '%Y:%j:%H:%M:%S')
+            bepoch = time.mktime(btime_str) + (self.FH.Micro * 0.0001)
+            # figure out where the end of the file is and read the last fixed
+            # header and calculate eepoch
+            (numblocks, odd_size) = divmod(self.filesize, self.blksize)
+            self.infileseek(-self.blksize, 2)
+            loc = self.infile.tell()
+            etime = self.btime2time(loc)
+            etime_str = time.strptime(etime, '%Y:%j:%H:%M:%S')
+            eepoch = time.mktime(etime_str) + (self.FH.Micro * 0.0001)
+
+            return bepoch, eepoch
+        except Exception as e:
+            return e
+
 #########################################################
-	def tracelength(self):
-		"""
-		returns tracelength in seconds
-		"""
-		try :
-			#get first fixed header and calculate beginning epoch
-			(bepoch, eepoch)=self.FirstLastTime()
-
-#			#here I have to get the last few samples and calculate how much time is accounted for
-			self.infileseek(-self.blksize+30,2)
-			sampblock=self.infileread(2)
-			fmtstr = self.fmt_order + "H"
-			numsamp = self.sunpack(fmtstr, sampblock)[0]
-			lastsamples=(numsamp-1)/self.rate
-			return ((eepoch+lastsamples) - bepoch )
-		except:
-			pass
+
+    def tracelength(self):
+        """
+        returns tracelength in seconds
+        """
+        try:
+            # get first fixed header and calculate beginning epoch
+            (bepoch, eepoch) = self.FirstLastTime()
+
+            # here I have to get the last few samples and calculate how much
+            # time is accounted for
+            self.infileseek(-self.blksize + 30, 2)
+            sampblock = self.infileread(2)
+            fmtstr = self.fmt_order + "H"
+            numsamp = self.sunpack(fmtstr, sampblock)[0]
+            lastsamples = (numsamp - 1) / self.rate
+            return ((eepoch + lastsamples) - bepoch)
+        except Exception:
+            pass
+
 #########################################################
-	def btime2time(self, seekval=0) :
-		"""
-		reads file fixed header and returns time string from btime
-		"""
-		try :
-			hdrs=self.fixedhdr(seekval)
-			time = str(list(map(str, (self.FH.Year, self.FH.Day, self.FH.Hour,self.FH.Min, self.FH.Sec)))).join(":")
-			return time
-		except:
-			pass
+
+    def btime2time(self, seekval=0):
+        """
+        reads file fixed header and returns time string from btime
+        """
+        try:
+            hdrs = self.fixedhdr(seekval)
+            time = str(list(map(str, (self.FH.Year, self.FH.Day,
+                                      self.FH.Hour, self.FH.Min,
+                                      self.FH.Sec)))).join(":")
+            return time
+        except Exception:
+            pass
+
 #########################################################
-	def idread(self, seekval=0) :
-		"""
-		read file as if it is mseed just pulling necessary info
-		from fixed header
-		"""
-		try :
-			hdrs=self.fixedhdr(seekval)
-
-			return self.FH.Stat, self.FH.Chan, self.FH.Loc, self.FH.Net,\
-			       self.rate, self.FH.Year, self.FH.Day, self.FH.Hour, self.FH.Min, self.FH.Sec, self.FH.Micro
-		except :
-			return
+
+    def idread(self, seekval=0):
+        """
+        read file as if it is mseed just pulling necessary info
+        from fixed header
+        """
+        try:
+            hdrs = self.fixedhdr(seekval)
+
+            return (self.FH.Stat, self.FH.Chan, self.FH.Loc, self.FH.Net,
+                    self.rate, self.FH.Year, self.FH.Day, self.FH.Hour,
+                    self.FH.Min, self.FH.Sec, self.FH.Micro)
+        except Exception:
+            return
+
 #########################################################
-	def calcrate(self):
-		"""
-		this routine assumes that idread has been called first
-
-		calculate the sample rate of mseed data
-		If Sample rate factor > 0 and Sample rate Multiplier > 0,
-			rate = Sampfact X Sampmult
-		If Sample rate factor > 0 and Sample rate Multiplier < 0,
-			rate = -1 X Sampfact/Sampmult
-		If Sample rate factor < 0 and Sample rate Multiplier > 0,
-			rate = -1 X Sampmult/Sampfact
-		If Sample rate factor < 0 and Sample rate Multiplier < 0,
-			rate = 1/(Sampfact X Sampmult)
-		"""
-		sampFact=float(self.FH.SampFact)
-		sampMult=float(self.FH.SampMult)
-		if sampFact > 0 and sampMult > 0 :
-			rate = sampFact * sampMult
-		elif sampFact > 0 and sampMult < 0 :
-			rate = -1.0 * (sampFact/sampMult)
-		elif sampFact < 0 and sampMult > 0 :
-			rate = -1.0 * (sampMult/sampFact)
-		elif sampFact < 0 and sampMult < 0 :
-			rate = 1.0/(sampFact * sampMult)
-		else :
-			rate = sampFact
-		return rate
+
+    def calcrate(self):
+        """
+        this routine assumes that idread has been called first
+
+        calculate the sample rate of mseed data
+        If Sample rate factor > 0 and Sample rate Multiplier > 0,
+                rate = Sampfact X Sampmult
+        If Sample rate factor > 0 and Sample rate Multiplier < 0,
+                rate = -1 X Sampfact/Sampmult
+        If Sample rate factor < 0 and Sample rate Multiplier > 0,
+                rate = -1 X Sampmult/Sampfact
+        If Sample rate factor < 0 and Sample rate Multiplier < 0,
+                rate = 1/(Sampfact X Sampmult)
+        """
+        sampFact = float(self.FH.SampFact)
+        sampMult = float(self.FH.SampMult)
+        if sampFact > 0 and sampMult > 0:
+            rate = sampFact * sampMult
+        elif sampFact > 0 and sampMult < 0:
+            rate = -1.0 * (sampFact / sampMult)
+        elif sampFact < 0 and sampMult > 0:
+            rate = -1.0 * (sampMult / sampFact)
+        elif sampFact < 0 and sampMult < 0:
+            rate = 1.0 / (sampFact * sampMult)
+        else:
+            rate = sampFact
+        return rate
+
 #########################################################
-	def ByteOrder(self, seekval=20) :
-		"""
-		read file as if it is mseed just pulling time info
-		from fixed header and determine if it makes sense unpacked
-		as big endian or little endian
-		"""
-		Order = "unknown"
-		try :
-			#seek to timeblock and read
-			self.infileseek(seekval)
-			timeblock=self.infileread(10)
-	#			timeblock=self.TraceBuffer[seekval:seekval+10]
-
-			#assume big endian
-			(Year, Day, Hour, Min, Sec, junk, Micro)=\
-			 self.sunpack('>HHBBBBH',timeblock)
-			#test if big endian read makes sense
-			if 1950 <= Year <= 2050 and \
-			   1 <= Day <= 366 and \
-			   0 <= Hour <= 23 and \
-			   0 <= Min <= 59 and \
-			   0 <= Sec <= 59:
-				Order = "big"
-				self.fmt_order = ">"
-			else:
-				#try little endian read
-				(Year, Day, Hour, Min, Sec, junk, Micro)=\
-				 self.sunpack('<HHBBBBH',timeblock)
-				#test if little endian read makes sense
-				if 1950 <= Year <= 2050 and \
-				   1 <= Day <= 366 and \
-				   0 <= Hour <= 23 and \
-				   0 <= Min <= 59 and \
-				   0 <= Sec <= 59:
-					Order = "little"
-					self.fmt_order = "<"
-		except :
-			pass
-
-		return Order
+
+    def ByteOrder(self, seekval=20):
+        """
+        read file as if it is mseed just pulling time info
+        from fixed header and determine if it makes sense unpacked
+        as big endian or little endian
+        """
+        Order = "unknown"
+        try:
+            # seek to timeblock and read
+            self.infileseek(seekval)
+            timeblock = self.infileread(10)
+            # timeblock=self.TraceBuffer[seekval:seekval+10]
+
+            # assume big endian
+            (Year, Day, Hour, Min, Sec, junk, Micro) =\
+                self.sunpack('>HHBBBBH', timeblock)
+            # test if big endian read makes sense
+            if 1950 <= Year <= 2050 and \
+               1 <= Day <= 366 and \
+               0 <= Hour <= 23 and \
+               0 <= Min <= 59 and \
+               0 <= Sec <= 59:
+                Order = "big"
+                self.fmt_order = ">"
+            else:
+                # try little endian read
+                (Year, Day, Hour, Min, Sec, junk, Micro) =\
+                    self.sunpack('<HHBBBBH', timeblock)
+                # test if little endian read makes sense
+                if 1950 <= Year <= 2050 and \
+                   1 <= Day <= 366 and \
+                   0 <= Hour <= 23 and \
+                   0 <= Min <= 59 and \
+                   0 <= Sec <= 59:
+                    Order = "little"
+                    self.fmt_order = "<"
+        except Exception:
+            pass
+
+        return Order
+
 #########################################################
-	def sizes(self, seekval=0):
-		"""
-		Finds Blockette 1000 and returns file size & Data Record Length
-		"""
-		try:
-			#determine file size
-			self.infileseek(0,2)
-			filesize=self.infile.tell()
-			#proceed to seekval
-			self.infileseek(seekval)
-			#self.infileseek(39)
-			#assign number of blockettes and offset to next blockette
-			nblock=self.FH.miscblk[3]
-			nextblock=self.FH.miscblk[6]
-			n=0
-			#find blockette 1000
-			while n < nblock:
-				self.infileseek(nextblock)
-				(blktype, newblock)=self.typenxt(nextblock)
-				if not blktype:
-					return None, None
-				if blktype == 1000:
-					(type, next, encode,order,length,res)=self.blk1000(nextblock)
-					return filesize, 2**length
-				nextblock=newblock
-				n+=1
-		except:
-			return None, None
+
+    def sizes(self, seekval=0):
+        """
+        Finds Blockette 1000 and returns file size & Data Record Length
+        """
+        try:
+            # determine file size
+            self.infileseek(0, 2)
+            filesize = self.infile.tell()
+            # proceed to seekval
+            self.infileseek(seekval)
+            # self.infileseek(39)
+            # assign number of blockettes and offset to next blockette
+            nblock = self.FH.miscblk[3]
+            nextblock = self.FH.miscblk[6]
+            n = 0
+            # find blockette 1000
+            while n < nblock:
+                self.infileseek(nextblock)
+                (blktype, newblock) = self.typenxt(nextblock)
+                if not blktype:
+                    return None, None
+                if blktype == 1000:
+                    (type, next, encode, order, length,
+                     res) = self.blk1000(nextblock)
+                    return filesize, 2**length
+                nextblock = newblock
+                n += 1
+        except Exception:
+            return None, None
 
 #########################################################
-	def typenxt(self, seekval=0):
-		"""
-		Reads first 4 bytes of blockette
-		Returns blockette type and next blockette offset
-		"""
-		try:
-			self.infileseek(seekval)
-			fmtstr = self.fmt_order + "HH"
-			(type, next)=self.sunpack(fmtstr, self.infileread(4))
-
-			#reset back to beginning of blockette
-			self.infileseek(-4,1)
-			return type, next
-		except:
-			return None, None
+
+    def typenxt(self, seekval=0):
+        """
+        Reads first 4 bytes of blockette
+        Returns blockette type and next blockette offset
+        """
+        try:
+            self.infileseek(seekval)
+            fmtstr = self.fmt_order + "HH"
+            (type, next) = self.sunpack(fmtstr, self.infileread(4))
+
+            # reset back to beginning of blockette
+            self.infileseek(-4, 1)
+            return type, next
+        except Exception:
+            return None, None
 
 #########################################################
-	def setEndian(self, endianess=""):
-		"""
-		set format string for endian type
-		"""
-		if endianess == "big":
-			fmtorderstr=">"
-		elif endianess == "little":
-			fmtorderstr="<"
-		else:
-			fmtorderstr=self.fmt_order
-		return fmtorderstr
+
+    def setEndian(self, endianess=""):
+        """
+        set format string for endian type
+        """
+        if endianess == "big":
+            fmtorderstr = ">"
+        elif endianess == "little":
+            fmtorderstr = "<"
+        else:
+            fmtorderstr = self.fmt_order
+        return fmtorderstr
 
 #########################################################
 #
 # for blockette descriptions below
 # from SEED manual
 #
-# Field		nbits	Description
-# UBYTE		8		Unsigned quantity
-# BYTE		8		Two's complement signed quantity
-# UWORD		16		Unsigned quantity
-# WORD		16		Two's complement signed quantity
-# ULONG		32		Unsigned quantity
-# LONG		32		Two's complement signed quantity
-# CHAR*n		n*8		n characters, each 8 bit and each with
-# 						a 7-bit ASCII character (high bit always 0)
-# FLOAT		32		IEEE Floating point number
+# Field     nbits   Description
+# UBYTE     8       Unsigned quantity
+# BYTE      8       Two's complement signed quantity
+# UWORD     16      Unsigned quantity
+# WORD      16      Two's complement signed quantity
+# ULONG     32      Unsigned quantity
+# LONG      32      Two's complement signed quantity
+# CHAR*n    n*8     n characters, each 8 bit and each with
+#                   a 7-bit ASCII character (high bit always 0)
+# FLOAT     32      IEEE Floating point number
 #
 # BTIME
-#	UWORD	16	Year (e.g. 1987)
-#	UWORD	16	J-Day
-#	UBYTE	8	Hours of day (0-23)
-#	UBYTE	8	Minutes of hour (0-59)
-#	UBYTE	8	Seconds of minute (0-59, 60 for leap seconds)
-#	UBYTE	8	Unused for data (required for alignment)(
-#	UWORD	16	.0001 seconds (0-9999)
+#   UWORD   16  Year (e.g. 1987)
+#   UWORD   16  J-Day
+#   UBYTE   8   Hours of day (0-23)
+#   UBYTE   8   Minutes of hour (0-59)
+#   UBYTE   8   Seconds of minute (0-59, 60 for leap seconds)
+#   UBYTE   8   Unused for data (required for alignment)(
+#   UWORD   16  .0001 seconds (0-9999)
 #########################################################
-	def fixedhdr(self, seekval=0):
-		"""
-		Reads fixed header of 48 bytes (see SEED manual)
-		Returns four tuples
-			textblk (SeqNum, DHQual, res, Stat, Loc, Chan, Net)
-				Sequence Number (CHAR*6)
-				Data header/quality indicator (CHAR*1)
-				Reserved (CHAR*1)
-				Station identifier code (CHAR*5)
-				Location identifier (CHAR*2)
-				Channel identifier (CHAR*3)
-				Network Code (CHAR*2)
-			timeblk (Year, Day, Hour, Min, Sec, junk, Micro)
-				Year (UWORD, 2)
-				Jday (UWORD, 2)
-				Hour (UBYTE, 1)
-				Min (UBYTE, 1)
-				Sec (UBYTE, 1)
-				unused (UBYTE, 1)
-				.0001 seconds (0-9999) (UWORD, 2)
-			sampblk (NumSamp, SampFact, SampMult)
-				Number of samples (UWORD, 2)
-				Sample rate factor (see calcrate) (WORD, 2)
-				Sample rate multiplier (see calcrate) (WORD, 2)
-			miscblk (act, io, DataDHQualFl, numblock, timcorr, bdata, bblock)
-				Activity flags (UBYTE, 1)
-				I/O and clock flags (UBYTE, 1)
-				Data quality flags (UBYTE, 1)
-				Number of blockettes that follow (UBYTE, 1)
-				Time correction (LONG, 4)
-				Offset to beginning of data (UWORD, 2)
-				Offset to beginning of next blockette (UWORD, 2)
-		"""
-		#local variable
-#		self.sunpack=self.sunpack
-		try:
-			del self.FH
-		except:
-			pass
-		self.FH = FixedHeader()
-		try:
-			self.infileseek(seekval)
-			fhblk=self.infileread(48)
-			#station info
-			fmtstr = self.fmt_order + "6scc5s2s3s2s"
-			self.FH.textblk=self.sunpack(fmtstr,fhblk[0:20])
-
-			#time info
-			fmtstr = self.fmt_order + "HHBBBBH"
-			self.FH.timeblk=self.sunpack(fmtstr,fhblk[20:30])
-
-			#sample info
-			fmtstr = self.fmt_order + "Hhh"
-			self.FH.sampblk=self.sunpack(fmtstr, fhblk[30:36])
-
-			#misc info
-			fmtstr = self.fmt_order + "BBBBlHH"
-			tmpblk=self.sunpack(fmtstr,fhblk[36:48])
-			#decompose tmpblk[0-2] into bit fields, create miscblk
-			for i in range(3):
-				self.FH.miscblk = self.UbytetoStr(tmpblk, i)
-				tmpblk=self.FH.miscblk #recast tmpblk as list
-
-			(self.FH.Serial, self.FH.DHQual, res, self.FH.Stat, self.FH.Loc, self.FH.Chan, self.FH.Net)\
-			 =self.FH.textblk
-			(self.FH.Year, self.FH.Day, self.FH.Hour, self.FH.Min, self.FH.Sec, junk, self.FH.Micro)\
-			 =self.FH.timeblk
-			(self.FH.NumSamp, self.FH.SampFact, self.FH.SampMult)\
-			 =self.FH.sampblk
-			self.rate=self.calcrate()
-
-			return self.FH.textblk, self.FH.timeblk, self.FH.sampblk, self.FH.miscblk
-#			return textblk,timeblk,sampblk,miscblk
-
-		except:
-			print("error reading fixed header")
-			pass
+    def fixedhdr(self, seekval=0):
+        """
+        Reads fixed header of 48 bytes (see SEED manual)
+        Returns four tuples
+                textblk (SeqNum, DHQual, res, Stat, Loc, Chan, Net)
+                        Sequence Number (CHAR*6)
+                        Data header/quality indicator (CHAR*1)
+                        Reserved (CHAR*1)
+                        Station identifier code (CHAR*5)
+                        Location identifier (CHAR*2)
+                        Channel identifier (CHAR*3)
+                        Network Code (CHAR*2)
+                timeblk (Year, Day, Hour, Min, Sec, junk, Micro)
+                        Year (UWORD, 2)
+                        Jday (UWORD, 2)
+                        Hour (UBYTE, 1)
+                        Min (UBYTE, 1)
+                        Sec (UBYTE, 1)
+                        unused (UBYTE, 1)
+                        .0001 seconds (0-9999) (UWORD, 2)
+                sampblk (NumSamp, SampFact, SampMult)
+                        Number of samples (UWORD, 2)
+                        Sample rate factor (see calcrate) (WORD, 2)
+                        Sample rate multiplier (see calcrate) (WORD, 2)
+                miscblk (act, io, DataDHQualFl, numblock, timcorr, bdata,
+                         bblock)
+                        Activity flags (UBYTE, 1)
+                        I/O and clock flags (UBYTE, 1)
+                        Data quality flags (UBYTE, 1)
+                        Number of blockettes that follow (UBYTE, 1)
+                        Time correction (LONG, 4)
+                        Offset to beginning of data (UWORD, 2)
+                        Offset to beginning of next blockette (UWORD, 2)
+        """
+        # local variable
+        # self.sunpack=self.sunpack
+        try:
+            del self.FH
+        except Exception:
+            pass
+        self.FH = FixedHeader()
+        try:
+            self.infileseek(seekval)
+            fhblk = self.infileread(48)
+            # station info
+            fmtstr = self.fmt_order + "6scc5s2s3s2s"
+            self.FH.textblk = self.sunpack(fmtstr, fhblk[0:20])
+
+            # time info
+            fmtstr = self.fmt_order + "HHBBBBH"
+            self.FH.timeblk = self.sunpack(fmtstr, fhblk[20:30])
+
+            # sample info
+            fmtstr = self.fmt_order + "Hhh"
+            self.FH.sampblk = self.sunpack(fmtstr, fhblk[30:36])
+
+            # misc info
+            fmtstr = self.fmt_order + "BBBBlHH"
+            tmpblk = self.sunpack(fmtstr, fhblk[36:48])
+            # decompose tmpblk[0-2] into bit fields, create miscblk
+            for i in range(3):
+                self.FH.miscblk = self.UbytetoStr(tmpblk, i)
+                tmpblk = self.FH.miscblk  # recast tmpblk as list
+
+            (self.FH.Serial, self.FH.DHQual, res, self.FH.Stat, self.FH.Loc, self.FH.Chan, self.FH.Net)\
+                = self.FH.textblk  # noqa: E501
+            (self.FH.Year, self.FH.Day, self.FH.Hour, self.FH.Min, self.FH.Sec, junk, self.FH.Micro)\
+                = self.FH.timeblk  # noqa: E501
+            (self.FH.NumSamp, self.FH.SampFact, self.FH.SampMult)\
+                = self.FH.sampblk
+            self.rate = self.calcrate()
+
+            return (self.FH.textblk, self.FH.timeblk, self.FH.sampblk,
+                    self.FH.miscblk)
+            # return textblk,timeblk,sampblk,miscblk
+
+        except Exception:
+            print("error reading fixed header")
+            pass
 
 #########################################################
-	def WriteFixedHdr(self, hdrlist, seekval=0, endianess=""):
-		"""
-		Writes fixed header of 48 bytes (see SEED manual)
-		Requires four tuples (see self.fixedhdr)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			#station info
-			#left justify values
-			#fmtstr0 = fmtorderstr + "6scc5s2s3s2s"
-
-			SeqNum=self.Pad(hdrlist[0][0], 6) #SeqNum
-			DQual=hdrlist[0][1] #DataQual
-			Res=hdrlist[0][2] #Reserved
-			Stat=self.Pad(hdrlist[0][3], 5) #Stat
-			Loc=self.Pad(hdrlist[0][4], 2) #Loc
-			Chan=self.Pad(hdrlist[0][5], 3) #Chan
-			Net=self.Pad(hdrlist[0][6], 2) #Net
-
-			#time info
-			#fmtstr1 = fmtorderstr + "HHBBBBH"
-			(Year, Day, Hour, Min, Sec, junk, Micro)=hdrlist[1]
-			Micro=int(Micro)
-
-			#sample info
-			#fmtstr2 = fmtorderstr + "Hhh"
-			(NumSamp, SampFact, SampMult)=hdrlist[2]
-
-			#misc info
-			#fmtstr3 = fmtorderstr + "BBBBlHH"
-			(actFlags, ioFlags, dqFlags, numblk, timecor, offsetData, offsetBlktt)=hdrlist[3]
-			#convert flag string to integer
-			actFlags = self.FlagStrtoInt(actFlags)
-			ioFlags = self.FlagStrtoInt(ioFlags)
-			dqFlags = self.FlagStrtoInt(dqFlags)
-
-			#pack fields
-			fmtstr= fmtorderstr + "6scc5s2s3s2sHHBBBBHHhhBBBBlHH"
-			pack_hdr=self.spack(fmtstr,SeqNum, DQual, Res, Stat, Loc, Chan, Net,\
-					     Year, Day, Hour, Min, Sec, junk, Micro,\
-					     NumSamp, SampFact, SampMult,\
-					     actFlags, ioFlags, dqFlags, numblk, timecor, offsetData, offsetBlktt)
-
-			#write header
-			self.infilewrite(pack_hdr)
-
-			return 48
-		except:
-			print("error writing fixed header")
-			return 0
+
+    def WriteFixedHdr(self, hdrlist, seekval=0, endianess=""):
+        """
+        Writes fixed header of 48 bytes (see SEED manual)
+        Requires four tuples (see self.fixedhdr)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            # station info
+            # left justify values
+            # fmtstr0 = fmtorderstr + "6scc5s2s3s2s"
+
+            SeqNum = self.Pad(hdrlist[0][0], 6)  # SeqNum
+            DQual = hdrlist[0][1]  # DataQual
+            Res = hdrlist[0][2]  # Reserved
+            Stat = self.Pad(hdrlist[0][3], 5)  # Stat
+            Loc = self.Pad(hdrlist[0][4], 2)  # Loc
+            Chan = self.Pad(hdrlist[0][5], 3)  # Chan
+            Net = self.Pad(hdrlist[0][6], 2)  # Net
+
+            # time info
+            # fmtstr1 = fmtorderstr + "HHBBBBH"
+            (Year, Day, Hour, Min, Sec, junk, Micro) = hdrlist[1]
+            Micro = int(Micro)
+
+            # sample info
+            # fmtstr2 = fmtorderstr + "Hhh"
+            (NumSamp, SampFact, SampMult) = hdrlist[2]
+
+            # misc info
+            # fmtstr3 = fmtorderstr + "BBBBlHH"
+            (actFlags, ioFlags, dqFlags, numblk, timecor,
+             offsetData, offsetBlktt) = hdrlist[3]
+            # convert flag string to integer
+            actFlags = self.FlagStrtoInt(actFlags)
+            ioFlags = self.FlagStrtoInt(ioFlags)
+            dqFlags = self.FlagStrtoInt(dqFlags)
+
+            # pack fields
+            fmtstr = fmtorderstr + "6scc5s2s3s2sHHBBBBHHhhBBBBlHH"
+            pack_hdr = self.spack(fmtstr, SeqNum, DQual, Res, Stat, Loc, Chan,
+                                  Net, Year, Day, Hour, Min, Sec, junk, Micro,
+                                  NumSamp, SampFact, SampMult, actFlags,
+                                  ioFlags, dqFlags, numblk, timecor,
+                                  offsetData, offsetBlktt)
+
+            # write header
+            self.infilewrite(pack_hdr)
+
+            return 48
+        except Exception:
+            print("error writing fixed header")
+            return 0
 
 #########################################################
 
@@ -577,1081 +627,1162 @@ class Mseed(futils):
             return bytes_written
 
 #########################################################
-	def blk100(self, seekval=0):
-		"""
-		Sample Rate Blockette 100 (12 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Actual sample rate (FLOAT, 4)
-				Flags (BYTE, 1)
-				Reserved (UBYTE, 3)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHfb3B"
-		blk=self.sunpack(fmtstr, self.infileread(12))
-		scrblk = self.UbytetoStr(blk, 3)
-		blk=scrblk
-		return blk
+
+    def blk100(self, seekval=0):
+        """
+        Sample Rate Blockette 100 (12 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Actual sample rate (FLOAT, 4)
+        Flags (BYTE, 1)
+        Reserved (UBYTE, 3)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHfb3B"
+        blk = self.sunpack(fmtstr, self.infileread(12))
+        scrblk = self.UbytetoStr(blk, 3)
+        blk = scrblk
+        return blk
 
 #########################################################
-	def Writeblk100(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Sample Rate Blockette 100 (12 bytes)
-		requires tuple inblk=(blkette, nextblk, actrate, flags, res0, res1, res2)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHfb3B"
-			(blkette, nextblk, actrate, flags, res0, res1, res2) = inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, actrate, flags, res0, res1, res2)
-			self.infilewrite(pack_blk)
-			return 12
-		except:
-			print("error writing blockette 100")
-			return 0
 
+    def Writeblk100(self, inblk, seekval=0, endianess=""):
+        """
+        writes Sample Rate Blockette 100 (12 bytes)
+        requires tuple inblk=(blkette, nextblk, actrate, flags, res0, res1,
+        res2)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHfb3B"
+            (blkette, nextblk, actrate, flags, res0, res1, res2) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk,
+                                  actrate, flags, res0, res1, res2)
+            self.infilewrite(pack_blk)
+            return 12
+        except Exception:
+            print("error writing blockette 100")
+            return 0
 
 #########################################################
-	def blk200(self, seekval=0):
-		"""
-		Generic Event Detection Blockette 200 (52 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Signal amplitude (FLOAT, 4)
-				Signal period (FLOAT,4)
-				Background estimate (FLOAT,4)
-				Event detection flags (UBYTE, 1)
-				Reserved (UBYTE, 1)
-				Signal onset time (BTime expanded, 10)
-				Detector Name (CHAR*24)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHfffBB"
-		blk1=self.sunpack(fmtstr, self.infileread(18))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "24s"
-		blk2=self.sunpack(fmtstr, self.infileread(24))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 5)
-		return blk
+
+    def blk200(self, seekval=0):
+        """
+        Generic Event Detection Blockette 200 (52 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Signal amplitude (FLOAT, 4)
+        Signal period (FLOAT,4)
+        Background estimate (FLOAT,4)
+        Event detection flags (UBYTE, 1)
+        Reserved (UBYTE, 1)
+        Signal onset time (BTime expanded, 10)
+        Detector Name (CHAR*24)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHfffBB"
+        blk1 = self.sunpack(fmtstr, self.infileread(18))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "24s"
+        blk2 = self.sunpack(fmtstr, self.infileread(24))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 5)
+        return blk
 
 #########################################################
-	def Writeblk200(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Generic Event Detection Blockette 200 (52 bytes)
-		requires tuple inblk
-		inblk=(blkette, nextblk, amp, period, bg, flags, \
-			Year, Day, Hour, Min, Sec, junk, Micro, charstr)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHfffBBHHBBBBH24s"
-
-			(blkette, nextblk, amp, period, bg, flags, \
-			 Year, Day, Hour, Min, Sec, junk, Micro, charstr)=inblk
-			flags=FlagsStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, amp, period, bg, flags, \
-					     Year, Day, Hour, Min, Sec, junk, Micro, charstr)
-			self.infilewrite(pack_blk)
-			return 52
-
-		except:
-			print("error writing blockette 200")
-			return 0
 
+    def Writeblk200(self, inblk, seekval=0, endianess=""):
+        """
+        writes Generic Event Detection Blockette 200 (52 bytes)
+        requires tuple inblk
+        inblk=(blkette, nextblk, amp, period, bg, flags, \
+                Year, Day, Hour, Min, Sec, junk, Micro, charstr)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHfffBBHHBBBBH24s"
+
+            (blkette, nextblk, amp, period, bg, flags,
+             Year, Day, Hour, Min, Sec, junk, Micro, charstr) = inblk
+            flags = FlagsStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, amp, period, bg,
+                                  Year, Day, Hour, Min, Sec, junk, Micro,
+                                  charstr)
+            self.infilewrite(pack_blk)
+            return 52
+
+        except Exception:
+            print("error writing blockette 200")
+            return 0
 
 #########################################################
-	def blk201(self, seekval=0):
-		"""
-		Murdock Event Detection Blockette 201 (60 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Signal amplitude (FLOAT, 4)
-				Signal period (FLOAT,4)
-				Background estimate (FLOAT,4)
-				Event detection flags (UBYTE, 1)
-				Reserved (UBYTE, 1)
-				Signal onset time (BTime expanded, 10)
-				Signal-to-noise ration values (UBYTE*6)
-				Lookback value (UBYTE, 1)
-				Pick algorithym (UBYTE, 1)
-				Detector Name (CHAR*24)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHfffBB"
-		blk1=self.sunpack(fmtstr, self.infileread(18))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "6BBB24s"
-		blk2=self.sunpack(fmtstr, self.infileread(32))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 5)
-		return blk
+
+    def blk201(self, seekval=0):
+        """
+        Murdock Event Detection Blockette 201 (60 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Signal amplitude (FLOAT, 4)
+        Signal period (FLOAT,4)
+        Background estimate (FLOAT,4)
+        Event detection flags (UBYTE, 1)
+        Reserved (UBYTE, 1)
+        Signal onset time (BTime expanded, 10)
+        Signal-to-noise ration values (UBYTE*6)
+        Lookback value (UBYTE, 1)
+        Pick algorithym (UBYTE, 1)
+        Detector Name (CHAR*24)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHfffBB"
+        blk1 = self.sunpack(fmtstr, self.infileread(18))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "6BBB24s"
+        blk2 = self.sunpack(fmtstr, self.infileread(32))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 5)
+        return blk
 
 #########################################################
-	def Writeblk201(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Murdock Event Detection Blockette 201 (60 bytes)
-		requires tuple inblk
-		inblk=(blkette, nextblk, amp, period, bg, flags, res,
-				Year, Day, Hour, Min, Sec, junk, Micro, SN0, SN1, SN2, SN3, SN4, SN5, loop, algo, Name)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHfffBBHHBBBBH6BBB24s"
-
-			(blkette, nextblk, amp, period, bg, flags, res, \
-			 Year, Day, Hour, Min, Sec, junk, Micro, SN0, SN1, SN2, SN3, SN4, SN5, \
-			 loop, algo, Name)=inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, amp, period, bg, flags, res, \
-					     Year, Day, Hour, Min, Sec, junk, Micro, SN0, SN1, SN2, SN3, SN4, SN5, loop, algo, Name)
-			self.infilewrite(pack_blk)
-			return 60
-
-		except:
-			print("error writing blockette 201")
-			return 0
 
+    def Writeblk201(self, inblk, seekval=0, endianess=""):
+        """
+        writes Murdock Event Detection Blockette 201 (60 bytes)
+        requires tuple inblk
+        inblk=(blkette, nextblk, amp, period, bg, flags, res,
+               Year, Day, Hour, Min, Sec, junk, Micro, SN0, SN1,
+               SN2, SN3, SN4, SN5, loop, algo, Name)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHfffBBHHBBBBH6BBB24s"
+
+            (blkette, nextblk, amp, period, bg, flags, res,
+             Year, Day, Hour, Min, Sec, junk, Micro, SN0, SN1, SN2, SN3, SN4,
+             SN5, loop, algo, Name) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, amp, period, bg,
+                                  flags, res, Year, Day, Hour, Min, Sec, junk,
+                                  Micro, SN0, SN1, SN2, SN3, SN4, SN5, loop,
+                                  algo, Name)
+            self.infilewrite(pack_blk)
+            return 60
+
+        except Exception:
+            print("error writing blockette 201")
+            return 0
 
 #########################################################
-	def blk300(self, seekval=0):
-		"""
-		Step Calibration Blockette 300 (60 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Beginning of calibration time (BTime expanded, 10)
-				Number of step calibrations (UBYTE, 1)
-				Calibrations flags (UBYTE, 1)
-				Step duration (ULONG, 4)
-				Interval durations (ULONG, 4)
-				Calibration signal amplitude (FLOAT, 4)
-				Channel with calibration input (CHAR*3)
-				Reserved (UBYTE, 1)
-				Reference amplitude (ULONG, 4)
-				Coupling (CHAR*12)
-				Rolloff (CHAR*12)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HH"
-		blk1=self.sunpack(fmtstr, self.infileread(4))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "BBIIf3sBI12s12s"
-		blk2=self.sunpack(fmtstr, self.infileread(46))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 4)
-		return blk
+
+    def blk300(self, seekval=0):
+        """
+        Step Calibration Blockette 300 (60 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Beginning of calibration time (BTime expanded, 10)
+        Number of step calibrations (UBYTE, 1)
+        Calibrations flags (UBYTE, 1)
+        Step duration (ULONG, 4)
+        Interval durations (ULONG, 4)
+        Calibration signal amplitude (FLOAT, 4)
+        Channel with calibration input (CHAR*3)
+        Reserved (UBYTE, 1)
+        Reference amplitude (ULONG, 4)
+        Coupling (CHAR*12)
+        Rolloff (CHAR*12)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HH"
+        blk1 = self.sunpack(fmtstr, self.infileread(4))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "BBIIf3sBI12s12s"
+        blk2 = self.sunpack(fmtstr, self.infileread(46))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 4)
+        return blk
 
 #########################################################
-	def Writeblk300(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Step Calibration Blockette 300 (60 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			numst, flags, dur, interv, amp, chan, res, ref, couple, rolloff)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHHHBBBBHBBIIf3sBI12s12s"
-
-			(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			 numst, flags, dur, interv, amp, chan, res, ref, couple, rolloff)=inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-					     numst, flags, dur, interv, amp, chan, res, ref, couple, rolloff)
-			self.infilewrite(pack_blk)
-			return 60
-
-		except:
-			print("error writing blockette 300")
-			return 0
+
+    def Writeblk300(self, inblk, seekval=0, endianess=""):
+        """
+        writes Step Calibration Blockette 300 (60 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro,
+               numst, flags, dur, interv, amp, chan, res, ref, couple,
+               rolloff)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHHHBBBBHBBIIf3sBI12s12s"
+
+            (blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, numst,
+             flags, dur, interv, amp, chan, res, ref, couple, rolloff) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, Year, Day, Hour,
+                                  Min, Sec, junk, Micro, numst, flags, dur,
+                                  interv, amp, chan, res, ref, couple, rolloff)
+            self.infilewrite(pack_blk)
+            return 60
+
+        except Exception:
+            print("error writing blockette 300")
+            return 0
 
 #########################################################
-	def blk310(self, seekval=0):
-		"""
-		Sine Calibration Blockette 310 (60 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Beginning of calibration time (BTime expanded, 10)
-				Reserved (UBYTE, 1)
-				Calibrations flags (UBYTE, 1)
-				Calibration duration (ULONG, 4)
-				Period of signal (FLOAT, 4)
-				Amplitude of signal (FLOAT, 4)
-				Channel with calibration input (CHAR*3)
-				Reserved (UBYTE, 1)
-				Reference amplitued (ULONG, 4)
-				Coupling (CHAR*12)
-				Rolloff (CHAR*12)
-
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HH"
-		blk1=self.sunpack(fmtstr, self.infileread(4))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "BBIff3sBI12s12s"
-		blk2=self.sunpack(fmtstr, self.infileread(46))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 4)
-		return blk
+
+    def blk310(self, seekval=0):
+        """
+        Sine Calibration Blockette 310 (60 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Beginning of calibration time (BTime expanded, 10)
+        Reserved (UBYTE, 1)
+        Calibrations flags (UBYTE, 1)
+        Calibration duration (ULONG, 4)
+        Period of signal (FLOAT, 4)
+        Amplitude of signal (FLOAT, 4)
+        Channel with calibration input (CHAR*3)
+        Reserved (UBYTE, 1)
+        Reference amplitued (ULONG, 4)
+        Coupling (CHAR*12)
+        Rolloff (CHAR*12)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HH"
+        blk1 = self.sunpack(fmtstr, self.infileread(4))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "BBIff3sBI12s12s"
+        blk2 = self.sunpack(fmtstr, self.infileread(46))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 4)
+        return blk
 
 #########################################################
-	def Writeblk310(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Sine Calibration Blockette 310 (60 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			res, flags, dura,per,ampsig,chan, res2,refamp,coup,rolloff)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHHHBBBBHBBIff3sBI12s12s"
-
-			(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			 res, flags, dura,per,ampsig,chan, res2,refamp,coup,rolloff)=inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-					     res, flags, dura,per,ampsig,chan, res2,refamp,coup,rolloff)
-			self.infilewrite(pack_blk)
-			return 60
-
-		except:
-			print("error writing blockette 310")
-			return 0
+
+    def Writeblk310(self, inblk, seekval=0, endianess=""):
+        """
+        writes Sine Calibration Blockette 310 (60 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
+                res, flags, dura,per,ampsig,chan, res2,refamp,coup,rolloff)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHHHBBBBHBBIff3sBI12s12s"
+
+            (blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res,
+             flags, dura, per, ampsig, chan, res2, refamp, coup,
+             rolloff) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, Year, Day, Hour,
+                                  Min, Sec, junk, Micro, res, flags, dura, per,
+                                  ampsig, chan, res2, refamp, coup, rolloff)
+            self.infilewrite(pack_blk)
+            return 60
+
+        except Exception:
+            print("error writing blockette 310")
+            return 0
 
 #########################################################
-	def blk320(self, seekval=0):
-		"""
-		Pseudo-random Calibraton Blockette 320 (64 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Beginning of calibration time (BTime expanded, 10)
-				Reserved (UBYTE, 1)
-				Calibrations flags (UBYTE, 1)
-				Calibration duration (ULONG, 4)
-				Peak-to-peak amplitude of steps (FLOAT, 4)
-				Channel with calibration input (CHAR*3)
-				Reserved (UBYTE, 1)
-				Reference amplitued (ULONG, 4)
-				Coupling (CHAR*12)
-				Rolloff (CHAR*12)
-				Noise type (CHAR*8)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HH"
-		blk1=self.sunpack(fmtstr, self.infileread(4))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "BBIf3sBI12s12s8s"
-		blk2=self.sunpack(fmtstr, self.infileread(50))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 4)
-		return blk
+
+    def blk320(self, seekval=0):
+        """
+        Pseudo-random Calibraton Blockette 320 (64 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Beginning of calibration time (BTime expanded, 10)
+        Reserved (UBYTE, 1)
+        Calibrations flags (UBYTE, 1)
+        Calibration duration (ULONG, 4)
+        Peak-to-peak amplitude of steps (FLOAT, 4)
+        Channel with calibration input (CHAR*3)
+        Reserved (UBYTE, 1)
+        Reference amplitued (ULONG, 4)
+        Coupling (CHAR*12)
+        Rolloff (CHAR*12)
+        Noise type (CHAR*8)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HH"
+        blk1 = self.sunpack(fmtstr, self.infileread(4))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "BBIf3sBI12s12s8s"
+        blk2 = self.sunpack(fmtstr, self.infileread(50))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 4)
+        return blk
 
 #########################################################
-	def Writeblk320(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Pseudo-random Calibraton Blockette 320 (64 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			res, flags, dura,ptop,chan, res2,refamp,coup,rolloff,noise)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHHHBBBBHBBIf3sBI12s12s8s"
-
-			(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			 res, flags, dura,ptop,chan, res2,refamp,coup,rolloff,noise)=inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-					     res, flags, dura,ptop,chan, res2,refamp,coup,rolloff,noise)
-			self.infilewrite(pack_blk)
-			return 64
-
-		except:
-			print("error writing blockette 320")
-			return 0
+
+    def Writeblk320(self, inblk, seekval=0, endianess=""):
+        """
+        writes Pseudo-random Calibraton Blockette 320 (64 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro,
+                res, flags, dura,ptop,chan, res2,refamp,coup,rolloff,noise)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHHHBBBBHBBIf3sBI12s12s8s"
+
+            (blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res,
+             flags, dura, ptop, chan, res2, refamp, coup, rolloff,
+             noise) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, Year, Day, Hour,
+                                  Min, Sec, junk, Micro, res, flags, dura,
+                                  ptop, chan, res2, refamp, coup, rolloff,
+                                  noise)
+            self.infilewrite(pack_blk)
+            return 64
+
+        except Exception:
+            print("error writing blockette 320")
+            return 0
 
 #########################################################
-	def blk390(self, seekval=0):
-		"""
-		Generic Calibraton Blockette 390 (28 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Beginning of calibration time (BTime expanded, 10)
-				Reserved (UBYTE, 1)
-				Calibrations flags (UBYTE, 1)
-				Calibration duration (ULONG, 4)
-				Calibration signal amplitude (FLOAT, 4)
-				Channel with calibration input (CHAR*3)
-				Reserved (UBYTE, 1)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HH"
-		blk1=self.sunpack(fmtstr, self.infileread(4))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr, self.infileread(10))
-		fmtstr = self.fmt_order + "BBIf3sB"
-		blk2=self.sunpack(fmtstr, self.infileread(14))
-
-		# incorporate timeblk tuple into blk list
-		tmpblk = list(blk1)
-		tmpblk.append(timeblk)
-		tmpblk = tmpblk + list(blk2)
-
-		#apply bit mask to Ubyte
-		blk = self.UbytetoStr(tmpblk, 4)
-		return blk
+
+    def blk390(self, seekval=0):
+        """
+        Generic Calibraton Blockette 390 (28 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Beginning of calibration time (BTime expanded, 10)
+        Reserved (UBYTE, 1)
+        Calibrations flags (UBYTE, 1)
+        Calibration duration (ULONG, 4)
+        Calibration signal amplitude (FLOAT, 4)
+        Channel with calibration input (CHAR*3)
+        Reserved (UBYTE, 1)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HH"
+        blk1 = self.sunpack(fmtstr, self.infileread(4))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "BBIf3sB"
+        blk2 = self.sunpack(fmtstr, self.infileread(14))
+
+        # incorporate timeblk tuple into blk list
+        tmpblk = list(blk1)
+        tmpblk.append(timeblk)
+        tmpblk = tmpblk + list(blk2)
+
+        # apply bit mask to Ubyte
+        blk = self.UbytetoStr(tmpblk, 4)
+        return blk
 
 #########################################################
-	def Writeblk390(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Generic Calibraton Blockette 390 (28 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			res, flags, dura,amp,chan, res2)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHHHBBBBHBBIf3sB"
-
-			(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-			 res, flags, dura,amp,chan, res2)=inblk
-			flags=self.FlagStrtoInt(flags)
-			pack_blk=self.spack(fmtstr, blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, \
-					     res, flags, dura,amp,chan, res2)
-			self.infilewrite(pack_blk)
-			return 28
-
-		except:
-			print("error writing blockette 390")
-			return 0
+
+    def Writeblk390(self, inblk, seekval=0, endianess=""):
+        """
+        writes Generic Calibraton Blockette 390 (28 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro,
+                res, flags, dura,amp,chan, res2)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHHHBBBBHBBIf3sB"
+
+            (blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro,
+             res, flags, dura, amp, chan, res2) = inblk
+            flags = self.FlagStrtoInt(flags)
+            pack_blk = self.spack(fmtstr, blkette, nextblk, Year, Day, Hour,
+                                  Min, Sec, junk, Micro, res, flags, dura, amp,
+                                  chan, res2)
+            self.infilewrite(pack_blk)
+            return 28
+
+        except Exception:
+            print("error writing blockette 390")
+            return 0
 
 #########################################################
-	def blk395(self, seekval=0):
-		"""
-		Calibraton Abort Blockette 395 (16 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				End of calibration time (BTime expanded, 10)
-				Reserved (UBYTE, 2)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHHHBBBBH2s"
-		blk=self.sunpack(fmtstr, self.infileread(16))
-		return list(blk)
+
+    def blk395(self, seekval=0):
+        """
+        Calibraton Abort Blockette 395 (16 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        End of calibration time (BTime expanded, 10)
+        Reserved (UBYTE, 2)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHHHBBBBH2s"
+        blk = self.sunpack(fmtstr, self.infileread(16))
+        return list(blk)
 
 #########################################################
-	def Writeblk395(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Calibraton Abort Blockette 395 (16 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHHHBBBBH2s"
-
-			(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res)
-			self.infilewrite(pack_blk)
-			return 16
-
-		except:
-			print("error writing blockette 395")
-			return 0
+
+    def Writeblk395(self, inblk, seekval=0, endianess=""):
+        """
+        writes Calibraton Abort Blockette 395 (16 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro, res)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHHHBBBBH2s"
+
+            (blkette, nextblk, Year, Day, Hour, Min, Sec, junk, Micro,
+             res) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk,
+                                  Year, Day, Hour, Min, Sec, junk, Micro, res)
+            self.infilewrite(pack_blk)
+            return 16
+
+        except Exception:
+            print("error writing blockette 395")
+            return 0
 
 #########################################################
-	def blk400(self, seekval=0):
-		"""
-		Beam Blockette 400 (16 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Beam azimuth (degrees) (FLOAT, 4)
-				Beam slowness (sec/degree) (FLOAT, 4)
-				Beam configuration (UWORD, 2)
-				Reserved (UBYTE, 2)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHffH2B"
-		blk=self.sunpack(fmtstr, self.infileread(16))
-		return list(blk)
+
+    def blk400(self, seekval=0):
+        """
+        Beam Blockette 400 (16 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Beam azimuth (degrees) (FLOAT, 4)
+        Beam slowness (sec/degree) (FLOAT, 4)
+        Beam configuration (UWORD, 2)
+        Reserved (UBYTE, 2)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHffH2B"
+        blk = self.sunpack(fmtstr, self.infileread(16))
+        return list(blk)
 
 #########################################################
-	def Writeblk400(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Beam Blockette 400 (16 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, baz,bslw,bconf,res0,res1)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHffH2B"
-
-			(blkette, nextblk, baz,bslw,bconf,res0,res1)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, baz,bslw,bconf,res0,res1)
-			self.infilewrite(pack_blk)
-			return 16
-
-		except:
-			print("error writing blockette 400")
-			return 0
+
+    def Writeblk400(self, inblk, seekval=0, endianess=""):
+        """
+        writes Beam Blockette 400 (16 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, baz,bslw,bconf,res0,res1)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHffH2B"
+
+            (blkette, nextblk, baz, bslw, bconf, res0, res1) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk,
+                                  baz, bslw, bconf, res0, res1)
+            self.infilewrite(pack_blk)
+            return 16
+
+        except Exception:
+            print("error writing blockette 400")
+            return 0
 
 #########################################################
-	def blk405(self, seekval=0):
-		"""
-		Beam Delay Blockette 405 (6 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Array of delay values (UWORD, 2)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHH"
-		blk=self.sunpack(fmtstr, self.infileread(6))
-		return list(blk)
+
+    def blk405(self, seekval=0):
+        """
+        Beam Delay Blockette 405 (6 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Array of delay values (UWORD, 2)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHH"
+        blk = self.sunpack(fmtstr, self.infileread(6))
+        return list(blk)
 
 #########################################################
-	def Writeblk405(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Beam Delay Blockette 405 (6 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, delay)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHH"
-
-			(blkette, nextblk, delay)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, delay)
-			self.infilewrite(pack_blk)
-			return 6
-
-		except:
-			print("error writing blockette 405")
-			return 0
+
+    def Writeblk405(self, inblk, seekval=0, endianess=""):
+        """
+        writes Beam Delay Blockette 405 (6 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, delay)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHH"
+
+            (blkette, nextblk, delay) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk, delay)
+            self.infilewrite(pack_blk)
+            return 6
+
+        except Exception:
+            print("error writing blockette 405")
+            return 0
 
 #########################################################
-	def blk500(self, seekval=0):
-		"""
-		Timing Blockette 500 (200 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				VCO correction (FLOAT, 4)
-				Time of exception (BTime expanded, 10)
-				microsec (UBYTE, 1)
-				Reception quality (UBYTE, 1)
-				Exception count (ULONG, 4)
-				Exception type (CHAR*16)
-				Clock model (CHAR*32)
-				Clock status (CHAR*128)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHf"
-		blk1=self.sunpack(fmtstr, self.infileread(8))
-		fmtstr = self.fmt_order + "HHBBBBH"
-		timeblk=self.sunpack(fmtstr,self.infileread(10))
-		fmtstr = self.fmt_order + "BBI16s32s128s"
-		blk2=self.sunpack(fmtstr, self.infileread(182))
-
-		# incorporate timeblk tuple into blk list
-		blk = list(blk1)
-		blk.append(timeblk)
-		blk = blk + list(blk2)
-
-		return blk
+
+    def blk500(self, seekval=0):
+        """
+        Timing Blockette 500 (200 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        VCO correction (FLOAT, 4)
+        Time of exception (BTime expanded, 10)
+        microsec (UBYTE, 1)
+        Reception quality (UBYTE, 1)
+        Exception count (ULONG, 4)
+        Exception type (CHAR*16)
+        Clock model (CHAR*32)
+        Clock status (CHAR*128)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHf"
+        blk1 = self.sunpack(fmtstr, self.infileread(8))
+        fmtstr = self.fmt_order + "HHBBBBH"
+        timeblk = self.sunpack(fmtstr, self.infileread(10))
+        fmtstr = self.fmt_order + "BBI16s32s128s"
+        blk2 = self.sunpack(fmtstr, self.infileread(182))
+
+        # incorporate timeblk tuple into blk list
+        blk = list(blk1)
+        blk.append(timeblk)
+        blk = blk + list(blk2)
+
+        return blk
 
 #########################################################
-	def Writeblk500(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Timing Blockette 500 (200 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, vcocorr,Year, Day, Hour, Min, Sec, junk, Micro, Micro2, \
-			qual,cnt,type,mod,stat)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHfHHBBBBHBBI16s32s128s"
-
-			(blkette, nextblk, vcocorr,Year, Day, Hour, Min, Sec, junk, Micro, Micro2, \
-			 qual,cnt,type,mod,stat)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, vcocorr,Year, Day, Hour, Min, Sec, junk, Micro, Micro2, \
-					     qual,cnt,type,mod,stat)
-			self.infilewrite(pack_blk)
-			return 200
-
-		except:
-			print("error writing blockette 500")
-			return 0
+
+    def Writeblk500(self, inblk, seekval=0, endianess=""):
+        """
+        writes Timing Blockette 500 (200 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, vcocorr,Year, Day, Hour, Min, Sec, junk,
+               Micro, Micro2, qual,cnt,type,mod,stat)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHfHHBBBBHBBI16s32s128s"
+
+            (blkette, nextblk, vcocorr, Year, Day, Hour, Min, Sec, junk,
+             Micro, Micro2, qual, cnt, type, mod, stat) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk, vcocorr, Year, Day,
+                                  Hour, Min, Sec, junk, Micro, Micro2, qual,
+                                  cnt, type, mod, stat)
+            self.infilewrite(pack_blk)
+            return 200
+
+        except Exception:
+            print("error writing blockette 500")
+            return 0
 
 #########################################################
-	def blk1000(self, seekval=0):
-		"""
-		Data Only SEED Blockette 1000 (8 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Encoding Format (BYTE, 1)
-				Word Order (UBYTE, 1)
-				Data Record Length (UBYTE, 1)
-				Reserved (UBYTE, 1)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHbBBB"
-		blk=self.sunpack(fmtstr, self.infileread(8))
-		return list(blk)
+
+    def blk1000(self, seekval=0):
+        """
+        Data Only SEED Blockette 1000 (8 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Encoding Format (BYTE, 1)
+        Word Order (UBYTE, 1)
+        Data Record Length (UBYTE, 1)
+        Reserved (UBYTE, 1)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHbBBB"
+        blk = self.sunpack(fmtstr, self.infileread(8))
+        return list(blk)
 
 #########################################################
-	def Writeblk1000(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Data Only SEED Blockette 1000 (8 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, fmt,order,length,res)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHbBBB"
-
-			(blkette, nextblk, fmt,order,length,res)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, fmt,order,length,res)
-			self.infilewrite(pack_blk)
-			return 8
-
-		except:
-			print("error writing blockette 1000")
-			return 0
+
+    def Writeblk1000(self, inblk, seekval=0, endianess=""):
+        """
+        writes Data Only SEED Blockette 1000 (8 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, fmt,order,length,res)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHbBBB"
+
+            (blkette, nextblk, fmt, order, length, res) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk,
+                                  fmt, order, length, res)
+            self.infilewrite(pack_blk)
+            return 8
+
+        except Exception:
+            print("error writing blockette 1000")
+            return 0
 
 #########################################################
-	def blk1001(self, seekval=0):
-		"""
-		Data Extension Blockette 1001 (8 bytes)
-		Returns tuple
-			blk
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header
-					(UWORD, 2)
-				Timing Quality (UBYTE, 1)
-				microsec (UBYTE, 1)
-				Reserved (UBYTE, 1)
-				Frame count (UBYTE, 1)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHBBBB"
-		blk=self.sunpack(fmtstr, self.infileread(8))
-		return list(blk)
+
+    def blk1001(self, seekval=0):
+        """
+        Data Extension Blockette 1001 (8 bytes)
+        Returns tuple
+                blk
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header
+                (UWORD, 2)
+        Timing Quality (UBYTE, 1)
+        microsec (UBYTE, 1)
+        Reserved (UBYTE, 1)
+        Frame count (UBYTE, 1)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHBBBB"
+        blk = self.sunpack(fmtstr, self.infileread(8))
+        return list(blk)
+
 #########################################################
-	def Writeblk1001(self, inblk, seekval=0, endianess=""):
-		"""
-		writes Data Extension Blockette 1001 (8 bytes)
-		requires tuples inblk
-		inblk=(blkette, nextblk, tqual,micro,res,fcnt)
-		"""
-
-		try:
-			self.infileseek(seekval)
-			fmtorderstr=self.setEndian(endianess)
-			fmtstr = fmtorderstr + "HHBBBB"
-
-			(blkette, nextblk, tqual,micro,res,fcnt)=inblk
-			pack_blk=self.spack(fmtstr, blkette, nextblk, tqual,micro,res,fcnt)
-			self.infilewrite(pack_blk)
-			return 8
-
-		except:
-			print("error writing blockette 1001")
-			return 0
+
+    def Writeblk1001(self, inblk, seekval=0, endianess=""):
+        """
+        writes Data Extension Blockette 1001 (8 bytes)
+        requires tuples inblk
+        inblk=(blkette, nextblk, tqual,micro,res,fcnt)
+        """
+
+        try:
+            self.infileseek(seekval)
+            fmtorderstr = self.setEndian(endianess)
+            fmtstr = fmtorderstr + "HHBBBB"
+
+            (blkette, nextblk, tqual, micro, res, fcnt) = inblk
+            pack_blk = self.spack(fmtstr, blkette, nextblk,
+                                  tqual, micro, res, fcnt)
+            self.infilewrite(pack_blk)
+            return 8
+
+        except Exception:
+            print("error writing blockette 1001")
+            return 0
 
 #########################################################
-	def blk2000(self, seekval=0):
-		"""
-		Variable Length Opaque Data Blockette
-		Returns two tuples
-			blk, opaque
-				Blockette type (UWORD, 2)
-				Next blockette's byte offset relative to fixed section of header. Use 0 if no
-					more blockettes will follow. (UWORD, 2)
-				Total Blockette length kin Bytes (UWORD, 2)
-				Offset to Opaque Data (UWORD, 2)
-				Record number (ULONG, 4)
-				Data Word order (UBYTE, 1)
-					0 = little endian (VAX or 80x86 byte order).
-					1 = big endian (68000 or SPARC byte order).
-				Opaque Data flags (UBYTE, 1)
-					[bit 0] Opaque blockette orientation.
-						0 = record oriented.
-						1 = stream oriented.
-					[bit 1] Packaging bit.
-						0 = Blockette 2000s from multiple SEED data records with different timetags
-						may be packaged into a single SEED data record. The exact original
-						timetag in each SEED Fixed Data Header is not required for each
-						blockette 2000.
-						1= Blockette 2000s from multiple SEED data records with differing timetags
-						may NOT be repackaged into a single SEED data record. Set this bit
-						if the timetag in the SEED Fixed Data Header is required to properly
-						interpret the opaque data.
-					[bits 2-3] Opaque blockette fragmentation flags.
-						00 = opaque record identified by record number is completely contained in
-						this opaque blockette.
-						01 = first opaque blockette for record spanning multiple blockettes.
-						11 = continuation blockette 2...N-1 of record spanning N blockettes.
-						10 = final blockette for record spanning N blockettes.
-					[bits 4-5] File blockette information.
-						00 = not file oriented.
-						01 = first blockette of file.
-						10 = continuation of file.
-						11 = last blockette of file.
-				Number of Opaque Header fields (UBYTE, 1)
-				Opaque Data Header fields (VAR)
-					a Record type
-					b Vendor type
-					c Model type
-					d Software
-					e Firmware
-				Opaque Data Opaque - bytes of opaque data. Total length of opaque data
-					in bytes is blockette_length-15-length (opaque_data_header_string)
-					(Opaque)
-		"""
-		self.infileseek(seekval)
-		fmtstr = self.fmt_order + "HHHHIBBB"
-		blk=self.sunpack(fmtstr, self.infileread(15))
-	#decompose tmpblk[6] into bit fields, create blk
-		tmpblk = self.UbytetoStr(blk, 6)
-		blk=tmpblk #recast blk as list
-
-	#Now decipher Opaque Header
-		charlist=[]
-		char=""
-		length_data_string = 0
-		NumOpaqueHeaders=int(blk[7])
-		fmtstr = self.fmt_order + "s"
-		for i in range(NumOpaqueHeaders):
-			tmpchar=""
-			while tmpchar != "~":
-				tupchar=self.sunpack(fmtstr, self.infileread(1))
-				tmpchar = str(tupchar[0])
-				if tmpchar != "~":
-					char = char + tmpchar
-				length_data_string += 1
-			charlist.append(char)
-		blk.append(charlist)
-# 		opaque = ""
-# 		rdbyte = int(tmpblk[2]) - 15 - length_data_string
-# 		fmt = "=%ds" % rdbyte
-# 		opaque=self.sunpack(fmt, self.infileread(rdbyte))
-#
-# #
-# 		print opaque
-# #
-		return blk
+
+    def blk2000(self, seekval=0):
+        """
+        Variable Length Opaque Data Blockette
+        Returns two tuples
+                blk, opaque
+        Blockette type (UWORD, 2)
+        Next blockette's byte offset relative to fixed section of header.
+        Use 0 if no more blockettes will follow. (UWORD, 2)
+        Total Blockette length kin Bytes (UWORD, 2)
+        Offset to Opaque Data (UWORD, 2)
+        Record number (ULONG, 4)
+        Data Word order (UBYTE, 1)
+            0 = little endian (VAX or 80x86 byte order).
+            1 = big endian (68000 or SPARC byte order).
+        Opaque Data flags (UBYTE, 1)
+            [bit 0] Opaque blockette orientation.
+                    0 = record oriented.
+                    1 = stream oriented.
+            [bit 1] Packaging bit.
+                    0 = Blockette 2000s from multiple SEED data records with
+                    different timetags may be packaged into a single SEED data
+                    record. The exact original timetag in each SEED Fixed Data
+                    Header is not required for each blockette 2000.
+                    1= Blockette 2000s from multiple SEED data records with
+                    differing timetags may NOT be repackaged into a single SEED
+                    data record. Set this bit if the timetag in the SEED Fixed
+                    Data Header is required to properly interpret the opaque
+                    data.
+            [bits 2-3] Opaque blockette fragmentation flags.
+                    00 = opaque record identified by record number is
+                    completely contained in this opaque blockette.
+                    01 = first opaque blockette for record spanning multiple
+                         blockettes.
+                    11 = continuation blockette 2...N-1 of record spanning N
+                         blockettes.
+                    10 = final blockette for record spanning N blockettes.
+            [bits 4-5] File blockette information.
+                    00 = not file oriented.
+                    01 = first blockette of file.
+                    10 = continuation of file.
+                    11 = last blockette of file.
+        Number of Opaque Header fields (UBYTE, 1)
+        Opaque Data Header fields (VAR)
+                a Record type
+                b Vendor type
+                c Model type
+                d Software
+                e Firmware
+        Opaque Data Opaque - bytes of opaque data. Total length of opaque data
+                in bytes is blockette_length-15-length
+                (opaque_data_header_string)
+                (Opaque)
+        """
+        self.infileseek(seekval)
+        fmtstr = self.fmt_order + "HHHHIBBB"
+        blk = self.sunpack(fmtstr, self.infileread(15))
+        # decompose tmpblk[6] into bit fields, create blk
+        tmpblk = self.UbytetoStr(blk, 6)
+        blk = tmpblk  # recast blk as list
+
+        # Now decipher Opaque Header
+        charlist = []
+        char = ""
+        length_data_string = 0
+        NumOpaqueHeaders = int(blk[7])
+        fmtstr = self.fmt_order + "s"
+        for i in range(NumOpaqueHeaders):
+            tmpchar = ""
+            while tmpchar != "~":
+                tupchar = self.sunpack(fmtstr, self.infileread(1))
+                tmpchar = str(tupchar[0])
+                if tmpchar != "~":
+                    char = char + tmpchar
+                length_data_string += 1
+            charlist.append(char)
+        blk.append(charlist)
+        # opaque = ""
+        # rdbyte = int(tmpblk[2]) - 15 - length_data_string
+        # fmt = "=%ds" % rdbyte
+        # opaque=self.sunpack(fmt, self.infileread(rdbyte))
+        #
+        #
+        # print(opaque)
+
+        return blk
+
 #########################################################
-	def UbytetoStr(self, tup, offset):
-		"""
-		converts unsign byte to string values
-		"""
-		list=[]
-		strval = ""
-		# mask bit fields and build string
-		for i in range(8):
-			mask = 2**i
-			if tup[offset] & mask:
-				strval = "1" + strval
-			else:
-				strval = "0" + strval
-
-		# build new list with decomposed bit string
-		for i in range(len(tup)):
-			if i == offset:
-				list.append(strval)
-			else:
-				list.append(tup[i])
-		return list
+
+    def UbytetoStr(self, tup, offset):
+        """
+        converts unsign byte to string values
+        """
+        list = []
+        strval = ""
+        # mask bit fields and build string
+        for i in range(8):
+            mask = 2**i
+            if tup[offset] & mask:
+                strval = "1" + strval
+            else:
+                strval = "0" + strval
+
+        # build new list with decomposed bit string
+        for i in range(len(tup)):
+            if i == offset:
+                list.append(strval)
+            else:
+                list.append(tup[i])
+        return list
+
 #########################################################
-	def FlagStrtoInt(self, flagstr):
-		"""
-		converts Flag String to Integer
-		"""
-		flagint=0
-		n=len(flagstr) - 1
-		for a in flagstr:
-			if int(a):
-				flagint = flagint + 2**n
-			n-=1
-		return flagint
+
+    def FlagStrtoInt(self, flagstr):
+        """
+        converts Flag String to Integer
+        """
+        flagint = 0
+        n = len(flagstr) - 1
+        for a in flagstr:
+            if int(a):
+                flagint = flagint + 2**n
+            n -= 1
+        return flagint
 
 #########################################################
-	def Pad(self, var, num):
-		"""
-		pad header values to specified length with blank space
-		right justified
-		"""
-		varlength=len(var)
-		if varlength == num:
-			return var
-		elif varlength < num:
-			pad=num-varlength
-			newvar= var + SPACE*pad
-			return newvar
+
+    def Pad(self, var, num):
+        """
+        pad header values to specified length with blank space
+        right justified
+        """
+        varlength = len(var)
+        if varlength == num:
+            return var
+        elif varlength < num:
+            pad = num - varlength
+            newvar = var + SPACE * pad
+            return newvar
 
 
 #########################################################
-### END MSEED
+# END MSEED
 #########################################################
 class Segy(futils):
-	def __init__(self, infile):
-		self.type=self.serial=self.chan=self.time=self.rate=None
-		futils.__init__(self,infile)
-		# self.byteorder: byte order of input file.
-		#    "big"
-		#    "little"
-		#    or "unknown"
-		self.byteorder = self.ByteOrder()
-		# self.fmt_order: companion to self.byteorder. Format string for stuct.pack
-		#    ">" big endian
-		#    "<" little endian
+    def __init__(self, infile):
+        self.type = self.serial = self.chan = self.time = self.rate = None
+        futils.__init__(self, infile)
+        # self.byteorder: byte order of input file.
+        # "big"
+        # "little"
+        # or "unknown"
+        self.byteorder = self.ByteOrder()
+        # self.fmt_order: companion to self.byteorder. Format string for
+        # stuct.pack
+        # ">" big endian
+        # "<" little endian
 
 #########################################################
-	def isSegy(self) :
-		"""
-		determines if processed file is segy or unknown type
-		"""
-		#if we don't know byteorder it must not be segy
-		if self.byteorder == "unknown": return 0
-
-		#otherwise it might be segy
-		(Sserial, Schan, Srate, Syear, Sday, Shour, Smin, Ssec) = self.idread()
-		#we have already tested for a valid time in self.ByteOrder, this test is
-		#to ensure that we were able to read a complete idhdr header
-		if Sserial == Schan == Srate == Syear == Sday == Shour == \
-		   Smin == Ssec == None: return 0
-		#if we're this far it must be segy
-		self.type = "segy"
-		if Sserial < 36864:
-			self.serial = Sserial
-		else:
-			self.serial = self.to_hex(Sserial)
-		self.time = str(list(map(str, (Syear, Sday, Shour, Smin, Ssec)))).join(":")
-		self.chan = Schan
-		self.rate = Srate
-		return 1
+
+    def isSegy(self):
+        """
+        determines if processed file is segy or unknown type
+        """
+        # if we don't know byteorder it must not be segy
+        if self.byteorder == "unknown":
+            return 0
+
+        # otherwise it might be segy
+        (Sserial, Schan, Srate, Syear, Sday, Shour, Smin, Ssec) = self.idread()
+        # we have already tested for a valid time in self.ByteOrder, this test
+        # is to ensure that we were able to read a complete idhdr header
+        if Sserial == Schan == Srate == Syear == Sday == Shour == \
+           Smin == Ssec is None:
+            return 0
+        # if we're this far it must be segy
+        self.type = "segy"
+        if Sserial < 36864:
+            self.serial = Sserial
+        else:
+            self.serial = self.to_hex(Sserial)
+        self.time = str(
+            list(map(str, (Syear, Sday, Shour, Smin, Ssec)))).join(":")
+        self.chan = Schan
+        self.rate = Srate
+        return 1
 
 #########################################################
-	def idhdr(self):
-		return self.type, self.serial, self.chan, self.time, self.rate
+
+    def idhdr(self):
+        return self.type, self.serial, self.chan, self.time, self.rate
 
 #########################################################
-	def tracelength(self):
-		"""
-		returns trace length in seconds
-		"""
-		self.infile.seek(228)
-		fmtstr = self.fmt_order + "L"
-		numsamp=struct.unpack(fmtstr, self.infile.read(4))[0]
-		length=numsamp/self.rate
-		return length
+
+    def tracelength(self):
+        """
+        returns trace length in seconds
+        """
+        self.infile.seek(228)
+        fmtstr = self.fmt_order + "L"
+        numsamp = struct.unpack(fmtstr, self.infile.read(4))[0]
+        length = numsamp / self.rate
+        return length
+
 #########################################################
-	def idread(self) :
-		"""
-		Read file as if SEGY file trying to extract
-		channel, time block, sample rate, and serial number
-		"""
-		try :
-			self.infile.seek(0)
-			SH=self.infile.read(240)
-#			self.infile.seek(12)
-			fmtstr = self.fmt_order + "L"
-#			chan = struct.unpack(fmtstr, self.infile.read(4))[0]
-#			print chan
-			chan=struct.unpack(fmtstr, SH[12:16])[0]
-
-# 			self.infile.seek(156)
-# 			timeblock=self.infile.read(10)
-			fmtstr = self.fmt_order + "HHHHH"
-#			(year,day,hour,min,sec)=struct.unpack(fmtstr, timeblock)
-			(year,day,hour,min,sec)=struct.unpack(fmtstr, SH[156:166])
-
-#			self.infile.seek(200)
-			fmtstr = self.fmt_order + "L"
-#			samp=struct.unpack(fmtstr, self.infile.read(4))[0]
-#			print samp
-			samp=struct.unpack(fmtstr, SH[200:204])[0]
-			rate = int(1/(samp/1e6))
-
-#			self.infile.seek(224)
-			fmtstr = self.fmt_order + "H"
-#			serial = struct.unpack(fmtstr, self.infile.read(2))[0]
-			serial=struct.unpack(fmtstr, SH[224:226])[0]
-
-			return serial, chan, rate, year, day, hour, min, sec
-
-		except :
-			return None, None, None, None, None, None, None, None
+
+    def idread(self):
+        """
+        Read file as if SEGY file trying to extract
+        channel, time block, sample rate, and serial number
+        """
+        try:
+            self.infile.seek(0)
+            SH = self.infile.read(240)
+            # self.infile.seek(12)
+            fmtstr = self.fmt_order + "L"
+            # chan = struct.unpack(fmtstr, self.infile.read(4))[0]
+            # print(chan)
+            chan = struct.unpack(fmtstr, SH[12:16])[0]
+
+            # self.infile.seek(156)
+            # timeblock=self.infile.read(10)
+            fmtstr = self.fmt_order + "HHHHH"
+            # (year,day,hour,min,sec)=struct.unpack(fmtstr, timeblock)
+            (year, day, hour, min, sec) = struct.unpack(fmtstr, SH[156:166])
+
+            # self.infile.seek(200)
+            fmtstr = self.fmt_order + "L"
+            # samp=struct.unpack(fmtstr, self.infile.read(4))[0]
+            # print(samp)
+            samp = struct.unpack(fmtstr, SH[200:204])[0]
+            rate = int(1 / (samp / 1e6))
+
+            # self.infile.seek(224)
+            fmtstr = self.fmt_order + "H"
+            # serial = struct.unpack(fmtstr, self.infile.read(2))[0]
+            serial = struct.unpack(fmtstr, SH[224:226])[0]
+
+            return serial, chan, rate, year, day, hour, min, sec
+
+        except Exception:
+            return None, None, None, None, None, None, None, None
 
 #########################################################
-	def ByteOrder(self, seekval=156) :
-		"""
-		read file as if it is segy just pulling time info
-		from header and determine if it makes sense unpacked
-		as big endian or little endian
-		"""
-		Order = "unknown"
-		try :
-			#seek to timeblock and read
-			self.infile.seek(seekval)
-			timeblock=self.infile.read(10)
-
-			#assume big endian
-			(Year, Day, Hour, Min, Sec)=\
-			 struct.unpack('>HHHHH',timeblock)
-			#test if big endian read makes sense
-			if 1950 <= Year <= 2050 and \
-			   1 <= Day <= 366 and \
-			   0 <= Hour <= 23 and \
-			   0 <= Min <= 59 and \
-			   0 <= Sec <= 59:
-				Order = "big"
-				self.fmt_order = ">"
-			else:
-				#try little endian read
-				(Year, Day, Hour, Min, Sec)=\
-				 struct.unpack('<HHHHH',timeblock)
-				#test if little endian read makes sense
-				if 1950 <= Year <= 2050 and \
-				   1 <= Day <= 366 and \
-				   0 <= Hour <= 23 and \
-				   0 <= Min <= 59 and \
-				   0 <= Sec <= 59:
-					Order = "little"
-					self.fmt_order = "<"
-		except :
-			pass
-
-		return Order
+
+    def ByteOrder(self, seekval=156):
+        """
+        read file as if it is segy just pulling time info
+        from header and determine if it makes sense unpacked
+        as big endian or little endian
+        """
+        Order = "unknown"
+        try:
+            # seek to timeblock and read
+            self.infile.seek(seekval)
+            timeblock = self.infile.read(10)
+
+            # assume big endian
+            (Year, Day, Hour, Min, Sec) =\
+                struct.unpack('>HHHHH', timeblock)
+            # test if big endian read makes sense
+            if 1950 <= Year <= 2050 and \
+               1 <= Day <= 366 and \
+               0 <= Hour <= 23 and \
+               0 <= Min <= 59 and \
+               0 <= Sec <= 59:
+                Order = "big"
+                self.fmt_order = ">"
+            else:
+                # try little endian read
+                (Year, Day, Hour, Min, Sec) =\
+                    struct.unpack('<HHHHH', timeblock)
+                # test if little endian read makes sense
+                if 1950 <= Year <= 2050 and \
+                   1 <= Day <= 366 and \
+                   0 <= Hour <= 23 and \
+                   0 <= Min <= 59 and \
+                   0 <= Sec <= 59:
+                    Order = "little"
+                    self.fmt_order = "<"
+        except Exception:
+            pass
+
+        return Order
+
 #########################################################
-	def to_int(self, input) :
-		"""
-		conversion routine from hex to integer
-		"""
-		HEXCHAR=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"]
-		hexnum=str(input)
-		retval=0
-		input_length=len(hexnum)
-		for i in range(input_length) :
-			for index in range(len(HEXCHAR)) :
-				if hexnum[i].upper() == HEXCHAR[index] :
-					retval=retval + index*(16**(input_length-(1+i)))
-		return retval
+
+    def to_int(self, input):
+        """
+        conversion routine from hex to integer
+        """
+        HEXCHAR = ["0", "1", "2", "3", "4", "5", "6",
+                   "7", "8", "9", "A", "B", "C", "D", "E", "F"]
+        hexnum = str(input)
+        retval = 0
+        input_length = len(hexnum)
+        for i in range(input_length):
+            for index in range(len(HEXCHAR)):
+                if hexnum[i].upper() == HEXCHAR[index]:
+                    retval = retval + index * (16**(input_length - (1 + i)))
+        return retval
 
 #########################################################
-	def to_hex(self, number) :
-		"""
-		conversion routine from integer to hex
-		"""
-		retval=0
-		hexnum=hex(number)
-		return hexnum[2:]
+
+    def to_hex(self, number):
+        """
+        conversion routine from integer to hex
+        """
+        # retval = 0
+        hexnum = hex(number)
+        return hexnum[2:]
+
+
 #########################################################
-### END SEGY
+# END SEGY
 #########################################################
-if __name__ == "__main__" :
-
-	VERSION = "2008.204"
-	filecnt=0
-# based on traverse routine in "python standard library", Lundh pg 34
-	def GetTrace(DataDir) :
-		global filecnt
-		stack = []
-		rwError=0
-		for k in range(len(DataDir)) :
-			stack.append(DataDir[k])
-		files = []
-		file_list = {}
-		errcnt=0
-		while stack :
-			directory = stack.pop()
-			if not os.path.isdir(directory):
-				print("\n***WARNING*** Directory \"%s\" not found.\n" % directory)
-				continue
-	#		else :
-			for file in os.listdir(directory):
-				fullname = os.path.join(directory, file)
-				if not os.access(fullname, 6):
-					rwError+=1
-					continue
-
-				if os.path.isfile(fullname) :
-					filecnt+=1
-					try:
-						newfile = Segy(fullname)
-						if newfile.isSegy():
-							(type, serial, chan, time, rate) = newfile.idhdr()
-							length = newfile.tracelength()
-	#						length = "NULL"
-							file_list[fullname] = (type, serial, chan, time, rate, length, newfile.ByteOrder())
-						newfile.close()
-					except:
-						rwError+=1
-						pass
-					else:
-						try:
-							newfile=Mseed(fullname)
-							if newfile.isMseed():
-								try:
-									#simple test to determine if correct size file
-									filesize=newfile.filesize
-									blksize=newfile.blksize
-									(numblocks, odd_size)=divmod(filesize, blksize)
-									if odd_size:
-										rwError+=1
-										continue
-								except:
-									rwError+=1
-									continue
-
-								type=newfile.type
-								serial=newfile.FH.Stat.strip()
-								chan=newfile.FH.Chan.strip()
-								loc=newfile.FH.Loc.strip()
-								net=newfile.FH.Net.strip()
-								time=newfile.time
-								rate=newfile.rate
-								length = newfile.tracelength()
-		#							length = "NULL"
-								file_list[fullname] = (type, serial, chan, time, rate, length, newfile.ByteOrder())
-								newfile.close()
-						except:
-							rwError+=1
-							pass
-	#			if os.path.isdir(fullname) and not os.path.islink(fullname) :
-				if os.path.isdir(fullname) or (os.path.islink(fullname) and not os.path.isfile(fullname)):
-					stack.append(fullname)
-		return file_list, rwError
-
-	if len(sys.argv) > 1 :
-		if sys.argv[1] == "-#" :
-			print(VERSION)
-			sys.exit(1)
-		else :
-			print("Unknown arguement %s" % sys.argv[1:])
-			sys.exit(1)
-
-	segynum = 0
-	mseednum = 0
-	unknownnum = 0
-	Dirs = []
-#	Dirs.append(",")
-	Dirs.append(".")
-#	Dirs.append("/Users/bruce/data/uniq")
-	(file_list,rwError) = GetTrace(Dirs)
-	for file in list(file_list.keys()) :
-		file_type = file_list[file][0]
-		if file_type == "segy" :
-			segynum += 1
-# 			print "\n SEGY \n"
-# 			print "segy: ", file_list[file][1], file_list[file][2], file_list[file][3], \
-# 				file_list[file][4], file_list[file][5], file_list[file][6]
-		elif file_type == "mseed" :
-#		if file_type == "mseed" :
-			mseednum += 1
-# 			print "\n MSEED \n"
-# 			print "mseed: ", file_list[file][1], file_list[file][2], file_list[file][3], \
-# 				file_list[file][4], file_list[file][5], file_list[file][6]
-
-		#else :
-			#unknownnum += 1
-			#print "\n Format Not Recognized \n"
-	print("\nTotal Files Found = %i " % filecnt)
-	print("SEGY Files Processed = %i \nMSEED Files Processed = %i" % (segynum, mseednum))
-	print("Total RWErrors = %i " % rwError)
-	print("Total Files Identified = %i" % len(file_list))
+if __name__ == "__main__":
+
+    VERSION = "2008.204"
+    filecnt = 0
+    # based on traverse routine in "python standard library", Lundh pg 34
+
+    def GetTrace(DataDir):
+        global filecnt
+        stack = []
+        rwError = 0
+        for k in range(len(DataDir)):
+            stack.append(DataDir[k])
+        files = []
+        file_list = {}
+        errcnt = 0
+        while stack:
+            directory = stack.pop()
+            if not os.path.isdir(directory):
+                print("\n***WARNING*** Directory \"%s\" not found.\n" %
+                      directory)
+                continue
+            # else :
+            for file in os.listdir(directory):
+                fullname = os.path.join(directory, file)
+                if not os.access(fullname, 6):
+                    rwError += 1
+                    continue
+
+                if os.path.isfile(fullname):
+                    filecnt += 1
+                    try:
+                        newfile = Segy(fullname)
+                        if newfile.isSegy():
+                            (type, serial, chan, time, rate) = newfile.idhdr()
+                            length = newfile.tracelength()
+                            # length = "NULL"
+                            file_list[fullname] = (type, serial, chan, time,
+                                                   rate, length,
+                                                   newfile.ByteOrder())
+                        newfile.close()
+                    except Exception:
+                        rwError += 1
+                        pass
+                    else:
+                        try:
+                            newfile = Mseed(fullname)
+                            if newfile.isMseed():
+                                try:
+                                    # simple test to determine if correct size
+                                    # file
+                                    filesize = newfile.filesize
+                                    blksize = newfile.blksize
+                                    (numblocks, odd_size) = divmod(
+                                        filesize, blksize)
+                                    if odd_size:
+                                        rwError += 1
+                                        continue
+                                except Exception:
+                                    rwError += 1
+                                    continue
+
+                                type = newfile.type
+                                serial = newfile.FH.Stat.strip()
+                                chan = newfile.FH.Chan.strip()
+                                loc = newfile.FH.Loc.strip()
+                                net = newfile.FH.Net.strip()
+                                time = newfile.time
+                                rate = newfile.rate
+                                length = newfile.tracelength()
+                                # length = "NULL"
+                                file_list[fullname] = (type, serial, chan,
+                                                       time, rate, length,
+                                                       newfile.ByteOrder())
+                                newfile.close()
+                        except Exception:
+                            rwError += 1
+                            pass
+                # if os.path.isdir(fullname) and not os.path.islink(fullname) :
+                if os.path.isdir(fullname) or (os.path.islink(fullname) and
+                                               not os.path.isfile(fullname)):
+                    stack.append(fullname)
+        return file_list, rwError
+
+    if len(sys.argv) > 1:
+        if sys.argv[1] == "-#":
+            print(VERSION)
+            sys.exit(1)
+        else:
+            print("Unknown arguement %s" % sys.argv[1:])
+            sys.exit(1)
+
+    segynum = 0
+    mseednum = 0
+    unknownnum = 0
+    Dirs = []
+    # Dirs.append(",")
+    Dirs.append(".")
+    # Dirs.append("/Users/bruce/data/uniq")
+    (file_list, rwError) = GetTrace(Dirs)
+    for file in list(file_list.keys()):
+        file_type = file_list[file][0]
+        if file_type == "segy":
+            segynum += 1
+            # print("\n SEGY \n")
+            # print("segy: ", file_list[file][1], file_list[file][2],
+            #       file_list[file][3], file_list[file][4], file_list[file][5],
+            #       file_list[file][6])
+        elif file_type == "mseed":
+            # if file_type == "mseed" :
+            mseednum += 1
+            # print("\n MSEED \n")
+            # print("mseed: ", file_list[file][1], file_list[file][2],
+            #       file_list[file][3], file_list[file][4], file_list[file][5],
+            #       file_list[file][6])
+
+        # else :
+            # unknownnum += 1
+            # print("\n Format Not Recognized \n")
+    print("\nTotal Files Found = %i " % filecnt)
+    print("SEGY Files Processed = %i \nMSEED Files Processed = %i" %
+          (segynum, mseednum))
+    print("Total RWErrors = %i " % rwError)
+    print("Total Files Identified = %i" % len(file_list))
diff --git a/mseedpeek/mseedInfo.py b/mseedpeek/mseedInfo.py
index cb3b54812bddbb355b05f003c7718a6262a73b4b..3df5a218a672be8591892668de75de3c10084763 100755
--- a/mseedpeek/mseedInfo.py
+++ b/mseedpeek/mseedInfo.py
@@ -1,179 +1,180 @@
 # VERSION 2005.026
 # definitions of variables for the various seed blockettes. The
 # 0th entry is the title of the blockette
+
 BlkVars = {}
 BlkVars[100] = [
-	"Sample Rate Blockette 100 (12 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Actual Sample Rate:",
-	"Flags:",
-	"Reserved:"
+    "Sample Rate Blockette 100 (12 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Actual Sample Rate:",
+    "Flags:",
+    "Reserved:"
 ]
 
-BlkVars[200]= [
-	"Generic Event Detection Blockette 200 (52 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Signal Amplitude:",
-	"Signal Period:",
-	"Background Estimate:",
-	"Event Detection Flags:",
-	"Reserved:",
-	"Signal Onset Time:",
-	"Detector Name:",
+BlkVars[200] = [
+    "Generic Event Detection Blockette 200 (52 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Signal Amplitude:",
+    "Signal Period:",
+    "Background Estimate:",
+    "Event Detection Flags:",
+    "Reserved:",
+    "Signal Onset Time:",
+    "Detector Name:",
 ]
 
 BlkVars[201] = [
-	"Murdock Event Detection Blockette 201 (60 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Signal Amplitude:",
-	"Signal Period:",
-	"Background Estimate:",
-	"Event Detection Flags:",
-	"Reserved:",
-	"Signal Onset Time:",
-	"Signal-to-Noise Ratio Values:",
-	"Lookback Value:",
-	"Pick Algorithym:",
-	"Detector Name:",
+    "Murdock Event Detection Blockette 201 (60 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Signal Amplitude:",
+    "Signal Period:",
+    "Background Estimate:",
+    "Event Detection Flags:",
+    "Reserved:",
+    "Signal Onset Time:",
+    "Signal-to-Noise Ratio Values:",
+    "Lookback Value:",
+    "Pick Algorithym:",
+    "Detector Name:",
 ]
 
 BlkVars[300] = [
-	"Step Calibration Blockette 300 (60 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Beginning of Calibration Time:",
-	"Number of Step Calibrations:",
-	"Calibrations Flags:",
-	"Step Duration:",
-	"Interval Durations:",
-	"Calibration Signal Amplitude:",
-	"Channel with Calibration Input:",
-	"Reserved:",
-	"Reference Amplitude:",
-	"Coupling:",
-	"Rolloff:"
+    "Step Calibration Blockette 300 (60 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Beginning of Calibration Time:",
+    "Number of Step Calibrations:",
+    "Calibrations Flags:",
+    "Step Duration:",
+    "Interval Durations:",
+    "Calibration Signal Amplitude:",
+    "Channel with Calibration Input:",
+    "Reserved:",
+    "Reference Amplitude:",
+    "Coupling:",
+    "Rolloff:"
 ]
 
 BlkVars[310] = [
-	"Sine Calibration Blockette 310 (60 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Beginning of Calibration time:",
-	"Reserved:",
-	"Calibrations Flags:",
-	"Calibration Duration:",
-	"Period of Signal:",
-	"Amplitude of Signal:",
-	"Channel with Calibration input:",
-	"Reserved:",
-	"Reference Amplitued:",
-	"Coupling:",
-	"Rolloff:"
+    "Sine Calibration Blockette 310 (60 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Beginning of Calibration time:",
+    "Reserved:",
+    "Calibrations Flags:",
+    "Calibration Duration:",
+    "Period of Signal:",
+    "Amplitude of Signal:",
+    "Channel with Calibration input:",
+    "Reserved:",
+    "Reference Amplitued:",
+    "Coupling:",
+    "Rolloff:"
 ]
 
 BlkVars[320] = [
-	"Pseudo-random Calibraton Blockette 320 (64 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Beginning of calibration time:",
-	"Reserved:",
-	"Calibrations flags:",
-	"Calibration duration:",
-	"Peak-to-peak amplitude of steps:",
-	"Channel with calibration input:",
-	"Reserved:",
-	"Reference amplitued:",
-	"Coupling:",
-	"Rolloff:",
-	"Noise type:"
+    "Pseudo-random Calibraton Blockette 320 (64 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Beginning of calibration time:",
+    "Reserved:",
+    "Calibrations flags:",
+    "Calibration duration:",
+    "Peak-to-peak amplitude of steps:",
+    "Channel with calibration input:",
+    "Reserved:",
+    "Reference amplitued:",
+    "Coupling:",
+    "Rolloff:",
+    "Noise type:"
 ]
 
 BlkVars[390] = [
-	"Generic Calibraton Blockette 390 (28 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Beginning of Calibration Time:",
-	"Reserved:",
-	"Calibrations Flags:",
-	"Calibration Duration:",
-	"Calibration Signal Amplitude:",
-	"Channel with Calibration Input:",
-	"Reserved:"
+    "Generic Calibraton Blockette 390 (28 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Beginning of Calibration Time:",
+    "Reserved:",
+    "Calibrations Flags:",
+    "Calibration Duration:",
+    "Calibration Signal Amplitude:",
+    "Channel with Calibration Input:",
+    "Reserved:"
 ]
 
 BlkVars[395] = [
-	"Calibraton Abort Blockette 395 (16 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"End of calibration time:",
-	"Reserved:"
+    "Calibraton Abort Blockette 395 (16 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "End of calibration time:",
+    "Reserved:"
 ]
 
 BlkVars[400] = [
-	"Beam Blockette 400 (16 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Beam Azimuth (degrees):",
-	"Beam Slowness (sec/degree):",
-	"Beam Configuration:",
-	"Reserved:"
+    "Beam Blockette 400 (16 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Beam Azimuth (degrees):",
+    "Beam Slowness (sec/degree):",
+    "Beam Configuration:",
+    "Reserved:"
 ]
 
 BlkVars[405] = [
-	"Beam Delay Blockette 405 (6 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Array of Delay Values:"
+    "Beam Delay Blockette 405 (6 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Array of Delay Values:"
 ]
 
 BlkVars[500] = [
-	"Timing Blockette 500 (200 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"VCO Correction:",
-	"Time of Exception:",
-	"microsec:",
-	"Reception Quality:",
-	"Exception Count:",
-	"Exception Type:",
-	"Clock Model:",
-	"Clock Status:"
+    "Timing Blockette 500 (200 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "VCO Correction:",
+    "Time of Exception:",
+    "microsec:",
+    "Reception Quality:",
+    "Exception Count:",
+    "Exception Type:",
+    "Clock Model:",
+    "Clock Status:"
 ]
 
 BlkVars[1000] = [
-	"Data Only SEED Blockette 1000 (8 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Encoding Format:",
-	"Word Order:",
-	"Data Record Length:",
-	"Reserved:"
+    "Data Only SEED Blockette 1000 (8 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Encoding Format:",
+    "Word Order:",
+    "Data Record Length:",
+    "Reserved:"
 ]
 
 BlkVars[1001] = [
-	"Data Extension Blockette 1001 (8 bytes)",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Timing Quality:",
-	"microsec:",
-	"Reserved:",
-	"Frame Count:",
+    "Data Extension Blockette 1001 (8 bytes)",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Timing Quality:",
+    "microsec:",
+    "Reserved:",
+    "Frame Count:",
 ]
 
 BlkVars[2000] = [
-	"Variable Length Opaque Data Blockette",
-	"Blockette Type:",
-	"Next Blk Offset:",
-	"Total Blockette Length in Bytes:",
-	"Offset to Opaque Data:",
-	"Record Number:",
-	"Data Word Order:",
-	"Opaque Data Flags:",
-	"Number of Opaque Header Fields:",
-	"Opaque Data Header Fields:"
+    "Variable Length Opaque Data Blockette",
+    "Blockette Type:",
+    "Next Blk Offset:",
+    "Total Blockette Length in Bytes:",
+    "Offset to Opaque Data:",
+    "Record Number:",
+    "Data Word Order:",
+    "Opaque Data Flags:",
+    "Number of Opaque Header Fields:",
+    "Opaque Data Header Fields:"
 ]
 
 # definitions of variables for the various seed blockettes. The
@@ -213,9 +214,9 @@ Fixed Section of Data Header (48 bytes)
 The data record header starts at the first byte. The next eight bytes follow
 the same structure as the control headers. Byte seven contains an ASCII D,
 indicating it is a data record. (The eighth byte, or third field, is always
-an ASCII space  shown here as a "delta"). The next ten bytes contain the station,
-location, and channel identity of the record. The rest of the header section
-is binary.
+an ASCII space  shown here as a "delta"). The next ten bytes contain the
+station, location, and channel identity of the record. The rest of the header
+section is binary.
 
 Note   Field Name                    Type   Length   Mask or Flags
 1      Sequence number               A       6       "######"
@@ -233,7 +234,7 @@ Note   Field Name                    Type   Length   Mask or Flags
 12      Activity flags               B       1
 13      I/O and clock flags          B       1
 14      Data quality flags           B       1
-15      Number of blockettes that 
+15      Number of blockettes that
         follow                       B       1
 16      Time correction              B       4
 17      Beginning of data            B       2
@@ -279,8 +280,8 @@ Notes for fields: * indicates mandatory information
                     second minute).
           [Bit 5]  A negative leap second happened during this record (A 59
                     second minute). A negative leap second clock correction has
-                    not yet been used, but the U.S. National Bureau of Standards
-                    has said that it might be necessary someday.
+                    not yet been used, but the U.S. National Bureau of
+                    Standards has said that it might be necessary someday.
           [Bit 6]  Event in progress
 13 UBYTE: I/O flags and clock flags:
           [Bit 0]  Station volume parity error possibly present
@@ -313,9 +314,9 @@ NOTE: All unused bits in the flag bytes are reserved and must be set to zero.
 The last word defines the length of the fixed header. The next-to-last word
 fixes the length reserved for the entire header.
 
-If glitches (missing samples) are detected, set bit 3 of the data quality flags,
-and code missing data values as the largest possible value. Do this for any data
-format, even if you are using theSteim Compression algorithm.
+If glitches (missing samples) are detected, set bit 3 of the data quality
+flags, and code missing data values as the largest possible value. Do this for
+any data format, even if you are using theSteim Compression algorithm.
 
 Here is an algorithm and some sample rate combinations that describe how the
 sample rate factors and multipliers work:
@@ -359,7 +360,7 @@ Notes for fields:
 4 BYTE:  Flags (to be defined)
 5 UBYTE: Reserved; do not use.
 """
-BlkInfoDict[200]= """
+BlkInfoDict[200] = """
 Generic Event Detection Blockette 200 (52 bytes)
 
 Note   Field Name                    Type   Length   Mask or Flags
@@ -480,7 +481,8 @@ Notes for fields:
           calibrator is set to 0dB. If this value is zero, then no units are
           specified, and the amplitude (Note 4) will be reported in "binary
           decibels" from to -96.
-12 CHAR*12: Coupling of calibration signal, such as "Resistive " or "Capacitive".
+12 CHAR*12: Coupling of calibration signal, such as "Resistive " or
+            "Capacitive".
 13 CHAR*12: Rolloff characteristics for any filters used on the calibrator,
             such as "3dB@10Hz".
 """
@@ -532,7 +534,7 @@ Notes for fields:
 12 CHAR*12: Coupling of calibration signal such as "Resistive or "Capacitive".
 13 CHAR*12: Rolloff characteristics for any filters used on the calibration,
             such as "3dB@10Hz".
-            
+
 NOTE: Only one of flag bits 4, 5, and 6 can be set at one time, but one of
 them must be set.
 """
@@ -548,7 +550,7 @@ Note   Field Name                    Type   Length   Mask or Flags
 4      Reserved byte                 B       1
 5      Calibration flags             B       1
 6      Calibration duration          B       4
-7      Peak-to-peak amplitude of 
+7      Peak-to-peak amplitude of
        steps                         B       4
 8      Channel w/ calibration input  A       3
 9      Reserved byte                 B       1
@@ -656,8 +658,8 @@ Note   Field Name                    Type   Length   Mask or Flags
 This blockette is used to specify how the beam indicated by the corresponding
 Beam Configuration Blockette [35] was formed for this data record. For beams
 formed by non-plane waves, the Beam Delay Blockette [405] should be used to
-determine the beam delay for each component referred to in the Beam Configuration
-Blockette [35].
+determine the beam delay for each component referred to in the Beam
+Configuration Blockette [35].
 
 Notes for fields:
 1 UWORD: Blockette type [400]: beam forming.
@@ -666,12 +668,12 @@ Notes for fields:
          section of the data header; use 0 if no more blockettes will follow.)
 3 FLOAT: Azimuth of beam (degrees clockwise from north).
 4 FLOAT: Beam slowness (sec/degree).
-5 UWORD: Beam configuration (see field 3 of the Beam Configuration Blockette [35]
-         abbreviation dictionary).
-         NOTE: This field is a binary equivalent of the ASCII formatted dictionary
-         key entry number in the Beam Configuration Blockette [35]. This is the
-         only place in SEED Version 2.1 where this ASCII-to-binary conversion
-         needs to be made.
+5 UWORD: Beam configuration (see field 3 of the Beam Configuration Blockette
+         [35] abbreviation dictionary).
+         NOTE: This field is a binary equivalent of the ASCII formatted
+         dictionary key entry number in the Beam Configuration Blockette [35].
+         This is the only place in SEED Version 2.1 where this ASCII-to-binary
+         conversion needs to be made.
 6 UWORD: Reserved; do not use.
 """
 
@@ -722,24 +724,24 @@ Notes for fields:
 2 UWORD: Byte number of next blockette. (Calculate this as the byte offset
          from the beginning of the logical record  including the fixed
          section of the data header; use 0 if no more blockettes will follow.)
-3 FLOAT: VCO correction is a floating point percentage from 0.0 to 100.0% of VCO
-         control value, where 0.0 is slowest , and 100.0% is fastest.
+3 FLOAT: VCO correction is a floating point percentage from 0.0 to 100.0% of
+         VCO control value, where 0.0 is slowest , and 100.0% is fastest.
 4 BTIME: Time of exception, same format as record start time.
 5 UBYTE: microsec has the clock time down to the microsecond. The SEED format
          handles down to 100microsecs. This field is an offset from that value.
-         The recommended value is from -50 to +49microsecs. At the users option,
-         this value may be from 0 to +99microsecs.
+         The recommended value is from -50 to +49microsecs. At the users
+         option, this value may be from 0 to +99microsecs.
 6 UBYTE: Reception quality is a number from 0 to 100% of maximum clock accuracy
          based only on information from the clock.
-7 ULONG: Exception count is an integer count, with its meaning based on the type
-         of exception, such as 15 missing timemarks.
-8 CHAR*16: Exception type describes the type of clock exception, such as "Missing"
-           or "Unexpected".
-9 CHAR*32: Clock model is an optional description of the clock, such as "Quanterra
-           GPS1/QTS".
-10 CHAR*128: Clock status is an optional description of clock specific parameters,
-             such as the station for an Omega clock, or satellite signal to noise
-             ratios for GPS clocks.
+7 ULONG: Exception count is an integer count, with its meaning based on the
+         type of exception, such as 15 missing timemarks.
+8 CHAR*16: Exception type describes the type of clock exception, such as
+           "Missing" or "Unexpected".
+9 CHAR*32: Clock model is an optional description of the clock, such as
+           "Quanterra GPS1/QTS".
+10 CHAR*128: Clock status is an optional description of clock specific
+             parameters, such as the station for an Omega clock, or satellite
+             signal to noise ratios for GPS clocks.
 """
 
 BlkInfoDict[1000] = """
@@ -793,13 +795,13 @@ Notes for fields:
                31        HGLP Format
                32        DWWSSN Gain Ranged Format
                33        RSTN 16 bit gain ranged
-               
+
 4. The byte swapping order for 16 bit and 32 bit words. A 0 indicates VAX or
    8086 order and a 1 indicates 68000 or SPARC word order. See fields 11 and
    12 of blockette 50.
-5. The exponent (as a power of two) of the record length for these data. The data
-   record can be as small as 256 bytes and, in Data Only SEED format as large as
-   2 raised to the 256 power.
+5. The exponent (as a power of two) of the record length for these data. The
+   data record can be as small as 256 bytes and, in Data Only SEED format as
+   large as 2 raised to the 256 power.
 """
 
 BlkInfoDict[1001] = """
@@ -822,9 +824,9 @@ Notes for fields:
 3. UBYTE: Timing quality is a vendor specific value from 0 to 100% of maxium
           accuracy, taking into account both clock quality and data flags.
 4. UBYTE: microsec has the data start time down to the microsecond. The SEED
-          format handles down to 100microsecs. This field is an offset from that
-          value. The recommended value is from -50 to +49microsecs. At the users
-          option, this value may be from 0 to +99microsecs.
+          format handles down to 100microsecs. This field is an offset from
+          that value. The recommended value is from -50 to +49microsecs. At
+          the users option, this value may be from 0 to +99microsecs.
 5. Reserved byte.
 6. UBYTE: Frame count is the number of 64 byte compressed data frames in the
           4K record (maximum of 63). Note that the user may specify fewer than
@@ -867,19 +869,20 @@ Notes for fields:
 2 UWORD: Byte number of next blockette. (Calculate this as the byte offset
          from the beginning of the logical record  including the fixed
          section of the data header; use 0 if no more blockettes will follow.)
-3 UWORD: Blockette length. The total number of bytes in this blockette, including
-         the 6 bytes of header. The only restriction is that the blockette must
-         fit within a single SEED data record for the channel. Otherwise, the
-         blockette must be partitioned into multiple blockettes.
+3 UWORD: Blockette length. The total number of bytes in this blockette,
+         including the 6 bytes of header. The only restriction is that the
+         blockette must fit within a single SEED data record for the channel.
+         Otherwise, the blockette must be partitioned into multiple blockettes.
 4 UWORD: Offset to Opaque Data. Byte offset from beginning of blockette to
          Opaque Data.
-5 ULONG: Record Number. The record number may be used for sequence identification
-         of stream, record, or file oriented data. If a record is partitioned
-         into multiple opaque blockettes, each blockette containing a portion of
-         the record should contain the identical record number. It is strongly
-         recommended that the record number be used to aid in the detection of
-         missing data and in merging data from different telemetry streams. Use
-         0 if data is not record oriented, or if record number is not required.
+5 ULONG: Record Number. The record number may be used for sequence
+         identification of stream, record, or file oriented data. If a record
+         is partitioned into multiple opaque blockettes, each blockette
+         containing a portion of the record should contain the identical record
+         number. It is strongly recommended that the record number be used to
+         aid in the detection of missing data and in merging data from
+         different telemetry streams. Use 0 if data is not record oriented, or
+         if record number is not required.
 6 UBYTE: Word order of binary opaque data. See field 4 of blockette 1000, and
          fields 11 and 12 of blockette 50.
               0 = little endian (VAX or 80x86 byte order).
@@ -889,19 +892,22 @@ Notes for fields:
               0 = record oriented.
               1 = stream oriented.
          [bit 1] Packaging bit.
-              0 = Blockette 2000s from multiple SEED data records with different
-                  timetags may be packaged into a single SEED data record. The exact
-                  original timetag in each SEED Fixed Data Header is not required
-                  for each blockette 2000.
-              1 = Blockette 2000s from multiple SEED data records with differing
-                  timetags may NOT be repackaged into a single SEED data record.
-                  Set this bit if the timetag in the SEED Fixed Data Header is
-                  required to properly interpret the opaque data.
+              0 = Blockette 2000s from multiple SEED data records with
+                  different timetags may be packaged into a single SEED data
+                  record. The exact original timetag in each SEED Fixed Data
+                  Header is not required for each blockette 2000.
+              1 = Blockette 2000s from multiple SEED data records with
+                  differing timetags may NOT be repackaged into a single SEED
+                  data record. Set this bit if the timetag in the SEED Fixed
+                  Data Header is required to properly interpret the opaque
+                  data.
          [bits 2-3] Opaque blockette fragmentation flags.
-              00 = opaque record identified by record number is completely contained
-                   in this opaque blockette.
-              01 = first opaque blockette for record spanning multiple blockettes.
-              11 = continuation blockette 2...N-1 of record spanning N blockettes.
+              00 = opaque record identified by record number is completely
+                   contained in this opaque blockette.
+              01 = first opaque blockette for record spanning multiple
+                   blockettes.
+              11 = continuation blockette 2...N-1 of record spanning N
+                   blockettes.
               10 = final blockette for record spanning N blockettes.
          [bits 4-5] File blockette information.
               00 = not file oriented.
@@ -910,9 +916,10 @@ Notes for fields:
               11 = last blockette of file.
 8 UBYTE: Number of Opaque Header fields. Each opaque header field is a variable
          length ascii string, terminated by the character ~.
-9 VAR: Opaque Data Header string, which contains the ascii variable length fields.
-       Each field is terminated by a "~". The definition of the fields may be
-       defined by the originator and receiver, but the following are recommended.
+9 VAR: Opaque Data Header string, which contains the ascii variable length
+       fields. Each field is terminated by a "~". The definition of the fields
+       may be defined by the originator and receiver, but the following are
+       recommended.
        Any of the fields may be empty.
          a    Record Type - name of the type of record (eg "GPS", "GPS MBEN").
          b    Vendor Type - name of equipment vendor (eg "ASHTECH").
@@ -921,4 +928,4 @@ Notes for fields:
          e   Firmware Version - firmware version number (eg "1G0C").
 10 OPAQUE: Opaque Data - bytes of opaque data. Total length of opaque data in
            bytes is blockette_length - 15 - length (opaque_data_header_string)
-"""
\ No newline at end of file
+"""
diff --git a/mseedpeek/mseedpeek.py b/mseedpeek/mseedpeek.py
index 63e67a0898d7dbfdbf70dd35a6d1f19032e5d328..4c26aced1e20508359a9d9094911f57ac83ba4e7 100755
--- a/mseedpeek/mseedpeek.py
+++ b/mseedpeek/mseedpeek.py
@@ -53,7 +53,8 @@
 # Modification
 # Author: bcb
 #
-# added main window button "Flush Dictionaries". Allows user view changes to mseed
+# added main window button "Flush Dictionaries". Allows user view changes to
+# mseed
 # files without rebuilding db
 
 ##########################
@@ -69,7 +70,8 @@
 # Modification
 # Author: bcb
 #
-# added feature if only one trace on commandline input then fill fields on startup
+# added feature if only one trace on commandline input then fill fields on
+# startup
 ##########################
 # 2005.335
 # bug fix
@@ -99,38 +101,54 @@
 #
 # Python 3 compatibility
 # setup.py
+################################################################
+#
+# modification
+# version: 2020.204
+# author: Maeva Pourpoint
+#
+# Updates to work under Python 3.
+# Unit tests to ensure basic functionality.
+# Code cleanup to conform to the PEP8 style guide.
+# Directory cleanup (remove unused files introduced by Cookiecutter).
+# Packaged with conda.
+################################################################
 
 import Pmw
+import sys
 
-from os import *
+from getopt import getopt
 from glob import glob
 from operator import mod
-from getopt import getopt
-import sys
-VERSION = "2018.131"
+from os import *
 from tkinter import *
 from tkinter.filedialog import *
+
 from mseedpeek.libtrace import *
 from mseedpeek.mseedInfo import *
+
+VERSION = "2020.204"
 SPACE = " "
+
+
 def main():
     # return version number if -# command line option
     ListInFiles = []
     try:
-	    opts, pargs = getopt(sys.argv[1:], 'f#')
-	    for flag, arg in opts:
-		    if flag == "-f":
-			    InFiles=pargs
-			    for fl in InFiles:
-				    for f in glob(fl):
-					    ListInFiles.append(f)
-		    if flag == "-#":
-			    print(VERSION)
-			    os._exit(0)
-    except:
-	    print("\nInvalid command line usage\n")
-	    print("Usage:\nmseedpeek\nmseedpeek -#\nmseedpeek -f file(s)\n")
-	    sys.exit(1)
+        opts, pargs = getopt(sys.argv[1:], 'f#')
+        for flag, arg in opts:
+            if flag == "-f":
+                InFiles = pargs
+                for fl in InFiles:
+                    for f in glob(fl):
+                        ListInFiles.append(f)
+            if flag == "-#":
+                print(VERSION)
+                sys.exit(0)
+    except Exception:
+        print("\nInvalid command line usage\n")
+        print("Usage:\nmseedpeek\nmseedpeek -#\nmseedpeek -f file(s)\n")
+        sys.exit(1)
 
     print("\n", os.path.basename(sys.argv[0]), VERSION)
 
@@ -144,1371 +162,1404 @@ def main():
         mw.root.mainloop()
 
 
-#From "Python and Tkinter Programming", J.E. Grayson, pg.103
+# From "Python and Tkinter Programming", J.E. Grayson, pg.103
 class Command:
-	def __init__(self,func, *args, **kw):
-		self.func = func
-		self.args = args
-		self.kw = kw
-	def __call__(self, *args, **kw):
-		args = self.args + args
-		kw.update(self.kw)
-		self.func(*args, **kw)
+    def __init__(self, func, *args, **kw):
+        self.func = func
+        self.args = args
+        self.kw = kw
+
+    def __call__(self, *args, **kw):
+        args = self.args + args
+        kw.update(self.kw)
+        self.func(*args, **kw)
 
 #
-#	Over ride some methods in FileDialog so we only select directories
-#	From TraceBuilder.py, auth Steve Azevedo & Lloyd Carothers
+# Over ride some methods in FileDialog so we only select directories
+# From TraceBuilder.py, auth Steve Azevedo & Lloyd Carothers
 #
-class DirectoryDialog (FileDialog) :
 
-	title="Directory Select"
-	def __init__ (self, root) :
-		FileDialog.__init__ (self, root)
+
+class DirectoryDialog(FileDialog):
+
+    title = "Directory Select"
+
+    def __init__(self, root):
+        FileDialog.__init__(self, root)
 
     #   Only allow selection of directories (single click)
-	def files_select_event (self, e):
-		pass
+    def files_select_event(self, e):
+        pass
     #   Double click
-	def files_double_event (self, e):
-		pass
+
+    def files_double_event(self, e):
+        pass
 
     #   Make sure it's a directory and accessable
-	def ok_command (self) :
-		ifile = self.get_selection ()
-		if not path.isdir (ifile) :
-			if not access (ifile, R_OK) :
-				self.root.bell ()
-				ifile = None
-		self.quit (ifile)
+    def ok_command(self):
+        ifile = self.get_selection()
+        if not path.isdir(ifile):
+            if not access(ifile, R_OK):
+                self.root.bell()
+                ifile = None
+        self.quit(ifile)
 
 
 class MainWindow:
-	def __init__(self, title='',InFiles=''):
-
-		self.root = Tk()
-		Pmw.initialise(self.root)
-		self.root.title(title)
-
-		self.e_width = 8
-		self.InfoString = StringVar()
-
-		#if files entered on commandline set self.ListInFiles
-		self.ListInFiles = {}
-		if InFiles:
-			self.ListInFiles=ListInFiles
-		#some standard vars
-		self.DataDirs = StringVar()
-		self.StatSel = StringVar()
-		self.StatSelList = []
-		self.Trace=StringVar()
-		self.SelDir = StringVar()
-		self.SelDir.set("")
-		self.Station = StringVar()
-		self.NetCode = StringVar()
-		self.SampleRate = IntVar()
-		self.Channel = StringVar()
-		self.LocCode = StringVar()
-		self.ByteOrder = StringVar()
-
-		#positional vars
-		self.ByteOffset = IntVar()
-		self.BlkSize = IntVar()
-
-		#dictionaries, lists and misc vars
-		self.BlockNum = IntVar()
-		self.JumpNum = IntVar()
-		self.NumBlocks = IntVar()
-		self.FixedHdrDict={}
-		self.RateDict={}
-		self.Blockettes={}
-		self.BlockettesList=[]
-		self.UniqueList=[]
-		self.UniqueSelectList=[]
-		self.UniqueSelect = StringVar()
-		self.TraceList=[]
-		self.TraceListDict={}
-
-		#file and verbosity vars
-		self.MseedFile = StringVar()
-		self.Blockette = StringVar()
-		self.BlocketteType = StringVar()
-		self.OldMseedFile = StringVar()
-		self.VerbVar = IntVar()
-		self.OldVerbVar = IntVar()
-		self.VerbList = [
-			["Standard", 0],
-			["Verbose", 1],
-			["Very Verbose", 2],
-			["Unique", 3]
-		]
-		self.VerbVar.set(0)
-		self.OldVerbVar.set(0)
-
-		#verbosity lists - each builds on the previous
-		self.StandardVars = [
-			["Station Name:", self.Station],
-			["Location Code:", self.LocCode],
-			["Channel:", self.Channel],
-			["Net Code:", self.NetCode],
-			["Sps (nominal):", self.SampleRate]
-		]
-
-		self.Year = StringVar()
-		self.Jday = StringVar()
-		self.Hour = StringVar()
-		self.Min = StringVar()
-		self.Sec = StringVar()
-		self.Micro = StringVar()
-		self.VerboseVars = [
-			["Year:", self.Year],
-			["Day:", self.Jday],
-			["Hour:", self.Hour],
-			["Min:", self.Min],
-			["Sec:", self.Sec],
-			["0.0001s:", self.Micro]
-		]
-		self.VerboseVars = self.StandardVars + self.VerboseVars
-
-		self.SeqNum = StringVar()
-		self.DQual = StringVar()
-		self.Resv = StringVar()
-		self.AddVVVars = [
-			["Sequence Number:", self.SeqNum],
-			["Data Hdr/Qaul:", self.DQual],
-			["Reserved:", self.Resv]
-		]
-
-		self.NumSamp = IntVar()
-		self.SampFact = IntVar()
-		self.SampMult = IntVar()
-		self.ActFlag = StringVar()
-		self.IOFlag = StringVar()
-		self.DQFlag = StringVar()
-		self.NumBlockettes = IntVar()
-		self.TimeCorr = IntVar()
-		self.BeginData = IntVar()
-		self.FstBlkett = IntVar()
-		self.VeryVerboseVars = [
-			["Number Samples:", self.NumSamp],
-			["Sample Factor:", self.SampFact],
-			["Sample Multiplier:", self.SampMult],
-			["Activity Flags:", self.ActFlag],
-			["I/O & Clk Flags:", self.IOFlag],
-			["Data Qaul Flags:", self.DQFlag],
-			["Number Blockettes:", self.NumBlockettes],
-			["Time Corr:", self.TimeCorr],
-			["Offet Data:", self.BeginData],
-			["Offset Blockette:", self.FstBlkett]
-		]
-		self.VeryVerboseVars = self.AddVVVars +self.VerboseVars + self.VeryVerboseVars
-
-		#set up notebooks
-		self.createMainButtons(self.root)
-		self.createNoteBooks(self.root)
+    def __init__(self, title='', InFiles=''):
+
+        self.root = Tk()
+        Pmw.initialise(self.root)
+        self.root.title(title)
+
+        self.e_width = 8
+        self.InfoString = StringVar()
+
+        # if files entered on commandline set self.ListInFiles
+        self.ListInFiles = {}
+        if InFiles:
+            self.ListInFiles = ListInFiles
+        # some standard vars
+        self.DataDirs = StringVar()
+        self.StatSel = StringVar()
+        self.StatSelList = []
+        self.Trace = StringVar()
+        self.SelDir = StringVar()
+        self.SelDir.set("")
+        self.Station = StringVar()
+        self.NetCode = StringVar()
+        self.SampleRate = IntVar()
+        self.Channel = StringVar()
+        self.LocCode = StringVar()
+        self.ByteOrder = StringVar()
+
+        # positional vars
+        self.ByteOffset = IntVar()
+        self.BlkSize = IntVar()
+
+        # dictionaries, lists and misc vars
+        self.BlockNum = IntVar()
+        self.JumpNum = IntVar()
+        self.NumBlocks = IntVar()
+        self.FixedHdrDict = {}
+        self.RateDict = {}
+        self.Blockettes = {}
+        self.BlockettesList = []
+        self.UniqueList = []
+        self.UniqueSelectList = []
+        self.UniqueSelect = StringVar()
+        self.TraceList = []
+        self.TraceListDict = {}
+
+        # file and verbosity vars
+        self.MseedFile = StringVar()
+        self.Blockette = StringVar()
+        self.BlocketteType = StringVar()
+        self.OldMseedFile = StringVar()
+        self.VerbVar = IntVar()
+        self.OldVerbVar = IntVar()
+        self.VerbList = [
+            ["Standard", 0],
+            ["Verbose", 1],
+            ["Very Verbose", 2],
+            ["Unique", 3]
+        ]
+        self.VerbVar.set(0)
+        self.OldVerbVar.set(0)
+
+        # verbosity lists - each builds on the previous
+        self.StandardVars = [
+            ["Station Name:", self.Station],
+            ["Location Code:", self.LocCode],
+            ["Channel:", self.Channel],
+            ["Net Code:", self.NetCode],
+            ["Sps (nominal):", self.SampleRate]
+        ]
+
+        self.Year = StringVar()
+        self.Jday = StringVar()
+        self.Hour = StringVar()
+        self.Min = StringVar()
+        self.Sec = StringVar()
+        self.Micro = StringVar()
+        self.VerboseVars = [
+            ["Year:", self.Year],
+            ["Day:", self.Jday],
+            ["Hour:", self.Hour],
+            ["Min:", self.Min],
+            ["Sec:", self.Sec],
+            ["0.0001s:", self.Micro]
+        ]
+        self.VerboseVars = self.StandardVars + self.VerboseVars
+
+        self.SeqNum = StringVar()
+        self.DQual = StringVar()
+        self.Resv = StringVar()
+        self.AddVVVars = [
+            ["Sequence Number:", self.SeqNum],
+            ["Data Hdr/Qaul:", self.DQual],
+            ["Reserved:", self.Resv]
+        ]
+
+        self.NumSamp = IntVar()
+        self.SampFact = IntVar()
+        self.SampMult = IntVar()
+        self.ActFlag = StringVar()
+        self.IOFlag = StringVar()
+        self.DQFlag = StringVar()
+        self.NumBlockettes = IntVar()
+        self.TimeCorr = IntVar()
+        self.BeginData = IntVar()
+        self.FstBlkett = IntVar()
+        self.VeryVerboseVars = [
+            ["Number Samples:", self.NumSamp],
+            ["Sample Factor:", self.SampFact],
+            ["Sample Multiplier:", self.SampMult],
+            ["Activity Flags:", self.ActFlag],
+            ["I/O & Clk Flags:", self.IOFlag],
+            ["Data Qaul Flags:", self.DQFlag],
+            ["Number Blockettes:", self.NumBlockettes],
+            ["Time Corr:", self.TimeCorr],
+            ["Offet Data:", self.BeginData],
+            ["Offset Blockette:", self.FstBlkett]
+        ]
+        self.VeryVerboseVars = (self.AddVVVars + self.VerboseVars +
+                                self.VeryVerboseVars)
+
+        # set up notebooks
+        self.createMainButtons(self.root)
+        self.createNoteBooks(self.root)
 
 ########################################
-	def createMainButtons(self,master):
-		"""
-		Build info bar and buttons for root window
-		"""
-		self.InfoString_l = Label(master,
-				bg = "yellow",
-				relief = "ridge")
-		self.InfoString_l.pack(side='bottom', fill='x')
-
-
-		self.Button_fm = Frame(master, relief = 'groove', borderwidth = 2)
-		self.Button_fm.pack(side = 'bottom', pady=5, fill = 'x')
-
-		self.exit_b = Button(self.Button_fm,
-					text = "Exit",
-					relief = "ridge",
-					cursor = 'pirate',
-					command = Command(self.Exit),
-					activebackground= 'red',
-					activeforeground='black')
-		self.exit_b.pack(side='right', anchor='e')
-
-		self.flush_b = Button(self.Button_fm,
-					text = "Flush Dictionaries",
-					relief = "ridge",
-					command = Command(self.FlushDict),
-					activebackground= 'orange',
-					activeforeground='black')
-		self.flush_b.pack(side='left', anchor='w')
+    def createMainButtons(self, master):
+        """
+        Build info bar and buttons for root window
+        """
+        self.InfoString_l = Label(master,
+                                  bg="yellow",
+                                  relief="ridge")
+        self.InfoString_l.pack(side='bottom', fill='x')
+
+        self.Button_fm = Frame(master, relief='groove', borderwidth=2)
+        self.Button_fm.pack(side='bottom', pady=5, fill='x')
+
+        self.exit_b = Button(self.Button_fm,
+                             text="Exit",
+                             relief="ridge",
+                             cursor='pirate',
+                             command=Command(self.Exit),
+                             activebackground='red',
+                             activeforeground='black')
+        self.exit_b.pack(side='right', anchor='e')
+
+        self.flush_b = Button(self.Button_fm,
+                              text="Flush Dictionaries",
+                              relief="ridge",
+                              command=Command(self.FlushDict),
+                              activebackground='orange',
+                              activeforeground='black')
+        self.flush_b.pack(side='left', anchor='w')
 
 ########################################
-	def createNoteBooks(self,master):
-		"""
-		Set up notebooks in root window
-		"""
-		nb = Pmw.NoteBook(master)
-		self.buildHdrDisplay(nb)
-		self.buildBlockette(nb)
-		self.buildHelp(nb)
-		nb.pack(padx=5, pady=5, fill='both', expand=1)
-		# If commandline trace input
-		if self.ListInFiles:
-			(self.TraceListDict, NumFiles) = self.IndexFiles(self.ListInFiles)
-			self.UpdateDirList(self.HdrSelect_fm)
-			if NumFiles == 1:
-				vdir=list(self.TraceListDict.keys())[0]
-				self.SelDir.set(vdir)
-				self.UpdateTrcList()
-				trace=self.TraceListDict[vdir][0]
-				self.MseedFile.set(trace)
-				self.ReadHdrs()
-
-
-			#clear any lingering updates
-# 			self.MseedFile.set("")
-# 			self.ClearAll(self.VeryVerboseVars)
-# 			self.Hdrs_fm.destroy()
-# 			self.Blks_fm.destroy()
-
-
-			self.root.bell()
-			text= "Done. " + str(NumFiles) + " mseed files found."
-			self.addTextInfoBar(self.InfoString_l, text, "green")
+    def createNoteBooks(self, master):
+        """
+        Set up notebooks in root window
+        """
+        nb = Pmw.NoteBook(master)
+        self.buildHdrDisplay(nb)
+        self.buildBlockette(nb)
+        self.buildHelp(nb)
+        nb.pack(padx=5, pady=5, fill='both', expand=1)
+        # If commandline trace input
+        if self.ListInFiles:
+            (self.TraceListDict, NumFiles) = self.IndexFiles(self.ListInFiles)
+            self.UpdateDirList(self.HdrSelect_fm)
+            if NumFiles == 1:
+                vdir = list(self.TraceListDict.keys())[0]
+                self.SelDir.set(vdir)
+                self.UpdateTrcList()
+                trace = self.TraceListDict[vdir][0]
+                self.MseedFile.set(trace)
+                self.ReadHdrs()
+
+            # clear any lingering updates
+            # self.MseedFile.set("")
+            # self.ClearAll(self.VeryVerboseVars)
+            # self.Hdrs_fm.destroy()
+            # self.Blks_fm.destroy()
+
+            self.root.bell()
+            text = "Done. " + str(NumFiles) + " mseed files found."
+            self.addTextInfoBar(self.InfoString_l, text, "green")
 ##################################################################
-	def buildHdrDisplay(self,master):
-		"""
-		Populate HdrDisplay NoteBook
-		"""
-		self.FixedHdr_nb = master.add('Trace Headers')
-
-		#data selection frame
-		self.DataDirs_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.DataDirs_fm.pack(side = 'top', pady=5, fill = 'x')
-		self.DataDirs_l = Label(self.DataDirs_fm, text='Data Directories: ')
-		self.DataDirs_l.pack(side='left')
-		self.DataDirs_e = Entry(self.DataDirs_fm,
-			selectbackground = 'yellow',
-			textvariable = self.DataDirs)
-		self.DataDirs_e.pack(side='left', anchor='w',expand=1, fill='x')
-		self.ClearDataDir_b = Button(self.DataDirs_fm,
-			activebackground = 'orange',
-			relief = "ridge",
-			text = "Clear",
-			command = Command(self.setValue, self.DataDirs)
-			)
-		self.ClearDataDir_b.pack(side='right')
-		self.FindDataDir_b = Button(self.DataDirs_fm,
-			activebackground = 'green',
-			relief = "ridge",
-			text = "Find",
-			command = Command(self.getPath, self.DataDirs, None)
-			)
-		self.FindDataDir_b.pack(side='right')
-		self.DataDirs.set(getcwd())
-
-		self.BuildTrcList_b = Button(self.DataDirs_fm,
-			activebackground = 'green',
-			relief = "ridge",
-			background='lightblue',
-			text = "Build Trace db",
-			command = Command(self.BuildTrcList)
-			)
-		self.BuildTrcList_b.pack(side='right')
-
-		# station selection frame and entry box
-		self.StatSel_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.StatSel_fm.pack(side = 'top', pady=5, fill = 'x')
-		self.StatSel_l = Label(self.StatSel_fm, text='Find only stations (colon separated list): ')
-		self.StatSel_l.pack(side='left')
-		self.StatSel_e = Entry(self.StatSel_fm,
-			selectbackground = 'yellow',
-			textvariable = self.StatSel)
-		self.StatSel_e.pack(side='left', anchor='w',expand=1, fill='x')
-
-		self.ClearStatSel_b = Button(self.StatSel_fm,
-			activebackground = 'orange',
-			relief = "ridge",
-			text = "Clear",
-			command = Command(self.setValue, self.StatSel)
-			)
-		self.ClearStatSel_b.pack(side='right')
-
-		#verbosity buttons
-		self.RadButtons_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.RadButtons_fm.pack(side = 'top', pady=5, fill = 'x')
-
-		for text, value in self.VerbList:
-			Radiobutton(self.RadButtons_fm,
-				text=text,
-				value=value,
-				command=Command(self.ReadHdrs, None),
-				variable=self.VerbVar).pack(side='left', anchor='e')
-
-		Entry(self.RadButtons_fm,
-			width = self.e_width,
-			background = 'yellow',
-			relief = 'ridge',
-			textvariable = self.ByteOrder).pack(side='right', anchor='e')
-		Label(self.RadButtons_fm,
-				text="Header Endianess").pack(side='right', anchor='e')
-
-		#set up frames that get filled when traces are selected
-		self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth = 2)
-		self.HdrScale_fm.pack(side = 'bottom', padx= 5, pady=5, fill = 'x')
-
-		self.HdrSelect_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.HdrSelect_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		self.Hdrs_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.Hdrs_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-##################################################################
-	def buildBlockette(self,master):
-		"""
-		Populate Blockettes NoteBook
-		"""
-		self.Blockette_nb = master.add('Blockettes')
-
-		#these get filled when traces are selected
-		self.BlkScale_fm = Frame(self.Blockette_nb, borderwidth = 2)
-		self.BlkScale_fm.pack(side = 'bottom', padx= 5, pady=5, fill = 'x')
 
-		self.BlksSelect_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.BlksSelect_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		self.BlksTitle_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.BlksTitle_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		self.Blks_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.Blks_fm.pack(side = 'top', pady = 5, fill = 'x')
+    def buildHdrDisplay(self, master):
+        """
+        Populate HdrDisplay NoteBook
+        """
+        self.FixedHdr_nb = master.add('Trace Headers')
+
+        # data selection frame
+        self.DataDirs_fm = Frame(self.FixedHdr_nb, relief='groove',
+                                 borderwidth=2)
+        self.DataDirs_fm.pack(side='top', pady=5, fill='x')
+        self.DataDirs_l = Label(self.DataDirs_fm, text='Data Directories: ')
+        self.DataDirs_l.pack(side='left')
+        self.DataDirs_e = Entry(self.DataDirs_fm,
+                                selectbackground='yellow',
+                                textvariable=self.DataDirs)
+        self.DataDirs_e.pack(side='left', anchor='w', expand=1, fill='x')
+        self.ClearDataDir_b = Button(self.DataDirs_fm,
+                                     activebackground='orange',
+                                     relief="ridge",
+                                     text="Clear",
+                                     command=Command(self.setValue,
+                                                     self.DataDirs))
+        self.ClearDataDir_b.pack(side='right')
+        self.FindDataDir_b = Button(self.DataDirs_fm,
+                                    activebackground='green',
+                                    relief="ridge",
+                                    text="Find",
+                                    command=Command(self.getPath,
+                                                    self.DataDirs,
+                                                    None))
+        self.FindDataDir_b.pack(side='right')
+        self.DataDirs.set(getcwd())
+
+        self.BuildTrcList_b = Button(self.DataDirs_fm,
+                                     activebackground='green',
+                                     relief="ridge",
+                                     background='lightblue',
+                                     text="Build Trace db",
+                                     command=Command(self.BuildTrcList)
+                                     )
+        self.BuildTrcList_b.pack(side='right')
+
+        # station selection frame and entry box
+        self.StatSel_fm = Frame(self.FixedHdr_nb, relief='groove',
+                                borderwidth=2)
+        self.StatSel_fm.pack(side='top', pady=5, fill='x')
+        self.StatSel_l = Label(self.StatSel_fm,
+                               text='Find only stations (colon separated '
+                                    'list): ')
+        self.StatSel_l.pack(side='left')
+        self.StatSel_e = Entry(self.StatSel_fm,
+                               selectbackground='yellow',
+                               textvariable=self.StatSel)
+        self.StatSel_e.pack(side='left', anchor='w', expand=1, fill='x')
+
+        self.ClearStatSel_b = Button(self.StatSel_fm,
+                                     activebackground='orange',
+                                     relief="ridge",
+                                     text="Clear",
+                                     command=Command(self.setValue,
+                                                     self.StatSel))
+        self.ClearStatSel_b.pack(side='right')
+
+        # verbosity buttons
+        self.RadButtons_fm = Frame(
+            self.FixedHdr_nb, relief='groove', borderwidth=2)
+        self.RadButtons_fm.pack(side='top', pady=5, fill='x')
+
+        for text, value in self.VerbList:
+            Radiobutton(self.RadButtons_fm,
+                        text=text,
+                        value=value,
+                        command=Command(self.ReadHdrs, None),
+                        variable=self.VerbVar).pack(side='left', anchor='e')
+
+        Entry(self.RadButtons_fm,
+              width=self.e_width,
+              background='yellow',
+              relief='ridge',
+              textvariable=self.ByteOrder).pack(side='right', anchor='e')
+        Label(self.RadButtons_fm,
+              text="Header Endianess").pack(side='right', anchor='e')
+
+        # set up frames that get filled when traces are selected
+        self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth=2)
+        self.HdrScale_fm.pack(side='bottom', padx=5, pady=5, fill='x')
+
+        self.HdrSelect_fm = Frame(
+            self.FixedHdr_nb, relief='groove', borderwidth=2)
+        self.HdrSelect_fm.pack(side='top', pady=5, fill='x')
+
+        self.Hdrs_fm = Frame(self.FixedHdr_nb, relief='groove', borderwidth=2)
+        self.Hdrs_fm.pack(side='top', pady=5, fill='x')
 
 ##################################################################
-	def buildBlkInfo(self, blktype, master):
-		"""
-		Provide information window for blockettes
-		"""
-
-
-		try:
-			self.tl_State = self.BlkInfo_tl.winfo_exists()
-		except:
-			self.tl_State = 0
-
-		if self.tl_State == 1:
-			self.BlkInfo_tl.tkraise()
-			#display info on selected block
-			self.BlocketteType.set(blktype)
-			self.displayBlkInfo(blktype)
-
+    def buildBlockette(self, master):
+        """
+        Populate Blockettes NoteBook
+        """
+        self.Blockette_nb = master.add('Blockettes')
 
-		else:
-			self.BlkInfo_tl = Toplevel(master)
-			self.BlkInfo_tl.title("Blockette Information")
+        # these get filled when traces are selected
+        self.BlkScale_fm = Frame(self.Blockette_nb, borderwidth=2)
+        self.BlkScale_fm.pack(side='bottom', padx=5, pady=5, fill='x')
 
-			self.BlkInfoSelect_fm = Frame(self.BlkInfo_tl, relief = 'groove', borderwidth = 2)
-			self.BlkInfoSelect_fm.pack(side = 'top', pady = 5, fill = 'x')
+        self.BlksSelect_fm = Frame(
+            self.Blockette_nb, relief='groove', borderwidth=2)
+        self.BlksSelect_fm.pack(side='top', pady=5, fill='x')
 
-			List = ["Fixed Header","Data Fields","BTime",100,200,201,300,310,320,390,395,400,405,500,1000,1001,2000]
-			Label(self.BlkInfoSelect_fm, text="Blockette:").grid(row=1, sticky=W)
-			Pmw.ComboBox(self.BlkInfoSelect_fm,
-				history=0,
-				entry_width=self.e_width + 15,
-				entry_textvariable=self.BlocketteType,
-				selectioncommand=Command(self.displayBlkInfo),
-				scrolledlist_items=(List)
-				).grid(row=1, column=1, sticky=W)
+        self.BlksTitle_fm = Frame(
+            self.Blockette_nb, relief='groove', borderwidth=2)
+        self.BlksTitle_fm.pack(side='top', pady=5, fill='x')
 
+        self.Blks_fm = Frame(self.Blockette_nb, relief='groove', borderwidth=2)
+        self.Blks_fm.pack(side='top', pady=5, fill='x')
 
-
-			self.ExitBlkInfo_b = Button(self.BlkInfo_tl,
-				activebackground = 'red',
-				cursor = 'pirate',
-				background = 'lightblue',
-				text="Done",
-				command = Command(self.killWindow, self.BlkInfo_tl)
-				)
-			self.ExitBlkInfo_b.pack(side='bottom', fill='x', expand=1)
-
-			self.BlkInfoText = Pmw.ScrolledText(self.BlkInfo_tl,
-				borderframe=1)
-			self.BlkInfoText.pack(side='bottom', fill='both', expand=1)
-
-			#display info on selected block
-			self.BlocketteType.set(blktype)
-			self.displayBlkInfo(blktype)
+##################################################################
+    def buildBlkInfo(self, blktype, master):
+        """
+        Provide information window for blockettes
+        """
+
+        try:
+            self.tl_State = self.BlkInfo_tl.winfo_exists()
+        except Exception:
+            self.tl_State = 0
+
+        if self.tl_State == 1:
+            self.BlkInfo_tl.tkraise()
+            # display info on selected block
+            self.BlocketteType.set(blktype)
+            self.displayBlkInfo(blktype)
+
+        else:
+            self.BlkInfo_tl = Toplevel(master)
+            self.BlkInfo_tl.title("Blockette Information")
+
+            self.BlkInfoSelect_fm = Frame(
+                self.BlkInfo_tl, relief='groove', borderwidth=2)
+            self.BlkInfoSelect_fm.pack(side='top', pady=5, fill='x')
+
+            List = ["Fixed Header", "Data Fields", "BTime", 100, 200, 201,
+                    300, 310, 320, 390, 395, 400, 405, 500, 1000, 1001, 2000]
+            Label(self.BlkInfoSelect_fm, text="Blockette:").grid(row=1,
+                                                                 sticky=W)
+            Pmw.ComboBox(self.BlkInfoSelect_fm,
+                         history=0,
+                         entry_width=self.e_width + 15,
+                         entry_textvariable=self.BlocketteType,
+                         selectioncommand=Command(self.displayBlkInfo),
+                         scrolledlist_items=(List)
+                         ).grid(row=1, column=1, sticky=W)
+
+            self.ExitBlkInfo_b = Button(self.BlkInfo_tl,
+                                        activebackground='red',
+                                        cursor='pirate',
+                                        background='lightblue',
+                                        text="Done",
+                                        command=Command(self.killWindow,
+                                                        self.BlkInfo_tl))
+            self.ExitBlkInfo_b.pack(side='bottom', fill='x', expand=1)
+
+            self.BlkInfoText = Pmw.ScrolledText(self.BlkInfo_tl,
+                                                borderframe=1)
+            self.BlkInfoText.pack(side='bottom', fill='both', expand=1)
+
+            # display info on selected block
+            self.BlocketteType.set(blktype)
+            self.displayBlkInfo(blktype)
 
 ##################################################################
 
-	def buildUniqueSelectBox(self, master):
-		"""
-		In unique view allows user to select block to jump to
-		"""
-		if "*" not in self.UniqueSelectList:
-			self.UniqueSelectList.append("*")
-			self.UniqueSelectList.sort()
-		Label(master, text="Select Keys:").pack(side='top', anchor='w')
-
-		Pmw.ComboBox(master,
-			history=1,
-			entry_width=self.e_width+15,
-			entry_textvariable=self.UniqueSelect,
-			selectioncommand=Command(self.SelectKeys),
-			scrolledlist_items=self.UniqueSelectList
-			).pack(side='top', anchor='w')
-		self.UniqueSelect.set("*")
+    def buildUniqueSelectBox(self, master):
+        """
+        In unique view allows user to select block to jump to
+        """
+        if "*" not in self.UniqueSelectList:
+            self.UniqueSelectList.append("*")
+            self.UniqueSelectList.sort()
+        Label(master, text="Select Keys:").pack(side='top', anchor='w')
+
+        Pmw.ComboBox(master,
+                     history=1,
+                     entry_width=self.e_width + 15,
+                     entry_textvariable=self.UniqueSelect,
+                     selectioncommand=Command(self.SelectKeys),
+                     scrolledlist_items=self.UniqueSelectList
+                     ).pack(side='top', anchor='w')
+        self.UniqueSelect.set("*")
 
 ##################################################################
 
-	def buildJumpBox(self, master, numblocks=0):
-		"""
-		In unique view allows user to select block to jump to
-		"""
-		if self.VerbVar.get() == 3:
-			Label(master, text="Jump To Block #:").pack(side='top', anchor='w')
-		else:
-			Label(master, text="Jump To Block #:").pack(side='top', anchor='n')
-
-		jumpbox_cb=Pmw.ComboBox(master,
-			history=1,
-			entry_width=self.e_width,
-			entry_textvariable=self.JumpNum,
-			selectioncommand=Command(self.Jump),
-			scrolledlist_items=(list(range(numblocks)))
-			)
-		if self.VerbVar.get() == 3:
-			jumpbox_cb.pack(side='top', anchor='w')
-		else:
-			jumpbox_cb.pack(side='top', anchor='n')
+    def buildJumpBox(self, master, numblocks=0):
+        """
+        In unique view allows user to select block to jump to
+        """
+        if self.VerbVar.get() == 3:
+            Label(master, text="Jump To Block #:").pack(side='top', anchor='w')
+        else:
+            Label(master, text="Jump To Block #:").pack(side='top', anchor='n')
+
+        jumpbox_cb = Pmw.ComboBox(master,
+                                  history=1,
+                                  entry_width=self.e_width,
+                                  entry_textvariable=self.JumpNum,
+                                  selectioncommand=Command(self.Jump),
+                                  scrolledlist_items=(list(range(numblocks))))
+        if self.VerbVar.get() == 3:
+            jumpbox_cb.pack(side='top', anchor='w')
+        else:
+            jumpbox_cb.pack(side='top', anchor='n')
 
 ##################################################################
-	def Jump(self, value):
-		"""
-		Fills hdr values based on block selected in JumpBox
-		"""
-		if int(value) < 0: value=0
-		if int(value) > (self.NumBlocks.get() - 1): value= self.NumBlocks.get() - 1
-		self.BlockNum.set(value)
-		if self.VerbVar.get() == 3:
-			self.VerbVar.set(2)
-		self.ReadHdrs()
-		self.FillHdr(value)
+    def Jump(self, value):
+        """
+        Fills hdr values based on block selected in JumpBox
+        """
+        if int(value) < 0:
+            value = 0
+        if int(value) > (self.NumBlocks.get() - 1):
+            value = self.NumBlocks.get() - 1
+        self.BlockNum.set(value)
+        if self.VerbVar.get() == 3:
+            self.VerbVar.set(2)
+        self.ReadHdrs()
+        self.FillHdr(value)
 
 ##################################################################
-	def SelectKeys(self, value):
-		"""
-		Fills hdr values based on block selected in JumpBox
-		"""
-		self.UniqueText.clear()
-		self.UniqueText.tag_config("list", foreground="blue")
-		self.UniqueText.tag_config("odd", backgroun="lightblue")
-
-		self.UniqueText.insert("end", "Block\tStat\tChan\tLoc\tNet\tRate\n", "list")
-
-		selectkey=self.UniqueSelect.get()
-		c=0
-		for key in self.UniqueList:
-			testkey=key.split(":")[1:].join(":")
-			if not selectkey == "*":
-				if selectkey != testkey: continue
-			for var in key.split(":"):
-				if c :
-					self.UniqueText.insert("end", """%s\t""" % var, "odd")
-				else :
-					self.UniqueText.insert("end", """%s\t""" % var)
-			self.UniqueText.insert("end", """\n""")
-			if c :
-				c=0
-			else :
-				c+=1
+    def SelectKeys(self, value):
+        """
+        Fills hdr values based on block selected in JumpBox
+        """
+        self.UniqueText.clear()
+        self.UniqueText.tag_config("list", foreground="blue")
+        self.UniqueText.tag_config("odd", backgroun="lightblue")
+
+        self.UniqueText.insert(
+            "end", "Block\tStat\tChan\tLoc\tNet\tRate\n", "list")
+
+        selectkey = self.UniqueSelect.get()
+        c = 0
+        for key in self.UniqueList:
+            testkey = key.split(":")[1:].join(":")
+            if selectkey != "*":
+                if selectkey != testkey:
+                    continue
+            for var in key.split(":"):
+                if c:
+                    self.UniqueText.insert("end", """%s\t""" % var, "odd")
+                else:
+                    self.UniqueText.insert("end", """%s\t""" % var)
+            self.UniqueText.insert("end", """\n""")
+            if c:
+                c = 0
+            else:
+                c += 1
 ##########################################
-	def UpdateDirList(self,fm):
-		"""
-		build dropdown for selecting data filled directories
-		"""
-		self.DirList=list(self.TraceListDict.keys())
-
-		self.DirList.sort()
-		self.SelDir.set("")
-		if not self.DirList:
-			self.root.bell()
-			self.addTextInfoBar(self.InfoString_l, "No Data Found", 'orange')
-
-		else:
-			Label(fm, text="Directory:").grid(row=0, sticky=W)
-			Pmw.ComboBox(fm,
-				history=0,
-				entry_width=self.e_width + 40,
-				entry_textvariable=self.SelDir,
-				selectioncommand=Command(self.UpdateTrcList),
-				scrolledlist_items=(self.DirList)
-				).grid(row=0, column=1, sticky=W)
 
-##################################################################
+    def UpdateDirList(self, fm):
+        """
+        build dropdown for selecting data filled directories
+        """
+        self.DirList = list(self.TraceListDict.keys())
+
+        self.DirList.sort()
+        self.SelDir.set("")
+        if not self.DirList:
+            self.root.bell()
+            self.addTextInfoBar(self.InfoString_l, "No Data Found", 'orange')
+
+        else:
+            Label(fm, text="Directory:").grid(row=0, sticky=W)
+            Pmw.ComboBox(fm,
+                         history=0,
+                         entry_width=self.e_width + 40,
+                         entry_textvariable=self.SelDir,
+                         selectioncommand=Command(self.UpdateTrcList),
+                         scrolledlist_items=(self.DirList)
+                         ).grid(row=0, column=1, sticky=W)
 
-	def UpdateTrcList(self, name=""):
-		"""
-		create dropdown file list based on selected directory
-		"""
-		self.MseedFile.set("")
-		self.TraceList=self.TraceListDict[self.SelDir.get()]
-		self.TraceList.sort()
-		self.ClearAll(self.VeryVerboseVars)
-		if not self.TraceList:
-			self.root.bell()
-			self.addTextInfoBar(self.InfoString_l, "No Data Found", 'orange')
-
-		Label(self.HdrSelect_fm, text="Trace:").grid(row=1, sticky=W)
-		Pmw.ComboBox(self.HdrSelect_fm,
-			history=0,
-			entry_width=self.e_width + 40,
-			entry_textvariable=self.MseedFile,
-			selectioncommand=Command(self.ReadHdrs),
-			scrolledlist_items=(self.TraceList)
-			).grid(row=1, column=1, sticky=W)
+##################################################################
 
+    def UpdateTrcList(self, name=""):
+        """
+        create dropdown file list based on selected directory
+        """
+        self.MseedFile.set("")
+        self.TraceList = self.TraceListDict[self.SelDir.get()]
+        self.TraceList.sort()
+        self.ClearAll(self.VeryVerboseVars)
+        if not self.TraceList:
+            self.root.bell()
+            self.addTextInfoBar(self.InfoString_l, "No Data Found", 'orange')
+
+        Label(self.HdrSelect_fm, text="Trace:").grid(row=1, sticky=W)
+        Pmw.ComboBox(self.HdrSelect_fm,
+                     history=0,
+                     entry_width=self.e_width + 40,
+                     entry_textvariable=self.MseedFile,
+                     selectioncommand=Command(self.ReadHdrs),
+                     scrolledlist_items=(self.TraceList)
+                     ).grid(row=1, column=1, sticky=W)
 
 #######################################
-	def BuildTrcList(self):
-		"""
-		build a trace list using DataDirList as base directories
-		"""
-		self.addTextInfoBar(self.InfoString_l)
-
-		self.ByteOrder.set("")
-		DataDirList = []
-		self.StatSelList = []
-		n=0
-		for idir in self.DataDirs.get().split(":") :
-			dirlist=glob(idir)
-			for newdir in dirlist:
-				if not path.isdir(newdir):
-					err="***WARNING*** Directory " + newdir + " not found."
-					self.root.bell()
-					self.addTextInfoBar(self.InfoString_l, err, "red")
-					return
-				DataDirList.append(newdir)
-
-		# split station select list if it exists
-		if self.StatSel.get() == "*" or self.StatSel.get() == "":
-			pass
-		else:
-			for statsel in str(self.StatSel.get()).split(":") :
-				statsel=statsel.strip()
-				self.StatSelList.append(statsel)
-
-		(self.TraceListDict, NumFiles, errfiles) = self.FindTrace(DataDirList)
-		self.UpdateDirList(self.HdrSelect_fm)
-
-		#clear any lingering updates
-		self.MseedFile.set("")
-		self.ClearAll(self.VeryVerboseVars)
-		self.Hdrs_fm.destroy()
-		self.Blks_fm.destroy()
-
-
-		self.root.bell()
-		text= "Done. " + str(NumFiles) + " mseed files found. ***" \
-		    + str(errfiles) + " files with errors."
-		self.addTextInfoBar(self.InfoString_l, text, "green")
+
+    def BuildTrcList(self):
+        """
+        build a trace list using DataDirList as base directories
+        """
+        self.addTextInfoBar(self.InfoString_l)
+
+        self.ByteOrder.set("")
+        DataDirList = []
+        self.StatSelList = []
+        for idir in self.DataDirs.get().split(":"):
+            dirlist = glob(idir)
+            for newdir in dirlist:
+                if not path.isdir(newdir):
+                    err = "***WARNING*** Directory " + newdir + " not found."
+                    self.root.bell()
+                    self.addTextInfoBar(self.InfoString_l, err, "red")
+                    return
+                DataDirList.append(newdir)
+
+        # split station select list if it exists
+        if self.StatSel.get() == "*" or self.StatSel.get() == "":
+            pass
+        else:
+            for statsel in str(self.StatSel.get()).split(":"):
+                statsel = statsel.strip()
+                self.StatSelList.append(statsel)
+
+        (self.TraceListDict, NumFiles, errfiles) = self.FindTrace(DataDirList)
+        self.UpdateDirList(self.HdrSelect_fm)
+
+        # clear any lingering updates
+        self.MseedFile.set("")
+        self.ClearAll(self.VeryVerboseVars)
+        self.Hdrs_fm.destroy()
+        self.Blks_fm.destroy()
+
+        self.root.bell()
+        text = "Done. " + str(NumFiles) + " mseed files found. ***" \
+            + str(errfiles) + " files with errors."
+        self.addTextInfoBar(self.InfoString_l, text, "green")
 
 #######################################
 
-	def FindTrace(self, DataDir) :
-		"""
-		based on traverse routine in "python standard library", Lundh pg 34
-		"""
-		stack = []
-		for k in range(len(DataDir)) :
-			stack.append(DataDir[k])
-		file_list = {}
-		NumMseedFiles=0
-		rwError=0
-		cnt=1
-		while stack :
-			directory = stack.pop()
-			if not path.isdir(directory):
-				print("\n***WARNING*** Directory \"%s\" not found.\n" % directory)
-				continue
-
-			try:
-				listfiles = listdir(directory)
-			except Exception as e:
-				print("Directory Read Error: %s" % e)
-
-			for ifile in listfiles:
-				if mod(cnt, 25):
-					pass
-				else:
-					self.wait("Examining File: ", cnt)
-				fullname = path.join(directory, ifile)
-				if path.isfile(fullname) :
-					if not os.access(fullname, 6):
-						err= "ERROR: Read/Write permission denied."
-						err1="\t File: " + fullname
-						print(err)
-						print(err1)
-						rwError+=1
-						continue
-					try:
-						msfile = Mseed(fullname)
-						if msfile.isMseed() :
-							try:
-								#simple test to determine if correct size file
-								filesize=msfile.filesize
-								blksize=msfile.blksize
-								(numblocks, odd_size)=divmod(filesize, blksize)
-								if odd_size:
-									warn="ERROR: File size is not an integer number of block size ("\
-									   + str(blksize) +"). \n\t File: " + fullname
-									print(warn)
-									rwError+=1
-									continue
-							except:
-								err= "ERROR: Cannot determine file and block sizes. \n\t File:" + fullname
-								print(err)
-								rwError+=1
-								continue
-							NumMseedFiles+=1
-							stat=msfile.FH.Stat.strip()
-
-							if self.StatSelList:
-								if not stat in self.StatSelList:
-									continue
-
-							if directory in file_list :
-								file_list[directory].append(ifile)
-							else :
-								file_list[directory] = []
-								file_list[directory].append(ifile)
-						msfile.close()
-					except Exception as e:
-						rwError+=1
-						print("File Open Error: %s" % fullname, e)
-				cnt+=1
-
-				if path.isdir(fullname) or (path.islink(fullname) and not path.isfile(fullname)):
-					stack.append(fullname)
-
-		return file_list, NumMseedFiles, rwError
+    def FindTrace(self, DataDir):
+        """
+        based on traverse routine in "python standard library", Lundh pg 34
+        """
+        stack = []
+        for k in range(len(DataDir)):
+            stack.append(DataDir[k])
+        file_list = {}
+        NumMseedFiles = 0
+        rwError = 0
+        cnt = 1
+        while stack:
+            directory = stack.pop()
+            if not path.isdir(directory):
+                print("\n***WARNING*** Directory \"%s\" not found.\n" %
+                      directory)
+                continue
+
+            try:
+                listfiles = listdir(directory)
+            except Exception as e:
+                print("Directory Read Error: %s" % e)
+
+            for ifile in listfiles:
+                if mod(cnt, 25):
+                    pass
+                else:
+                    self.wait("Examining File: ", cnt)
+                fullname = path.join(directory, ifile)
+                if path.isfile(fullname):
+                    if not os.access(fullname, 6):
+                        err = "ERROR: Read/Write permission denied."
+                        err1 = "\t File: " + fullname
+                        print(err)
+                        print(err1)
+                        rwError += 1
+                        continue
+                    try:
+                        msfile = Mseed(fullname)
+                        if msfile.isMseed():
+                            try:
+                                # simple test to determine if correct size file
+                                filesize = msfile.filesize
+                                blksize = msfile.blksize
+                                (numblocks, odd_size) = divmod(
+                                    filesize, blksize)
+                                if odd_size:
+                                    warn = ("ERROR: File size is not an "
+                                            " integer number of block size (" +
+                                            str(blksize) + "). \n\t File: " +
+                                            fullname)
+                                    print(warn)
+                                    rwError += 1
+                                    continue
+                            except Exception:
+                                err = ("ERROR: Cannot determine file and "
+                                       "block sizes. \n\t File:" + fullname)
+                                print(err)
+                                rwError += 1
+                                continue
+                            NumMseedFiles += 1
+                            stat = msfile.FH.Stat.strip()
+
+                            if self.StatSelList:
+                                if stat not in self.StatSelList:
+                                    continue
+
+                            if directory in file_list:
+                                file_list[directory].append(ifile)
+                            else:
+                                file_list[directory] = []
+                                file_list[directory].append(ifile)
+                        msfile.close()
+                    except Exception as e:
+                        rwError += 1
+                        print("File Open Error: %s" % fullname, e)
+                cnt += 1
+
+                if (path.isdir(fullname) or (path.islink(fullname) and
+                                             not path.isfile(fullname))):
+                    stack.append(fullname)
+
+        return file_list, NumMseedFiles, rwError
 
 #######################################
 
-	def IndexFiles(self, ListInFiles) :
-		"""
-		based on traverse routine in "python standard library", Lundh pg 34
-		"""
-		file_list = {}
-		cnt=1
-		NumMseedFiles=0
-		directory=getcwd()
-		self.DataDirs.set(getcwd())
-		for ifile in ListInFiles:
-			if mod(cnt, 25):
-				pass
-			else:
-				self.wait("Examining File: ", cnt)
-			fullname = path.join(directory, ifile)
-			if path.isfile(fullname) :
-				try:
-					newfile = Mseed(fullname)
-					if newfile.isMseed() :
-						stat=newfile.FH.Stat.strip()
-						if self.StatSelList:
-							if not stat in self.StatSelList:
-								continue
-
-						NumMseedFiles+=1
-						if directory in file_list :
-							file_list[directory].append(ifile)
-						else :
-							file_list[directory] = []
-							file_list[directory].append(ifile)
-					newfile.close()
-				except Exception as e:
-					print("File Open Error: %s" % e)
-			cnt+=1
-
-		return file_list, NumMseedFiles
+    def IndexFiles(self, ListInFiles):
+        """
+        based on traverse routine in "python standard library", Lundh pg 34
+        """
+        file_list = {}
+        cnt = 1
+        NumMseedFiles = 0
+        directory = getcwd()
+        self.DataDirs.set(getcwd())
+        for ifile in ListInFiles:
+            if mod(cnt, 25):
+                pass
+            else:
+                self.wait("Examining File: ", cnt)
+            fullname = path.join(directory, ifile)
+            if path.isfile(fullname):
+                try:
+                    newfile = Mseed(fullname)
+                    if newfile.isMseed():
+                        stat = newfile.FH.Stat.strip()
+                        if self.StatSelList:
+                            if stat not in self.StatSelList:
+                                continue
+
+                        NumMseedFiles += 1
+                        if directory in file_list:
+                            file_list[directory].append(ifile)
+                        else:
+                            file_list[directory] = []
+                            file_list[directory].append(ifile)
+                    newfile.close()
+                except Exception as e:
+                    print("File Open Error: %s" % e)
+            cnt += 1
+
+        return file_list, NumMseedFiles
 #######################################
-	def ReadHdrs(self, ifile=""):
-		"""
-		read headers of a given file build dictionary for quick access
-		"""
-
-		#this is a bit of a hack, but I am unable to pass self.MseedFile.get()
-		#from buildHdrDisplay:Radiobutton:command
-		if not ifile:
-			ifile=self.MseedFile.get()
-			#if someone changes VerbVar before selecting file do nothing
-			if not ifile:
-				return
-
-		FileAbsolutePath = path.join(self.SelDir.get(), ifile)
-
-		#create object (we've already tested all files for mseed)
-		#and get some base info
-		rdfile=Mseed(FileAbsolutePath)
-		if rdfile.isMseed():
-			try:
-				filesize=rdfile.filesize
-				blksize=rdfile.blksize
-			except:
-				self.ClearAll(self.VeryVerboseVars)
-				self.Hdrs_fm.destroy()
-				self.HdrScale_fm.destroy()
-				self.BlkScale_fm.destroy()
-				self.BlksSelect_fm.destroy()
-				self.BlksTitle_fm.destroy()
-				self.Blks_fm.destroy()
-				err= "Cannot determine file and block sizes. File: " + ifile
-				self.addTextInfoBar(self.InfoString_l, err, 'red')
-				rdfile.close()
-				return
-		else:
-			return
-
-		#initialize variables, lists, and dicts for later
-		self.BlkSize.set(blksize)
-		(numblocks, self.odd_size)=divmod(filesize, blksize)
-		self.NumBlocks.set(numblocks)
-		verbose=self.VerbVar.get()
-		if not self.OldMseedFile.get() or self.OldMseedFile.get() != FileAbsolutePath:
-			self.FixedHdrDict={}
-			self.RateDict={}
-			self.Blockettes={}
-			self.keyList=[]
-			self.UniqueList=[]
-			self.UniqueSelectList=[]
-			n=0
-
-			#now build a dictionary of all fixed header info keyed to block number
-			#looping over total number of blocks in files
-			lastkey = -1
-			while n < numblocks:
-
-				hdrs=rdfile.fixedhdr(n*blksize)
-				position = rdfile.where() - 48
-				self.FixedHdrDict[n]=hdrs
-# 				fact=hdrs[2][1]
-# 				mult=hdrs[2][2]
-#				self.RateDict[n]=rdfile.calcrate(mult,fact)
-				self.RateDict[n]=rdfile.rate
-
-				#if unique selected build unique list
-#				if verbose == 3:
-				(SeqNum, DHQual, res, Stat, Loc, Chan, Net)=hdrs[0]
-				Rate=str(self.RateDict[n])
-				Stat=Stat.strip()
-				Chan=Chan.strip()
-				Loc=Loc.strip(Loc)
-				Net=Net.strip(Net)
-				key=str(Stat) + ":" + str(Chan) + ":" + str(Loc) + ":" + str(Net) + ":" + str(Rate)
-#				if key in self.keyList:
-				if key == lastkey:
-					pass
-				else:
-#					self.keyList.append(key)
-					lastkey = key
-					if key not in self.UniqueSelectList:
-						self.UniqueSelectList.append(key)
-					key= str(n) + ":" + key
-					self.UniqueList.append(key)
-
-				#build Blockette dictionary keyed to block number
-				numblk=hdrs[3][3]
-				addseek=hdrs[3][6]
-				b=0
-			#loop over number of blockettes following fixed header at block n
-				while b < numblk:
-					seekval=(n*blksize)+addseek
-					(blktype, next)=rdfile.typenxt(seekval)
-					#builds command to read specific blockette
-					#getBlkCmd="blklist=rdfile.blk" + str(blktype) + "(" + str(seekval) + ")"
-					blklist = eval("rdfile.blk" + str(blktype) + "(" + str(seekval) + ")")
-					if blklist :
-						#handle awkward lists w/ muli-byte reserve, array, or calib fields
-						if blklist[0] == 100:
-							tmplist=blklist[:4]
-							tup=blklist[4:]
-							tmplist.append(tup)
-							blklist=tmplist
-						if blklist[0] == 201:
-							tmplist=blklist[:8]
-							tup=blklist[8:13]
-							for new in tup, blklist[14], blklist[15], blklist[16]:
-								tmplist.append(new)
-							blklist=tmplist
-						if blklist[0] == 400:
-							tmplist=blklist[:5]
-							tup=blklist[5:]
-							tmplist.append(tup)
-							blklist=tmplist
-						#build Blockettes
-						if n in self.Blockettes:
-							self.Blockettes[n].append(blklist)
-						else:
-							self.Blockettes[n] = []
-							self.Blockettes[n].append(blklist)
-
-					addseek=next
-					b+=1
-				n+=1
-		#get endianess before closing
-		self.ByteOrder.set(rdfile.byteorder)
-		rdfile.close()
-
-
-		#if unique proceed, else set up scales and entry fields.
-		if verbose == 3:
-			self.Unique(numblocks)
-		else:
-			try:
-				self.HdrScale_fm.destroy()
-				self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth = 2)
-				self.HdrScale_fm.pack(side = 'bottom', padx= 5, pady=5, fill = 'x')
-				self.BlkScale_fm.destroy()
-				self.BlkScale_fm = Frame(self.Blockette_nb, borderwidth = 2)
-				self.BlkScale_fm.pack(side = 'bottom', padx= 5, pady=5, fill = 'x')
-			except:
-				pass
-			self.buildJumpBox(self.HdrScale_fm, numblocks)
-
-			tick=numblocks/6
-			if FileAbsolutePath != self.OldMseedFile.get():
-				self.BlockNum.set(0)
-				self.JumpNum.set(0)
-
-			Label(self.HdrScale_fm, text='Block Number').pack(side='left', anchor='w')
-
-			Scale(self.HdrScale_fm,
-				variable=self.BlockNum,
-				length=625,
-				orient='horizontal',
-				from_ = 0,
-				to = numblocks-1,
-				tickinterval=numblocks/6,
-				command=Command(self.FillHdr)
-				).pack(side='left', anchor='w')
-
-			Label(self.BlkScale_fm, text='Block Number').pack(side='left', anchor='w')
-			Scale(self.BlkScale_fm,
-				variable=self.BlockNum,
-				length=625,
-				orient='horizontal',
-				from_ = 0,
-				to = numblocks-1,
-				tickinterval=numblocks/6,
-				command=Command(self.FillHdr)
-				).pack(side='left', anchor='w')
-
-			self.SetBlockettes(0)
-			if not verbose:
-				self.Standard(0, 1)
-			elif verbose == 1:
-				self.Verbose(0, 1)
-			elif verbose == 2:
-				self.VeryVerbose(0, 1)
-
-		self.OldMseedFile.set(FileAbsolutePath)
+
+    def ReadHdrs(self, ifile=""):
+        """
+        read headers of a given file build dictionary for quick access
+        """
+
+        # this is a bit of a hack, but I am unable to pass self.MseedFile.get()
+        # from buildHdrDisplay:Radiobutton:command
+        if not ifile:
+            ifile = self.MseedFile.get()
+            # if someone changes VerbVar before selecting file do nothing
+            if not ifile:
+                return
+
+        FileAbsolutePath = path.join(self.SelDir.get(), ifile)
+
+        # create object (we've already tested all files for mseed)
+        # and get some base info
+        rdfile = Mseed(FileAbsolutePath)
+        if rdfile.isMseed():
+            try:
+                filesize = rdfile.filesize
+                blksize = rdfile.blksize
+            except Exception:
+                self.ClearAll(self.VeryVerboseVars)
+                self.Hdrs_fm.destroy()
+                self.HdrScale_fm.destroy()
+                self.BlkScale_fm.destroy()
+                self.BlksSelect_fm.destroy()
+                self.BlksTitle_fm.destroy()
+                self.Blks_fm.destroy()
+                err = "Cannot determine file and block sizes. File: " + ifile
+                self.addTextInfoBar(self.InfoString_l, err, 'red')
+                rdfile.close()
+                return
+        else:
+            return
+
+        # initialize variables, lists, and dicts for later
+        self.BlkSize.set(blksize)
+        (numblocks, self.odd_size) = divmod(filesize, blksize)
+        self.NumBlocks.set(numblocks)
+        verbose = self.VerbVar.get()
+        if not self.OldMseedFile.get() or \
+           self.OldMseedFile.get() != FileAbsolutePath:
+            self.FixedHdrDict = {}
+            self.RateDict = {}
+            self.Blockettes = {}
+            self.keyList = []
+            self.UniqueList = []
+            self.UniqueSelectList = []
+            n = 0
+
+            # now build a dictionary of all fixed header info keyed to block
+            # number looping over total number of blocks in files
+            lastkey = -1
+            while n < numblocks:
+
+                hdrs = rdfile.fixedhdr(n * blksize)
+                self.FixedHdrDict[n] = hdrs
+                # fact=hdrs[2][1]
+                # mult=hdrs[2][2]
+                # self.RateDict[n]=rdfile.calcrate(mult,fact)
+                self.RateDict[n] = rdfile.rate
+
+                # if unique selected build unique list
+                # if verbose == 3:
+                (SeqNum, DHQual, res, Stat, Loc, Chan, Net) = hdrs[0]
+                Rate = str(self.RateDict[n])
+                Stat = Stat.strip()
+                Chan = Chan.strip()
+                Loc = Loc.strip(Loc)
+                Net = Net.strip(Net)
+                key = str(Stat) + ":" + str(Chan) + ":" + \
+                    str(Loc) + ":" + str(Net) + ":" + str(Rate)
+                # if key in self.keyList:
+                if key == lastkey:
+                    pass
+                else:
+                    # self.keyList.append(key)
+                    lastkey = key
+                    if key not in self.UniqueSelectList:
+                        self.UniqueSelectList.append(key)
+                    key = str(n) + ":" + key
+                    self.UniqueList.append(key)
+
+                # build Blockette dictionary keyed to block number
+                numblk = hdrs[3][3]
+                addseek = hdrs[3][6]
+                b = 0
+                # loop over number of blockettes following fixed header at
+                # block n
+                while b < numblk:
+                    seekval = (n * blksize) + addseek
+                    (blktype, next) = rdfile.typenxt(seekval)
+                    # builds command to read specific blockette
+                    # getBlkCmd="blklist=rdfile.blk" + str(blktype) + \
+                    #           "(" + str(seekval) + ")"
+                    blklist = eval("rdfile.blk" + str(blktype) +
+                                   "(" + str(seekval) + ")")
+                    if blklist:
+                        # handle awkward lists w/ muli-byte reserve, array, or
+                        # calib fields
+                        if blklist[0] == 100:
+                            tmplist = blklist[:4]
+                            tup = blklist[4:]
+                            tmplist.append(tup)
+                            blklist = tmplist
+                        if blklist[0] == 201:
+                            tmplist = blklist[:8]
+                            tup = blklist[8:13]
+                            for new in (tup, blklist[14], blklist[15],
+                                        blklist[16]):
+                                tmplist.append(new)
+                            blklist = tmplist
+                        if blklist[0] == 400:
+                            tmplist = blklist[:5]
+                            tup = blklist[5:]
+                            tmplist.append(tup)
+                            blklist = tmplist
+                        # build Blockettes
+                        if n in self.Blockettes:
+                            self.Blockettes[n].append(blklist)
+                        else:
+                            self.Blockettes[n] = []
+                            self.Blockettes[n].append(blklist)
+
+                    addseek = next
+                    b += 1
+                n += 1
+        # get endianess before closing
+        self.ByteOrder.set(rdfile.byteorder)
+        rdfile.close()
+
+        # if unique proceed, else set up scales and entry fields.
+        if verbose == 3:
+            self.Unique(numblocks)
+        else:
+            try:
+                self.HdrScale_fm.destroy()
+                self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth=2)
+                self.HdrScale_fm.pack(side='bottom', padx=5, pady=5, fill='x')
+                self.BlkScale_fm.destroy()
+                self.BlkScale_fm = Frame(self.Blockette_nb, borderwidth=2)
+                self.BlkScale_fm.pack(side='bottom', padx=5, pady=5, fill='x')
+            except Exception:
+                pass
+            self.buildJumpBox(self.HdrScale_fm, numblocks)
+
+            if FileAbsolutePath != self.OldMseedFile.get():
+                self.BlockNum.set(0)
+                self.JumpNum.set(0)
+
+            Label(self.HdrScale_fm, text='Block Number').pack(
+                side='left', anchor='w')
+
+            Scale(self.HdrScale_fm,
+                  variable=self.BlockNum,
+                  length=625,
+                  orient='horizontal',
+                  from_=0,
+                  to=numblocks - 1,
+                  tickinterval=numblocks / 6,
+                  command=Command(self.FillHdr)
+                  ).pack(side='left', anchor='w')
+
+            Label(self.BlkScale_fm, text='Block Number').pack(
+                side='left', anchor='w')
+            Scale(self.BlkScale_fm,
+                  variable=self.BlockNum,
+                  length=625,
+                  orient='horizontal',
+                  from_=0,
+                  to=numblocks - 1,
+                  tickinterval=numblocks / 6,
+                  command=Command(self.FillHdr)
+                  ).pack(side='left', anchor='w')
+
+            self.SetBlockettes(0)
+            if not verbose:
+                self.Standard(0, 1)
+            elif verbose == 1:
+                self.Verbose(0, 1)
+            elif verbose == 2:
+                self.VeryVerbose(0, 1)
+
+        self.OldMseedFile.set(FileAbsolutePath)
 
 #######################################
-	def SetBlockettes(self, key):
-		"""
-		setup blockette frames for new key entry
-		"""
-		self.BlockettesList=[]
-		for blk in self.Blockettes[key]:
-			self.BlockettesList.append(blk[0])
-		self.BlockettesList.sort()
-		self.Blockette.set(self.BlockettesList[0])
-
-		self.BlksSelect_fm.destroy()
-		self.BlksSelect_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.BlksSelect_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		Label(self.BlksSelect_fm, text="Blockette:").grid(row=1, sticky=W)
-		Pmw.ComboBox(self.BlksSelect_fm,
-			history=0,
-			entry_width=self.e_width,
-			entry_textvariable=self.Blockette,
-			selectioncommand=Command(self.FillSelectBlk, key),
-			scrolledlist_items=(self.BlockettesList)
-			).grid(row=1, column=1, sticky=W)
+    def SetBlockettes(self, key):
+        """
+        setup blockette frames for new key entry
+        """
+        self.BlockettesList = []
+        for blk in self.Blockettes[key]:
+            self.BlockettesList.append(blk[0])
+        self.BlockettesList.sort()
+        self.Blockette.set(self.BlockettesList[0])
+
+        self.BlksSelect_fm.destroy()
+        self.BlksSelect_fm = Frame(
+            self.Blockette_nb, relief='groove', borderwidth=2)
+        self.BlksSelect_fm.pack(side='top', pady=5, fill='x')
+
+        Label(self.BlksSelect_fm, text="Blockette:").grid(row=1, sticky=W)
+        Pmw.ComboBox(self.BlksSelect_fm,
+                     history=0,
+                     entry_width=self.e_width,
+                     entry_textvariable=self.Blockette,
+                     selectioncommand=Command(self.FillSelectBlk, key),
+                     scrolledlist_items=(self.BlockettesList)
+                     ).grid(row=1, column=1, sticky=W)
 
 # fill blockette info for first blockette found
-		self.FillSelectBlk(key, self.BlockettesList[0])
+        self.FillSelectBlk(key, self.BlockettesList[0])
 
 #######################################
-	def VarInit(self, Vars):
-		"""
-		clears/initializes entry fields on HdrDisplay
-		"""
-
-		self.Hdrs_fm.destroy()
-		self.Hdrs_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.Hdrs_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		c=r=n=0
-		for var in Vars:
-			Label(self.Hdrs_fm, text=var[0]).grid(row=r, column=c, sticky=W)
-			Entry(self.Hdrs_fm,
-				width = self.e_width,
-				selectbackground = 'yellow',
-				textvariable = var[1]).grid(row=r, column=c+1, sticky=W)
-			if n == 5:
-				n=r=0
-				c+=2
-			else:
-				n+=1
-				r+=1
+    def VarInit(self, Vars):
+        """
+        clears/initializes entry fields on HdrDisplay
+        """
+
+        self.Hdrs_fm.destroy()
+        self.Hdrs_fm = Frame(self.FixedHdr_nb, relief='groove', borderwidth=2)
+        self.Hdrs_fm.pack(side='top', pady=5, fill='x')
+
+        c = r = n = 0
+        for var in Vars:
+            Label(self.Hdrs_fm, text=var[0]).grid(row=r, column=c, sticky=W)
+            Entry(self.Hdrs_fm,
+                  width=self.e_width,
+                  selectbackground='yellow',
+                  textvariable=var[1]).grid(row=r, column=c + 1, sticky=W)
+            if n == 5:
+                n = r = 0
+                c += 2
+            else:
+                n += 1
+                r += 1
 
 #######################################
-	def Unique(self, numblocks=0):
-		"""
-		setup hdr frames for new unique display
-		"""
-		self.ClearAll(self.VeryVerboseVars)
-		self.Hdrs_fm.destroy()
-		self.Hdrs_fm = Frame(self.FixedHdr_nb, relief = 'groove', borderwidth = 2)
-		self.Hdrs_fm.pack(side = 'top', pady = 5, fill = 'x')
-		self.HdrScale_fm.destroy()
-		self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth = 2)
-		self.HdrScale_fm.pack(side = 'bottom', padx= 5, pady=5, fill = 'x')
-		self.buildUniqueSelectBox(self.Hdrs_fm)
-		self.buildJumpBox(self.Hdrs_fm, numblocks)
-
-		self.FillUnique()
+    def Unique(self, numblocks=0):
+        """
+        setup hdr frames for new unique display
+        """
+        self.ClearAll(self.VeryVerboseVars)
+        self.Hdrs_fm.destroy()
+        self.Hdrs_fm = Frame(self.FixedHdr_nb, relief='groove', borderwidth=2)
+        self.Hdrs_fm.pack(side='top', pady=5, fill='x')
+        self.HdrScale_fm.destroy()
+        self.HdrScale_fm = Frame(self.FixedHdr_nb, borderwidth=2)
+        self.HdrScale_fm.pack(side='bottom', padx=5, pady=5, fill='x')
+        self.buildUniqueSelectBox(self.Hdrs_fm)
+        self.buildJumpBox(self.Hdrs_fm, numblocks)
+
+        self.FillUnique()
 
 #######################################
-	def Standard(self, key, init=0):
-		"""
-		setup standard vars for new key entry
-		"""
-		if init:
-			self.VarInit(self.StandardVars)
+    def Standard(self, key, init=0):
+        """
+        setup standard vars for new key entry
+        """
+        if init:
+            self.VarInit(self.StandardVars)
 
-		self.FillStandard(key)
+        self.FillStandard(key)
 
 #######################################
-	def Verbose(self, key, init=0):
-		"""
-		setup verbose vars for new key entry
-		"""
+    def Verbose(self, key, init=0):
+        """
+        setup verbose vars for new key entry
+        """
 
-		if init:
-			self.VarInit(self.VerboseVars)
+        if init:
+            self.VarInit(self.VerboseVars)
 
-		self.FillVerbose(key)
+        self.FillVerbose(key)
 
 #######################################
-	def VeryVerbose(self, key, init=0):
-		"""
-		setup very verbose vars for new key entry
-		"""
+    def VeryVerbose(self, key, init=0):
+        """
+        setup very verbose vars for new key entry
+        """
 
-		if init:
-			self.VarInit(self.VeryVerboseVars)
+        if init:
+            self.VarInit(self.VeryVerboseVars)
 
-		self.FillVeryVerbose(key)
+        self.FillVeryVerbose(key)
 
 #######################################
-	def FillHdr(self, value):
-		"""
-		fill header field on page based on block number
-		"""
-		key = int(value)
-		self.JumpNum.set(value)
-		self.ByteOffset.set(self.BlockNum.get()*self.BlkSize.get())
-		verbose=self.VerbVar.get()
-		self.SetBlockettes(key)
-		if not verbose:
-			self.Standard(key)
-		elif verbose == 1:
-			self.Verbose(key)
-		elif verbose == 2:
-			self.VeryVerbose(key)
-
-		if self.odd_size:
-			info="WARNING: File size is not an integer number of block size (" + str(self.BlkSize.get()) +")"
-			self.addTextInfoBar(self.InfoString_l, info, "orange")
-			self.odd_size=0
-		else:
-			info="Byte Offset: " + str(self.BlockNum.get()*self.BlkSize.get())
-			self.addTextInfoBar(self.InfoString_l, info)
+    def FillHdr(self, value):
+        """
+        fill header field on page based on block number
+        """
+        key = int(value)
+        self.JumpNum.set(value)
+        self.ByteOffset.set(self.BlockNum.get() * self.BlkSize.get())
+        verbose = self.VerbVar.get()
+        self.SetBlockettes(key)
+        if not verbose:
+            self.Standard(key)
+        elif verbose == 1:
+            self.Verbose(key)
+        elif verbose == 2:
+            self.VeryVerbose(key)
+
+        if self.odd_size:
+            info = ("WARNING: File size is not an integer number of block "
+                    "size (" + str(self.BlkSize.get()) + ")")
+            self.addTextInfoBar(self.InfoString_l, info, "orange")
+            self.odd_size = 0
+        else:
+            info = "Byte Offset: " + \
+                   str(self.BlockNum.get() * self.BlkSize.get())
+            self.addTextInfoBar(self.InfoString_l, info)
 
 #######################################
-	def FillSelectBlk(self, key, blktype):
-		"""
-		clears/initializes entry fields on Blockette Display
-		"""
-		self.BlksTitle_fm.destroy()
-		self.BlksTitle_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.BlksTitle_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-		self.BlkInfo_b = Button(self.BlksTitle_fm ,
-			activebackground = 'green',
-			background = 'lightblue',
-			text="Blockette Info",
-			activeforeground= 'black',
-			command = Command(self.buildBlkInfo, blktype, self.Blockette_nb)
-			)
-		self.BlkInfo_b.grid(row=0, column=1, padx=10)
-
-		self.Blks_fm.destroy()
-		self.Blks_fm = Frame(self.Blockette_nb, relief = 'groove', borderwidth = 2)
-		self.Blks_fm.pack(side = 'top', pady = 5, fill = 'x')
-
-
-		for block in self.Blockettes[key]:
-			if block[0] == blktype:
-				blocktuple = block
-
-		Label(self.BlksTitle_fm, text=BlkVars[blktype][0]).grid(row=0, column=0)
-
-		c=r=n=0
-		for var in range(len(BlkVars[blktype])-1):
-			Label(self.Blks_fm,
-				text=BlkVars[blktype][var+1]).grid(row=r, column=c, sticky=W)
-			Label(self.Blks_fm,
-				text=blocktuple[var]).grid(row=r, column=c+1, sticky=W)
-			if n == 5:
-				n=r=0
-				c+=2
-			else:
-				n+=1
-				r+=1
+    def FillSelectBlk(self, key, blktype):
+        """
+        clears/initializes entry fields on Blockette Display
+        """
+        self.BlksTitle_fm.destroy()
+        self.BlksTitle_fm = Frame(self.Blockette_nb, relief='groove',
+                                  borderwidth=2)
+        self.BlksTitle_fm.pack(side='top', pady=5, fill='x')
+
+        self.BlkInfo_b = Button(self.BlksTitle_fm,
+                                activebackground='green',
+                                background='lightblue',
+                                text="Blockette Info",
+                                activeforeground='black',
+                                command=Command(self.buildBlkInfo, blktype,
+                                                self.Blockette_nb))
+        self.BlkInfo_b.grid(row=0, column=1, padx=10)
+
+        self.Blks_fm.destroy()
+        self.Blks_fm = Frame(self.Blockette_nb, relief='groove', borderwidth=2)
+        self.Blks_fm.pack(side='top', pady=5, fill='x')
+
+        for block in self.Blockettes[key]:
+            if block[0] == blktype:
+                blocktuple = block
+
+        Label(self.BlksTitle_fm, text=BlkVars[blktype][0]).grid(
+            row=0, column=0)
+
+        c = r = n = 0
+        for var in range(len(BlkVars[blktype]) - 1):
+            Label(self.Blks_fm,
+                  text=BlkVars[blktype][var + 1]).grid(row=r, column=c,
+                                                       sticky=W)
+            Label(self.Blks_fm,
+                  text=blocktuple[var]).grid(row=r, column=c + 1, sticky=W)
+            if n == 5:
+                n = r = 0
+                c += 2
+            else:
+                n += 1
+                r += 1
 
 #######################################
-	def FillUnique(self):
-		"""
-		Fills unique info on HdrDisplay
-		"""
-		self.UniqueText = Pmw.ScrolledText(self.Hdrs_fm,
-			borderframe=1)
-		self.UniqueText.pack(side='bottom', fill='both', expand=1)
-
-
-		self.UniqueText.tag_config("list", foreground="blue")
-		self.UniqueText.tag_config("odd", backgroun="lightblue")
-
-		self.UniqueText.insert("end", "Block\tStat\tChan\tLoc\tNet\tRate\n", "list")
-
-		c=0
-		for key in self.UniqueList:
-			for var in key.split(":"):
-				if c :
-					self.UniqueText.insert("end", """%s\t""" % var, "odd")
-				else :
-					self.UniqueText.insert("end", """%s\t""" % var)
-			self.UniqueText.insert("end", """\n""")
-			if c :
-				c=0
-			else :
-				c+=1
+    def FillUnique(self):
+        """
+        Fills unique info on HdrDisplay
+        """
+        self.UniqueText = Pmw.ScrolledText(self.Hdrs_fm,
+                                           borderframe=1)
+        self.UniqueText.pack(side='bottom', fill='both', expand=1)
+
+        self.UniqueText.tag_config("list", foreground="blue")
+        self.UniqueText.tag_config("odd", backgroun="lightblue")
+
+        self.UniqueText.insert("end", "Block\tStat\tChan\tLoc\tNet\tRate\n",
+                               "list")
+
+        c = 0
+        for key in self.UniqueList:
+            for var in key.split(":"):
+                if c:
+                    self.UniqueText.insert("end", """%s\t""" % var, "odd")
+                else:
+                    self.UniqueText.insert("end", """%s\t""" % var)
+            self.UniqueText.insert("end", """\n""")
+            if c:
+                c = 0
+            else:
+                c += 1
 
 #######################################
-	def FillStandard(self, key):
-		"""
-		Fills standard info on HdrDisplay
-		"""
-
-		#cleanup existing vars and reset to new key location
-		self.ClearAll(self.StandardVars)
-		(SeqNum, DHQual, res, Stat, Loc, Chan, Net)=self.FixedHdrDict[key][0]
-		self.SeqNum.set(SeqNum)
-		self.DQual.set(DHQual)
-		self.Resv.set(res)
-		self.Station.set(Stat)
-		self.Channel.set(Chan)
-		self.LocCode.set(Loc)
-		self.NetCode.set(Net)
-		(numsamp, sampfact, sampmult)=self.FixedHdrDict[key][2]
-		rate=self.RateDict[key]
-		self.SampleRate.set(rate)
+    def FillStandard(self, key):
+        """
+        Fills standard info on HdrDisplay
+        """
+
+        # cleanup existing vars and reset to new key location
+        self.ClearAll(self.StandardVars)
+        (SeqNum, DHQual, res, Stat, Loc, Chan, Net) = self.FixedHdrDict[key][0]
+        self.SeqNum.set(SeqNum)
+        self.DQual.set(DHQual)
+        self.Resv.set(res)
+        self.Station.set(Stat)
+        self.Channel.set(Chan)
+        self.LocCode.set(Loc)
+        self.NetCode.set(Net)
+        (numsamp, sampfact, sampmult) = self.FixedHdrDict[key][2]
+        rate = self.RateDict[key]
+        self.SampleRate.set(rate)
 
 #######################################
-	def FillVerbose(self, key):
-		"""
-		Fills verbose info on HdrDisplay
-		"""
-
-		#cleanup existing vars and reset to new key location
-		self.ClearAll(self.VerboseVars)
-		self.FillStandard(key)
-		(Year, Day, Hour, Min, Sec, junk, Micro)=self.FixedHdrDict[key][1]
-		self.Year.set(Year)
-		self.Jday.set(Day)
-		self.Hour.set(Hour)
-		self.Min.set(Min)
-		self.Sec.set(Sec)
-		self.Micro.set(Micro)
+    def FillVerbose(self, key):
+        """
+        Fills verbose info on HdrDisplay
+        """
+
+        # cleanup existing vars and reset to new key location
+        self.ClearAll(self.VerboseVars)
+        self.FillStandard(key)
+        (Year, Day, Hour, Min, Sec, junk, Micro) = self.FixedHdrDict[key][1]
+        self.Year.set(Year)
+        self.Jday.set(Day)
+        self.Hour.set(Hour)
+        self.Min.set(Min)
+        self.Sec.set(Sec)
+        self.Micro.set(Micro)
 
 #######################################
-	def FillVeryVerbose(self, key):
-		"""
-		Fills very verbose info on HdrDisplay
-		"""
-
-		#cleanup existing vars and reset to new key location
-		self.ClearAll(self.VeryVerboseVars)
-		self.FillVerbose(key)
-		(NumSamp, SampFact, SampMult)=self.FixedHdrDict[key][2]
-		(act, io, DQual, numblk, timcorr, bdata, bblock)=self.FixedHdrDict[key][3]
-		self.NumSamp.set(NumSamp)
-		self.SampFact.set(SampFact)
-		self.SampMult.set(SampMult)
-		self.ActFlag.set(act)
-		self.IOFlag.set(io)
-		self.DQFlag.set(DQual)
-		self.NumBlockettes.set(numblk)
-		self.TimeCorr.set(timcorr)
-		self.BeginData.set(bdata)
-		self.FstBlkett.set(bblock)
+    def FillVeryVerbose(self, key):
+        """
+        Fills very verbose info on HdrDisplay
+        """
+
+        # cleanup existing vars and reset to new key location
+        self.ClearAll(self.VeryVerboseVars)
+        self.FillVerbose(key)
+        (NumSamp, SampFact, SampMult) = self.FixedHdrDict[key][2]
+        (act, io, DQual, numblk, timcorr, bdata,
+         bblock) = self.FixedHdrDict[key][3]
+        self.NumSamp.set(NumSamp)
+        self.SampFact.set(SampFact)
+        self.SampMult.set(SampMult)
+        self.ActFlag.set(act)
+        self.IOFlag.set(io)
+        self.DQFlag.set(DQual)
+        self.NumBlockettes.set(numblk)
+        self.TimeCorr.set(timcorr)
+        self.BeginData.set(bdata)
+        self.FstBlkett.set(bblock)
 
 ##########################################
-	def FlushDict(self) :
-		"""
-		clears dictionaries and OldMseedFile. Allows user to apply a reset and
-		dynamically monitor changes to mseed files.
-		"""
-
-		#clear selected directory and file
-		self.MseedFile.set("")
-		self.SelDir.set("")
-
-		#clear variables and destroy frames
-		self.ClearAll(self.VeryVerboseVars)
-		self.Hdrs_fm.destroy()
-		self.HdrScale_fm.destroy()
-		self.BlkScale_fm.destroy()
-		self.BlksSelect_fm.destroy()
-		self.BlksTitle_fm.destroy()
-		self.Blks_fm.destroy()
-
-		#now clear dictionaries and set OldMseedFile to blank
-		self.OldMseedFile.set("")
-		self.FixedHdrDict={}
-		self.RateDict={}
-		self.Blockettes={}
-		self.keyList=[]
-		self.UniqueList=[]
+    def FlushDict(self):
+        """
+        clears dictionaries and OldMseedFile. Allows user to apply a reset and
+        dynamically monitor changes to mseed files.
+        """
+
+        # clear selected directory and file
+        self.MseedFile.set("")
+        self.SelDir.set("")
+
+        # clear variables and destroy frames
+        self.ClearAll(self.VeryVerboseVars)
+        self.Hdrs_fm.destroy()
+        self.HdrScale_fm.destroy()
+        self.BlkScale_fm.destroy()
+        self.BlksSelect_fm.destroy()
+        self.BlksTitle_fm.destroy()
+        self.Blks_fm.destroy()
+
+        # now clear dictionaries and set OldMseedFile to blank
+        self.OldMseedFile.set("")
+        self.FixedHdrDict = {}
+        self.RateDict = {}
+        self.Blockettes = {}
+        self.keyList = []
+        self.UniqueList = []
 
 ##########################################
 
-	def getPath (self, var, clear=1) :
-		"""
-		Concatonate paths
-		"""
-		self.var=var
-		if clear:
-			self.var.set('')
-		newpath_dd = DirectoryDialog (self.root)
-		self.path = newpath_dd.go (dir_or_file = getcwd())
-		if self.path != None :
-			if self.var.get():
-				self.var.set(self.var.get() + ':')
-			if len(self.path) == 1 and self.path[0] == "/":
-				self.var.set(self.var.get() + self.path)
-			elif self.path[-1] == "/":
-				self.var.set(self.var.get() + self.path[:-1])
-			else:
-				self.var.set(self.var.get() + self.path)
+    def getPath(self, var, clear=1):
+        """
+        Concatonate paths
+        """
+        self.var = var
+        if clear:
+            self.var.set('')
+        newpath_dd = DirectoryDialog(self.root)
+        self.path = newpath_dd.go(dir_or_file=getcwd())
+        if self.path is not None:
+            if self.var.get():
+                self.var.set(self.var.get() + ':')
+            if len(self.path) == 1 and self.path[0] == "/":
+                self.var.set(self.var.get() + self.path)
+            elif self.path[-1] == "/":
+                self.var.set(self.var.get() + self.path[:-1])
+            else:
+                self.var.set(self.var.get() + self.path)
 
 ##################################################################
 
-	def ClearTxt(self, var) :
-		"""
-		clear text
-		"""
-		var.clear()
+    def ClearTxt(self, var):
+        """
+        clear text
+        """
+        var.clear()
 
 ##################################################################
 
-	def ClearAll(self, varlist) :
-		"""
-		clear a variable list
-		"""
-		self.addTextInfoBar(self.InfoString_l)
-		for var in varlist :
-			self.setValue(var[1])
+    def ClearAll(self, varlist):
+        """
+        clear a variable list
+        """
+        self.addTextInfoBar(self.InfoString_l)
+        for var in varlist:
+            self.setValue(var[1])
 
 #######################################
 
-	def setValue(self, var, value=''):
-		"""
-		Sets Value of var
-		"""
-		var.set(value)
+    def setValue(self, var, value=''):
+        """
+        Sets Value of var
+        """
+        var.set(value)
 
 #######################################
 
-	def addTextInfoBar(self, widget, str='', bg='yellow'):
-		"""
-		Adds Text To InfoBar
-		"""
-		widget.configure(background=bg, text=str)
-##################################################################
+    def addTextInfoBar(self, widget, str='', bg='yellow'):
+        """
+        Adds Text To InfoBar
+        """
+        widget.configure(background=bg, text=str)
 
-	def killWindow(self, widget):
-		"""
-		Destroy Widget and Set InfoBar to Default
-		"""
-		widget.destroy()
-		self.addTextInfoBar(self.InfoString_l)
+##################################################################
 
+    def killWindow(self, widget):
+        """
+        Destroy Widget and Set InfoBar to Default
+        """
+        widget.destroy()
+        self.addTextInfoBar(self.InfoString_l)
 
 #######################################
 
-	def wait(self, words, cnt):
-		"""
-		routine to put words on info bar, used to count traces
-		being examined
-		"""
+    def wait(self, words, cnt):
+        """
+        routine to put words on info bar, used to count traces
+        being examined
+        """
 
-		txt = words + str(cnt)
-		self.root.update()
-		self.addTextInfoBar(self.InfoString_l, txt, 'lightblue')
+        txt = words + str(cnt)
+        self.root.update()
+        self.addTextInfoBar(self.InfoString_l, txt, 'lightblue')
 
 ##################################################################
 
-	def Exit(self):
-		"""
-		a no questions asked exit
-		"""
-		sys.exit(0)
+    def Exit(self):
+        """
+        a no questions asked exit
+        """
+        sys.exit(0)
 
 ##################################################################
 
-	def displayBlkInfo(self, type):
-		text=BlkInfoDict[type]
-		self.BlkInfoText.settext(text)
+    def displayBlkInfo(self, type):
+        text = BlkInfoDict[type]
+        self.BlkInfoText.settext(text)
 
 ##################################################################
-	def buildHelp(self,master):
-		"""
-		Populate Help NoteBook
-		"""
-		self.Help_nb = master.add('Help')
-
-		self.HelpText = Pmw.ScrolledText(self.Help_nb,
-			borderframe=1)
-		self.HelpText.pack(side='bottom', fill='both', expand=1)
-
-
-		self.HelpText.tag_config("hdr1", foreground="blue")
-		self.HelpText.tag_config("hdr2", foreground="darkgreen")
-		self.HelpText.tag_config("bttn", foreground="red")
-
-		self.HelpText.insert("end", "NAME", "hdr1")
-		self.HelpText.insert("end", """
+    def buildHelp(self, master):
+        """
+        Populate Help NoteBook
+        """
+        self.Help_nb = master.add('Help')
+
+        self.HelpText = Pmw.ScrolledText(self.Help_nb,
+                                         borderframe=1)
+        self.HelpText.pack(side='bottom', fill='both', expand=1)
+
+        self.HelpText.tag_config("hdr1", foreground="blue")
+        self.HelpText.tag_config("hdr2", foreground="darkgreen")
+        self.HelpText.tag_config("bttn", foreground="red")
+
+        self.HelpText.insert("end", "NAME", "hdr1")
+        self.HelpText.insert("end", """
    mseedpeek - GUI for displaying mseed file headers.\n""")
 
-		self.HelpText.insert("end", "\nVERSION", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nVERSION", "hdr1")
+        self.HelpText.insert("end", """
    %s\n""" % VERSION)
 
-		self.HelpText.insert("end", "\nSYNOPSIS", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nSYNOPSIS", "hdr1")
+        self.HelpText.insert("end", """
    mseedpeek
    mseedpeek -#
    mseedpeek -f file_names\n""")
 
-		self.HelpText.insert("end", "\nOPTIONS", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nOPTIONS", "hdr1")
+        self.HelpText.insert("end", """
    -# returns version number
-   -f file_name(s) - accepts command line input for files to inspect (wildcards accepted)\n""")
+   -f file_name(s) - accepts command line input for files to inspect (wildcards accepted)\n""")  # noqa: E501
 
-		self.HelpText.insert("end", "\nDESCRIPTION", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nDESCRIPTION", "hdr1")
+        self.HelpText.insert("end", """
    mseedpeek has three notebooks: """)
-		self.HelpText.insert("end", "[Trace Headers]", "hdr2")
-		self.HelpText.insert("end", "[Blockettes]", "hdr2")
-		self.HelpText.insert("end", """, and """)
-		self.HelpText.insert("end", "[Help]", "hdr2")
-		self.HelpText.insert("end", """.""")
+        self.HelpText.insert("end", "[Trace Headers]", "hdr2")
+        self.HelpText.insert("end", "[Blockettes]", "hdr2")
+        self.HelpText.insert("end", """, and """)
+        self.HelpText.insert("end", "[Help]", "hdr2")
+        self.HelpText.insert("end", """.""")
 
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", """
    The """)
-		self.HelpText.insert("end", "[Trace Headers]", "hdr2")
-		self.HelpText.insert("end", """ notebook displays various the fixed header
-   in four levels of verbosity. The """)
-		self.HelpText.insert("end", "[Blockettes]", "hdr2")
-		self.HelpText.insert("end", """ notebook displays
-   blockette information.\n""")
-
-		self.HelpText.insert("end", "\n   [Trace Headers]", "hdr2")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "[Trace Headers]", "hdr2")
+        self.HelpText.insert("end", """ notebook displays various the fixed
+   header in four levels of verbosity.\n   The """)
+        self.HelpText.insert("end", "[Blockettes]", "hdr2")
+        self.HelpText.insert("end", """ notebook displays blockette information.\n""")  # noqa: E501
+
+        self.HelpText.insert("end", "\n   [Trace Headers]", "hdr2")
+        self.HelpText.insert("end", """
    General:
       >> specify/load directories for building trace db
       >> select trace for header display
       >> select level of verbosity for display
 
    Buttons:\n""")
-		self.HelpText.insert("end", "      <Build Trace db>", "bttn")
-		self.HelpText.insert("end", """: Searchs the directories listed in the "Data-
+        self.HelpText.insert("end", "      <Build Trace db>", "bttn")
+        self.HelpText.insert("end", """: Searchs the directories listed in the "Data-
          Directories" entry box (a colon separated list) and builds a list of mseed
          files found indexing them on unique values of <dir>:<file_name>. It then
-         creates a dropdown menu with entries for each data directory found.\n""")
-		self.HelpText.insert("end", "      <Find>", "bttn")
-		self.HelpText.insert("end", """: Launches a file browser allowing the user to
+         creates a dropdown menu with entries for each data directory found.\n""")  # noqa: E501
+        self.HelpText.insert("end", "      <Find>", "bttn")
+        self.HelpText.insert("end", """: Launches a file browser allowing the user to
          add directories to the "Data Directories" entry box. Double clicking selects
-         the new directory.\n""")
-		self.HelpText.insert("end", "      <Clear>", "bttn")
-		self.HelpText.insert("end", """: Clears the "Data Directories" entry box.\n""")
+         the new directory.\n""")  # noqa: E501
+        self.HelpText.insert("end", "      <Clear>", "bttn")
+        self.HelpText.insert(
+            "end", """: Clears the "Data Directories" entry box.\n""")
 
-
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", """
         By selecting a data directory a dropdown menu is created for
         trace selection. Selecting a trace from this menu will create
         a header display.
 
    Radio Buttons:\n""")
-		self.HelpText.insert("end", "      <Standard>", "bttn")
-		self.HelpText.insert("end", """: This is the default. It displays Station, Channel, Location Code,
-        Net Code, and the nominal Sample Rate.\n""")
-		self.HelpText.insert("end", "      <Verbose>", "bttn")
-		self.HelpText.insert("end", """: Standard display plus time of block.\n""")
-		self.HelpText.insert("end", "      <Very Verbose>", "bttn")
-		self.HelpText.insert("end", """: Verbose plus the rest of the mseed fixed header fields.\n""")
-		self.HelpText.insert("end", "      <Unique>", "bttn")
-		self.HelpText.insert("end", """: This displays changes in the Standard fields within a mseed file.\n""")
-		self.HelpText.insert("end", """:
+        self.HelpText.insert("end", "      <Standard>", "bttn")
+        self.HelpText.insert("end", """: This is the default. It displays Station, Channel, Location Code,
+        Net Code, and the nominal Sample Rate.\n""")  # noqa: E501
+        self.HelpText.insert("end", "      <Verbose>", "bttn")
+        self.HelpText.insert(
+            "end", """: Standard display plus time of block.\n""")
+        self.HelpText.insert("end", "      <Very Verbose>", "bttn")
+        self.HelpText.insert(
+            "end", """: Verbose plus the rest of the mseed fixed header fields.\n""")  # noqa: E501
+        self.HelpText.insert("end", "      <Unique>", "bttn")
+        self.HelpText.insert(
+            "end", """: This displays changes in the Standard fields within a mseed file.\n""")  # noqa: E501
+        self.HelpText.insert("end", """
 
    Slider Scale and """)
-		self.HelpText.insert("end", "<Jump To Block #>", "bttn")
-		self.HelpText.insert("end", """ Button:
+        self.HelpText.insert("end", "<Jump To Block #>", "bttn")
+        self.HelpText.insert("end", """ Button:
         At the bottom of the page is a scale bar showing block numbers. Sliding
-        the bar scans through all fixed headers for the selected mseed file.\n""")
+        the bar scans through all fixed headers for the selected mseed file.\n""")  # noqa: E501
 
-		self.HelpText.insert("end", "\n   <Flush Dictionaries>", "bttn")
-		self.HelpText.insert("end", """: Clears cached trace header data.
+        self.HelpText.insert("end", "\n   <Flush Dictionaries>", "bttn")
+        self.HelpText.insert("end", """: Clears cached trace header data.
         As you view mseed headers, mseedpeek maintains a cache of previously
         viewed headers for quick, future access. If you wish to monitor changes
         to mseed files you need to flush the dictionaries so that the new
         changes will be displayed.\n\n""")
 
-
-		self.HelpText.insert("end", "   [Blockettes]", "hdr2")
-		self.HelpText.insert("end", """:
+        self.HelpText.insert("end", "   [Blockettes]", "hdr2")
+        self.HelpText.insert("end", """:
         The 'Blockettes' notebook displays all blockettes found for the select
         mseed file in a dropdown menu. By selecting a blockette from the dropdown
-        menu, the contents of the blockette will be displayed.\n""")
+        menu, the contents of the blockette will be displayed.\n""")  # noqa: E501
 
-		self.HelpText.insert("end", "      <Blockette Info>", "bttn")
-		self.HelpText.insert("end", """: Displays a pop-up window with a definition of the SEED Blockette.
+        self.HelpText.insert("end", "      <Blockette Info>", "bttn")
+        self.HelpText.insert("end", """: Displays a pop-up window with a definition of the SEED Blockette.
 
         At the bottom of the page is a scale bar showing block numbers and
-        Sliding the bar scans through all blockettes for the selected mseed file.\n""")
+        Sliding the bar scans through all blockettes for the selected mseed file.\n""")  # noqa: E501
 
-		self.HelpText.insert("end", "\nKEYWORDS", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nKEYWORDS", "hdr1")
+        self.HelpText.insert("end", """
    mseed; header information\n""")
 
-		self.HelpText.insert("end", "\nSEE ALSO", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nSEE ALSO", "hdr1")
+        self.HelpText.insert("end", """
    SEED manual (pdf), fixhdr, mseedhdr\n""")
 
-		self.HelpText.insert("end", "\nAUTHOR", "hdr1")
-		self.HelpText.insert("end", """
+        self.HelpText.insert("end", "\nAUTHOR", "hdr1")
+        self.HelpText.insert("end", """
    Bruce Beaudoin <bruce@passcal.nmt.edu>
 """)
 
 
-if __name__ == '__main__' :
+if __name__ == '__main__':
     main()
diff --git a/setup.cfg b/setup.cfg
index 75864c6ea6c18f8dd8a99ed2f6f3df715aca0ddd..3e16c9aa4de92883ce48eebabea3688a4ead6f10 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,22 +1,5 @@
-[bumpversion]
-current_version = 2018.129
-commit = True
-tag = True
-
-[bumpversion:file:setup.py]
-search = version='{current_version}'
-replace = version='{new_version}'
-
-[bumpversion:file:mseedpeek/__init__.py]
-search = __version__ = '{current_version}'
-replace = __version__ = '{new_version}'
-
-[bdist_wheel]
-universal = 1
-
 [flake8]
 exclude = docs
 
 [aliases]
 # Define setup.py command aliases here
-
diff --git a/setup.py b/setup.py
index 1db522551e6f5a7a3ee6108b98f484167a2a68dc..501e103bc209eaf7e314b8dff1d1d4517897843f 100644
--- a/setup.py
+++ b/setup.py
@@ -30,19 +30,12 @@ setup(
             'mseedpeek=mseedpeek.mseedpeek:main',
         ],
     },
-    setup_requires = [],
     install_requires=['Pmw @ https://github.com/schrodinger/pmw-patched/archive/master.tar.gz'],
+    setup_requires=[],
     extras_require={
         'dev': [
-            'pip',
-            'bumpversion',
-            'wheel',
-            'watchdog',
             'flake8',
             'tox',
-            'coverage',
-            'Sphinx',
-            'twine',
         ]
     },
     license="GNU General Public License v3",
@@ -51,8 +44,7 @@ setup(
     keywords='mseedpeek',
     name='mseedpeek',
     packages=find_packages(include=['mseedpeek']),
-    test_suite='tests',
     url='https://git.passcal.nmt.edu/passoft/mseedpeek',
-    version='2018.129',
+    version='2020.204',
     zip_safe=False,
 )
diff --git a/tox.ini b/tox.ini
index bf6c0725b91a09d47ebc02bcfec374415d4ecfc9..86082c8d69669cefe7b963758654dd27a25d4971 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,10 @@
 [tox]
-envlist = py36, py37, py38
+envlist = py36, py37, py38, flake8
+
+[testenv:flake8]
+basepython = python
+deps = flake8
+commands = flake8 --ignore=F403,F405,F821,F841,W504 mseedpeek
 
 [testenv]
 commands = python -m unittest