diff --git a/pyspedas/analysis/tdeflag.py b/pyspedas/analysis/tdeflag.py index 51e58b54..83558ce3 100644 --- a/pyspedas/analysis/tdeflag.py +++ b/pyspedas/analysis/tdeflag.py @@ -5,7 +5,7 @@ ---- Allowed wildcards are ? for a single character, * from multiple characters. Similar to tdeflag.pro in IDL SPEDAS. - +Moved to PyTplot/pytplot/tplot_math, 2023-11-30 """ import logging import pyspedas @@ -30,7 +30,7 @@ def tdeflag(names, method=None, new_names=None, suffix=None, If '', then pytplot variables are replaced. If not given, then a suffix is applied. suffix: str, optional - A suffix to apply. Default is '-clip'. + A suffix to apply. Default is '-deflag'. overwrite: bool, optional Replace the existing tplot name. @@ -39,38 +39,7 @@ def tdeflag(names, method=None, new_names=None, suffix=None, None. """ - old_names = pyspedas.tnames(names) - - if len(old_names) < 1: - logging.error('tdeflag error: No pytplot names were provided.') - return - - if suffix is None: - suffix = '-deflag' - - if overwrite is not None: - n_names = old_names - elif new_names is None: - n_names = [s + suffix for s in old_names] - else: - n_names = new_names - - if isinstance(n_names, str): - n_names = [n_names] - - if len(n_names) != len(old_names): - n_names = [s + suffix for s in old_names] - - for i in range(len(old_names)): - alldata = pytplot.get_data(old_names[i]) - time = alldata[0] - data = alldata[1] - new_time = [] - new_data = [] - for j in range(len(time)): - if not numpy.isnan(data[j]): - new_time.append(time[j]) - new_data.append(data[j]) - pytplot.store_data(n_names[i], data={'x': new_time, 'y': new_data}) - - logging.info('tdeflag was applied to: ' + n_names[i]) + logging.info("tdeflag has been moved to the pytplot.tplot_math module. Please update your imports!") + logging.info("This version will eventually be removed.") + pytplot.tplot_math.tdeflag(names,method=method,new_names=new_names, + suffix=suffix,overwrite=overwrite)