# Path: pysmo/aimbat/ttconfig.py
# def getDefaults():
#     def __init__(self):
#     def __init__(self):
# def _load_xcorr_func(func):
#     def __init__(self):
#     def __init__(self):
# def getParser():
# class PPConfig:
# class QCConfig:
# class CCConfig:
# class MCConfig:
# 
# Path: pysmo/aimbat/sacpickle.py
# def zipFile(zipmode='gz'):
# def fileZipMode(ifilename):
# def writePickle(d, picklefile, zipmode=None):
# def readPickle(picklefile, zipmode=None):
#     def __init__(self, ifile, delta=-1):
#     def resampleData(self, delta):
#     def gethdr(self, hdr):
#     def sethdr(self, hdr, val):
#     def writeHdrs(self):
#     def sethdrs(self, sacobj):
#     def savesac(self):
#     def __init__(self, ifiles, delta=-1):
#     def resampleData(self, delta):
# def resampleSeis(data, deltaold, delta):
# def sac2obj(ifiles, delta=-1):
# def sac2pkl(ifiles, pkfile='sac.pkl', delta=-1, zipmode='gz'):
# def obj2sac(gsac):
# def pkl2sac(pkfile, zipmode):
# def _days(year):
# def date2jul(year, mon, day):
# def jul2date(year, jday):
# def taper(data, taperwidth=0.1, tapertype='hanning'):
# def taperWindow(timewindow, taperwidth=0.1):
# def windowIndex(saclist, reftimes, timewindow=(-5.0,5.0), taperwindow=1.0):
# def windowData(saclist, nstart, ntotal, taperwidth, tapertype='hanning', datatype='data'):
# def windowTime(saclist, nstart, ntotal, taperwidth, tapertype='hanning'):
# def windowTimeData(saclist, nstart, ntotal, taperwidth, tapertype='hanning'):
# def loadData(ifiles, opts, para):
# def saveData(gsac, opts):
# def getOptions():
# def main():
# class SacDataHdrs:
# class SacGroup:
#     class BreakIt(Exception): pass
# 
# Path: pysmo/aimbat/plotutils.py
# def pickLegend(ax, npick, pickcolors, pickstyles, left=True):
#     def ignore(self, event):
# def dataNorm(d, w=0.05):
# def axLimit(minmax, w=0.05):
# def indexBaseTick(na, nb, pagesize, pna):
# def getAxes(opts):
# def plotDelay(stalos, stalas, dtimes, opts):
# class TimeSelector(SpanSelector):


import sys, copy
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from pysmo.aimbat import ttconfig
from pysmo.aimbat import sacpickle as sacpkl
from pysmo.aimbat import plotutils as putil
        self.yzoom = putil.axLimit(mm)

    def getDist(self, degree=True):
        """ Get epicentral distances in degree/km as ybases for waveforms. """
        if degree:
            dists = [ sacdh.gcarc for sacdh in self.saclist ]
        else:
            dists = [ sacdh.dist  for sacdh in self.saclist ]
        self.ybases = dists
        mm = min(dists), max(dists)
        self.yzoom = putil.axLimit(mm, 0.1)
        if self.opts.stack_on:
            self.stackbase = (mm[1]+self.yzoom[1])/2
            self.yzoom[1] += (self.yzoom[1]-mm[1])/2

    def getAzim(self):
        """ Get azimuth as ybases for waveforms. """
        azims = [ sacdh.az for sacdh in self.saclist ]
        self.ybases = azims
        mm = min(azims), max(azims)
        self.yzoom = putil.axLimit(mm, 0.1)
        if self.opts.stack_on:
            self.stackbase = (mm[1]+self.yzoom[1])/2
            self.yzoom[1] += (self.yzoom[1]-mm[1])/2

    def getBAzim(self):
        """ Get back azimuth as ybases for waveforms. """
        bazims = [ sacdh.baz for sacdh in self.saclist ]
        self.ybases = bazims
        mm = min(bazims), max(bazims)

# Path: pysmo/aimbat/ttconfig.py
# def getDefaults():
#     def __init__(self):
#     def __init__(self):
# def _load_xcorr_func(func):
#     def __init__(self):
#     def __init__(self):
# def getParser():
# class PPConfig:
# class QCConfig:
# class CCConfig:
# class MCConfig:
# 
# Path: pysmo/aimbat/sacpickle.py
# def zipFile(zipmode='gz'):
# def fileZipMode(ifilename):
# def writePickle(d, picklefile, zipmode=None):
# def readPickle(picklefile, zipmode=None):
#     def __init__(self, ifile, delta=-1):
#     def resampleData(self, delta):
#     def gethdr(self, hdr):
#     def sethdr(self, hdr, val):
#     def writeHdrs(self):
#     def sethdrs(self, sacobj):
#     def savesac(self):
#     def __init__(self, ifiles, delta=-1):
#     def resampleData(self, delta):
# def resampleSeis(data, deltaold, delta):
# def sac2obj(ifiles, delta=-1):
# def sac2pkl(ifiles, pkfile='sac.pkl', delta=-1, zipmode='gz'):
# def obj2sac(gsac):
# def pkl2sac(pkfile, zipmode):
# def _days(year):
# def date2jul(year, mon, day):
# def jul2date(year, jday):
# def taper(data, taperwidth=0.1, tapertype='hanning'):
# def taperWindow(timewindow, taperwidth=0.1):
# def windowIndex(saclist, reftimes, timewindow=(-5.0,5.0), taperwindow=1.0):
# def windowData(saclist, nstart, ntotal, taperwidth, tapertype='hanning', datatype='data'):
# def windowTime(saclist, nstart, ntotal, taperwidth, tapertype='hanning'):
# def windowTimeData(saclist, nstart, ntotal, taperwidth, tapertype='hanning'):
# def loadData(ifiles, opts, para):
# def saveData(gsac, opts):
# def getOptions():
# def main():
# class SacDataHdrs:
# class SacGroup:
#     class BreakIt(Exception): pass
# 
# Path: pysmo/aimbat/plotutils.py
# def pickLegend(ax, npick, pickcolors, pickstyles, left=True):
#     def ignore(self, event):
# def dataNorm(d, w=0.05):
# def axLimit(minmax, w=0.05):
# def indexBaseTick(na, nb, pagesize, pna):
# def getAxes(opts):
# def plotDelay(stalos, stalas, dtimes, opts):
# class TimeSelector(SpanSelector):


# Path: pysmo/aimbat/plotphase.py
import sys, copy
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from pysmo.aimbat import ttconfig
from pysmo.aimbat import sacpickle as sacpkl
from pysmo.aimbat import plotutils as putil

        self.yzoom = putil.axLimit(mm)

    def getDist(self, degree=True):
        """ Get epicentral distances in degree/km as ybases for waveforms. """
        if degree:
            dists = [ sacdh.gcarc for sacdh in self.saclist ]
        else:
            dists = [ sacdh.dist  for sacdh in self.saclist ]
        self.ybases = dists
        mm = min(dists), max(dists)
        self.yzoom = putil.axLimit(mm, 0.1)
        if self.opts.stack_on:
            self.stackbase = (mm[1]+self.yzoom[1])/2
            self.yzoom[1] += (self.yzoom[1]-mm[1])/2

    def getAzim(self):
        """ Get azimuth as ybases for waveforms. """
        azims = [ sacdh.az for sacdh in self.saclist ]
        self.ybases = azims
        mm = min(azims), max(azims)
        self.yzoom = putil.axLimit(mm, 0.1)
        if self.opts.stack_on:
            self.stackbase = (mm[1]+self.yzoom[1])/2
            self.yzoom[1] += (self.yzoom[1]-mm[1])/2

    def getBAzim(self):
        """ Get back azimuth as ybases for waveforms. """
        bazims = [ sacdh.baz for sacdh in self.saclist ]
        self.ybases = bazims
        mm = min(bazims), max(bazims)

        self.yzoom = putil.axLimit(mm, 0.1)