timeseries

_calculate_time_range

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

Discretizes time range according to step size dt in seconds

get_combined_input_time_steps

PVGeo._helpers.timeseries.get_combined_input_time_steps(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

get_input_time_steps

PVGeo._helpers.timeseries.get_input_time_steps(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 aren’t any, returns None)

Return type:

list

get_requested_time

PVGeo._helpers.timeseries.get_requested_time(algorithm, outInfo, 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)

  • outInfo (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.get_requested_time(self, outInfo)

update_time_steps

PVGeo._helpers.timeseries.update_time_steps(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