Scale Set Filter

The foglamp-filter-scale-set plugin is a filter that allows a scale factor and an offset to be applied to numerical data where an asset has multiple data points. It is very similar to the foglamp-filter-scale filter, which allows a single scale and offset to be applied to all assets and data points. It’s primary uses are for adjusting values to match different measurement scales, for example converting temperatures from Centigrade to Fahrenheit or when a sensor reports a value in non-base units, e.g. 1/10th of a degree.

Scale set filters are added in the same way as any other filters.

  • Click on the Applications add icon for your service or task.

  • Select the scale-set plugin from the list of available plugins.

  • Name your scale-set filter.

  • Click Next and you will be presented with the following configuration page

    scaleset_1

  • This allows you to select if the filter should be enabled or disabled

  • Now click on the Scale factors tab

    scaleset_2

  • This allows the entry of a set of asset names, datapoint names, scale factors and offsets.

  • A list that defines a set of factors and offsets to apply particular assets and datapoints within these assets. A regular expression that is matched against the asset name and another that matches the data point name within the asset to determine if a particular scale factor and offset is applied to the datapoint value.

    Name

    Description

    Asset Name

    A regular expression to match against the asset name. The scale factor is only applied to assets whose name matches this regular expression.

    Datapoint

    A regular expression to match against the data point name within a matching asset. The scale factor is only applied to assets whose name matches this regular expression.

    Scale Factor

    The scale factor to apply to the numeric data.

    Offset

    The offset to add to the matching numeric data.

  • Click on Done to activate your plugin

List Interactions

There are a number of ways you can interact with the list of scale factors. A pair of buttons control the view that is seen of the list.

scaleset_views

  • Clicking on the left button will display a grid based view of the list of assets, datapoint, scale factor and offset.

  • Clicking on the right button will display a more detailed view for each entry in the list.

scaleset_3

In this more detailed view individual items may be collapsed or expanded. Entries may also be deleted from the list by clicking on the cross icon to the right of the entry.

In both views there are a set of controls that allow entries to be added to the list, imported and exported.

scaleset_commands

The import and export functions support two file formats; a CSV file format and a JSON format.

The CSV format has a single header row that list the 4 items that make up each entry in the list;

asset,datapoint,scale,offset
.*,temperature,1.8,32
.*,humidity,0.1,0

The names are the internal names used for the items in the list.

The JSON file format uses these same names as the keys in each of the list item objects

[
  {
    "asset": ".*",
    "datapoint": "temperature",
    "scale": "1.8",
    "offset": "32.0"
  },
  {
    "asset": ".*",
    "datapoint": "humidity",
    "scale": "0.1",
    "offset": "0.0"
  }
]

The import function allows for the imported data to either be appended to the current list or to overwrite the current list.

Example

In the following example we have an asset whose name is environment which contains two data points; temperature and humidity. We wish to allow two different scale factors and offsets to these two data points whilst not affecting assets of any other name in the data stream. We can accomplish this by using the following list of scale factors in the plugin configuration;

asset

datapoint

scale

offset

environment

temperature

1.8

32.0

environment

humidity

0.1

0.0

If instead we had multiple assets that contain temperature and humidity we can accomplish the same transformation on all these assets, whilst not affecting any other datapoints, by changing the asset regular expression to something that matches more asset names;

asset

datapoint

scale

offset

.*

temperature

1.8

32.0

.*

humidity

0.1

0.0

List Interactions

Configuration items that require the user to enter lists of values, each of which has multiple items within a list entry, offer a number of features to allow the user to interact with them. This allows for;

  • Grid or detail views of the list contents.

  • Import and Export of the list contents in either CSV or JSON format.

  • Addition and deletion of individual list items.

See Also

foglamp-filter-ADM_LD_prediction - Filter to detect whether a large discharge is required for a centrifuge

foglamp-filter-asset-validation - A plugin for performing basic sanity checking on the data flowing in the pipeline.

foglamp-filter-batch-label - A filter to attach batch labels to the data. Batch numbers are updated based on conditions seen in the data stream.

foglamp-filter-breakover - Filter to forecast the a pending breakover event in a centrifuge.

foglamp-filter-conditional-labeling - Attach labels to the reading data based on a set of expressions matched against the data stream.

foglamp-filter-ednahint - A hint filter for controlling how data is written using the eDNA north plugin to AVEVA’s eDNA historian

foglamp-filter-enumeration - A filter to map between symbolic names and numeric values in a datapoint.

foglamp-filter-expression - A FogLAMP processing filter plugin that applies a user define formula to the data as it passes through the filter

foglamp-filter-fft - A FogLAMP processing filter plugin that calculates a Fast Fourier Transform across sensor data

foglamp-filter-inventory - A plugin that can inventory the data that flows through a FogLAMP pipeline.

foglamp-filter-log - A FogLAMP filter that converts the readings data to a logarithmic scale. This is the example filter used in the plugin developers guide.

foglamp-filter-metadata - A FogLAMP processing filter plugin that adds metadata to the readings in the data stream

foglamp-filter-normalise - Normalise the timestamps of all readings that pass through the filter. This allows data collected at different rate or with skewed timestamps to be directly compared.

foglamp-filter-omfhint - A filter plugin that allows data to be added to assets that will provide extra information to the OMF north plugin.

foglamp-filter-python35 - A FogLAMP processing filter that allows Python 3 code to be run on each sensor value.

foglamp-filter-rms - A FogLAMP processing filter plugin that calculates RMS value for sensor data

foglamp-filter-sigmacleanse - A data cleansing plugin that removes data that differs from the mean value by more than x sigma

foglamp-filter-specgram - FogLAMP filter to generate spectrogram images for vibration data

foglamp-filter-statistics - Generic statistics filter for FogLAMP data that supports the generation of mean, mode, median, minimum, maximum, standard deviation and variance.

foglamp-filter-vibration_features - A filter plugin that takes a stream of vibration data and generates a set of features that characterise that data

foglamp-south-Expression - A FogLAMP south plugin that uses a user define expression to generate data