<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hello,</div><div><br></div><div>I am trying to extract data from a CSV file via python, and I am having trouble.</div><div><br></div><div>I ran Trace to get the calls for how to go about opening the file… I can open the file manually, and look at the file information via the GUI, but I cannot seem to automate it via python..</div><div><br></div><div>The Trace routine gave me the following from a successful opening of the CSV file:</div><div>-----------------------------</div><div><br></div><div><div>try: paraview.simple</div><div>except: from paraview.simple import *</div><div>paraview.simple._DisableFirstRenderCameraReset()</div><div><br></div><div>actdata2_csv = CSVReader( DetectNumericColumns=1, MergeConsecutiveDelimiters=0, FieldDelimiterCharacters=',', FileName=['/Users/jjm390/LFM-Data/Zmhd2007-09-20T00/act-data2.csv'], UseStringDelimiter=1, HaveHeaders=1 )</div><div><br></div><div>AnimationScene4 = GetAnimationScene()</div><div>SpreadSheetView2 = CreateRenderView()</div><div>SpreadSheetView2.ColumnToSort = None</div><div>SpreadSheetView2.SelectionOnly = 0</div><div>SpreadSheetView2.BlockSize = 1024L</div><div>SpreadSheetView2.SelectedComponent = -1</div><div>SpreadSheetView2.InvertOrder = 0</div><div>SpreadSheetView2.ViewTime = 0.0</div><div><br></div><div>DataRepresentation2 = Show(actdata2_csv)</div><div>DataRepresentation2.CompositeDataSetIndex = 0</div><div>DataRepresentation2.FieldAssociation = 'Row Data'</div><div>DataRepresentation2.Visibility = 1</div><div><br></div><div>AnimationScene4.ViewModules = SpreadSheetView2</div><div><br></div><div>Render()</div></div><div><br></div><div>-----------------------------</div><div>But when I try to run this as a script, I get the following error:</div><div><br></div><div>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;">Traceback (most recent call last):</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;"> File "<string>", line 16, in <module></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;"> File "/usr/local/ParaView 3.12.0.app/Contents/Python/paraview/simple.py", line 209, in Show</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;"> raise RuntimeError, "Could not create a representation object for proxy %s" % proxy.GetXMLLabel()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;">RuntimeError: Could not create a representation object for proxy CSV Reader</span><!--EndFragment--></p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;"><br></span></p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:13pt; color:#ff0000;"><br></span></p></div><div>Can someone tell me what I am doing wrong? All I want to do is open the CSV file and use the data (locations) within to extract data from another data set (grid)…</div><div><br></div><div>Basically, if I can get into the table via python and query different cells, I will be all set… If the trace doesn't work, can someone please explain how to open a CSV file and load the data properly from within Python?</div><div><br></div><div>Thanks,</div><div>Josh</div><div><br></div></body></html>