Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Ziemen
paraview-files
Commits
80c1e313
Commit
80c1e313
authored
Jan 22, 2022
by
Florian Ziemen
Browse files
ingredients for velocity magnitude plot
parent
45ec56fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
DYAMOND_WINTER/velmag.py
0 → 100644
View file @
80c1e313
# state file generated using paraview version 5.8.1-2374-gdd080cd
#### import the simple module from the paraview
from
paraview.simple
import
*
#### disable automatic camera reset on 'Show'
paraview
.
simple
.
_DisableFirstRenderCameraReset
()
# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------
# Create a new 'Render View'
renderView1
=
CreateView
(
'RenderView'
)
renderView1
.
ViewSize
=
[
1594
,
1014
]
renderView1
.
InteractionMode
=
'2D'
renderView1
.
AxesGrid
=
'GridAxes3DActor'
renderView1
.
CenterOfRotation
=
[
1.52587890625e-05
,
-
7.62939453125e-06
,
1.9786605834960938
]
renderView1
.
StereoType
=
'Crystal Eyes'
renderView1
.
CameraPosition
=
[
840.3610484629874
,
-
808.9015975213953
,
650.1553759250085
]
renderView1
.
CameraFocalPoint
=
[
-
2.8902204361228723
,
-
24.603985340010166
,
-
23.064632601375326
]
renderView1
.
CameraViewUp
=
[
0.23326822430858335
,
0.7655176539788445
,
0.5996404397425567
]
renderView1
.
CameraFocalDisk
=
1.0
renderView1
.
CameraParallelScale
=
156.65342198771174
SetActiveView
(
None
)
# ----------------------------------------------------------------
# setup view layouts
# ----------------------------------------------------------------
# create new layout object 'Layout #1'
layout1
=
CreateLayout
(
name
=
'Layout #1'
)
layout1
.
AssignView
(
0
,
renderView1
)
layout1
.
SetSize
(
1594
,
1014
)
# ----------------------------------------------------------------
# restore active view
SetActiveView
(
renderView1
)
# ----------------------------------------------------------------
# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------
# create a new 'CDIReader'
dpp0029_ocean3D_top_level_20200901TZnc
=
CDIReader
(
registrationName
=
'dpp0029_ocean3D_top_level_20200901T..Z.nc'
,
FileNames
=
[
'/work/kv0653/k202051/ICON/NextGEMS_R2B9/dpp0029_ocean3D_top_level_20200901T000000Z.nc'
])
dpp0029_ocean3D_top_level_20200901TZnc
.
Dimensions
=
'(clon, clat, depth)'
dpp0029_ocean3D_top_level_20200901TZnc
.
CellArrayStatus
=
[
'u'
,
'v'
]
dpp0029_ocean3D_top_level_20200901TZnc
.
SetProjection
=
'Spherical Projection'
dpp0029_ocean3D_top_level_20200901TZnc
.
LayerThickness
=
50
dpp0029_ocean3D_top_level_20200901TZnc
.
MaskingValueVar
=
'u'
# create a new 'Calculator'
calculator1
=
Calculator
(
registrationName
=
'Calculator1'
,
Input
=
dpp0029_ocean3D_top_level_20200901TZnc
)
calculator1
.
AttributeType
=
'Cell Data'
calculator1
.
ResultArrayName
=
'vel'
calculator1
.
Function
=
'u*iHat + v *jHat'
# ----------------------------------------------------------------
# setup the visualization in view 'renderView1'
# ----------------------------------------------------------------
# show data from calculator1
calculator1Display
=
Show
(
calculator1
,
renderView1
,
'UnstructuredGridRepresentation'
)
# get color transfer function/color map for 'vel'
velLUT
=
GetColorTransferFunction
(
'vel'
)
velLUT
.
AutomaticRescaleRangeMode
=
'Never'
velLUT
.
RGBPoints
=
[
0.0
,
0.031373
,
0.25098
,
0.505882
,
0.06274500000000005
,
0.031373
,
0.329719
,
0.590527
,
0.12549
,
0.031911
,
0.408397
,
0.674787
,
0.1882355
,
0.100807
,
0.479262
,
0.710219
,
0.25098050000000005
,
0.169704
,
0.550219
,
0.745744
,
0.3137255
,
0.238601
,
0.62699
,
0.787082
,
0.37647049999999993
,
0.307958
,
0.703114
,
0.826759
,
0.4392155
,
0.39654
,
0.752326
,
0.797232
,
0.501960785
,
0.485121
,
0.801046
,
0.767705
,
0.564706
,
0.573702
,
0.83451
,
0.738178
,
0.627451
,
0.661592
,
0.867743
,
0.711034
,
0.690196
,
0.732457
,
0.895302
,
0.74253
,
0.7529410000000001
,
0.801845
,
0.922307
,
0.774579
,
0.8156865
,
0.841215
,
0.938055
,
0.817885
,
0.8784315
,
0.880907
,
0.95391
,
0.861084
,
0.9411765000000001
,
0.926182
,
0.971626
,
0.902422
,
1.0
,
0.968627
,
0.988235
,
0.941176
]
velLUT
.
ColorSpace
=
'Lab'
velLUT
.
NanColor
=
[
1.0
,
0.0
,
0.0
]
velLUT
.
ScalarRangeInitialized
=
1.0
# get opacity transfer function/opacity map for 'vel'
velPWF
=
GetOpacityTransferFunction
(
'vel'
)
velPWF
.
ScalarRangeInitialized
=
1
# trace defaults for the display properties.
calculator1Display
.
Representation
=
'Surface'
calculator1Display
.
ColorArrayName
=
[
'CELLS'
,
'vel'
]
calculator1Display
.
LookupTable
=
velLUT
calculator1Display
.
SelectTCoordArray
=
'None'
calculator1Display
.
SelectNormalArray
=
'None'
calculator1Display
.
SelectTangentArray
=
'None'
calculator1Display
.
OSPRayScaleFunction
=
'PiecewiseFunction'
calculator1Display
.
SelectOrientationVectors
=
'None'
calculator1Display
.
ScaleFactor
=
59.997473144531256
calculator1Display
.
SelectScaleArray
=
'None'
calculator1Display
.
GlyphType
=
'Arrow'
calculator1Display
.
GlyphTableIndexArray
=
'None'
calculator1Display
.
GaussianRadius
=
2.9998736572265625
calculator1Display
.
SetScaleArray
=
[
None
,
''
]
calculator1Display
.
ScaleTransferFunction
=
'PiecewiseFunction'
calculator1Display
.
OpacityArray
=
[
None
,
''
]
calculator1Display
.
OpacityTransferFunction
=
'PiecewiseFunction'
calculator1Display
.
DataAxesGrid
=
'GridAxesRepresentation'
calculator1Display
.
PolarAxes
=
'PolarAxesRepresentation'
calculator1Display
.
ScalarOpacityFunction
=
velPWF
calculator1Display
.
ScalarOpacityUnitDistance
=
10.74003524973295
calculator1Display
.
OpacityArrayName
=
[
'CELLS'
,
'u'
]
calculator1Display
.
BumpMapInputDataArray
=
[
None
,
''
]
calculator1Display
.
ExtrusionInputDataArray
=
[
'CELLS'
,
'u'
]
calculator1Display
.
SelectInputVectors
=
[
'CELLS'
,
'vel'
]
calculator1Display
.
NumberOfSteps
=
400
calculator1Display
.
WriteLog
=
''
# setup the color legend parameters for each legend in this view
# get color legend/bar for velLUT in view renderView1
velLUTColorBar
=
GetScalarBar
(
velLUT
,
renderView1
)
velLUTColorBar
.
Title
=
'vel'
velLUTColorBar
.
ComponentTitle
=
'Magnitude'
# set color bar visibility
velLUTColorBar
.
Visibility
=
1
# show color legend
calculator1Display
.
SetScalarBarVisibility
(
renderView1
,
True
)
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
# note: the Get..() functions create a new object, if needed
# ----------------------------------------------------------------
# ----------------------------------------------------------------
# restore active source
SetActiveSource
(
calculator1
)
# ----------------------------------------------------------------
if
__name__
==
'__main__'
:
# generate extracts
SaveExtracts
(
ExtractsOutputDirectory
=
'extracts'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment