def plot_phases_zpk(zpks, filename_pdf, fmin=0.001, fmax=100., nf=100): import gmtpy p = gmtpy.LogLinPlot(width=30*gmtpy.cm) for i, (zeros, poles, constant) in enumerate(zpks): f, h = evaluate(zeros, poles, constant, fmin, fmax, nf) phase = num.unwrap(num.angle(h)) /d2r p.plot((f, phase), '-W1p,%s' % gmtpy.color(i)) p.save(filename_pdf)
def plot_phases(self, filename_pdf, type='displacement'): import gmtpy p = gmtpy.LogLinPlot() f = self.sampled_response.frequencies() atab = num.unwrap(num.angle(self.response(f, method='tabulated', type=type))) /d2r acom = num.unwrap(num.angle(self.response(f, method='gains-and-filters', type=type))) /d2r aconst = num.unwrap(num.angle(self.response(f, method='gains', type=type))) /d2r p.plot((f, atab), '-W2p,red') p.plot((f, acom), '-W1p,blue') p.plot((f, aconst), '-W1p,green') p.save(filename_pdf)