You put together a "Programmable Source" to do that. Attached is a Plugin
with such a Programmable source/reader. Load it using "Tools | Plugins".
Then when you open the csv file, you'll be promped to choose a reader,
choose the ""CSV Reader With Time Column".
On Wed, Nov 9, 2016 at 7:15 PM, andrealphus <[email protected]> wrote:
> I have a database of earthquakes in a csv file formatted as;
>
> x,y,z,M,time
> 344914.339004,4153503.07632,-7703,1.22,441772084.24
> 337090.052527,4158668.87752,-10404,1.06,441774936.69
> 335085.941364,4156934.63971,-7245,0.72,441789441.37
> 337111.336138,4167120.16812,-8539,0.76,441790442.57
> 335024.848735,4159463.38774,-4032,0.71,441801083.1
> 338135.588075,4159856.10709,-4160,1.17,441821076.16
>
> where time is in unix seconds.
>
> Normally I plot this by table_to_points, as spherical glpyhs, colored
> by time and sized by "M" (magnitude), see image;
> http://tinyurl.com/neaxe7n
>
>
> But it would be nice to step through these points with time. I just
> cant figure out how to actually get paraview to recognize my time
> column in my table (or my point attribute).
>
> Normally I would either reformat this to a netcdf or create individual
> file at each time step, but for this case these are not suitable
> options.
>
> Any suggestions?
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
<ServerManagerConfiguration>
<ProxyGroup name="sources">
<SourceProxy name="TemporalCSVReader" class="vtkPythonProgrammableFilter" label="TemporalCSVReader">
<Documentation
long_help="CVS Reader with time"
short_help="CVS Reader with time">
</Documentation>
<StringVectorProperty
name="Filename"
label="Filename"
initial_string="filename"
command="SetParameter"
animateable="1"
default_values="/tmp/foo.1csv"
number_of_elements="1">
<Documentation></Documentation>
<FileListDomain name="files" />
</StringVectorProperty>
<!-- Output data type: "Table" -->
<IntVectorProperty command="SetOutputDataSetType"
default_values="19"
name="OutputDataSetType"
number_of_elements="1"
panel_visibility="advanced">
<Documentation>The value of this property determines the dataset type
for the output of the programmable filter.</Documentation>
</IntVectorProperty>
<StringVectorProperty
name="Script"
command="SetScript"
number_of_elements="1"
default_values="# Code for 'Script'
def GetUpdateTimestep ( algorithm ):
 """ Returns the requested time value , or None if not present """
 executive = algorithm . GetExecutive ()
 outInfo = executive . GetOutputInformation (0)
 return outInfo . Get ( executive . UPDATE_TIME_STEP () ) \
 if outInfo . Has ( executive . UPDATE_TIME_STEP () ) else None

def find_nearest(array,value):
 """find for nearest value"""
 idx = (np.abs(array-value)).argmin()
 return array[idx]

# This is the requested time-step. This may not be exactly equal to the
# timesteps published in RequestInformation(). Your code must handle that
# correctly
req_time = GetUpdateTimestep (self)

import numpy as np
data = np.genfromtxt(filename, dtype=None, names=True, delimiter=',', autostrip=True)

timesteps = np.unique(data["time"])
req_time = find_nearest(timesteps, req_time)
data = data[data["time"] == req_time]

for name in data.dtype.names:
 array = data[name]
 output.RowData.append(array, name)
"
panel_visibility="advanced">
<Hints>
<Widget type="multi_line" syntax="python" />
</Hints>
<Documentation>This property contains the text of a python program that
the programmable source runs.</Documentation>
</StringVectorProperty>
<StringVectorProperty
name="InformationScript"
label="RequestInformation Script"
command="SetInformationScript"
number_of_elements="1"
default_values="# Code for 'RequestInformation Script'.
filename = "/tmp/foo1.csv"

def setOutputTimesteps ( algorithm , timesteps ):
 " helper routine to set timestep information "
 executive = algorithm . GetExecutive ()
 outInfo = executive . GetOutputInformation (0)
 outInfo.Remove ( executive . TIME_STEPS () )
 for timestep in timesteps :
 outInfo.Append ( executive . TIME_STEPS () , timestep )
 outInfo.Remove ( executive . TIME_RANGE () )
 outInfo.Append ( executive . TIME_RANGE () , timesteps [0])
 outInfo.Append ( executive . TIME_RANGE () , timesteps [ -1])

import numpy as np
data = np.genfromtxt(filename, dtype=None, names=True, delimiter=',', autostrip=True)
timesteps = np.unique(data["time"])
setOutputTimesteps(self, timesteps)
"
panel_visibility="advanced">
<Hints>
<Widget type="multi_line" syntax="python" />
</Hints>
<Documentation>This property is a python script that is executed during
the RequestInformation pipeline pass. Use this to provide information
such as WHOLE_EXTENT to the pipeline downstream.</Documentation>
</StringVectorProperty>
<DoubleVectorProperty information_only="1"
name="TimestepValues"
repeatable="1">
<TimeStepsInformationHelper />
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
<!-- View can be used to specify the preferred view for the proxy -->
<View type="SpreadSheetView" />
<ReaderFactory extensions="csv txt CSV TXT"
file_description="Delimited Text With Time" />
</Hints>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview