#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct  6 10:37:41 2022

@author: davidhealy
"""
from obspy import read_inventory, UTCDateTime
from datetime import timedelta
import matplotlib.pyplot as plt

sta = 'R6C8A'
now = UTCDateTime.now() - timedelta(days=1)

inv = read_inventory('https://fdsnws.raspberryshakedata.com/fdsnws/station/1/query?network=AM&station=%s&level=resp&format=xml&nodata=404&starttime=%s' % (sta, str(now)))
inv.plot_response(min_freq=0.001, outfile='resp.png')

