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.
- pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
- pytecplot-1.5.2.dist-info/METADATA +508 -0
- pytecplot-1.5.2.dist-info/RECORD +97 -0
- pytecplot-1.5.2.dist-info/WHEEL +5 -0
- pytecplot-1.5.2.dist-info/top_level.txt +1 -0
- tecplot/__init__.py +94 -0
- tecplot/annotation/__init__.py +7 -0
- tecplot/annotation/annotation.py +223 -0
- tecplot/annotation/geometry.py +369 -0
- tecplot/annotation/georeference.py +33 -0
- tecplot/annotation/image.py +185 -0
- tecplot/annotation/iter.py +105 -0
- tecplot/annotation/polyline.py +381 -0
- tecplot/annotation/text.py +744 -0
- tecplot/constant.py +401 -0
- tecplot/data/__init__.py +34 -0
- tecplot/data/array.py +645 -0
- tecplot/data/create.py +1 -0
- tecplot/data/dataset.py +1809 -0
- tecplot/data/extract.py +544 -0
- tecplot/data/face_neighbors.py +494 -0
- tecplot/data/facemap.py +814 -0
- tecplot/data/load.py +2075 -0
- tecplot/data/nodemap.py +577 -0
- tecplot/data/operate.py +928 -0
- tecplot/data/query.py +334 -0
- tecplot/data/save.py +343 -0
- tecplot/data/variable.py +280 -0
- tecplot/data/zone.py +841 -0
- tecplot/exception.py +201 -0
- tecplot/export/__init__.py +13 -0
- tecplot/export/animation.py +521 -0
- tecplot/export/export_setup.py +318 -0
- tecplot/export/image.py +577 -0
- tecplot/export/print_setup.py +218 -0
- tecplot/export/time_animation.py +607 -0
- tecplot/extension/__init__.py +14 -0
- tecplot/extension/ipython.py +68 -0
- tecplot/layout/__init__.py +20 -0
- tecplot/layout/frame.py +1285 -0
- tecplot/layout/layout.py +488 -0
- tecplot/layout/page.py +541 -0
- tecplot/legend/__init__.py +4 -0
- tecplot/legend/contour_legend.py +516 -0
- tecplot/legend/legend.py +141 -0
- tecplot/legend/line_legend.py +66 -0
- tecplot/legend/rgb_coloring_legend.py +291 -0
- tecplot/legend/scatter_legend.py +136 -0
- tecplot/macro.py +339 -0
- tecplot/plot/__init__.py +62 -0
- tecplot/plot/axes.py +881 -0
- tecplot/plot/axis.py +1350 -0
- tecplot/plot/blanking.py +584 -0
- tecplot/plot/contour.py +1302 -0
- tecplot/plot/effects.py +162 -0
- tecplot/plot/fieldmap.py +2159 -0
- tecplot/plot/grid.py +758 -0
- tecplot/plot/isosurface.py +1167 -0
- tecplot/plot/labels.py +338 -0
- tecplot/plot/linemap.py +1905 -0
- tecplot/plot/linking.py +489 -0
- tecplot/plot/plot.py +1791 -0
- tecplot/plot/rgb_coloring.py +281 -0
- tecplot/plot/scatter.py +396 -0
- tecplot/plot/slice.py +1544 -0
- tecplot/plot/streamtrace.py +1949 -0
- tecplot/plot/symbol.py +567 -0
- tecplot/plot/ticks.py +666 -0
- tecplot/plot/title.py +380 -0
- tecplot/plot/vector.py +679 -0
- tecplot/plot/view.py +868 -0
- tecplot/session/__init__.py +112 -0
- tecplot/session/aux_data.py +276 -0
- tecplot/session/config.py +92 -0
- tecplot/session/session.py +425 -0
- tecplot/session/state_changed.py +225 -0
- tecplot/session/style.py +504 -0
- tecplot/tecutil/__init__.py +16 -0
- tecplot/tecutil/arglist.py +230 -0
- tecplot/tecutil/captured_output.py +177 -0
- tecplot/tecutil/constant.py +1312 -0
- tecplot/tecutil/index_set.py +118 -0
- tecplot/tecutil/lock.py +36 -0
- tecplot/tecutil/message_pb2.py +39 -0
- tecplot/tecutil/preamble.py +54 -0
- tecplot/tecutil/stringlist.py +114 -0
- tecplot/tecutil/sv.py +1662 -0
- tecplot/tecutil/tecutil.py +12402 -0
- tecplot/tecutil/tecutil_client.py +627 -0
- tecplot/tecutil/tecutil_connector.py +937 -0
- tecplot/tecutil/tecutil_rpc.py +6845 -0
- tecplot/tecutil/util.py +332 -0
- tecplot/text/__init__.py +3 -0
- tecplot/text/font.py +224 -0
- tecplot/text/label_format.py +374 -0
- tecplot/text/textbox.py +106 -0
- tecplot/version.py +41 -0
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
from ..tecutil import _tecutil, sv
|
|
2
|
+
from ..constant import *
|
|
3
|
+
from ..exception import *
|
|
4
|
+
from .. import tecutil, version
|
|
5
|
+
|
|
6
|
+
from .animation import animation
|
|
7
|
+
from .export_setup import ExportSetup
|
|
8
|
+
from .print_setup import PrintSetup
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@tecutil.lock()
|
|
12
|
+
def save_time_animation(filename, start_time=None, end_time=None,
|
|
13
|
+
timestep_step=1, width=800, animation_speed=10,
|
|
14
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
15
|
+
compression=None, image_type=None,
|
|
16
|
+
multiple_color_tables=False, format_options=None,
|
|
17
|
+
convert_to_256_colors=False,
|
|
18
|
+
jpeg_encoding=JPEGEncoding.Standard, quality=75,
|
|
19
|
+
gray_scale_depth=None,
|
|
20
|
+
tiff_byte_order=TIFFByteOrder.Intel, format=None):
|
|
21
|
+
ani = animation(filename=filename, width=width,
|
|
22
|
+
animation_speed=animation_speed, region=region,
|
|
23
|
+
supersample=supersample, compression=compression,
|
|
24
|
+
image_type=image_type,
|
|
25
|
+
multiple_color_tables=multiple_color_tables,
|
|
26
|
+
format_options=format_options,
|
|
27
|
+
convert_to_256_colors=convert_to_256_colors,
|
|
28
|
+
jpeg_encoding=jpeg_encoding, quality=quality,
|
|
29
|
+
gray_scale_depth=gray_scale_depth,
|
|
30
|
+
tiff_byte_order=tiff_byte_order, format=format)
|
|
31
|
+
ani.setup()
|
|
32
|
+
with tecutil.ArgList() as arglist:
|
|
33
|
+
if start_time is not None:
|
|
34
|
+
arglist[sv.STARTTIME] = float(start_time)
|
|
35
|
+
if end_time is not None:
|
|
36
|
+
arglist[sv.ENDTIME] = float(end_time)
|
|
37
|
+
if timestep_step is not None:
|
|
38
|
+
arglist[sv.SKIP] = int(timestep_step)
|
|
39
|
+
arglist[sv.CREATEMOVIEFILE] = True
|
|
40
|
+
if not _tecutil.AnimateTimeX(arglist):
|
|
41
|
+
raise TecplotSystemError()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def save_time_animation_avi(filename, start_time=None, end_time=None,
|
|
45
|
+
timestep_step=1, width=800, animation_speed=10,
|
|
46
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
47
|
+
# compression and multiple_color_tables are deprecated, use format_options
|
|
48
|
+
compression=None, multiple_color_tables=False,
|
|
49
|
+
format_options=None):
|
|
50
|
+
"""Export transient data time-series AVI animation to a file.
|
|
51
|
+
|
|
52
|
+
Parameters:
|
|
53
|
+
filename (`str`): The resulting video file name or path, relative to
|
|
54
|
+
Python's current working directory.
|
|
55
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
56
|
+
animation. This defaults to the earliest solution time in the
|
|
57
|
+
dataset.
|
|
58
|
+
end_time (`float`, optional): The ending solution time of the
|
|
59
|
+
animation. This defaults to the latest solution time in the
|
|
60
|
+
dataset.
|
|
61
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
62
|
+
for each frame of the animation. (default: 1)
|
|
63
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
64
|
+
800)
|
|
65
|
+
animation_speed (`int`, optional): The frame-rate of the video in
|
|
66
|
+
frames per second. (default: 10)
|
|
67
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
68
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
69
|
+
<tecplot.layout.Frame>` object or one of
|
|
70
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
71
|
+
`ExportRegion.WorkArea`.
|
|
72
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
73
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
74
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
75
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
76
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
77
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
78
|
+
occurs on your machine, try updating your graphics driver or using
|
|
79
|
+
a lower anti-aliasing value. (default: **3**)
|
|
80
|
+
format_options (`str`, optional): A string of options passed directly
|
|
81
|
+
to the underlying application `FFmpeg <https://www.ffmpeg.org/>`_.
|
|
82
|
+
By default, this will be "-vcodec mjpeg -q:v 5".
|
|
83
|
+
|
|
84
|
+
Example usage, see the example under `save_time_animation_mpeg4` for a
|
|
85
|
+
complete working example::
|
|
86
|
+
|
|
87
|
+
>>> tp.export.save_time_animation_avi('output.avi')
|
|
88
|
+
"""
|
|
89
|
+
return save_time_animation(filename=filename, start_time=start_time,
|
|
90
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
91
|
+
width=width, animation_speed=animation_speed,
|
|
92
|
+
region=region, supersample=supersample,
|
|
93
|
+
compression=compression,
|
|
94
|
+
multiple_color_tables=multiple_color_tables,
|
|
95
|
+
format_options=format_options,
|
|
96
|
+
format=ExportFormat.AVI)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def save_time_animation_bmp(filename, start_time=None, end_time=None,
|
|
100
|
+
timestep_step=1, width=800,
|
|
101
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
102
|
+
convert_to_256_colors=False):
|
|
103
|
+
"""Export transient data time-series animation as BMP image files.
|
|
104
|
+
|
|
105
|
+
Parameters:
|
|
106
|
+
filename (`str`): Each frame of the animation will be exported to image
|
|
107
|
+
files that will include and underscore followed by the frame number
|
|
108
|
+
padded to six digits with zeros just before the last period. For
|
|
109
|
+
example, a **filename** of ``img.ext`` that exports three frames
|
|
110
|
+
will create the files: ``img_000001.ext``, ``img_000002.ext`` and
|
|
111
|
+
``img_000003.ext``.
|
|
112
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
113
|
+
animation. This defaults to the earliest solution time in the
|
|
114
|
+
dataset.
|
|
115
|
+
end_time (`float`, optional): The ending solution time of the
|
|
116
|
+
animation. This defaults to the latest solution time in the
|
|
117
|
+
dataset.
|
|
118
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
119
|
+
for each frame of the animation. (default: 1)
|
|
120
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
121
|
+
800)
|
|
122
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
123
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
124
|
+
<tecplot.layout.Frame>` object or one of
|
|
125
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
126
|
+
`ExportRegion.WorkArea`.
|
|
127
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
128
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
129
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
130
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
131
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
132
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
133
|
+
occurs on your machine, try updating your graphics driver or using
|
|
134
|
+
a lower anti-aliasing value. (default: **3**)
|
|
135
|
+
convert_to_256_colors (`Boolean <bool>`, optional): |export_convert256_description|
|
|
136
|
+
|
|
137
|
+
The following example will create a series of image files named
|
|
138
|
+
``img_000001.bmp``, ``img_000002.bmp``, etc.::
|
|
139
|
+
|
|
140
|
+
tp.export.save_time_animation_bmp('img.bmp')
|
|
141
|
+
|
|
142
|
+
.. versionadded:: 2018.2
|
|
143
|
+
Exporting animations as images requires Tecplot 360 2018 R2 or later.
|
|
144
|
+
"""
|
|
145
|
+
return save_time_animation(filename=filename, start_time=start_time,
|
|
146
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
147
|
+
width=width, region=region,
|
|
148
|
+
supersample=supersample,
|
|
149
|
+
convert_to_256_colors=convert_to_256_colors,
|
|
150
|
+
format=ExportFormat.BMP)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def save_time_animation_flash(filename, start_time=None, end_time=None,
|
|
154
|
+
timestep_step=1, width=800, animation_speed=10,
|
|
155
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
156
|
+
compression=None,
|
|
157
|
+
image_type=FlashImageType.Lossless):
|
|
158
|
+
"""Export transient data time-series Flash animation to a file.
|
|
159
|
+
|
|
160
|
+
Parameters:
|
|
161
|
+
filename (`str`): The resulting video file name or path, relative to
|
|
162
|
+
Python's current working directory.
|
|
163
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
164
|
+
animation. This defaults to the earliest solution time in the
|
|
165
|
+
dataset.
|
|
166
|
+
end_time (`float`, optional): The ending solution time of the
|
|
167
|
+
animation. This defaults to the latest solution time in the
|
|
168
|
+
dataset.
|
|
169
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
170
|
+
for each frame of the animation. (default: 1)
|
|
171
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
172
|
+
800)
|
|
173
|
+
animation_speed (`int`, optional): The frame-rate of the video in
|
|
174
|
+
frames per second. (default: 10)
|
|
175
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
176
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
177
|
+
<tecplot.layout.Frame>` object or one of
|
|
178
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
179
|
+
`ExportRegion.WorkArea`.
|
|
180
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
181
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
182
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
183
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
184
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
185
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
186
|
+
occurs on your machine, try updating your graphics driver or using
|
|
187
|
+
a lower anti-aliasing value. (default: **3**)
|
|
188
|
+
compression (`FlashCompressionType`, optional): The compression scheme
|
|
189
|
+
to use when creating the video stream. Options are:
|
|
190
|
+
`FlashCompressionType.BestSpeed` (default) and
|
|
191
|
+
`FlashCompressionType.SmallestSize`.
|
|
192
|
+
image_type (`FlashImageType`, optional): The type of images to generate
|
|
193
|
+
for each frame of the animation. Options are:
|
|
194
|
+
`FlashImageType.Color256`, `FlashImageType.JPEG` and
|
|
195
|
+
`FlashImageType.Lossless` (default).
|
|
196
|
+
|
|
197
|
+
Example usage, see the example under `save_time_animation_mpeg4` for a
|
|
198
|
+
complete working example::
|
|
199
|
+
|
|
200
|
+
>>> tp.export.save_time_animation_flash('output.flv')
|
|
201
|
+
"""
|
|
202
|
+
save_time_animation(filename=filename, start_time=start_time,
|
|
203
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
204
|
+
width=width, animation_speed=animation_speed,
|
|
205
|
+
region=region, supersample=supersample,
|
|
206
|
+
compression=compression, image_type=image_type,
|
|
207
|
+
format=ExportFormat.Flash)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def save_time_animation_jpeg(filename, start_time=None, end_time=None,
|
|
211
|
+
timestep_step=1, width=800,
|
|
212
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
213
|
+
encoding=JPEGEncoding.Standard, quality=75):
|
|
214
|
+
"""Export transient data time-series animation as JPEG image files.
|
|
215
|
+
|
|
216
|
+
Parameters:
|
|
217
|
+
filename (`str`): Each frame of the animation will be exported to image
|
|
218
|
+
files that will include and underscore followed by the frame number
|
|
219
|
+
padded to six digits with zeros just before the last period. For
|
|
220
|
+
example, a **filename** of ``img.ext`` that exports three frames
|
|
221
|
+
will create the files: ``img_000001.ext``, ``img_000002.ext`` and
|
|
222
|
+
``img_000003.ext``.
|
|
223
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
224
|
+
animation. This defaults to the earliest solution time in the
|
|
225
|
+
dataset.
|
|
226
|
+
end_time (`float`, optional): The ending solution time of the
|
|
227
|
+
animation. This defaults to the latest solution time in the
|
|
228
|
+
dataset.
|
|
229
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
230
|
+
for each frame of the animation. (default: 1)
|
|
231
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
232
|
+
800)
|
|
233
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
234
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
235
|
+
<tecplot.layout.Frame>` object or one of
|
|
236
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
237
|
+
`ExportRegion.WorkArea`.
|
|
238
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
239
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
240
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
241
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
242
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
243
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
244
|
+
occurs on your machine, try updating your graphics driver or using
|
|
245
|
+
a lower anti-aliasing value. (default: **3**)
|
|
246
|
+
encoding (`JPEGEncoding`, optional) Encoding method for the JPEG
|
|
247
|
+
file which may be one of the following: *
|
|
248
|
+
`JPEGEncoding.Standard` Creates a JPEG which downloads
|
|
249
|
+
one line at a time, starting at the top line. *
|
|
250
|
+
`JPEGEncoding.Progressive` Creates a JPEG image that
|
|
251
|
+
can be displayed with a "fade in" effect in a browser.
|
|
252
|
+
This is sometimes useful when viewing the JPEG in a
|
|
253
|
+
browser with a slow connection, since it allows an
|
|
254
|
+
approximation of the JPEG to be drawn immediately, and
|
|
255
|
+
the browser does not have to wait for the entire image
|
|
256
|
+
to download.
|
|
257
|
+
|
|
258
|
+
(default: `JPEGEncoding.Standard`)
|
|
259
|
+
quality (`int` 1-100, optional) Select the quality of JPEG image.
|
|
260
|
+
Higher quality settings produce larger files and better looking
|
|
261
|
+
export images. Lower quality settings produce smaller files.
|
|
262
|
+
For best results, use a quality setting of **75** or higher.
|
|
263
|
+
(default: **75**)
|
|
264
|
+
|
|
265
|
+
The following example will create a series of image files named
|
|
266
|
+
``img_000001.jpeg``, ``img_000002.jpeg``, etc.::
|
|
267
|
+
|
|
268
|
+
tp.export.save_time_animation_jpeg('img.jpeg')
|
|
269
|
+
|
|
270
|
+
.. versionadded:: 2018.2
|
|
271
|
+
Exporting animations as images requires Tecplot 360 2018 R2 or later.
|
|
272
|
+
"""
|
|
273
|
+
return save_time_animation(filename=filename, start_time=start_time,
|
|
274
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
275
|
+
width=width, region=region,
|
|
276
|
+
supersample=supersample,
|
|
277
|
+
jpeg_encoding=encoding, quality=quality,
|
|
278
|
+
format=ExportFormat.JPEG)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def save_time_animation_mpeg4(filename, start_time=None, end_time=None,
|
|
282
|
+
timestep_step=1, width=800, animation_speed=10,
|
|
283
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
284
|
+
format_options=None
|
|
285
|
+
):
|
|
286
|
+
"""Export transient data time-series MPEG-4 animation to a file.
|
|
287
|
+
|
|
288
|
+
Parameters:
|
|
289
|
+
filename (`str`): The resulting video file name or path, relative to
|
|
290
|
+
Python's current working directory.
|
|
291
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
292
|
+
animation. This defaults to the earliest solution time in the
|
|
293
|
+
dataset.
|
|
294
|
+
end_time (`float`, optional): The ending solution time of the
|
|
295
|
+
animation. This defaults to the latest solution time in the
|
|
296
|
+
dataset.
|
|
297
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
298
|
+
for each frame of the animation. (default: 1)
|
|
299
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
300
|
+
800)
|
|
301
|
+
animation_speed (`int`, optional): The frame-rate of the video in
|
|
302
|
+
frames per second. (default: 10)
|
|
303
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
304
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
305
|
+
<tecplot.layout.Frame>` object or one of
|
|
306
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
307
|
+
`ExportRegion.WorkArea`.
|
|
308
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
309
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
310
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
311
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
312
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
313
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
314
|
+
occurs on your machine, try updating your graphics driver or using
|
|
315
|
+
a lower anti-aliasing value. (default: **3**)
|
|
316
|
+
format_options (`str`, optional): A string of options passed directly
|
|
317
|
+
to the underlying application `FFmpeg <https://www.ffmpeg.org/>`_.
|
|
318
|
+
By default, this will be "-c:v libx264 -profile:v high -crf 20
|
|
319
|
+
-pix_fmt yuv420p".
|
|
320
|
+
|
|
321
|
+
Example usage:
|
|
322
|
+
|
|
323
|
+
.. code-block:: python
|
|
324
|
+
:emphasize-lines: 19-21
|
|
325
|
+
|
|
326
|
+
import os
|
|
327
|
+
|
|
328
|
+
import tecplot as tp
|
|
329
|
+
from tecplot.constant import *
|
|
330
|
+
|
|
331
|
+
examples = tp.session.tecplot_examples_directory()
|
|
332
|
+
datafile = os.path.join(examples, 'SimpleData', 'VortexShedding.plt')
|
|
333
|
+
dataset = tp.data.load_tecplot(datafile)
|
|
334
|
+
|
|
335
|
+
plot = tp.active_frame().plot(PlotType.Cartesian2D)
|
|
336
|
+
plot.activate()
|
|
337
|
+
plot.show_contour = True
|
|
338
|
+
|
|
339
|
+
plot.axes.x_axis.min = -0.002
|
|
340
|
+
plot.axes.x_axis.max = 0.012
|
|
341
|
+
plot.axes.y_axis.min = -0.006
|
|
342
|
+
plot.axes.y_axis.max = 0.006
|
|
343
|
+
|
|
344
|
+
tp.export.save_time_animation_mpeg4('vortex_shedding.mp4',
|
|
345
|
+
start_time=0, end_time=0.0006,
|
|
346
|
+
width=400, supersample=3)
|
|
347
|
+
|
|
348
|
+
.. raw:: html
|
|
349
|
+
|
|
350
|
+
<video controls>
|
|
351
|
+
<source src="../_static/videos/vortex_shedding.m4v" type="video/mp4">
|
|
352
|
+
I'm sorry; your browser doesn't support HTML5 MPEG4/H.264 video.
|
|
353
|
+
</video>
|
|
354
|
+
"""
|
|
355
|
+
save_time_animation(filename=filename, start_time=start_time,
|
|
356
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
357
|
+
width=width, animation_speed=animation_speed,
|
|
358
|
+
region=region, supersample=supersample,
|
|
359
|
+
format_options=format_options,
|
|
360
|
+
format=ExportFormat.MPEG4)
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def save_time_animation_png(filename, start_time=None, end_time=None,
|
|
364
|
+
timestep_step=1, width=800,
|
|
365
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
366
|
+
convert_to_256_colors=False):
|
|
367
|
+
"""Export transient data time-series animation as PNG image files.
|
|
368
|
+
|
|
369
|
+
Parameters:
|
|
370
|
+
filename (`str`): Each frame of the animation will be exported to image
|
|
371
|
+
files that will include and underscore followed by the frame number
|
|
372
|
+
padded to six digits with zeros just before the last period. For
|
|
373
|
+
example, a **filename** of ``img.ext`` that exports three frames
|
|
374
|
+
will create the files: ``img_000001.ext``, ``img_000002.ext`` and
|
|
375
|
+
``img_000003.ext``.
|
|
376
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
377
|
+
animation. This defaults to the earliest solution time in the
|
|
378
|
+
dataset.
|
|
379
|
+
end_time (`float`, optional): The ending solution time of the
|
|
380
|
+
animation. This defaults to the latest solution time in the
|
|
381
|
+
dataset.
|
|
382
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
383
|
+
for each frame of the animation. (default: 1)
|
|
384
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
385
|
+
800)
|
|
386
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
387
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
388
|
+
<tecplot.layout.Frame>` object or one of
|
|
389
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
390
|
+
`ExportRegion.WorkArea`.
|
|
391
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
392
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
393
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
394
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
395
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
396
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
397
|
+
occurs on your machine, try updating your graphics driver or using
|
|
398
|
+
a lower anti-aliasing value. (default: **3**)
|
|
399
|
+
convert_to_256_colors (`Boolean <bool>`, optional): |export_convert256_description|
|
|
400
|
+
|
|
401
|
+
The following example will create a series of image files named
|
|
402
|
+
``img_000001.png``, ``img_000002.png``, etc.::
|
|
403
|
+
|
|
404
|
+
tp.export.save_time_animation_png('img.png')
|
|
405
|
+
|
|
406
|
+
.. versionadded:: 2018.2
|
|
407
|
+
Exporting animations as images requires Tecplot 360 2018 R2 or later.
|
|
408
|
+
"""
|
|
409
|
+
return save_time_animation(filename=filename, start_time=start_time,
|
|
410
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
411
|
+
width=width, region=region,
|
|
412
|
+
supersample=supersample,
|
|
413
|
+
convert_to_256_colors=convert_to_256_colors,
|
|
414
|
+
format=ExportFormat.PNG)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def save_time_animation_raster_metafile(filename, start_time=None,
|
|
418
|
+
end_time=None, timestep_step=1,
|
|
419
|
+
width=800, animation_speed=10,
|
|
420
|
+
region=ExportRegion.AllFrames,
|
|
421
|
+
supersample=3,
|
|
422
|
+
multiple_color_tables=False):
|
|
423
|
+
"""Export transient data time-series Raster Metafile animation to a file.
|
|
424
|
+
|
|
425
|
+
Parameters:
|
|
426
|
+
filename (`str`): The resulting video file name or path, relative to
|
|
427
|
+
Python's current working directory.
|
|
428
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
429
|
+
animation. This defaults to the earliest solution time in the
|
|
430
|
+
dataset.
|
|
431
|
+
end_time (`float`, optional): The ending solution time of the
|
|
432
|
+
animation. This defaults to the latest solution time in the
|
|
433
|
+
dataset.
|
|
434
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
435
|
+
for each frame of the animation. (default: 1)
|
|
436
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
437
|
+
800)
|
|
438
|
+
animation_speed (`int`, optional): The frame-rate of the video in
|
|
439
|
+
frames per second. (default: 10)
|
|
440
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
441
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
442
|
+
<tecplot.layout.Frame>` object or one of
|
|
443
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
444
|
+
`ExportRegion.WorkArea`.
|
|
445
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
446
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
447
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
448
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
449
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
450
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
451
|
+
occurs on your machine, try updating your graphics driver or using
|
|
452
|
+
a lower anti-aliasing value. (default: **3**)
|
|
453
|
+
multiple_color_tables (`bool`, optional): Create a color table for each
|
|
454
|
+
frame of the animation. If `False` (default), the whole animation
|
|
455
|
+
will be scanned in an attempt to create a single table of 256
|
|
456
|
+
colors.
|
|
457
|
+
|
|
458
|
+
Example usage, see the example under `save_time_animation_mpeg4` for a
|
|
459
|
+
complete working example::
|
|
460
|
+
|
|
461
|
+
>>> tp.export.save_time_animation_raster_metafile('output.rm')
|
|
462
|
+
"""
|
|
463
|
+
save_time_animation(filename=filename, start_time=start_time,
|
|
464
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
465
|
+
width=width, animation_speed=animation_speed,
|
|
466
|
+
region=region, supersample=supersample,
|
|
467
|
+
multiple_color_tables=multiple_color_tables,
|
|
468
|
+
format=ExportFormat.RasterMetafile)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def save_time_animation_tiff(filename, start_time=None, end_time=None,
|
|
472
|
+
timestep_step=1, width=800,
|
|
473
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
474
|
+
convert_to_256_colors=False,
|
|
475
|
+
gray_scale_depth=None,
|
|
476
|
+
byte_order=TIFFByteOrder.Intel):
|
|
477
|
+
"""Export transient data time-series animation as TIFF image files.
|
|
478
|
+
|
|
479
|
+
Parameters:
|
|
480
|
+
filename (`str`): Each frame of the animation will be exported to image
|
|
481
|
+
files that will include and underscore followed by the frame number
|
|
482
|
+
padded to six digits with zeros just before the last period. For
|
|
483
|
+
example, a **filename** of ``img.ext`` that exports three frames
|
|
484
|
+
will create the files: ``img_000001.ext``, ``img_000002.ext`` and
|
|
485
|
+
``img_000003.ext``.
|
|
486
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
487
|
+
animation. This defaults to the earliest solution time in the
|
|
488
|
+
dataset.
|
|
489
|
+
end_time (`float`, optional): The ending solution time of the
|
|
490
|
+
animation. This defaults to the latest solution time in the
|
|
491
|
+
dataset.
|
|
492
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
493
|
+
for each frame of the animation. (default: 1)
|
|
494
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
495
|
+
800)
|
|
496
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
497
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
498
|
+
<tecplot.layout.Frame>` object or one of
|
|
499
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
500
|
+
`ExportRegion.WorkArea`.
|
|
501
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
502
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
503
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
504
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
505
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
506
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
507
|
+
occurs on your machine, try updating your graphics driver or using
|
|
508
|
+
a lower anti-aliasing value. (default: **3**)
|
|
509
|
+
convert_to_256_colors (`Boolean <bool>`, optional): |export_convert256_description|
|
|
510
|
+
gray_scale_depth (`int`, optional) Export a gray-scale TIFF.
|
|
511
|
+
The ``gray_scale_depth`` parameter may be set to a depth of
|
|
512
|
+
**1-8**
|
|
513
|
+
|
|
514
|
+
``gray_scale_depth`` specifies the number of shades of gray by how
|
|
515
|
+
many bits of gray scale information is used per pixel. The larger
|
|
516
|
+
the number of bits per pixel, the larger the resulting file.
|
|
517
|
+
|
|
518
|
+
Options are: * **0**: On/Off One bit per pixel using an
|
|
519
|
+
on/off strategy. All background pixels are made white (on),
|
|
520
|
+
and all foreground pixels, black (off). This setting
|
|
521
|
+
creates small files and is good for images with lots of
|
|
522
|
+
background, such as line plots and contour lines. *
|
|
523
|
+
**1**: 1 Bit per Pixel One bit per pixel using gray scale
|
|
524
|
+
values of pixels to determine black or white. Those
|
|
525
|
+
pixels that are more than 50 percent gray are black; the
|
|
526
|
+
rest are white. This setting creates small files that might
|
|
527
|
+
be useful for a rough draft or a preview image. *
|
|
528
|
+
**4**: 4 Bits per Pixel Four bits per pixel resulting
|
|
529
|
+
in sixteen levels of gray scale. This setting generates
|
|
530
|
+
fairly small image files with a fair number of gray levels.
|
|
531
|
+
This setting works well for most preview image purposes. *
|
|
532
|
+
**8**: 8 Bits per Pixel Eight bits per pixel resulting in
|
|
533
|
+
256 levels of gray. This setting is useful for full image
|
|
534
|
+
representation, but the files generated by this setting can
|
|
535
|
+
be large.
|
|
536
|
+
|
|
537
|
+
(default: `None`)
|
|
538
|
+
byte_order (`TIFFByteOrder`, optional) Specify the byte order
|
|
539
|
+
(Intel or Motorola) of the TIFF image. (Default:
|
|
540
|
+
`TIFFByteOrder.Intel`)
|
|
541
|
+
|
|
542
|
+
The following example will create a series of image files named
|
|
543
|
+
``img_000001.tiff``, ``img_000002.tiff``, etc.::
|
|
544
|
+
|
|
545
|
+
tp.export.save_time_animation_tiff('img.tiff')
|
|
546
|
+
|
|
547
|
+
.. versionadded:: 2018.2
|
|
548
|
+
Exporting animations as images requires Tecplot 360 2018 R2 or later.
|
|
549
|
+
"""
|
|
550
|
+
return save_time_animation(filename=filename, start_time=start_time,
|
|
551
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
552
|
+
width=width, region=region,
|
|
553
|
+
supersample=supersample,
|
|
554
|
+
convert_to_256_colors=convert_to_256_colors,
|
|
555
|
+
gray_scale_depth=gray_scale_depth,
|
|
556
|
+
tiff_byte_order=byte_order,
|
|
557
|
+
format=ExportFormat.TIFF)
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
def save_time_animation_wmv(filename, start_time=None, end_time=None,
|
|
561
|
+
timestep_step=1, width=800, animation_speed=10,
|
|
562
|
+
region=ExportRegion.AllFrames, supersample=3,
|
|
563
|
+
format_options=None):
|
|
564
|
+
"""Export transient data time-series Windows Media Video (WMV) to a file.
|
|
565
|
+
|
|
566
|
+
Parameters:
|
|
567
|
+
filename (`str`): The resulting video file name or path, relative to
|
|
568
|
+
Python's current working directory.
|
|
569
|
+
start_time (`float`, optional): The beginning solution time of the
|
|
570
|
+
animation. This defaults to the earliest solution time in the
|
|
571
|
+
dataset.
|
|
572
|
+
end_time (`float`, optional): The ending solution time of the
|
|
573
|
+
animation. This defaults to the latest solution time in the
|
|
574
|
+
dataset.
|
|
575
|
+
timestep_step (`int`, optional): The number of timesteps to increments
|
|
576
|
+
for each frame of the animation. (default: 1)
|
|
577
|
+
width (`int`, optional): The width of the video in pixels. (default:
|
|
578
|
+
800)
|
|
579
|
+
animation_speed (`int`, optional): The frame-rate of the video in
|
|
580
|
+
frames per second. (default: 10)
|
|
581
|
+
region (`Frame <tecplot.layout.Frame>` or `ExportRegion`, optional):
|
|
582
|
+
The rectangular area to be exported. This can be a specific `Frame
|
|
583
|
+
<tecplot.layout.Frame>` object or one of
|
|
584
|
+
`ExportRegion.CurrentFrame`, `ExportRegion.AllFrames` (default) or
|
|
585
|
+
`ExportRegion.WorkArea`.
|
|
586
|
+
supersample (`int`, optional): Controls the amount of anti-aliasing
|
|
587
|
+
used in each frame. Valid values are 1-16. A value of **1**
|
|
588
|
+
indicates that no antialiasing will be used. Antialiasing smooths
|
|
589
|
+
jagged edges on text, lines, and edges of the video output by the
|
|
590
|
+
process of supersampling. *Some graphics cards* can cause Tecplot
|
|
591
|
+
360 to crash when larger anti-aliasing values are used. If this
|
|
592
|
+
occurs on your machine, try updating your graphics driver or using
|
|
593
|
+
a lower anti-aliasing value. (default: **3**)
|
|
594
|
+
format_options (`str`, optional): A string of options passed directly
|
|
595
|
+
to the underlying application `FFmpeg <https://www.ffmpeg.org/>`_.
|
|
596
|
+
By default, this will be "-qscale 4".
|
|
597
|
+
|
|
598
|
+
Example usage, see the example under `save_time_animation_mpeg4` for a
|
|
599
|
+
complete working example::
|
|
600
|
+
|
|
601
|
+
>>> tp.export.save_time_animation_wmv('output.wmv')
|
|
602
|
+
"""
|
|
603
|
+
save_time_animation(filename=filename, start_time=start_time,
|
|
604
|
+
end_time=end_time, timestep_step=timestep_step,
|
|
605
|
+
width=width, animation_speed=animation_speed,
|
|
606
|
+
region=region, supersample=supersample,
|
|
607
|
+
format_options=format_options, format=ExportFormat.WMV)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Optional and extended functionality.
|
|
2
|
+
|
|
3
|
+
This sub-module provides integration with popular third-party libraries
|
|
4
|
+
including `NumPy <https://www.numpy.org/>`_ and `IPython
|
|
5
|
+
<https://ipython.org/>`_. These will be ignored if the required dependencies
|
|
6
|
+
are not installed. To enable extensions, you can install the required
|
|
7
|
+
dependencies with pip:
|
|
8
|
+
|
|
9
|
+
cd pytecplot
|
|
10
|
+
python -m pip install -U .[extras]
|
|
11
|
+
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from . import ipython
|