[Paraview] Help with adjusting contour levels in python script

Nikolaos Beratlis nikos.beratlis at gmail.com
Mon May 2 14:09:00 EDT 2016


Hi,

I am running a small python code with pvbatch that read a XDMF file and
plots contours:

    cf_VP_anim_xmf = XDMFReader( FileName=wdir+'VPfield_files/XDMF/cf_VP'
+index[i]+'.xmf' )


    cf_VP_anim_xmf.CellArrays = []

    cf_VP_anim_xmf.Sets = []

    cf_VP_anim_xmf.PointArrays = ['Cf']


    RenderView1 = GetRenderView()

    a1_Cf_PVLookupTable = GetLookupTableForArray( "Cf", 1 )


    Cfcontours = Show()

    Cfcontours.EdgeColor = [0.0, 0.0, 0.50000762951094835]

    Cfcontours.SelectionPointFieldDataArrayName = 'Cf'

    Cfcontours.ScalarOpacityFunction = []

    Cfcontours.ColorArrayName = 'Cf'

    Cfcontours.ScalarOpacityUnitDistance = 2.4071425938556859

    Cfcontours.LookupTable = a1_Cf_PVLookupTable

    Cfcontours.ScaleFactor = 15.0


    cf_VP_anim_xmf.Grids = ['STL Grid']


    RenderView1.CacheKey = 2.0

    RenderView1.CameraClippingRange = [288.47079837284241,
299.16435388730815]

    RenderView1.UseCache = 0


    a1_Cf_PVLookupTable = GetLookupTableForArray( "Cf", 1, RGBPoints=[-
0.0001, 0.0, 0.0, 1.0, 0.0001, 1.0, 0.0, 0.0], LockScalarRange=1,
ColorSpace='HSV' )


    separationline = Contour( PointMergeMethod="Uniform Binning" )


    separationline.ContourBy = ['POINTS', 'Cf']

    separationline.Isosurfaces = [0.0]


    DataSeparationLine = Show()

    DataSeparationLine.ScaleFactor = 12.321390008926393

    DataSeparationLine.SelectionPointFieldDataArrayName = 'Cf'

    DataSeparationLine.EdgeColor = [0.0, 0.0, 0.50000762951094835]

    DataSeparationLine.LineWidth = 2.0

    DataSeparationLine.DiffuseColor = [0.0, 0.0, 0.0]


    DataSeparationLine.ColorArrayName = ''


    Cfcontours.Visibility = 1


    #--- Setup view

    RenderView1 = GetRenderView()

    RenderView1.Background = [1.0, 1.0, 1.0]

    RenderView1.CenterAxesVisibility = 0

    RenderView1.OrientationAxesVisibility = 0

    RenderView1.ViewSize = [1450, 300]


    RenderView1.InteractionMode = '3D'

    RenderView1.CameraClippingRange = [120.40716073726786,
126.85668499830999]

    RenderView1.CameraPosition = [25.95, 41.63, 1.43]

    RenderView1.CameraFocalPoint = [4.31, 5.36, 4.77]

    RenderView1.CameraViewUp = [0.93, -0.36, -0.053]


    #--- Uncomment for 2D Interaction Mode

    #RenderView1.CameraParallelScale = 5.5


    a1_Cf_PVLookupTable = GetLookupTableForArray( "Cf", 1, RGBPoints=[-
0.0001, 0.0, 0.0, 1.0, 0.0001, 1.0, 0.0, 0.0], LockScalarRange=1 )


    #--- Export image

    Render()

    WriteImage(wdir+'POSTPRO/IMAGES/cf_view1_'+index[i]+'.jpg')

I set the range of the contours from -0.0001 to 0.0001 but the contours
levels revert back to automatic scaling instead of the range that I
specify. I am using version 3.98 of Paraview but I also tried with version
4.1.0. Why is this happening? Do I miss something in my script?

Nikos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160502/220d9566/attachment.html>


More information about the ParaView mailing list