# Possible bug: bandpass filter creates NAN in filtered	data

**URL:** <https://discourse.obspy.org/t/possible-bug-bandpass-filter-creates-nan-in-filtered-data/396>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [March 11, 2015, 4:43pm UTC](https://discourse.obspy.org/t/possible-bug-bandpass-filter-creates-nan-in-filtered-data/396 "2015-03-11T16:43:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randall\_Pratt](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@Randall\_Pratt](https://discourse.obspy.org/u/Randall_Pratt)\
**Post date:** [March 11, 2015, 4:43pm UTC](https://discourse.obspy.org/t/possible-bug-bandpass-filter-creates-nan-in-filtered-data/396/1 "2015-03-11T16:43:21Z")

</div>

Greetings,

I have discovered what appears to be a bug in the bandpass filter. The error is repeatable using the code below. By commenting out the filter line all is OK so I don't believe the response correction is involved.

If the data component selection is changed to LH\* at 1 hz sample rate the filter works but at the MH\* 40 sps sample rate it fails and creates NAN in the output.

Randy

################### Code Block###########Error line is commented out########  
from obspy.fdsn import Client  
from obspy import UTCDateTime  
import numpy as np

t = UTCDateTime("2014-12-19T00:00:00.000")

client = Client("IRIS")

st = client.get\_waveforms("TA", "MDND", "--", "BH\*", t, t + 3600, attach\_response=True)

print st

if np.isnan(np.min(st[0].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in st[0]'  
if np.isnan(np.min(st[1].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in st[1]'  
if np.isnan(np.min(st[2].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in st[2]'

st.remove\_response()

##### Error caused by this next line######  
#st.filter("bandpass", freqmin = 0.105, freqmax = .125, zerophase = True)

if np.isnan(np.min(st[0].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in filtered trace0'  
if np.isnan(np.min(st[1].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in filtered trace1'  
if np.isnan(np.min(st[2].data)):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 'Warning: nan in filtered trace2'
