LLNL-PyDV 3.9.1__tar.gz → 3.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/LICENSE +11 -11
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0/LLNL_PyDV.egg-info}/PKG-INFO +32 -29
- llnl_pydv-3.10.0/LLNL_PyDV.egg-info/SOURCES.txt +23 -0
- llnl_pydv-3.10.0/LLNL_PyDV.egg-info/dependency_links.txt +1 -0
- llnl_pydv-3.10.0/LLNL_PyDV.egg-info/entry_points.txt +2 -0
- llnl_pydv-3.10.0/LLNL_PyDV.egg-info/requires.txt +19 -0
- llnl_pydv-3.10.0/LLNL_PyDV.egg-info/top_level.txt +1 -0
- llnl_pydv-3.10.0/PKG-INFO +85 -0
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/README.md +1 -1
- llnl_pydv-3.10.0/pydv/__init__.py +1 -0
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/curve.py +149 -102
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pdv.py +1533 -1338
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pdv_launcher.py +3 -1
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pdvplot.py +76 -49
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pdvutil.py +86 -88
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pydvpy.py +501 -509
- llnl_pydv-3.10.0/pyproject.toml +76 -0
- llnl_pydv-3.10.0/setup.cfg +4 -0
- llnl_pydv-3.10.0/tests/test_pdv.py +313 -0
- llnl_pydv-3.10.0/tests/test_pydv_images.py +525 -0
- llnl_pydv-3.10.0/tests/test_pydvpy.py +300 -0
- llnl_pydv-3.9.1/pydv/__init__.py +0 -1
- llnl_pydv-3.9.1/pydv/pdv +0 -22
- llnl_pydv-3.9.1/pydv/scripts/date.txt +0 -1
- llnl_pydv-3.9.1/pydv/scripts/update_version_and_date.py +0 -64
- llnl_pydv-3.9.1/pydv/scripts/version.txt +0 -1
- llnl_pydv-3.9.1/pyproject.toml +0 -81
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/img/app_icon3.png +0 -0
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/img/window-code-7.png +0 -0
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/img/window-code-7@2x.png +0 -0
- {llnl_pydv-3.9.1 → llnl_pydv-3.10.0}/pydv/pdvnavbar.py +0 -0
|
@@ -3,15 +3,15 @@ Produced at the Lawrence Livermore National Laboratory
|
|
|
3
3
|
Written by Mason Kwiat, Douglas S. Miller, Kevin Griffin, Ephraim Rusu, Rachael Brooks, Sarah El-Jurf, Jorge Moreno
|
|
4
4
|
e-mail: moreno45@llnl.gov
|
|
5
5
|
LLNL-CODE-507071
|
|
6
|
-
All rights reserved.
|
|
7
|
-
|
|
8
|
-
This file is part of PDV. For details, see <https://lc.llnl.gov/confluence/pages/viewpage.action?spaceKey=PYDV&title=PyDV%3A+Python+Data+Visualizer>.
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
This file is part of PDV. For details, see <https://lc.llnl.gov/confluence/pages/viewpage.action?spaceKey=PYDV&title=PyDV%3A+Python+Data+Visualizer>.
|
|
9
9
|
Please also read "Additional BSD Notice".
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
|
12
12
|
modification, are permitted provided that the following conditions
|
|
13
13
|
are met:
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
Redistributions of source code must retain the above copyright
|
|
16
16
|
notice, this list of conditions and the disclaimer below.
|
|
17
17
|
Redistributions in binary form must reproduce the above copyright
|
|
@@ -20,7 +20,7 @@ in the documentation and/or other materials provided with the
|
|
|
20
20
|
distribution. Neither the name of the LLNS/LLNL nor the names of
|
|
21
21
|
its contributors may be used to endorse or promote products derived
|
|
22
22
|
from this software without specific prior written permission.
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
25
25
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
26
26
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
@@ -34,21 +34,21 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
34
34
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
35
35
|
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
36
36
|
SUCH DAMAGE.
|
|
37
|
-
|
|
38
|
-
Additional BSD Notice
|
|
39
|
-
|
|
37
|
+
|
|
38
|
+
Additional BSD Notice
|
|
39
|
+
|
|
40
40
|
1. This notice is required to be provided under our contract with
|
|
41
41
|
the U.S. Department of Energy (DOE). This work was produced at
|
|
42
42
|
Lawrence Livermore National Laboratory under Contract
|
|
43
43
|
No. DE-AC52-07NA27344 with the DOE.
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
2. Neither the United States Government nor Lawrence Livermore
|
|
46
46
|
National Security, LLC nor any of their employees, makes any
|
|
47
47
|
warranty, express or implied, or assumes any liability or
|
|
48
48
|
responsibility for the accuracy, completeness, or usefulness of any
|
|
49
49
|
information, apparatus, product, or process disclosed, or represents
|
|
50
50
|
that its use would not infringe privately-owned rights.
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
3. Also, reference herein to any specific commercial products,
|
|
53
53
|
process, or services by trade name, trademark, manufacturer or
|
|
54
54
|
otherwise does not necessarily constitute or imply its endorsement,
|
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: LLNL-PyDV
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.10.0
|
|
4
4
|
Summary: PyDV: Python Data Visualizer
|
|
5
|
+
Author-email: Jorge Moreno <moreno45@llnl.gov>, Sarah El-Jurf <eljurf1@llnl.gov>, Ephraim Rusu <rusu1@llnl.gov>
|
|
6
|
+
Maintainer-email: Jorge Moreno <moreno45@llnl.gov>
|
|
5
7
|
License: BSD
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Maintainer-email: moreno45@llnl.gov
|
|
11
|
-
Requires-Python: >=3.9
|
|
8
|
+
Project-URL: Homepage, https://github.com/LLNL/PyDV
|
|
9
|
+
Project-URL: Documentation, https://pydv.readthedocs.io/en/latest/
|
|
10
|
+
Project-URL: Issues, https://github.com/LLNL/PyDV/issues
|
|
11
|
+
Project-URL: Discussions, https://github.com/LLNL/PyDV/discussions
|
|
12
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
-
Classifier:
|
|
13
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
14
14
|
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
15
16
|
Classifier: Intended Audience :: Science/Research
|
|
16
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
17
|
-
Classifier: License :: Other/Proprietary License
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
26
17
|
Classifier: Topic :: Scientific/Engineering
|
|
27
18
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
28
|
-
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
29
24
|
Requires-Dist: matplotlib
|
|
30
25
|
Requires-Dist: numpy
|
|
31
|
-
Requires-Dist: scikit-image
|
|
32
|
-
Requires-Dist: scikit-learn
|
|
33
26
|
Requires-Dist: scipy
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
Requires-Dist: pyside6<=6.9.3
|
|
28
|
+
Requires-Dist: h5py
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
31
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest; extra == "dev"
|
|
33
|
+
Requires-Dist: sphinx-autoapi; extra == "dev"
|
|
34
|
+
Requires-Dist: six; extra == "dev"
|
|
35
|
+
Requires-Dist: scikit-image; extra == "dev"
|
|
36
|
+
Requires-Dist: imageio; extra == "dev"
|
|
37
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff; extra == "dev"
|
|
39
|
+
Requires-Dist: ty; extra == "dev"
|
|
40
|
+
Requires-Dist: coverage; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# PyDV
|
|
41
45
|
|
|
42
46
|
A 1D graphics and data analysis tool, heavily based on the ULTRA plotting tool.
|
|
43
47
|
|
|
@@ -79,4 +83,3 @@ All new contributions must be made under the [BSD-3 License](LICENSE)
|
|
|
79
83
|
See [LICENSE](LICENSE) for details.
|
|
80
84
|
|
|
81
85
|
LLNL-CODE-507071
|
|
82
|
-
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
LLNL_PyDV.egg-info/PKG-INFO
|
|
5
|
+
LLNL_PyDV.egg-info/SOURCES.txt
|
|
6
|
+
LLNL_PyDV.egg-info/dependency_links.txt
|
|
7
|
+
LLNL_PyDV.egg-info/entry_points.txt
|
|
8
|
+
LLNL_PyDV.egg-info/requires.txt
|
|
9
|
+
LLNL_PyDV.egg-info/top_level.txt
|
|
10
|
+
pydv/__init__.py
|
|
11
|
+
pydv/curve.py
|
|
12
|
+
pydv/pdv.py
|
|
13
|
+
pydv/pdv_launcher.py
|
|
14
|
+
pydv/pdvnavbar.py
|
|
15
|
+
pydv/pdvplot.py
|
|
16
|
+
pydv/pdvutil.py
|
|
17
|
+
pydv/pydvpy.py
|
|
18
|
+
pydv/img/app_icon3.png
|
|
19
|
+
pydv/img/window-code-7.png
|
|
20
|
+
pydv/img/window-code-7@2x.png
|
|
21
|
+
tests/test_pdv.py
|
|
22
|
+
tests/test_pydv_images.py
|
|
23
|
+
tests/test_pydvpy.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pydv
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: LLNL-PyDV
|
|
3
|
+
Version: 3.10.0
|
|
4
|
+
Summary: PyDV: Python Data Visualizer
|
|
5
|
+
Author-email: Jorge Moreno <moreno45@llnl.gov>, Sarah El-Jurf <eljurf1@llnl.gov>, Ephraim Rusu <rusu1@llnl.gov>
|
|
6
|
+
Maintainer-email: Jorge Moreno <moreno45@llnl.gov>
|
|
7
|
+
License: BSD
|
|
8
|
+
Project-URL: Homepage, https://github.com/LLNL/PyDV
|
|
9
|
+
Project-URL: Documentation, https://pydv.readthedocs.io/en/latest/
|
|
10
|
+
Project-URL: Issues, https://github.com/LLNL/PyDV/issues
|
|
11
|
+
Project-URL: Discussions, https://github.com/LLNL/PyDV/discussions
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: matplotlib
|
|
25
|
+
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: scipy
|
|
27
|
+
Requires-Dist: pyside6<=6.9.3
|
|
28
|
+
Requires-Dist: h5py
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
31
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest; extra == "dev"
|
|
33
|
+
Requires-Dist: sphinx-autoapi; extra == "dev"
|
|
34
|
+
Requires-Dist: six; extra == "dev"
|
|
35
|
+
Requires-Dist: scikit-image; extra == "dev"
|
|
36
|
+
Requires-Dist: imageio; extra == "dev"
|
|
37
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff; extra == "dev"
|
|
39
|
+
Requires-Dist: ty; extra == "dev"
|
|
40
|
+
Requires-Dist: coverage; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# PyDV
|
|
45
|
+
|
|
46
|
+
A 1D graphics and data analysis tool, heavily based on the ULTRA plotting tool.
|
|
47
|
+
|
|
48
|
+
## PyDV Importable Interface Module ###
|
|
49
|
+
You can now call most of PyDV's functionality from within a Python script. Below is an example of how to do this.
|
|
50
|
+
|
|
51
|
+
### Most Current
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
import sys
|
|
55
|
+
sys.path.append("/usr/gapps/pydv/current")
|
|
56
|
+
import pydvpy
|
|
57
|
+
|
|
58
|
+
curves = list()
|
|
59
|
+
curves.append(pydvpy.span(1,10,6))
|
|
60
|
+
pydvpy.save('myFile.txt', curves)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### PyPi or WEAVE Environment
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
from pydv import pydvpy
|
|
67
|
+
|
|
68
|
+
curves = list()
|
|
69
|
+
curves.append(pydvpy.span(1,10,6))
|
|
70
|
+
pydvpy.save('myFile.txt', curves)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
# Documentation
|
|
74
|
+
|
|
75
|
+
[PyDV Users Manual](https://pydv.readthedocs.io/en/latest/) [](https://pydv.readthedocs.io/en/latest/?badge=latest)
|
|
76
|
+
|
|
77
|
+
# License
|
|
78
|
+
|
|
79
|
+
PyDV is distributed under the terms of the [BSD-3 License](LICENSE)
|
|
80
|
+
|
|
81
|
+
All new contributions must be made under the [BSD-3 License](LICENSE)
|
|
82
|
+
|
|
83
|
+
See [LICENSE](LICENSE) for details.
|
|
84
|
+
|
|
85
|
+
LLNL-CODE-507071
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__all__ = ["curve", "pdv", "pdvnavbar", "pdvplot", "pdvutil", "pydvpy"]
|
|
@@ -59,47 +59,49 @@
|
|
|
59
59
|
# endorsement purposes.
|
|
60
60
|
|
|
61
61
|
import sys
|
|
62
|
+
|
|
62
63
|
import numpy as np
|
|
63
|
-
from scipy import
|
|
64
|
+
from scipy import integrate, interpolate
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
class Curve(object):
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
68
|
+
def __init__(
|
|
69
|
+
self,
|
|
70
|
+
x=np.empty(0),
|
|
71
|
+
y=np.empty(0),
|
|
72
|
+
name="",
|
|
73
|
+
filename="",
|
|
74
|
+
xlabel="",
|
|
75
|
+
ylabel="",
|
|
76
|
+
title="",
|
|
77
|
+
record_id="",
|
|
78
|
+
step=False,
|
|
79
|
+
step_original_x=np.empty(0),
|
|
80
|
+
step_original_y=np.empty(0),
|
|
81
|
+
xticks_labels=None,
|
|
82
|
+
plotname="",
|
|
83
|
+
color="",
|
|
84
|
+
edited=False,
|
|
85
|
+
scatter=False,
|
|
86
|
+
linespoints=False,
|
|
87
|
+
linewidth=None,
|
|
88
|
+
linestyle="-",
|
|
89
|
+
drawstyle="default",
|
|
90
|
+
dashes=None,
|
|
91
|
+
hidden=False,
|
|
92
|
+
ebar=None, # errorbar
|
|
93
|
+
erange=None, # errorrange
|
|
94
|
+
marker=".", # Use matplotlib markers when setting directly
|
|
95
|
+
markerstyle=None,
|
|
96
|
+
markersize=3,
|
|
97
|
+
markerfacecolor=None,
|
|
98
|
+
markeredgecolor=None,
|
|
99
|
+
plotprecedence=0,
|
|
100
|
+
legend_show=True,
|
|
101
|
+
math_interp_left=None,
|
|
102
|
+
math_interp_right=None,
|
|
103
|
+
math_interp_period=None,
|
|
104
|
+
):
|
|
103
105
|
self.x = np.array(x, dtype=float)
|
|
104
106
|
self.y = np.array(y, dtype=float)
|
|
105
107
|
self.name = name
|
|
@@ -109,8 +111,8 @@ class Curve(object):
|
|
|
109
111
|
self.title = title
|
|
110
112
|
self.record_id = record_id
|
|
111
113
|
self.step = step
|
|
112
|
-
self.step_original_x = step_original_x
|
|
113
|
-
self.step_original_y = step_original_y
|
|
114
|
+
self.step_original_x = step_original_x
|
|
115
|
+
self.step_original_y = step_original_y
|
|
114
116
|
self.xticks_labels = xticks_labels
|
|
115
117
|
self.plotname = plotname
|
|
116
118
|
self.color = color
|
|
@@ -141,10 +143,17 @@ class Curve(object):
|
|
|
141
143
|
def __add__(a, b):
|
|
142
144
|
c = Curve()
|
|
143
145
|
c.drawstyle = a.drawstyle
|
|
144
|
-
c.plotname = str(a.plotname +
|
|
145
|
-
ia, ib = getinterp(
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
c.plotname = str(a.plotname + " + " + b.plotname + " ").strip(" ")
|
|
147
|
+
ia, ib = getinterp(
|
|
148
|
+
a,
|
|
149
|
+
b,
|
|
150
|
+
a.math_interp_left,
|
|
151
|
+
a.math_interp_right,
|
|
152
|
+
a.math_interp_period,
|
|
153
|
+
b.math_interp_left,
|
|
154
|
+
b.math_interp_right,
|
|
155
|
+
b.math_interp_period,
|
|
156
|
+
)
|
|
148
157
|
if ia.x is not None and ib.x is not None:
|
|
149
158
|
c.x = ia.x
|
|
150
159
|
c.y = ia.y + ib.y
|
|
@@ -155,10 +164,17 @@ class Curve(object):
|
|
|
155
164
|
def __sub__(a, b):
|
|
156
165
|
c = Curve()
|
|
157
166
|
c.drawstyle = a.drawstyle
|
|
158
|
-
c.plotname = str(a.plotname +
|
|
159
|
-
ia, ib = getinterp(
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
c.plotname = str(a.plotname + " - " + b.plotname + " ").strip(" ")
|
|
168
|
+
ia, ib = getinterp(
|
|
169
|
+
a,
|
|
170
|
+
b,
|
|
171
|
+
a.math_interp_left,
|
|
172
|
+
a.math_interp_right,
|
|
173
|
+
a.math_interp_period,
|
|
174
|
+
b.math_interp_left,
|
|
175
|
+
b.math_interp_right,
|
|
176
|
+
b.math_interp_period,
|
|
177
|
+
)
|
|
162
178
|
if ia.x is not None and ib.x is not None:
|
|
163
179
|
c.x = ia.x
|
|
164
180
|
c.y = ia.y - ib.y
|
|
@@ -169,10 +185,17 @@ class Curve(object):
|
|
|
169
185
|
def __mul__(a, b):
|
|
170
186
|
c = Curve()
|
|
171
187
|
c.drawstyle = a.drawstyle
|
|
172
|
-
c.plotname = str(a.plotname +
|
|
173
|
-
ia, ib = getinterp(
|
|
174
|
-
|
|
175
|
-
|
|
188
|
+
c.plotname = str(a.plotname + " * " + b.plotname + " ").strip(" ")
|
|
189
|
+
ia, ib = getinterp(
|
|
190
|
+
a,
|
|
191
|
+
b,
|
|
192
|
+
a.math_interp_left,
|
|
193
|
+
a.math_interp_right,
|
|
194
|
+
a.math_interp_period,
|
|
195
|
+
b.math_interp_left,
|
|
196
|
+
b.math_interp_right,
|
|
197
|
+
b.math_interp_period,
|
|
198
|
+
)
|
|
176
199
|
if ia.x is not None and ib.x is not None:
|
|
177
200
|
c.x = ia.x
|
|
178
201
|
c.y = ia.y * ib.y
|
|
@@ -183,10 +206,17 @@ class Curve(object):
|
|
|
183
206
|
def __div__(a, b):
|
|
184
207
|
c = Curve()
|
|
185
208
|
c.drawstyle = a.drawstyle
|
|
186
|
-
c.plotname = str(a.plotname +
|
|
187
|
-
ia, ib = getinterp(
|
|
188
|
-
|
|
189
|
-
|
|
209
|
+
c.plotname = str(a.plotname + " / " + b.plotname + " ").strip(" ")
|
|
210
|
+
ia, ib = getinterp(
|
|
211
|
+
a,
|
|
212
|
+
b,
|
|
213
|
+
a.math_interp_left,
|
|
214
|
+
a.math_interp_right,
|
|
215
|
+
a.math_interp_period,
|
|
216
|
+
b.math_interp_left,
|
|
217
|
+
b.math_interp_right,
|
|
218
|
+
b.math_interp_period,
|
|
219
|
+
)
|
|
190
220
|
if ia.x is not None and ib.x is not None:
|
|
191
221
|
c.x = ia.x
|
|
192
222
|
|
|
@@ -205,10 +235,17 @@ class Curve(object):
|
|
|
205
235
|
def __truediv__(a, b):
|
|
206
236
|
c = Curve()
|
|
207
237
|
c.drawstyle = a.drawstyle
|
|
208
|
-
c.plotname = str(a.plotname +
|
|
209
|
-
ia, ib = getinterp(
|
|
210
|
-
|
|
211
|
-
|
|
238
|
+
c.plotname = str(a.plotname + " / " + b.plotname + " ").strip(" ")
|
|
239
|
+
ia, ib = getinterp(
|
|
240
|
+
a,
|
|
241
|
+
b,
|
|
242
|
+
a.math_interp_left,
|
|
243
|
+
a.math_interp_right,
|
|
244
|
+
a.math_interp_period,
|
|
245
|
+
b.math_interp_left,
|
|
246
|
+
b.math_interp_right,
|
|
247
|
+
b.math_interp_period,
|
|
248
|
+
)
|
|
212
249
|
if ia.x is not None and ib.x is not None:
|
|
213
250
|
c.x = ia.x
|
|
214
251
|
|
|
@@ -227,7 +264,7 @@ class Curve(object):
|
|
|
227
264
|
def __pow__(a, b):
|
|
228
265
|
c = Curve()
|
|
229
266
|
c.drawstyle = a.drawstyle
|
|
230
|
-
c.plotname = str(a.plotname +
|
|
267
|
+
c.plotname = str(a.plotname + "^" + str(b)).strip(" ")
|
|
231
268
|
c.x = np.array(a.x)
|
|
232
269
|
c.y = np.power(a.y, b)
|
|
233
270
|
nans = np.isnan(c.y) # remove NaNs
|
|
@@ -238,7 +275,7 @@ class Curve(object):
|
|
|
238
275
|
def __neg__(a):
|
|
239
276
|
c = Curve()
|
|
240
277
|
c.drawstyle = a.drawstyle
|
|
241
|
-
c.plotname = str(
|
|
278
|
+
c.plotname = str("-" + a.plotname)
|
|
242
279
|
c.x = np.array(a.x)
|
|
243
280
|
c.y = np.array(-a.y)
|
|
244
281
|
return c
|
|
@@ -248,40 +285,42 @@ class Curve(object):
|
|
|
248
285
|
Return a new copy of the curve object
|
|
249
286
|
"""
|
|
250
287
|
|
|
251
|
-
c = Curve(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
288
|
+
c = Curve(
|
|
289
|
+
x=np.array(self.x, dtype=float),
|
|
290
|
+
y=np.array(self.y, dtype=float),
|
|
291
|
+
name=self.name,
|
|
292
|
+
filename=self.filename,
|
|
293
|
+
xlabel=self.xlabel,
|
|
294
|
+
ylabel=self.ylabel,
|
|
295
|
+
title=self.title,
|
|
296
|
+
record_id=self.record_id,
|
|
297
|
+
step=self.step,
|
|
298
|
+
step_original_x=self.step_original_x,
|
|
299
|
+
step_original_y=self.step_original_y,
|
|
300
|
+
xticks_labels=self.xticks_labels,
|
|
301
|
+
plotname=self.plotname,
|
|
302
|
+
color=self.color,
|
|
303
|
+
edited=self.edited,
|
|
304
|
+
scatter=self.scatter,
|
|
305
|
+
linespoints=self.linespoints,
|
|
306
|
+
linewidth=self.linewidth,
|
|
307
|
+
linestyle=self.linestyle,
|
|
308
|
+
drawstyle=self.drawstyle,
|
|
309
|
+
dashes=self.dashes,
|
|
310
|
+
hidden=self.hidden,
|
|
311
|
+
ebar=self.ebar,
|
|
312
|
+
erange=self.erange,
|
|
313
|
+
marker=self.marker,
|
|
314
|
+
markerstyle=self.markerstyle,
|
|
315
|
+
markersize=self.markersize,
|
|
316
|
+
markerfacecolor=self.markerfacecolor,
|
|
317
|
+
markeredgecolor=self.markeredgecolor,
|
|
318
|
+
plotprecedence=self.plotprecedence,
|
|
319
|
+
legend_show=self.legend_show,
|
|
320
|
+
math_interp_left=self.math_interp_left,
|
|
321
|
+
math_interp_right=self.math_interp_right,
|
|
322
|
+
math_interp_period=self.math_interp_period,
|
|
323
|
+
)
|
|
285
324
|
|
|
286
325
|
return c
|
|
287
326
|
|
|
@@ -300,10 +339,18 @@ class Curve(object):
|
|
|
300
339
|
return c
|
|
301
340
|
|
|
302
341
|
|
|
303
|
-
def getinterp(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
342
|
+
def getinterp(
|
|
343
|
+
a,
|
|
344
|
+
b,
|
|
345
|
+
a_left=None,
|
|
346
|
+
a_right=None,
|
|
347
|
+
a_period=None,
|
|
348
|
+
b_left=None,
|
|
349
|
+
b_right=None,
|
|
350
|
+
b_period=None,
|
|
351
|
+
samples=100,
|
|
352
|
+
match="domain",
|
|
353
|
+
):
|
|
307
354
|
"""
|
|
308
355
|
Gets the interpolated and domain matched versions of the two curves.
|
|
309
356
|
|
|
@@ -327,7 +374,7 @@ def getinterp(a, b,
|
|
|
327
374
|
:type match: str
|
|
328
375
|
:returns: curve pair -- the interpolated and domain matched versions of a and b
|
|
329
376
|
"""
|
|
330
|
-
if match ==
|
|
377
|
+
if match == "domain":
|
|
331
378
|
ux = list(set(a.x).union(set(b.x))) # get union of xvals
|
|
332
379
|
ux.sort()
|
|
333
380
|
|
|
@@ -340,7 +387,7 @@ def getinterp(a, b,
|
|
|
340
387
|
ib.y = np.interp(ux, b.x, b.y, b_left, b_right, b_period) # interpolate y vals
|
|
341
388
|
|
|
342
389
|
return ia, ib
|
|
343
|
-
elif match ==
|
|
390
|
+
elif match == "step":
|
|
344
391
|
ax, step = np.linspace(min(a.x), max(a.x), num=samples, retstep=True)
|
|
345
392
|
|
|
346
393
|
bxsamples = int((max(b.x) - min(b.x)) / step)
|
|
@@ -376,7 +423,7 @@ def interp1d(a, num=100, retstep=False):
|
|
|
376
423
|
step: float, optional -- only returned if retstep is True. Size of the spacing between samples
|
|
377
424
|
"""
|
|
378
425
|
num = int(num)
|
|
379
|
-
f = interpolate.interp1d(a.x, a.y, kind=
|
|
426
|
+
f = interpolate.interp1d(a.x, a.y, kind="linear", bounds_error=False, fill_value=0)
|
|
380
427
|
|
|
381
428
|
ia = a.copy()
|
|
382
429
|
|