<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><font face="Droid Serif">Hi.<br>
<br>
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?<br>
<br>
Thanks in advance for any help.<br>
<br>
Greg<br>
<br>
Here is the working (except for scaling) macro so far:<br>
-----------------------------------------------------------------------------------<br>
try: paraview.simple<br>
except: from paraview.simple import *<br>
<br>
paraview.simple._DisableFirstRenderCameraReset()<br>
<br>
XYChartView1 = CreateXYPlotView()<br>
XYChartView1.ViewTime=0.0<br>
<br>
animscene = GetAnimationScene()<br>
animscene.ViewModules = [ XYChartView1 ]<br>
<br>
filename =
'/raid/schussma/work2/ace3p/paraview/macros/wakeplot/wake.out'<br>
wake_out = CSVReader(FileName=filename,<br>
FieldDelimiterCharacters = ' ',<br>
HaveHeaders = 0)<br>
<br>
################################################################################<br>
# What is the right approach for this section? <br>
<br>
data = servermanager.Fetch(wake_out) # can't use wake_out
directly<br>
print "rows:", data.GetNumberOfRows() # works<br>
print "cols:", data.GetNumberOfColumns() # works<br>
<br>
# get largest magnitude value from column 2<br>
<br>
# how?<br>
<br>
<br>
# rescale column 1<br>
<br>
# how?<br>
<br>
<br>
# have PlotData use this new data instead of the original
wake_out<br>
<br>
# how?<br>
<br>
################################################################################<br>
<br>
pd = PlotData(wake_out)<br>
<br>
dr = Show(pd,<br>
XArrayName = 'Field 0',<br>
AttributeType = 'Row Data',<br>
SeriesVisibility = ['vtkOriginalIndices', '0'])<br>
<br>
Render()<br>
<br>
<br>
</font></font>
</body>
</html>