Skip to content

HttpDataSetSeriesReader ​

Introduction ​

The vtkHttpDataSetSeriesReader is a reader which can load datasets that vary over time. It is a wrapper over multiple vtkHttpDataSetReader, one per time step, described by an index.json file of the following shape:

json
{
  "series": [
    { "url": "0", "timeStep": 0.0 },
    { "url": "1", "timeStep": 0.333333 }
  ]
}

Usage ​

js
import vtkHttpDataSetSeriesReader from '@kitware/vtk.js/IO/Core/HttpDataSetSeriesReader';

const reader = vtkHttpDataSetSeriesReader.newInstance();
reader.setUrl('https://kitware.github.io/vtk-js-datasets/data/temporal').then(() => {
  const [begin, end] = reader.getTimeRange();
  reader.setUpdateTimeStep((begin + end) / 2);
});

Methods ​

enableArray ​

Enable or disable a given array on the current time step reader.

ArgumentTypeRequiredDescription
locationStringYes
nameStringYes
enableBooleanNo(default true)

extend ​

Method used to decorate a given object (publicAPI+model) with vtkHttpDataSetSeriesReader characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIHttpDataSetSeriesReaderInitialValuesNo(default: {})

getBaseURL ​

Get the base url used to download the individual time steps.

getTimeRange ​

Get the first and last time steps of the series, or an empty array when the series is empty.

getTimeSteps ​

Get the sorted list of time steps defined in the series.

getUrl ​

Get the url of the series index to load.

loadData ​

Download the enabled arrays of the current time step reader.

newInstance ​

Method used to create a new instance of vtkHttpDataSetSeriesReader

ArgumentTypeRequiredDescription
initialValuesIHttpDataSetSeriesReaderInitialValuesNofor pre-setting some of its content

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setDataAccessHelper ​

ArgumentTypeRequiredDescription
dataAccessHelperYes

setUpdateTimeStep ​

Make the reader of the latest time step at or before the given time the current one, and expose its dataset as this reader's output.

ArgumentTypeRequiredDescription
timeStepNumberYes

setUrl ​

Set the url of the series to load. The url must point at an index.json file, or at a folder containing one.

ArgumentTypeRequiredDescription
urlStringYesthe url of the series to load.
optionsIHttpDataSetSeriesReaderOptionsNo

updateMetaData ​

Fetch the series index and create one vtkHttpDataSetReader per time step. Resolves with this reader once every time step has been fetched.

ArgumentTypeRequiredDescription
loadDataBooleanNoAlso download the arrays (default false).