Archiver Appliance Enabled Time Plots

Time plots can be augmented with the ability to automatically request archived data from an instance of the EPICS archiver appliance if such an instance is available to the user.

In order to use this functionality, the environment variable PYDM_ARCHIVER_URL must be set to point to the archiver appliance instance. For example:


These plots can then be created with python code, or using designer.

  • Creating in Designer

After setting the above environment variable, archiver time plots will then be able to be created in designer through the usual drag and drop flow. Upon opening designer, there will now be a plotting widget called PyDMArchiverTimePlot available for use. The channel connections can be created in the same way as a regular time plot, no need to preface anything with “archiver://”, the requests to archiver will happen automatically upon running the plot and panning the x-axis to the left, or zooming out.

One property that will be particularly useful to set is the timeSpan. This value (in seconds) will determine how much data to request from archiver upon plot initialization. For example, setting it to 600 will cause the plot to backfill with the last 10 minutes worth of data for the plotted values anytime the plot is opened. If more data is needed after starting up the plot, it can be requested as described below.

Creating PyDMArchiverTimePlot in Qt Designer
  • Plot Usage

Upon opening the plot, it will plot the requested amount of archived data. It will then behave like a regular time plot with live data being added to the plot. If more archived data would be useful, requests can be made by either panning the x-axis to the left, or zooming out on the entire plot. This will automatically generate a call to the archiver appliance that will add data to the plot once it is received.

Note that there is a property on the plot called bufferSize which determines how many data points can be displayed on the plot at once. If the request for archived data would return an amount greater than that buffer, it will convert to a request for optimized data which includes the average, min, and max of each data point returned. These will then be plotted as bars to show the full range of data represented by each point. As an example - with a buffer size of 365, a request for a year of data for a PV that updates every second would return roughly 365 points each of which will contain the min and max of that day’s data to plot the full range represented.

Requesting additional data from a live plot


class pydm.widgets.archiver_time_plot.PyDMArchiverTimePlot(parent: Optional[QObject] = None, init_y_channels: List[str] = [], background: str = 'default', optimized_data_bins: int = 2000)[source]

Bases: PyDMTimePlot

PyDMArchiverTimePlot is a PyDMTimePlot with support for receiving data from the archiver appliance.

  • parent (QObject, optional) – The parent of this widget.

  • init_y_channels (list) – A list of scalar channels to plot vs time.

  • background (str) – The background color for the plot. Accepts any arguments that pyqtgraph.mkColor will accept.

  • optimized_data_bins (int) – The number of bins of data returned from the archiver when using optimized requests

addYChannel(y_channel=None, plot_style=None, name=None, color=None, lineStyle=None, lineWidth=None, symbol=None, symbolSize=None, barWidth=None, upperThreshold=None, lowerThreshold=None, thresholdColor=None, yAxisName=None, useArchiveData=False, liveData=True) ArchivePlotCurveItem[source]

Overrides timeplot addYChannel method to be able to pass the liveData flag.


Take any action needed when this plot receives new data from archiver appliance

clearCurves() None[source]

Clear all curves from the plot

createCurveItem(*args, **kwargs) ArchivePlotCurveItem[source]

Create and return a curve item to be plotted


Dump and return the current list of curves and each curve’s settings into a list of JSON-formatted strings.

getArchiveBufferSize() int[source]

Returns the size of the data buffer used to store archived data

getCurves() List[str][source]

Dump and return the current list of curves and each curve’s settings into a list of JSON-formatted strings.

requestDataFromArchiver(min_x: Optional[float] = None, max_x: Optional[float] = None) None[source]

Make the request to the archiver appliance data plugin for archived data.

  • min_x (float, optional) – Timestamp representing the start of the time period to fetch archive data from. Defaults to the minimum value visible on the plot when omitted.

  • max_x (float, optional) – Timestamp representing the end of the time period to fetch archive data from. Defaults to the timestamp of the oldest live data point in the buffer if available. If no live points are recorded yet, then defaults to the timestamp at which the plot was first rendered.

setAutoScroll(enable: bool = False, timespan: float = 60, padding: float = 0.1, refresh_rate: int = 5000)[source]

Enable/Disable autoscrolling along the x-axis. This will (un)pause the autoscrolling QTimer, which calls the auto_scroll slot when time is up.

  • enable (bool, optional) – Whether or not to start the autoscroll QTimer, by default False

  • timespan (float, optional) – The timespan to set for autoscrolling along the x-axis in seconds, by default 60

  • padding (float, optional) – The size of the empty space between the data and the sides of the plot, by default 0.1

  • refresh_rate (int, optional) – How often the scroll should occur in milliseconds, by default 5000

setCurves(new_list: List[str]) None[source]

Add a list of curves into the graph.


new_list (list) – A list of JSON-formatted strings, each contains a curve and its settings


Set the value of the plot’s timespan

updateXAxis(update_immediately: bool = False) None[source]

Manages the requests to archiver appliance. When the user pans or zooms the x axis to the left, a request will be made for backfill data


class pydm.widgets.archiver_time_plot.ArchivePlotCurveItem(channel_address: Optional[str] = None, use_archive_data: bool = True, liveData: bool = True, **kws)[source]

Bases: TimePlotCurveItem

ArchivePlotCurveItem is a TimePlotCurveItem with support for receiving data from the archiver appliance.

  • channel_address (str) – The address to of the scalar data to plot. Will also be used to retrieve data from archiver appliance if requested.

  • use_archive_data (bool) – If True, requests will be made to archiver appliance for archived data when the plot is zoomed or scrolled to the left.

  • **kws (dict[str: any]) – Additional parameters supported by pyqtgraph.PlotDataItem.

channels() List[PyDMChannel][source]

Return the list of channels this curve is connected to

getArchiveBufferSize() int[source]

Return the length of the archive buffer

initializeArchiveBuffer() None[source]

Initialize the archive data buffer used for this curve.

insert_archive_data(data: ndarray) None[source]

Inserts data directly into the archive buffer.

An example use case would be zooming into optimized mean-value data and replacing it with the raw data.


data (np.ndarray) – A numpy array of shape (2, length_of_data). Index 0 contains timestamps and index 1 contains the data observations.


Provide the the most recent timestamp from the archiver data buffer. This is useful for scaling the x-axis.


The timestamp of the most recent data point in the archiver data buffer.

Return type:



Provide the the oldest valid timestamp from the archiver data buffer.


The timestamp of the oldest data point in the archiver data buffer.

Return type:


receiveArchiveData(data: ndarray) None[source]

Receive data from archiver appliance and place it into the archive data buffer. Will overwrite any previously existing data at the indices written to.


data (np.ndarray) – A numpy array of varying shape consisting of archived data for display. At a minimum, index 0 will contain the timestamps and index 1 the actual data observations. Additional indices may be used as well based on the type of request made to the archiver appliance. For example optimized data will include standard deviations, minimums, and maximums

redrawCurve(min_x=None, max_x=None) None[source]

Redraw the curve with any new data added since the last draw call.

resetArchiveBufferSize() None[source]

Reset the length of the archive buffer back to the default and zero it out

setArchiveBufferSize(value: int) None[source]

Set the length of the archive data buffer and zero it out

to_dict() OrderedDict[source]

Returns an OrderedDict representation with values for all properties needed to recreate this curve.