timeseries

_calculateTimeRange

PVGeo._helpers.timeseries._calculateTimeRange(nt, dt=1.0)[source]

Discretizes time range accoridng to step size dt in seconds

getCombinedInputTimeSteps

PVGeo._helpers.timeseries.getCombinedInputTimeSteps(algorithm, idx=0)[source]

This will iterate over all input ports and combine their unique timesteps for an output algorithm to have.

Parameters:algorithm (vtkDataObject) – The data object (Proxy) on the pipeline (pass self from algorithm subclasses)
Returns:a 1D array of all the unique timestep values (empty array if no time variance)
Return type:np.ndarray

getInputTimeSteps

PVGeo._helpers.timeseries.getInputTimeSteps(algorithm, port=0, idx=0)[source]

Get the timestep values for the algorithm’s input

Parameters:
  • algorithm (vtkDataObject) – The data object (Proxy) on the pipeline (pass self from algorithm subclasses)
  • port (int) – the input port
  • idx (int) – optional : the connection index on the input port
Returns:

the time step values of the input (if there arn’t any, returns None)

Return type:

list

getRequestedTime

PVGeo._helpers.timeseries.getRequestedTime(algorithm, outInfoVec, idx=0)[source]

Handles setting up the timesteps on on the pipeline for a file series reader.

Parameters:
  • algorithm (vtkDataObject) – The data object (Proxy) on the pipeline (pass self from algorithm subclasses)
  • outInfoVec (vtkInformationVector) – The output information for the algorithm
  • idx (int) – the index for the output port
Returns:

the index of the requested time

Return type:

int

Example

>>> # Get requested time index
>>> i = _helpers.getRequestedTime(self, outInfoVec)

updateTimeSteps

PVGeo._helpers.timeseries.updateTimeSteps(algorithm, nt, dt=1.0, explicit=False)[source]

Handles setting up the timesteps on on the pipeline for a file series reader.

Parameters:
  • algorithm (vtkDataObject) – The data object (Proxy) on the pipeline (pass self from algorithm subclasses)
  • nt (int or list) – Number of timesteps (Pass a list to use length of that list)
  • dt (float) – The discrete value in seconds for the time step.
  • explicit (boolean) – if true, this will treat the nt argument as the exact timestep values to use
Returns:

Returns the timesteps as an array

Return type:

numpy.array