# Response is dropping stationxml decimation element

**URL:** <https://discourse.obspy.org/t/response-is-dropping-stationxml-decimation-element/1129>\
**Category:** Usage Questions\
**Created:** [November 11, 2020, 3:13am UTC](https://discourse.obspy.org/t/response-is-dropping-stationxml-decimation-element/1129 "2020-11-11T03:13:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mth](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@mth](https://discourse.obspy.org/u/mth)\
**Post date:** [November 11, 2020, 3:13am UTC](https://discourse.obspy.org/t/response-is-dropping-stationxml-decimation-element/1129/1 "2020-11-11T03:13:51Z")

</div>

I have a test StationXML file that is part of the IRIS validation test suite.  
It contains a response with this stage in it:

```
<Stage number="1">
    <Decimation>
        <InputSampleRate>512000.0</InputSampleRate>
        <Factor>1</Factor>
        <Offset>0</Offset>
        <Delay>0.0</Delay>
        <Correction>0.0</Correction>
    </Decimation>
    <StageGain>
        <Value>0.4</Value>
        <Frequency>1.0</Frequency>
    </StageGain>
</Stage>

```

This stage does not specify a PolesZeros/Coefficients/etc element; it  
is designed to fail IRIS validation rule 423.  
Obspy reads this stage into a generic ResponseStage but it drops the decimation  
information (e.g., stage.decimation\_input\_sample\_rate is None), making it look like any other stage containing only a stage.stage\_gain.

Is this a bug ?

I’ll attach the xmlfile to this post.

Thanks!  
[F1\_423.xml](https://discourse.obspy.org/uploads/short-url/1iKcpI5noGFm7hDPEteFpGtQXzX.xml) (30.0 KB)

---

<div class="post-metadata">

**Author:** ![mth](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@mth](https://discourse.obspy.org/u/mth)\
**Post date:** [November 11, 2020, 3:02pm UTC](https://discourse.obspy.org/t/response-is-dropping-stationxml-decimation-element/1129/2 "2020-11-11T15:02:00Z")

</div>

Nevermind - looking through the code I can see that it expects a stage  
to be one of the 5 types:  
type\_elems = [poles\_zeros\_elem, coefficients\_elem, response\_list\_elem,  
fir\_elem, polynomial\_elem]

and for these it will pass the decimation info in \*\*kwargs to instantiate the object,  
or else it simply returns the base ResponseStage without any additional info (like decimation).

So I guess I’ll have to trap this particular case using lxml directly.
