Skip to content

Commit

Permalink
added test that filter complex response does not choke when provided …
Browse files Browse the repository at this point in the history
…with a simple integer or float rather than a numpy array -- issue #18
  • Loading branch information
kkappler committed Mar 30, 2021
1 parent 63ff054 commit fa10d4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mt_metadata/timeseries/filters/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_filter_generation_from_xml_via_obspy(inventory):
for fltr in filters_list:
print(fltr.type)
frequencies = np.logspace(-3, 3, 200)
test_filter_response_works_for_float(fltr)
# fltr.plot_complex_response(frequencies)
# fltr.plot_response(None, x_units='frequency')
channel_response_filter = ChannelResponseFilter(filters_list=filters_list)
Expand All @@ -94,6 +95,12 @@ def test_filter_generation_from_xml_via_obspy(inventory):
print("ok")


def test_filter_response_works_for_float(fltr):
integer_response = fltr.complex_response(1)
float_response = fltr.complex_response(1.0)
print(f'integer response {integer_response}, float response {float_response}')
return

def test_correct_sense_of_normalization_factor():
"""
Load in an mth5 with data from NIMS system and calibrate the data. Confirm whether the normalization factor
Expand Down

0 comments on commit fa10d4a

Please sign in to comment.