fork download
  1. import matplotlib.pyplot as plt
  2. import pandas as pd
  3. from scipy.signal import find_peaks
  4.  
  5. file_path = "J125188_0508_500Hz.txt"
  6.  
  7. MIN_HEIGHT = 3.5
  8. MIN_DISTANCE = 10
  9.  
  10. try:df = pd.read_csv(file_path, header=None, names=["Time", "Voltage"])
  11. except FileNotFoundError:
  12. exit()
  13.  
  14. times = df["Time"].values
  15. voltages = df["Voltage"].values
  16.  
  17. peak_indices, _ = find_peaks(
  18. voltages, height=MIN_HEIGHT, distance=MIN_DISTANCE
  19. )
Success #stdin #stdout 1.01s 97868KB
stdin
Standard input is empty
stdout
Standard output is empty