Hi.

I've got a simple script to read a csv file and open a new plot window. One of the columns in the data file needs to be rescaled. I've had poor luck googling around and looking at examples. Does anyone have any suggestions?

Thanks in advance for any help.

Greg

Here is the working (except for scaling) macro so far:
-----------------------------------------------------------------------------------
try: paraview.simple
except: from paraview.simple import *

paraview.simple._DisableFirstRenderCameraReset()

XYChartView1 = CreateXYPlotView()
XYChartView1.ViewTime=0.0

animscene = GetAnimationScene()
animscene.ViewModules = [ XYChartView1 ]

filename = '/raid/schussma/work2/ace3p/paraview/macros/wakeplot/wake.out'
wake_out = CSVReader(FileName=filename,
                     FieldDelimiterCharacters = ' ',
                     HaveHeaders = 0)

################################################################################
# What is the right approach for this section?

data = servermanager.Fetch(wake_out)      # can't use wake_out directly
print "rows:", data.GetNumberOfRows()     # works
print "cols:", data.GetNumberOfColumns()  # works

# get largest magnitude value from column 2

# how?


# rescale column 1

# how?


# have PlotData use this new data instead of the original wake_out

# how?

################################################################################

pd = PlotData(wake_out)

dr = Show(pd,
          XArrayName = 'Field 0',
          AttributeType = 'Row Data',
          SeriesVisibility = ['vtkOriginalIndices', '0'])

Render()


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to