pytecplot 1.5.2__py3-none-any.whl

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.
Files changed (97) hide show
  1. pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
  2. pytecplot-1.5.2.dist-info/METADATA +508 -0
  3. pytecplot-1.5.2.dist-info/RECORD +97 -0
  4. pytecplot-1.5.2.dist-info/WHEEL +5 -0
  5. pytecplot-1.5.2.dist-info/top_level.txt +1 -0
  6. tecplot/__init__.py +94 -0
  7. tecplot/annotation/__init__.py +7 -0
  8. tecplot/annotation/annotation.py +223 -0
  9. tecplot/annotation/geometry.py +369 -0
  10. tecplot/annotation/georeference.py +33 -0
  11. tecplot/annotation/image.py +185 -0
  12. tecplot/annotation/iter.py +105 -0
  13. tecplot/annotation/polyline.py +381 -0
  14. tecplot/annotation/text.py +744 -0
  15. tecplot/constant.py +401 -0
  16. tecplot/data/__init__.py +34 -0
  17. tecplot/data/array.py +645 -0
  18. tecplot/data/create.py +1 -0
  19. tecplot/data/dataset.py +1809 -0
  20. tecplot/data/extract.py +544 -0
  21. tecplot/data/face_neighbors.py +494 -0
  22. tecplot/data/facemap.py +814 -0
  23. tecplot/data/load.py +2075 -0
  24. tecplot/data/nodemap.py +577 -0
  25. tecplot/data/operate.py +928 -0
  26. tecplot/data/query.py +334 -0
  27. tecplot/data/save.py +343 -0
  28. tecplot/data/variable.py +280 -0
  29. tecplot/data/zone.py +841 -0
  30. tecplot/exception.py +201 -0
  31. tecplot/export/__init__.py +13 -0
  32. tecplot/export/animation.py +521 -0
  33. tecplot/export/export_setup.py +318 -0
  34. tecplot/export/image.py +577 -0
  35. tecplot/export/print_setup.py +218 -0
  36. tecplot/export/time_animation.py +607 -0
  37. tecplot/extension/__init__.py +14 -0
  38. tecplot/extension/ipython.py +68 -0
  39. tecplot/layout/__init__.py +20 -0
  40. tecplot/layout/frame.py +1285 -0
  41. tecplot/layout/layout.py +488 -0
  42. tecplot/layout/page.py +541 -0
  43. tecplot/legend/__init__.py +4 -0
  44. tecplot/legend/contour_legend.py +516 -0
  45. tecplot/legend/legend.py +141 -0
  46. tecplot/legend/line_legend.py +66 -0
  47. tecplot/legend/rgb_coloring_legend.py +291 -0
  48. tecplot/legend/scatter_legend.py +136 -0
  49. tecplot/macro.py +339 -0
  50. tecplot/plot/__init__.py +62 -0
  51. tecplot/plot/axes.py +881 -0
  52. tecplot/plot/axis.py +1350 -0
  53. tecplot/plot/blanking.py +584 -0
  54. tecplot/plot/contour.py +1302 -0
  55. tecplot/plot/effects.py +162 -0
  56. tecplot/plot/fieldmap.py +2159 -0
  57. tecplot/plot/grid.py +758 -0
  58. tecplot/plot/isosurface.py +1167 -0
  59. tecplot/plot/labels.py +338 -0
  60. tecplot/plot/linemap.py +1905 -0
  61. tecplot/plot/linking.py +489 -0
  62. tecplot/plot/plot.py +1791 -0
  63. tecplot/plot/rgb_coloring.py +281 -0
  64. tecplot/plot/scatter.py +396 -0
  65. tecplot/plot/slice.py +1544 -0
  66. tecplot/plot/streamtrace.py +1949 -0
  67. tecplot/plot/symbol.py +567 -0
  68. tecplot/plot/ticks.py +666 -0
  69. tecplot/plot/title.py +380 -0
  70. tecplot/plot/vector.py +679 -0
  71. tecplot/plot/view.py +868 -0
  72. tecplot/session/__init__.py +112 -0
  73. tecplot/session/aux_data.py +276 -0
  74. tecplot/session/config.py +92 -0
  75. tecplot/session/session.py +425 -0
  76. tecplot/session/state_changed.py +225 -0
  77. tecplot/session/style.py +504 -0
  78. tecplot/tecutil/__init__.py +16 -0
  79. tecplot/tecutil/arglist.py +230 -0
  80. tecplot/tecutil/captured_output.py +177 -0
  81. tecplot/tecutil/constant.py +1312 -0
  82. tecplot/tecutil/index_set.py +118 -0
  83. tecplot/tecutil/lock.py +36 -0
  84. tecplot/tecutil/message_pb2.py +39 -0
  85. tecplot/tecutil/preamble.py +54 -0
  86. tecplot/tecutil/stringlist.py +114 -0
  87. tecplot/tecutil/sv.py +1662 -0
  88. tecplot/tecutil/tecutil.py +12402 -0
  89. tecplot/tecutil/tecutil_client.py +627 -0
  90. tecplot/tecutil/tecutil_connector.py +937 -0
  91. tecplot/tecutil/tecutil_rpc.py +6845 -0
  92. tecplot/tecutil/util.py +332 -0
  93. tecplot/text/__init__.py +3 -0
  94. tecplot/text/font.py +224 -0
  95. tecplot/text/label_format.py +374 -0
  96. tecplot/text/textbox.py +106 -0
  97. tecplot/version.py +41 -0
@@ -0,0 +1,381 @@
1
+ import ctypes
2
+
3
+ from ..tecutil import _tecutil
4
+ from .. import constant, tecutil, version
5
+
6
+ from . import geometry
7
+
8
+
9
+ class Arrowhead(object):
10
+ """Polyline arrowhead properties.
11
+
12
+ .. seealso:: `Frame.add_polyline()`
13
+
14
+ .. code-block:: python
15
+ :emphasize-lines: 10-12
16
+
17
+ import tecplot as tp
18
+ from tecplot.constant import *
19
+
20
+ frame = tp.active_frame()
21
+
22
+ line0 = frame.add_polyline([[30,30], [50,60]], coord_sys=CoordSys.Frame)
23
+ line1 = frame.add_polyline([[35,30], [55,60]], coord_sys=CoordSys.Frame)
24
+ line2 = frame.add_polyline([[40,30], [60,60]], coord_sys=CoordSys.Frame)
25
+
26
+ line0.arrowhead.attachment = ArrowheadAttachment.AtEnd
27
+ line1.arrowhead.attachment = ArrowheadAttachment.AtEnd
28
+ line2.arrowhead.attachment = ArrowheadAttachment.AtEnd
29
+
30
+ line0.line_thickness = 2
31
+ line1.line_thickness = 2
32
+ line2.line_thickness = 2
33
+
34
+ tp.export.save_png('arrowhead.png', 600)
35
+
36
+ .. figure:: /_static/images/arrowhead.png
37
+ :width: 300px
38
+ :figwidth: 300px
39
+ """
40
+ def __init__(self, polyline):
41
+ self.polyline = polyline
42
+ self.uid = self.polyline.uid
43
+ self.frame = self.polyline.frame
44
+
45
+ @property
46
+ def angle(self):
47
+ """`float`: The angle of the arrow lines in degrees.
48
+
49
+ This is the angle that one side of the arrowhead makes with the vector,
50
+ i.e. the apex angle is twice the arrowhead angle::
51
+
52
+ >>> from tecplot.constant import ArrowheadAttachment
53
+ >>> polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
54
+ >>> polyline.arrowhead.angle = 45
55
+ """
56
+ with self.frame.activated():
57
+ return _tecutil.GeomArrowheadGetAngle(self.uid)
58
+
59
+ @angle.setter
60
+ @tecutil.lock()
61
+ def angle(self, value):
62
+ with self.frame.activated():
63
+ _tecutil.GeomArrowheadSetAngle(self.uid, float(value))
64
+
65
+ @property
66
+ def attachment(self):
67
+ """`ArrowheadAttachment`: Location of arrowhead on the polyline.
68
+
69
+ Possible values are `ArrowheadAttachment.None_`,
70
+ `ArrowheadAttachment.AtBeginning`, `ArrowheadAttachment.AtEnd` and
71
+ `ArrowheadAttachment.AtBothEnds`::
72
+
73
+ >>> from tecplot.constant import ArrowheadAttachment
74
+ >>> polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
75
+ """
76
+ with self.frame.activated():
77
+ return _tecutil.GeomArrowheadGetAttach(self.uid)
78
+
79
+ @attachment.setter
80
+ @tecutil.lock()
81
+ def attachment(self, value):
82
+ attachment = constant.ArrowheadAttachment(value)
83
+ with self.frame.activated():
84
+ _tecutil.GeomArrowheadSetAttach(self.uid, attachment.value)
85
+
86
+ @property
87
+ def size(self):
88
+ """`float`: Size of the arrowhead on the polyline.
89
+
90
+ This is in the coordinate system specified by the
91
+ `position_coordinate_system <Polyline2D.position_coordinate_system>`
92
+ attribute of the polyline::
93
+
94
+ >>> from tecplot.constant import ArrowheadAttachment
95
+ >>> polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
96
+ >>> polyline.arrowhead.size = 10
97
+ """
98
+ with self.frame.activated():
99
+ return _tecutil.GeomArrowheadGetSize(self.uid)
100
+
101
+ @size.setter
102
+ @tecutil.lock()
103
+ def size(self, value):
104
+ with self.frame.activated():
105
+ _tecutil.GeomArrowheadSetSize(self.uid, float(value))
106
+
107
+ @property
108
+ def style(self):
109
+ """`ArrowheadStyle`: The style of the arrowhead on the polyline.
110
+
111
+ Possible values are `ArrowheadStyle.Plain`, `ArrowheadStyle.Hollow` and
112
+ `ArrowheadStyle.Filled`::
113
+
114
+ >>> from tecplot.constant import ArrowheadAttachment, ArrowheadStyle
115
+ >>> polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
116
+ >>> polyline.arrowhead.style = ArrowheadStyle.Filled
117
+ """
118
+ with self.frame.activated():
119
+ return _tecutil.GeomArrowheadGetStyle(self.uid)
120
+
121
+ @style.setter
122
+ @tecutil.lock()
123
+ def style(self, value):
124
+ style = constant.ArrowheadStyle(value)
125
+ with self.frame.activated():
126
+ _tecutil.GeomArrowheadSetStyle(self.uid, style.value)
127
+
128
+
129
+ class Polyline(geometry.Geometry):
130
+ def __init__(self, index, mpolyline):
131
+ self.index = tecutil.Index(index)
132
+ self.mpolyline = mpolyline
133
+ self.uid = self.mpolyline.uid
134
+ self.frame = self.mpolyline.frame
135
+
136
+ def __len__(self):
137
+ with self.frame.activated():
138
+ return _tecutil.GeomMPolyGetPointCount(self.uid, self.index + 1)
139
+
140
+
141
+ class Polyline2D(Polyline, geometry.Geometry2D):
142
+ """A series of connected points in 2D.
143
+
144
+ .. seealso:: `Frame.add_polyline()`
145
+
146
+ .. code-block:: python
147
+ :emphasize-lines: 13-15
148
+
149
+ import math
150
+
151
+ import tecplot as tp
152
+ from tecplot.constant import *
153
+
154
+ # create sine-wave in frame % coordinates
155
+ xx = list(range(10, 90))
156
+ yy = [10 * math.sin(x / 5) + 50 for x in xx]
157
+ points = [(x, y) for x, y in zip(xx, yy)]
158
+
159
+ frame = tp.active_frame()
160
+
161
+ line = frame.add_polyline(points, coord_sys=CoordSys.Frame)
162
+ line.line_thickness = 2
163
+ line.color = Color.Blue
164
+
165
+ tp.export.save_png('polyline2d.png', 600)
166
+
167
+ .. figure:: /_static/images/polyline2d.png
168
+ :width: 300px
169
+ :figwidth: 300px
170
+ """
171
+ @property
172
+ def arrowhead(self):
173
+ """`Arrowhead`: Style control for arrowheads.
174
+
175
+ Example usage::
176
+
177
+ >>> from tecplot.constant import ArrowheadAttachment, ArrowheadStyle
178
+ >>> polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
179
+ >>> polyline.arrowhead.style = ArrowheadStyle.Filled
180
+ """
181
+ return Arrowhead(self)
182
+
183
+ def __getitem__(self, i):
184
+ if __debug__:
185
+ if i >= len(self):
186
+ raise IndexError
187
+ with self.frame.activated():
188
+ pos = _tecutil.Geom2DMPolyGetPoint(self.uid, self.index + 1, i + 1)
189
+ return tecutil.XY(*pos)
190
+
191
+ @tecutil.lock()
192
+ def __setitem__(self, i, values):
193
+ if isinstance(i, slice):
194
+ num_points = len(self)
195
+ if i == slice(None, None, None):
196
+ x = (ctypes.c_double * num_points)(*[v[0] for v in values])
197
+ y = (ctypes.c_double * num_points)(*[v[1] for v in values])
198
+ else:
199
+ x = (ctypes.c_double * num_points)()
200
+ y = (ctypes.c_double * num_points)()
201
+ for j in range(len(self)):
202
+ x[j], y[j] = self[j]
203
+ x[i] = [v[0] for v in values]
204
+ y[i] = [v[1] for v in values]
205
+ else:
206
+ x, y = (float(v) for v in values)
207
+ with self.frame.activated():
208
+ if isinstance(x, ctypes.Array):
209
+ _tecutil.Geom2DMPolySetPolyline(self.uid, self.index + 1, x, y)
210
+ else:
211
+ _tecutil.Geom2DMPolySetPoint(self.uid, self.index + 1, i + 1, x, y)
212
+
213
+
214
+ class Polyline3D(Polyline):
215
+ """A series of connected points in 3D.
216
+
217
+ .. seealso:: `Frame.add_polyline()`
218
+
219
+ .. code-block:: python
220
+ :emphasize-lines: 18-20
221
+
222
+ import math
223
+
224
+ import tecplot as tp
225
+ from tecplot.constant import *
226
+
227
+ # create helix polyline in data coordinates
228
+ zz = [z / 2000 for z in range(1000)]
229
+ xx = [0.5 * math.cos(z * 50) for z in zz]
230
+ yy = [0.5 * math.sin(z * 50) for z in zz]
231
+ points = [(x, y, z) for x, y, z in zip(xx, yy, zz)]
232
+
233
+ frame = tp.active_frame()
234
+ dataset = frame.create_dataset('Dataset Name', ['x', 'y', 'z'])
235
+ dataset.add_ordered_zone('Zone Name', (10, 10, 10))
236
+ plot = frame.plot(PlotType.Cartesian3D)
237
+ plot.activate()
238
+
239
+ line = frame.add_polyline(points)
240
+ line.line_thickness = 2
241
+ line.color = Color.Chartreuse
242
+
243
+ tp.export.save_png('polyline3d.png', 600)
244
+
245
+ .. figure:: /_static/images/polyline3d.png
246
+ :width: 300px
247
+ :figwidth: 300px
248
+ """
249
+ def __getitem__(self, i):
250
+ if __debug__:
251
+ if i >= len(self):
252
+ raise IndexError
253
+ with self.frame.activated():
254
+ pos = _tecutil.Geom3DMPolyGetPoint(self.uid, self.index + 1, i + 1)
255
+ return tecutil.XYZ(*pos)
256
+
257
+ @tecutil.lock()
258
+ def __setitem__(self, i, values):
259
+ if isinstance(i, slice):
260
+ num_points = len(self)
261
+ if i == slice(None, None, None):
262
+ x = (ctypes.c_double * num_points)(*[v[0] for v in values])
263
+ y = (ctypes.c_double * num_points)(*[v[1] for v in values])
264
+ z = (ctypes.c_double * num_points)(*[v[2] for v in values])
265
+ else:
266
+ x = (ctypes.c_double * num_points)()
267
+ y = (ctypes.c_double * num_points)()
268
+ z = (ctypes.c_double * num_points)()
269
+ for j in range(len(self)):
270
+ x[j], y[j], z[j] = self[j]
271
+ x[i] = [v[0] for v in values]
272
+ y[i] = [v[1] for v in values]
273
+ z[i] = [v[2] for v in values]
274
+ else:
275
+ x, y, z = (float(v) for v in values)
276
+ with self.frame.activated():
277
+ if isinstance(x, ctypes.Array):
278
+ _tecutil.Geom3DMPolySetPolyline(self.uid, self.index + 1, x, y, z)
279
+ else:
280
+ _tecutil.Geom3DMPolySetPoint(self.uid, self.index + 1, i + 1, x, y, z)
281
+
282
+
283
+ class MultiPolyline(geometry.Geometry):
284
+ def __len__(self):
285
+ with self.frame.activated():
286
+ return _tecutil.GeomMPolyGetPolylineCnt(self.uid)
287
+
288
+
289
+ class MultiPolyline2D(MultiPolyline, geometry.Geometry2D):
290
+ """A collection of `Polyline2D` objects.
291
+
292
+ .. seealso:: `Frame.add_polyline()`
293
+
294
+ .. code-block:: python
295
+ :emphasize-lines: 16-18
296
+
297
+ import math
298
+
299
+ import tecplot as tp
300
+ from tecplot.constant import *
301
+
302
+ # create sine-wave in frame % coordinates
303
+ xx = list(range(10, 90))
304
+ yy = [10 * math.sin(x / 5) + 50 for x in xx]
305
+ points = [(x, y) for x, y in zip(xx, yy)]
306
+
307
+ # create new line with points shifted up and to the left
308
+ shifted_points = [(x + 5, y + 5) for x, y in points]
309
+
310
+ frame = tp.active_frame()
311
+
312
+ multi_line = frame.add_polyline(points, shifted_points, coord_sys=CoordSys.Frame)
313
+ multi_line.line_thickness = 2
314
+ multi_line.color = Color.Blue
315
+
316
+ tp.export.save_png('multipolyline2d.png', 600)
317
+
318
+ .. figure:: /_static/images/multipolyline2d.png
319
+ :width: 300px
320
+ :figwidth: 300px
321
+ """
322
+ @property
323
+ def arrowhead(self):
324
+ """`Arrowhead`: Style control for arrowheads.
325
+
326
+ Example usage::
327
+
328
+ >>> from tecplot.constant import ArrowheadAttachment, ArrowheadStyle
329
+ >>> multi_polyline.arrowhead.attachment = ArrowheadAttachment.AtEnd
330
+ >>> multi_polyline.arrowhead.style = ArrowheadStyle.Filled
331
+ """
332
+ return Arrowhead(self)
333
+
334
+ def __getitem__(self, i):
335
+ if __debug__:
336
+ if i >= len(self):
337
+ raise IndexError
338
+ return Polyline2D(i, self)
339
+
340
+
341
+ class MultiPolyline3D(MultiPolyline):
342
+ """A collection of `Polyline3D` objects.
343
+
344
+ .. seealso:: `Frame.add_polyline()`
345
+
346
+ .. code-block:: python
347
+ :emphasize-lines: 19-21
348
+
349
+ import math
350
+
351
+ import tecplot as tp
352
+ from tecplot.constant import *
353
+
354
+ # create double-helix multi-polyline in data coordinates
355
+ zz = [z / 2000 for z in range(1000)]
356
+ xx = [0.5 * math.cos(z * 50) for z in zz]
357
+ yy = [0.5 * math.sin(z * 50) for z in zz]
358
+ points = [(x, y, z) for x, y, z in zip(xx, yy, zz)]
359
+ points_shifted = [(x, y, z + 0.02) for x, y, z in zip(xx, yy, zz)]
360
+
361
+ frame = tp.active_frame()
362
+ dataset = frame.create_dataset('Dataset Name', ['x', 'y', 'z'])
363
+ dataset.add_ordered_zone('Zone Name', (10, 10, 10))
364
+ plot = frame.plot(PlotType.Cartesian3D)
365
+ plot.activate()
366
+
367
+ line = frame.add_polyline(points, points_shifted)
368
+ line.line_thickness = 2
369
+ line.color = Color.Turquoise
370
+
371
+ tp.export.save_png('multipolyline3d.png', 600)
372
+
373
+ .. figure:: /_static/images/multipolyline3d.png
374
+ :width: 300px
375
+ :figwidth: 300px
376
+ """
377
+ def __getitem__(self, i):
378
+ if __debug__:
379
+ if i >= len(self):
380
+ raise IndexError
381
+ return Polyline3D(i, self)