• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spedas / pyspedas / 17001196665

15 Aug 2025 11:12PM UTC coverage: 89.516% (+0.7%) from 88.849%
17001196665

push

github

web-flow
Merge branch 'pyspedas_2_0_dev' into master

5072 of 6199 new or added lines in 413 files covered. (81.82%)

8 existing lines in 2 files now uncovered.

40061 of 44753 relevant lines covered (89.52%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
/pyspedas/tplot_tools/tplot_math/tinterp.py
1
# Copyright 2020 Regents of the University of Colorado. All Rights Reserved.
2
# Released under the MIT license.
3
# This software was developed at the University of Colorado's Laboratory for Atmospheric and Space Physics.
4
# Verify current version before use at: https://github.com/MAVENSDC/Pytplot
5

6
import pyspedas
1✔
7
import copy
1✔
8

9

10
def tinterp(tvar1,tvar2,replace=False):
1✔
11
    """
12
    Interpolates one tplot variable to another one's time cadence.  This is done automatically by other processing routines.
13

14
    Parameters
15
    ----------
16
        tvar1 : str
17
            Name of first tplot variable whose times will be used to interpolate tvar2's data.
18
        tvar2 : str
19
            Name of second tplot variable whose data will be interpolated.
20
        replace : bool, optional
21
            If true, the data in the original tplot variable is replaced.  Otherwise, a variable is created.
22

23
    Returns
24
    -------
25
        str
26
            Name of the new tplot variable
27

28
    Examples
29
    --------
30
        >>> pyspedas.store_data('a', data={'x':[0,4,8,12,16], 'y':[1,2,3,4,5]})
31
        >>> pyspedas.store_data('c', data={'x':[0,4,8,12,16,19,21], 'y':[1,4,1,7,1,9,1]})
32
        >>> pyspedas.tinterp('a','c')
33

34
    """
35
    new_tvar2 = pyspedas.tplot_tools.data_quants[tvar2].interp_like(pyspedas.tplot_tools.data_quants[tvar1])
1✔
36

37
    if replace:
1✔
NEW
38
        pyspedas.tplot_tools.data_quants[tvar2] = new_tvar2
×
NEW
39
        return
×
40
    else:
41
        pyspedas.tplot_tools.data_quants[tvar1 + '_tinterp'] = copy.deepcopy(new_tvar2)
1✔
42
        pyspedas.tplot_tools.data_quants[tvar1 + '_tinterp'].attrs = copy.deepcopy(new_tvar2.attrs)
1✔
43
        pyspedas.tplot_tools.data_quants[tvar1 + '_tinterp'].name = tvar1 + '_tinterp'
1✔
44

45
    return tvar1 + '_tinterp'
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc