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

spedas / pyspedas / 25194239086

26 Apr 2026 08:07PM UTC coverage: 61.697% (-28.8%) from 90.54%
25194239086

push

github

jameswilburlewis
Added test for loading Cluster CODIF differential energy flux

0 of 7 new or added lines in 1 file covered. (0.0%)

19460 existing lines in 418 files now uncovered.

30204 of 48955 relevant lines covered (61.7%)

1.44 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
3✔
7
import copy
3✔
8

9

10
def tinterp(tvar1,tvar2,replace=False):
3✔
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
    """
UNCOV
35
    new_tvar2 = pyspedas.tplot_tools.data_quants[tvar2].interp_like(pyspedas.tplot_tools.data_quants[tvar1])
2✔
36

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

UNCOV
45
    return tvar1 + '_tinterp'
2✔
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