Repository: obspy/obspy

Issue:
EVRESP ERROR when using tr.remove_response
Hello,

I get this error message using obspy 'tr.remove_response()' command:

EVRESP ERROR (... [File: <stdin>; Start date: ; Stage: 9]):
     check_channel; required decimation blockette for IIR or FIR filter missing,
     skipping to next response now
*** ValueError: check_channel: Illegal RESP format 

This happens only when I use the permanent stations from the DK network archived at GEOFON where I have also downloaded the StationXML file from.
The GEOFON team assume an obspy bug....

I am using Python 2.7.6 and obspy 1.1.0

I appreciate your help.


Discussion:
Can you post a small reproducible example that also acquires the data from a web service?
```
from obspy import UTCDateTime, Stream, read_inventory
from obspy.clients.fdsn import Client

client = Client("GFZ")

pre_filter = [0.005, 0.008, 2, 4]

t0 = UTCDateTime(2015,5,5,10,0,0)
t1 = UTCDateTime(2015,5,5,11,0,0)

bulk = [("DK", "COP", "*", "BHZ", t0, t1),
        ("DK", "BSD", "*", "BHZ", t0, t1),
        ("DK", "MUD", "*", "BHZ", t0, t1)]
inv = client.get_stations_bulk(bulk, level="response")

st = Stream()
st += client.get_waveforms("DK", "COP", "*", "BHZ", t0, t1)

st.attach_response(inv)
st.remove_response(output='VEL', pre_filt=pre_filter, taper_fraction=0.005)
```
This stage is causing the problem:

```xml
435           <Stage number="9">
436             <PolesZeros resourceId="ResponsePAZ#20170829123231.311077.14" name="GFZ:DK1980:HDR24_iirpaz_1">
437               <InputUnits>
438                 <Name>COUNTS</Name>
439               </InputUnits>
440               <OutputUnits>
441                 <Name>COUNTS</Name>
442               </OutputUnits>
443               <PzTransferFunctionType>DIGITAL (Z-TRANSFORM)</PzTransferFunctionType>
444               <NormalizationFactor>0.999969</NormalizationFactor>
445               <NormalizationFrequency>1</NormalizationFrequency>
446               <Zero number="1">
447                 <Real>1</Real>
448                 <Imaginary>0</Imaginary>
449               </Zero>
450               <Pole number="0">
451                 <Real>0.99937</Real>
452                 <Imaginary>0</Imaginary>
453               </Pole>
454             </PolesZeros>
455             <StageGain>
456               <Value>1</Value>
457               <Frequency>1</Frequency>
458             </StageGain>
459           </Stage>
```
Seems like an IIR decimation stage and for `PolesZeros` the required decimation attributes are not present (and generally unsupported by the StationXML schema). The GFZ webservices also omits these values in the SC3ML output, despite having support for it after verison 0.10.

We can raise a warning instead of throwing but that's about it? I think the decimation attributes are needed.

@andres-h can share some wisdom maybe.
I have contacted Andres before. He has written to me: "stage 9 of DK stations is a digital IIR filter (poles&zeros). There is no decimation and decimation blockette is not required by the FDSN standard"
Yeah, it's not required by the metadata schema but EVRESP needs them or it throws that error. One thing we could do when the decimation blockette it is missing is add a bogus one with a factor of 1 internally when reading inventories.

E.g. pushing this in your code makes it pass:

    for net in inv:
      for sta in net:
        for cha in sta:
          cha.response.response_stages[8].decimation_factor = 1
          cha.response.response_stages[8].decimation_delay = 0.0
          cha.response.response_stages[8].decimation_correction = 0.0
          cha.response.response_stages[8].decimation_offset = 0
          cha.response.response_stages[8].decimation_input_sample_rate = cha.response.response_stages[9].decimation_input_sample_rate

Thoughts?
Nice catch about the decimation stuff @Jollyfant!

> when the decimation blockette it is missing is add a bogus one with a factor of 1 internally when reading inventories

Maybe only do it during the evalresp call? In general we should not automagically change user data I think..
From my point of view that should be an acceptable solution.
However, now I get warning:
WARNING (norm_resp): computed and reported sensitivities differ by more than 5 percent. 
	 Execution continuing.
> Seems like an IIR decimation stage and for PolesZeros the required decimation attributes are not present (and generally unsupported by the StationXML schema)

All response stages can have the decimation attributes - see the `ResponseStageType` in the schema.



> Maybe only do it during the evalresp call? In general we should not automagically change user data I think..

I'll give it a shot. I'm a bit surprised we did not encounter this any earlier given the massive amount of testing we did for the responses.
Lion, me too. I have requested many data from various networks and clients. This is the only case where the error was encountered.
> From my point of view that should be an acceptable solution.
> However, now I get warning:
> WARNING (norm_resp): computed and reported sensitivities differ by more than 5 percent.
> Execution continuing.

That is (hopefully) an unrelated problem. `evalresp` internally calculates the total sensitivity by just multiplying the sensitivities of all stages. It then compares this to the total sensitivity written in the file and raises this warning if it differs too much (but it always uses the computed one). Usually this is no cause to worry if you deconvolve the whole response. Just to be sure: Do you have a chance to compare the response ObsPy computes (e.g. `inv.plot_reponse(0.001)`) with a reference solution for these stations?

Resolving patch:
diff --git a/obspy/core/inventory/response.py b/obspy/core/inventory/response.py
--- a/obspy/core/inventory/response.py
+++ b/obspy/core/inventory/response.py
@@ -15,10 +15,11 @@
 
 import copy
 import ctypes as C
-import warnings
 from collections import defaultdict, Iterable
 from copy import deepcopy
+import itertools
 from math import pi
+import warnings
 
 import numpy as np
 import scipy.interpolate
@@ -767,6 +768,124 @@ def __init__(self, resource_id=None, instrument_sensitivity=None,
             msg = "response_stages must be an iterable."
             raise ValueError(msg)
 
+    def get_sampling_rates(self):
+        """
+        Computes the input and output sampling rates of each stage.
+
+        For well defined files this will just read the decimation attributes
+        of each stage. For others it will attempt to infer missing values
+        from the surrounding stages.
+
+        :returns: A nested dictionary detailing the sampling rates of each
+            response stage.
+        :rtype: dict
+
+        >>> import obspy
+        >>> inv = obspy.read_inventory("AU.MEEK.xml")  # doctest: +SKIP
+        >>> inv[0][0][0].response.get_sampling_rates()  # doctest: +SKIP
+        {1: {'decimation_factor': 1,
+             'input_sampling_rate': 600.0,
+             'output_sampling_rate': 600.0},
+         2: {'decimation_factor': 1,
+             'input_sampling_rate': 600.0,
+             'output_sampling_rate': 600.0},
+         3: {'decimation_factor': 1,
+             'input_sampling_rate': 600.0,
+             'output_sampling_rate': 600.0},
+         4: {'decimation_factor': 3,
+             'input_sampling_rate': 600.0,
+             'output_sampling_rate': 200.0},
+         5: {'decimation_factor': 10,
+             'input_sampling_rate': 200.0,
+             'output_sampling_rate': 20.0}}
+        """
+        # Get all stages, but skip stage 0.
+        stages = [_i.stage_sequence_number for _i in self.response_stages
+                  if _i.stage_sequence_number]
+        if not stages:
+            return {}
+
+        if list(range(1, len(stages) + 1)) != stages:
+            raise ValueError("Can only determine sampling rates if response "
+                             "stages are in order.")
+
+        # First fill in all the set values.
+        sampling_rates = {}
+        for stage in self.response_stages:
+            input_sr = None
+            output_sr = None
+            factor = None
+            if stage.decimation_input_sample_rate:
+                input_sr = stage.decimation_input_sample_rate
+                if stage.decimation_factor:
+                    factor = stage.decimation_factor
+                    output_sr = input_sr / float(factor)
+            sampling_rates[stage.stage_sequence_number] = {
+                "input_sampling_rate": input_sr,
+                "output_sampling_rate": output_sr,
+                "decimation_factor": factor}
+
+        # Nothing might be set - just return in that case.
+        if set(itertools.chain.from_iterable(v.values()
+               for v in sampling_rates.values())) == {None}:
+            return sampling_rates
+
+        # Find the first set input sampling rate. The output sampling rate
+        # cannot be set without it. Set all prior input and output sampling
+        # rates to it.
+        for i in stages:
+            sr = sampling_rates[i]["input_sampling_rate"]
+            if sr:
+                for j in range(1, i):
+                    sampling_rates[j]["input_sampling_rate"] = sr
+                    sampling_rates[j]["output_sampling_rate"] = sr
+                    sampling_rates[j]["decimation_factor"] = 1
+                break
+
+        # This should guarantee that the input and output sampling rate of the
+        # the first stage are set.
+        output_sr = sampling_rates[1]["output_sampling_rate"]
+        if not output_sr:  # pragma: no cover
+            raise NotImplementedError
+
+        for i in stages:
+            si = sampling_rates[i]
+            if not si["input_sampling_rate"]:
+                si["input_sampling_rate"] = output_sr
+            if not si["output_sampling_rate"]:
+                if not si["decimation_factor"]:
+                    si["output_sampling_rate"] = si["input_sampling_rate"]
+                    si["decimation_factor"] = 1
+                else:
+                    si["output_sampling_rate"] = si["input_sampling_rate"] / \
+                        float(si["decimation_factor"])
+            if not si["decimation_factor"]:
+                si["decimation_factor"] = int(round(
+                    si["input_sampling_rate"] / si["output_sampling_rate"]))
+            output_sr = si["output_sampling_rate"]
+
+        def is_close(a, b):
+            return abs(a - b) < 1e-5
+
+        # Final consistency checks.
+        sr = sampling_rates[stages[0]]["input_sampling_rate"]
+        for i in stages:
+            si = sampling_rates[i]
+            if not is_close(si["input_sampling_rate"], sr):  # pragma: no cover
+                msg = ("Input sampling rate of stage %i is inconsistent "
+                       "with the previous stages' output sampling rate")
+                warnings.warn(msg % i)
+
+            if not is_close(
+                    si["input_sampling_rate"] / si["output_sampling_rate"],
+                    si["decimation_factor"]):  # pragma: no cover
+                msg = ("Decimation factor in stage %i is inconsistent with "
+                       "input and output sampling rates.")
+                warnings.warn(msg % i)
+            sr = si["output_sampling_rate"]
+
+        return sampling_rates
+
     def recalculate_overall_sensitivity(self, frequency=None):
         """
         Recalculates the overall sensitivity.
@@ -1243,6 +1362,39 @@ def get_unit_mapping(key):
             if blkt is not None:
                 stage_blkts.append(blkt)
 
+            # Evalresp requires FIR and IIR blockettes to have decimation
+            # values. Set the "unit decimation" values in case they are not
+            # set.
+            #
+            # Only set it if there is a stage gain - otherwise evalresp
+            # complains again.
+            if isinstance(blockette, PolesZerosResponseStage) and \
+                    blockette.stage_gain and \
+                    None in set([
+                        blockette.decimation_correction,
+                        blockette.decimation_delay,
+                        blockette.decimation_factor,
+                        blockette.decimation_input_sample_rate,
+                        blockette.decimation_offset]):
+                # Don't modify the original object.
+                blockette = copy.deepcopy(blockette)
+                blockette.decimation_correction = 0.0
+                blockette.decimation_delay = 0.0
+                blockette.decimation_factor = 1
+                blockette.decimation_offset = 0
+                sr = self.get_sampling_rates()
+                if sr and blockette.stage_sequence_number in sr and \
+                        sr[blockette.stage_sequence_number][
+                            "input_sampling_rate"]:
+                    blockette.decimation_input_sample_rate = \
+                        self.get_sampling_rates()[
+                            blockette.stage_sequence_number][
+                            "input_sampling_rate"]
+                # This branch get's large called for responses that only have a
+                # a single stage.
+                else:
+                    blockette.decimation_input_sample_rate = 1.0
+
             # Parse the decimation if is given.
             decimation_values = set([
                 blockette.decimation_correction,


Test patch:
diff --git a/obspy/core/tests/data/DK.BSD..BHZ.xml b/obspy/core/tests/data/DK.BSD..BHZ.xml
new file mode 100644
--- /dev/null
+++ b/obspy/core/tests/data/DK.BSD..BHZ.xml
@@ -0,0 +1,609 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FDSNStationXML xmlns="http://www.fdsn.org/xml/station/1" schemaVersion="1.0">
+  <Source>SeisComP3</Source>
+  <Sender>GFZ</Sender>
+  <Created>2018-04-26T15:00:20.570353</Created>
+  <Network code="DK" startDate="1980-01-01T00:00:00" restrictedStatus="open">
+    <Description>Danish National Seismic Network</Description>
+    <Station code="BSD" startDate="2004-12-04T00:00:00" restrictedStatus="open">
+      <Latitude>55.1139</Latitude>
+      <Longitude>14.9147</Longitude>
+      <Elevation>88</Elevation>
+      <Site>
+        <Name>Station Bornholm Skovbrynet, Denmark</Name>
+        <Country>Denmark</Country>
+      </Site>
+      <CreationDate>2004-12-04T00:00:00</CreationDate>
+      <Channel code="BHZ" startDate="2004-12-04T00:00:00" restrictedStatus="open" locationCode="">
+        <Latitude>55.1139</Latitude>
+        <Longitude>14.9147</Longitude>
+        <Elevation>88</Elevation>
+        <Depth>0</Depth>
+        <Azimuth>0</Azimuth>
+        <Dip>-90</Dip>
+        <SampleRate>20</SampleRate>
+        <SampleRateRatio>
+          <NumberSamples>20</NumberSamples>
+          <NumberSeconds>1</NumberSeconds>
+        </SampleRateRatio>
+        <StorageFormat>Steim2</StorageFormat>
+        <ClockDrift>0</ClockDrift>
+        <Sensor resourceId="Sensor#20170829123231.306616.5">
+          <Type>VBB</Type>
+          <Description>GFZ:DK1980:STS-2/G3/g=1500</Description>
+          <Manufacturer>Streckeisen</Manufacturer>
+          <Model>STS-2/G3</Model>
+        </Sensor>
+        <DataLogger resourceId="Datalogger#20170829123231.308231.7">
+          <Type>Nanometrics HDR24</Type>
+          <Description>GFZ:DK1980:HDR24/N/g=788033</Description>
+          <Manufacturer>Nanometrics</Manufacturer>
+          <Model>HDR24</Model>
+        </DataLogger>
+        <Response>
+          <InstrumentSensitivity>
+            <Value>635942631</Value>
+            <Frequency>0.02</Frequency>
+            <InputUnits>
+              <Name>M/S</Name>
+            </InputUnits>
+            <OutputUnits>
+              <Name>COUNTS</Name>
+            </OutputUnits>
+          </InstrumentSensitivity>
+          <Stage number="1">
+            <PolesZeros resourceId="ResponsePAZ#20170829123231.307035.6" name="GFZ:DK1980:STS-2/G3/g=1500">
+              <InputUnits>
+                <Name>M/S</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>V</Name>
+              </OutputUnits>
+              <PzTransferFunctionType>LAPLACE (RADIANS/SECOND)</PzTransferFunctionType>
+              <NormalizationFactor>3.46844e+17</NormalizationFactor>
+              <NormalizationFrequency>1</NormalizationFrequency>
+              <Zero number="11">
+                <Real>0</Real>
+                <Imaginary>0</Imaginary>
+              </Zero>
+              <Zero number="12">
+                <Real>0</Real>
+                <Imaginary>0</Imaginary>
+              </Zero>
+              <Zero number="13">
+                <Real>-15.15</Real>
+                <Imaginary>0</Imaginary>
+              </Zero>
+              <Zero number="14">
+                <Real>-176.6</Real>
+                <Imaginary>0</Imaginary>
+              </Zero>
+              <Zero number="15">
+                <Real>-463.1</Real>
+                <Imaginary>430.5</Imaginary>
+              </Zero>
+              <Zero number="16">
+                <Real>-463.1</Real>
+                <Imaginary>-430.5</Imaginary>
+              </Zero>
+              <Pole number="0">
+                <Real>-0.037</Real>
+                <Imaginary>0.037</Imaginary>
+              </Pole>
+              <Pole number="1">
+                <Real>-0.037</Real>
+                <Imaginary>-0.037</Imaginary>
+              </Pole>
+              <Pole number="2">
+                <Real>-15.64</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+              <Pole number="3">
+                <Real>-97.34</Real>
+                <Imaginary>-400.7</Imaginary>
+              </Pole>
+              <Pole number="4">
+                <Real>-97.34</Real>
+                <Imaginary>400.7</Imaginary>
+              </Pole>
+              <Pole number="5">
+                <Real>-255.1</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+              <Pole number="6">
+                <Real>-374.8</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+              <Pole number="7">
+                <Real>-520.3</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+              <Pole number="8">
+                <Real>-10530</Real>
+                <Imaginary>10050</Imaginary>
+              </Pole>
+              <Pole number="9">
+                <Real>-10530</Real>
+                <Imaginary>-10050</Imaginary>
+              </Pole>
+              <Pole number="10">
+                <Real>-13300</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+            </PolesZeros>
+            <StageGain>
+              <Value>1500</Value>
+              <Frequency>0.02</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="2">
+            <PolesZeros resourceId="ResponsePAZ#20170829123231.308452.8" name="GFZ:DK1980:HDR24_digipaz_1">
+              <InputUnits>
+                <Name>V</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>V</Name>
+              </OutputUnits>
+              <PzTransferFunctionType>LAPLACE (RADIANS/SECOND)</PzTransferFunctionType>
+              <NormalizationFactor>1.40631e+12</NormalizationFactor>
+              <NormalizationFrequency>1</NormalizationFrequency>
+              <Pole number="0">
+                <Real>-9904.8</Real>
+                <Imaginary>3786</Imaginary>
+              </Pole>
+              <Pole number="1">
+                <Real>-9904.8</Real>
+                <Imaginary>-3786</Imaginary>
+              </Pole>
+              <Pole number="2">
+                <Real>-12507.3</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+            </PolesZeros>
+            <StageGain>
+              <Value>0.538</Value>
+              <Frequency>1</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="3">
+            <Coefficients>
+              <InputUnits>
+                <Name>V</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <CfTransferFunctionType>DIGITAL</CfTransferFunctionType>
+            </Coefficients>
+            <Decimation>
+              <InputSampleRate>30000</InputSampleRate>
+              <Factor>1</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>788033</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="4">
+            <FIR resourceId="ResponseFIR#20170829123231.308856.9" name="GFZ:DK1980:HDR24_FIR_1">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>3.78878e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000199727</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000591277</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00119834</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0016772</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00123444</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00115877</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00607173</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0126102</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0176669</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0161537</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00263181</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0260166</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0680539</NumeratorCoefficient>
+              <NumeratorCoefficient>0.115986</NumeratorCoefficient>
+              <NumeratorCoefficient>0.158234</NumeratorCoefficient>
+              <NumeratorCoefficient>0.18305</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>30000</InputSampleRate>
+              <Factor>5</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="5">
+            <FIR resourceId="ResponseFIR#20170829123231.309486.10" name="GFZ:DK1980:HDR24_FIR_2">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>6.58791e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000189997</NumeratorCoefficient>
+              <NumeratorCoefficient>-4.82719e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00121678</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00245761</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000568704</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00649528</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0129497</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00544901</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.021593</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0469646</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0271107</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0656651</NumeratorCoefficient>
+              <NumeratorCoefficient>0.202943</NumeratorCoefficient>
+              <NumeratorCoefficient>0.306183</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>6000</InputSampleRate>
+              <Factor>3</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="6">
+            <FIR resourceId="ResponseFIR#20170829123231.309826.11" name="GFZ:DK1980:HDR24_FIR_3">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>-1.0469e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-2.37759e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-5.71898e-06</NumeratorCoefficient>
+              <NumeratorCoefficient>3.42359e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>3.05109e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-4.39314e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-7.44501e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>3.35697e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000136269</NumeratorCoefficient>
+              <NumeratorCoefficient>1.27756e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000202509</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000112215</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000248813</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000273009</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000237879</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000488299</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000125725</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000727343</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000129368</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000931762</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000552402</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00101653</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00113568</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000879633</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00182378</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000420099</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00250427</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000436356</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00300832</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00170771</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00312431</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00332718</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00262574</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00512246</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00131145</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00680853</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000946345</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00799837</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00415349</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00823239</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00815258</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00702311</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0125959</NumeratorCoefficient>
+              <NumeratorCoefficient>0.003906</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0169353</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00151894</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0204222</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00957991</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0220943</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0206082</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0206774</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0352195</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0141705</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0552559</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00190459</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.087902</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0450415</NumeratorCoefficient>
+              <NumeratorCoefficient>0.182297</NumeratorCoefficient>
+              <NumeratorCoefficient>0.410586</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>2000</InputSampleRate>
+              <Factor>2</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="7">
+            <FIR resourceId="ResponseFIR#20170829123231.310274.12" name="GFZ:DK1980:HDR24_FIR_4">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>1.27829e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>4.86436e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000114412</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000191012</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000219187</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000104308</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000242629</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000828811</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00149734</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00189428</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00154402</NumeratorCoefficient>
+              <NumeratorCoefficient>-5.73342e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00257422</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00572408</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00808691</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00798133</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00400912</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00410132</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0148003</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0245514</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0284513</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0216121</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000939619</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0333076</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0768324</NumeratorCoefficient>
+              <NumeratorCoefficient>0.121895</NumeratorCoefficient>
+              <NumeratorCoefficient>0.159156</NumeratorCoefficient>
+              <NumeratorCoefficient>0.180251</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>1000</InputSampleRate>
+              <Factor>5</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="8">
+            <FIR resourceId="ResponseFIR#20170829123231.310627.13" name="GFZ:DK1980:HDR24_FIR_5">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>-1.0469e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-2.37759e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-5.71898e-06</NumeratorCoefficient>
+              <NumeratorCoefficient>3.42359e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>3.05109e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-4.39314e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-7.44501e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>3.35697e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000136269</NumeratorCoefficient>
+              <NumeratorCoefficient>1.27756e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000202509</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000112215</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000248813</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000273009</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000237879</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000488299</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000125725</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000727343</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000129368</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000931762</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000552402</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00101653</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00113568</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000879633</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00182378</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000420099</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00250427</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000436356</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00300832</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00170771</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00312431</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00332718</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00262574</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00512246</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00131145</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00680853</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000946345</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00799837</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00415349</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00823239</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00815258</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00702311</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0125959</NumeratorCoefficient>
+              <NumeratorCoefficient>0.003906</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0169353</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00151894</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0204222</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00957991</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0220943</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0206082</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0206774</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0352195</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0141705</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0552559</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00190459</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.087902</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0450415</NumeratorCoefficient>
+              <NumeratorCoefficient>0.182297</NumeratorCoefficient>
+              <NumeratorCoefficient>0.410586</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>200</InputSampleRate>
+              <Factor>2</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="9">
+            <PolesZeros resourceId="ResponsePAZ#20170829123231.311077.14" name="GFZ:DK1980:HDR24_iirpaz_1">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <PzTransferFunctionType>DIGITAL (Z-TRANSFORM)</PzTransferFunctionType>
+              <NormalizationFactor>0.999969</NormalizationFactor>
+              <NormalizationFrequency>1</NormalizationFrequency>
+              <Zero number="1">
+                <Real>1</Real>
+                <Imaginary>0</Imaginary>
+              </Zero>
+              <Pole number="0">
+                <Real>0.99937</Real>
+                <Imaginary>0</Imaginary>
+              </Pole>
+            </PolesZeros>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>1</Frequency>
+            </StageGain>
+          </Stage>
+          <Stage number="10">
+            <FIR resourceId="ResponseFIR#20170829123231.311417.15" name="GFZ:DK1980:HDR24_FIR_6">
+              <InputUnits>
+                <Name>COUNTS</Name>
+              </InputUnits>
+              <OutputUnits>
+                <Name>COUNTS</Name>
+              </OutputUnits>
+              <Symmetry>EVEN</Symmetry>
+              <NumeratorCoefficient>4.03246e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>7.45328e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000123455</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000170189</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00019731</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000185489</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000119346</NumeratorCoefficient>
+              <NumeratorCoefficient>-5.7231e-06</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000177923</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000367326</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00052951</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000615009</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000583235</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000417284</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000134952</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000208333</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000527709</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00072819</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000731259</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00050192</NumeratorCoefficient>
+              <NumeratorCoefficient>6.78318e-05</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000477149</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000989158</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00130892</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00130736</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000930017</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000226254</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000648348</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00146171</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00196322</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00195662</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00136772</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000285463</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00104039</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00225068</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00296907</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00291274</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00199058</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000357354</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00159884</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00334097</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00432376</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00415564</NumeratorCoefficient>
+              <NumeratorCoefficient>0.002736</NumeratorCoefficient>
+              <NumeratorCoefficient>0.000323431</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00249475</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00493494</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0062252</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00583614</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00366897</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000139409</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00388023</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00726123</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00891936</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00814025</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00483705</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.000343478</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00611567</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0108478</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0129927</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0115499</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00643038</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0013912</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0100057</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0169806</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0199734</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0174066</NumeratorCoefficient>
+              <NumeratorCoefficient>0.00902946</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.00379497</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.018183</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.030223</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0357833</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.031469</NumeratorCoefficient>
+              <NumeratorCoefficient>-0.0155044</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0116724</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0472683</NumeratorCoefficient>
+              <NumeratorCoefficient>0.0865082</NumeratorCoefficient>
+              <NumeratorCoefficient>0.123467</NumeratorCoefficient>
+              <NumeratorCoefficient>0.152194</NumeratorCoefficient>
+              <NumeratorCoefficient>0.167894</NumeratorCoefficient>
+            </FIR>
+            <Decimation>
+              <InputSampleRate>100</InputSampleRate>
+              <Factor>5</Factor>
+              <Offset>0</Offset>
+              <Delay>0</Delay>
+              <Correction>0</Correction>
+            </Decimation>
+            <StageGain>
+              <Value>1</Value>
+              <Frequency>0</Frequency>
+            </StageGain>
+          </Stage>
+        </Response>
+      </Channel>
+    </Station>
+  </Network>
+</FDSNStationXML>
diff --git a/obspy/core/tests/test_response.py b/obspy/core/tests/test_response.py
--- a/obspy/core/tests/test_response.py
+++ b/obspy/core/tests/test_response.py
@@ -368,6 +368,92 @@ def test_str_method_of_the_polynomial_response_stage(self):
             "\tNumber of coefficients: 0"
         )
 
+    def test_get_sampling_rates(self):
+        """
+        Tests for the get_sampling_rates() method.
+        """
+        # Test for the default inventory.
+        resp = read_inventory()[0][0][0].response
+        self.assertEqual(
+            resp.get_sampling_rates(),
+            {1: {'decimation_factor': 1,
+                 'input_sampling_rate': 200.0,
+                 'output_sampling_rate': 200.0},
+             2: {'decimation_factor': 1,
+                 'input_sampling_rate': 200.0,
+                 'output_sampling_rate': 200.0}})
+
+        # Another, well behaved file.
+        inv = read_inventory(os.path.join(self.data_dir, "AU.MEEK.xml"))
+        self.assertEqual(
+            inv[0][0][0].response.get_sampling_rates(),
+            {1: {'decimation_factor': 1,
+                 'input_sampling_rate': 600.0,
+                 'output_sampling_rate': 600.0},
+             2: {'decimation_factor': 1,
+                 'input_sampling_rate': 600.0,
+                 'output_sampling_rate': 600.0},
+             3: {'decimation_factor': 1,
+                 'input_sampling_rate': 600.0,
+                 'output_sampling_rate': 600.0},
+             4: {'decimation_factor': 3,
+                 'input_sampling_rate': 600.0,
+                 'output_sampling_rate': 200.0},
+             5: {'decimation_factor': 10,
+                 'input_sampling_rate': 200.0,
+                 'output_sampling_rate': 20.0}})
+
+        # This file lacks decimation attributes for the first two stages as
+        # well as one of the later ones. These thus have to be inferred.
+        inv = read_inventory(os.path.join(self.data_dir, "DK.BSD..BHZ.xml"))
+        self.assertEqual(
+            inv[0][0][0].response.get_sampling_rates(),
+            {1: {'decimation_factor': 1,
+                 'input_sampling_rate': 30000.0,
+                 'output_sampling_rate': 30000.0},
+             2: {'decimation_factor': 1,
+                 'input_sampling_rate': 30000.0,
+                 'output_sampling_rate': 30000.0},
+             3: {'decimation_factor': 1,
+                 'input_sampling_rate': 30000.0,
+                 'output_sampling_rate': 30000.0},
+             4: {'decimation_factor': 5,
+                 'input_sampling_rate': 30000.0,
+                 'output_sampling_rate': 6000.0},
+             5: {'decimation_factor': 3,
+                 'input_sampling_rate': 6000.0,
+                 'output_sampling_rate': 2000.0},
+             6: {'decimation_factor': 2,
+                 'input_sampling_rate': 2000.0,
+                 'output_sampling_rate': 1000.0},
+             7: {'decimation_factor': 5,
+                 'input_sampling_rate': 1000.0,
+                 'output_sampling_rate': 200.0},
+             8: {'decimation_factor': 2,
+                 'input_sampling_rate': 200.0,
+                 'output_sampling_rate': 100.0},
+             9: {'decimation_factor': 1,
+                 'input_sampling_rate': 100.0,
+                 'output_sampling_rate': 100.0},
+             10: {'decimation_factor': 5,
+                  'input_sampling_rate': 100.0,
+                  'output_sampling_rate': 20.0}})
+
+    def test_response_calculation_paz_without_decimation(self):
+        """
+        This test files has two PAZ stages with no decimation attributes.
+
+        Evalresp does not like this so we have to add dummy decimation
+        attributes before calling it.
+        """
+        inv = read_inventory(os.path.join(self.data_dir, "DK.BSD..BHZ.xml"))
+        np.testing.assert_allclose(
+            inv[0][0][0].response.get_evalresp_response_for_frequencies(
+                [0.1, 1.0, 10.0]),
+            [6.27191825e+08 + 1.38925202e+08j,
+             6.51826202e+08 + 1.28404787e+07j,
+             2.00067263e+04 - 2.63711751e+03j])
+
 
 def suite():
     return unittest.makeSuite(ResponseTestCase, 'test')