Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
ed44e4ea
Commit
ed44e4ea
authored
Nov 21, 2012
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup paraview script, add support for mpi
parent
5debc4a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
46 deletions
+26
-46
netcdf_swe.py
paraview/netcdf_swe.py
+26
-46
No files found.
paraview/netcdf_swe.py
View file @
ed44e4ea
...
@@ -11,58 +11,38 @@ def nullMessageOutput(type, msg):
...
@@ -11,58 +11,38 @@ def nullMessageOutput(type, msg):
QtCore
.
qInstallMsgHandler
(
nullMessageOutput
)
QtCore
.
qInstallMsgHandler
(
nullMessageOutput
)
files
=
QtGui
.
QFileDialog
.
getOpenFileNames
(
None
,
'Select SWE output files ...'
,
QtCore
.
QString
(),
'NetCDF (*.nc)'
)
files
=
QtGui
.
QFileDialog
.
getOpenFileNames
(
None
,
'Select SWE output files ...'
,
QtCore
.
QString
(),
'NetCDF (*.nc)'
)
out_00_nc
=
NetCDFReader
(
FileName
=
[
str
(
files
[
0
])]
)
# List of all sources we load
sources
=
[]
#AnimationScene1 = GetAnimationScene()
for
file
in
files
:
out_00_nc
.
Dimensions
=
'(y, x)'
# Create NetCDF reader
reader
=
NetCDFReader
(
FileName
=
[
str
(
file
)]
)
reader
.
Dimensions
=
'(y, x)'
#AnimationScene1.EndTime = 15.003315925598145
sources
.
append
(
reader
)
#AnimationScene1.PlayMode = 'Snap To TimeSteps'
#a2DRenderView1 = Create2DRenderView()
# Group Data if mor then one
#a2DRenderView1.CompressorConfig = 'vtkSquirtCompressor 0 3'
if
len
(
sources
)
>
1
:
#a2DRenderView1.RemoteRenderThreshold = 3.0
#a2DRenderView1.ViewTime = 0.0
#a2DRenderView1.LODResolution = 50.0
#a2DRenderView1.Background = [0.31999694819562063, 0.3400015259021897, 0.4299992370489052]
#a2DRenderView1.LODThreshold = 5.0
#AnimationScene1.ViewModules = a2DRenderView1
group
=
GroupDatasets
(
Input
=
sources
)
else
:
group
=
sources
[
0
]
#DataRepresentation1 = Show()
# Create Calculator, to show "min(h,h+b)"
#DataRepresentation1.ColorArrayName = 'b'
calc
=
Calculator
(
Input
=
group
)
#DataRepresentation1.UseXYPlane = 0
calc
.
AttributeMode
=
'point_data'
calc
.
Function
=
'min(h,h+b)'
Calculator1
=
Calculator
()
# Specify the data representation
representation
=
Show
()
representation
.
Representation
=
'Surface'
#a1_b_PVLookupTable = GetLookupTableForArray( "b", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[-260.0, 0.23, 0.299, 0.754, -255.0, 0.706, 0.016, 0.15], VectorMode='Magnitude', ColorSpace='Diverging', ScalarRangeInitialized=1.0 )
# Create nice color table form -1 to 2
table
=
GetLookupTableForArray
(
"Result"
,
1
,
RGBPoints
=
[
-
1.0
,
0.23
,
0.299
,
0.754
,
2.0
,
0.706
,
0.016
,
0.15
],
VectorMode
=
'Magnitude'
,
NanColor
=
[
0.25
,
0.0
,
0.0
],
ColorSpace
=
'Diverging'
,
ScalarRangeInitialized
=
1.0
,
LockScalarRange
=
1
)
#a1_b_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0] )
# Color result
representation
.
ColorArrayName
=
'Result'
representation
.
LookupTable
=
table
#a2DRenderView1.CameraPosition = [500.0, 500.0, 2724.048059039453]
GetRenderView
()
.
ResetCamera
()
#a2DRenderView1.CameraFocalPoint = [500.0, 500.0, 0.0]
#a2DRenderView1.CameraClippingRange = [2696.8075784490584, 2764.9087799250456]
#a2DRenderView1.CameraParallelScale = 705.0355174539663
#DataRepresentation1.LookupTable = a1_b_PVLookupTable
Calculator1
.
AttributeMode
=
'point_data'
Calculator1
.
Function
=
'min(h,h+b)'
DataRepresentation2
=
Show
()
#DataRepresentation2.ColorArrayName = 'b'
DataRepresentation2
.
Representation
=
'Slice'
#DataRepresentation2.UseXYPlane = 0
#DataRepresentation1.Visibility = 0
a1_Result_PVLookupTable
=
GetLookupTableForArray
(
"Result"
,
1
,
RGBPoints
=
[
-
1.0
,
0.23
,
0.299
,
0.754
,
2.0
,
0.706
,
0.016
,
0.15
],
VectorMode
=
'Magnitude'
,
NanColor
=
[
0.25
,
0.0
,
0.0
],
ColorSpace
=
'Diverging'
,
ScalarRangeInitialized
=
1.0
,
LockScalarRange
=
1
)
#a1_Result_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0] )
DataRepresentation2
.
ColorArrayName
=
'Result'
DataRepresentation2
.
LookupTable
=
a1_Result_PVLookupTable
GetRenderView
.
ResetCamera
()
Render
()
Render
()
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