You're right, I have multiple timestep data and for the first couple of timesteps there is nothing within that threshold range but as I proceed with consequent timesteps data starts falling within that range. I am trying to visualize data that starts from nothing and starts expanding into a certain threshold range. How would I handle the case where there is no data within a certain range and not have it crash? I would think that it would just simply render nothing and continue with the following timesteps instead of just crashing out. I could simply start at the frame where data starts appearing by statically coding the frame number but this script will be ran on different datasets.<br>
<br>Jesus<br><br><div class="gmail_quote">On Tue, Aug 30, 2011 at 7:25 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You're getting that error because more likely than not, your threshold<br>
range is such that no data is getting passed through. Ensure that the<br>
the Threshold1.ThresholdRange is set to a valid range so that at<br>
least some cells are passed through.<br>
<br>
Utaksrh<br>
<div><div></div><div><br>
On Mon, Aug 29, 2011 at 8:27 PM, Jesus Pulido <<a href="mailto:jpulido@ucdavis.edu" target="_blank">jpulido@ucdavis.edu</a>> wrote:<br>
> I omitted that line before because I was getting the following error.<br>
> Readding it gives this error:<br>
> Traceback (most recent call last):<br>
> File "/home/user/DNS/volume.py", line 40, in <module><br>
> DataRepresentation2.ColorArrayName = 'volume_scalars'<br>
> File<br>
> "/home/user/Programs/ParaView-3.11.1-git/bin/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",<br>
> line 212, in __setattr__<br>
> setter(self, value)<br>
> File<br>
> "/home/user/Programs/ParaView-3.11.1-git/bin/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",<br>
> line 2267, in setProperty<br>
> return self.SetPropertyWithName(propName, value)<br>
> File<br>
> "/home/user/Programs/ParaView-3.11.1-git/bin/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",<br>
> line 267, in SetPropertyWithName<br>
> prop.SetData(arg)<br>
> File<br>
> "/home/user/Programs/ParaView-3.11.1-git/bin/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py",<br>
> line 695, in SetData<br>
> raise ValueError("Could not locate array %s in the input." % arr)<br>
> ValueError: Could not locate array volume_scalars in the input.<br>
><br>
> Jesus<br>
><br>
> On Mon, Aug 29, 2011 at 3:53 PM, Utkarsh Ayachit<br>
> <<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>><br>
>> Try adding:<br>
>><br>
>> DataRepresentation2.ColorArrayName = 'volume_scalars'<br>
>><br>
>> Utkarsh<br>
>><br>
>> On Wed, Aug 24, 2011 at 7:02 PM, Jesus Pulido <<a href="mailto:jpulido@ucdavis.edu" target="_blank">jpulido@ucdavis.edu</a>> wrote:<br>
>> > I am trying to volume render an unstructured grid of points using<br>
>> > pvbatch<br>
>> > but I am getting an error:<br>
>> ><br>
>> > ERROR: In<br>
>> ><br>
>> > /home/user/Programs/ParaView-3.11.1-git/ParaView/VTK/VolumeRendering/vtkUnstructuredGridVolumeRayCastMapper.cxx,<br>
>> > line 211<br>
>> > vtkUnstructuredGridVolumeRayCastMapper (0x2473a40): Can't use the ray<br>
>> > cast<br>
>> > mapper without scalars!<br>
>> ><br>
>> > When trying to use Bunyk Ray casting<br>
>> ><br>
>> > and<br>
>> ><br>
>> > ERROR: In<br>
>> ><br>
>> > /home/user/Programs/ParaView-3.11.1-git/ParaView/VTK/VolumeRendering/vtkOpenGLProjectedTetrahedraMapper.cxx,<br>
>> > line 237<br>
>> > vtkOpenGLProjectedTetrahedraMapper (0x2ab3190): Can't use projected<br>
>> > tetrahedra without scalars!<br>
>> ><br>
>> > When trying to use Projected tetra.<br>
>> ><br>
>> > I am using the "latest" git version as of today. I also tried with<br>
>> > PV3.10.1<br>
>> > 64bit linux binary and I am having the same error with pvbatch.<br>
>> ><br>
>> ><br>
>> > Here is the script that I am using in pvbatch. I generated this script<br>
>> > with<br>
>> > the help from using python trace within paraview (where the rendering<br>
>> > works). I think it tries to reference the data under<br>
>> ><br>
>> > Threshold1.Scalars = ['POINTS', 'volume_scalars']<br>
>> ><br>
>> > but even if I comment this line out of my script I obtain the same error<br>
>> > as<br>
>> > above so somehow it's not able to reference the scalar points.<br>
>> > --------<br>
>> > try: paraview.simple<br>
>> > except: from paraview.simple import *<br>
>> > paraview.simple._DisableFirstRenderCameraReset()<br>
>> ><br>
>> > wavelet_ = XMLImageDataReader( FileName=['/home/wavelet.vti'] )<br>
>> ><br>
>> > wavelet_.CellArrayStatus = []<br>
>> > wavelet_.PointArrayStatus = ['volume_scalars']<br>
>> ><br>
>> > RenderView4 = GetRenderView()<br>
>> > RenderView4.CameraViewUp = [0.0, 0.0, 1.0]<br>
>> > RenderView4.CameraPosition = [-725.7466298125642, 127.5, 127.5]<br>
>> > RenderView4.CameraFocalPoint = [127.5, 127.5, 127.5]<br>
>> > RenderView4.CameraClippingRange = [590.9891635144385,<br>
>> > 1185.4328292597527]<br>
>> > RenderView4.Background = [0.0, 0.0, 0.0]<br>
>> > RenderView4.CenterAxesVisibility = 0<br>
>> > RenderView4.OrientationAxesVisibility = 0<br>
>> > RenderView4.ViewSize = [800, 600]<br>
>> ><br>
>> > SetActiveSource(wavelet_)<br>
>> > Threshold1 = Threshold()<br>
>> ><br>
>> > a1_volume_scalars_PVLookupTable = GetLookupTableForArray(<br>
>> > "volume_scalars",<br>
>> > 1, RGBPoints=[1.9, 0.0, 1.0, 0.0, 1.95, 1.4972662149337713e-07, 1.0,<br>
>> > 0.0014876325368879406, 2.0, 0.0, 0.996078431372549, 0.0, 2.05,<br>
>> > 1.6337586200641548e-07, 1.0, 0.0015525676008689975, 2.1,<br>
>> > 1.2838779441233928e-07, 1.0, 0.0013859544585118407] )<br>
>> > a1_volume_scalars_PiecewiseFunction = CreatePiecewiseFunction()<br>
>> > a1_volume_scalars_PiecewiseFunction.Points = [1.9, 0.1, 1.95, 0.5, 2.0,<br>
>> > 1.0,<br>
>> > 2.05, 0.5, 2.1, 0.1]<br>
>> ><br>
>> > Threshold1 = GetActiveSource()<br>
>> > Threshold1.Scalars = ['POINTS', 'volume_scalars']<br>
>> > Threshold1.ThresholdRange = [1.9, 2.1]<br>
>> ><br>
>> > DataRepresentation2 = Show()<br>
>> > DataRepresentation2 = GetDisplayProperties(Threshold1)<br>
>> > DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]<br>
>> > DataRepresentation2.SelectMapper = 'Fixed point'<br>
>> > DataRepresentation2.ScalarOpacityFunction =<br>
>> > a1_volume_scalars_PiecewiseFunction<br>
>> > DataRepresentation2.ScalarOpacityUnitDistance = 7.74209043877865<br>
>> > DataRepresentation2.LookupTable = a1_volume_scalars_PVLookupTable<br>
>> > DataRepresentation2.Representation = 'Volume'<br>
>> > DataRepresentation2.SelectMapper = 'Bunyk ray cast'<br>
>> ><br>
>> > Render()<br>
>> ><br>
>> > -----<br>
>> ><br>
>> ><br>
>> > Jesus<br>
>> ><br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the ParaView Wiki at:<br>
>> > <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>> ><br>
>> ><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
</div></div></blockquote></div><br>