Source code for gmprocess.waveform_processing.resample
"""Module for resampling."""fromgmprocess.waveform_processing.processing_stepimportprocessing_step
[docs]@processing_stepdefresample(st,new_sampling_rate=None,method=None,a=None,config=None):"""Resample stream. Args: st (StationStream): Stream of data. new_sampling_rate (float): New sampling rate, in Hz. method (str): Method for interpolation. Currently only supports 'lanczos'. a (int): Width of the Lanczos window, in number of samples. config (dict): Configuration dictionary (or None). See get_config(). Returns: StationStream: With resampling applied. """ifnotst.passed:returnstifmethod!="lanczos":raiseValueError("Only lanczos interpolation method is supported.")fortrinst:iftr.passed:tr.interpolate(sampling_rate=new_sampling_rate,method=method,a=a)tr.set_provenance("resample",{"new_sampling_rate":new_sampling_rate})returnst