Search the Community
Showing results for tags 'capsule pane'.
Found 3 results
FAQ: I have a CSV file that has the start and end times of some historical events and various information about the events that I would like to use in my analysis in Seeq. How do I go about getting these events and all of their associated information into Seeq? Solution: Use the Import from CSV tool and Seeq Formula to bring in a condition comprised of each of these events and assign the data in each column of the CSV as a property of the condition. 1. Ensure your CSV file is formatted correctly for import into Seeq. The first column should be the event start time, the second column should be the event end time, and all other data columns should be to the right of these. A list of acceptable timestamp formats can be found on the Seeq Knowledge Base in this article. 2. Use the Import CSV File tool to bring the condition into Seeq. Drag and drop your CSV file or navigate to your file through Windows (Mac) Explorer. Under "Import File as" select "condition". Choose the start-time and end-time columns in the "Choose columns" section. Specify a max capsule duration that is just longer than your longest event. 3. Once your condition is imported, use Seeq Formula to assign the data from the other columns of our CSV as properties of each capsule. Begin by using the item properties for the CSV imported condition to duplicate the condition to Formula. Once in Formula, add the column headers from your CSV to the query in line 1 of the code, separated by commas. Then use the setProperty() function to assign each of the columns of the CSV as a property of each capsule. Once executed, the output is a new condition that looks exactly like the original from trend view in the display pane. However, this new condition has properties, that can be added to the capsules pane using the gridded+ button.
Background: A property can be added to capsules for further filtering and aggregation through Seeq tools, including Histogram. All properties on a condition are stored as string values. This post examines how to add a property to a condition and then how those properties may be used. Adding Properties to a Condition Capsule properties may be used to store important information such as, Product Codes, Batch IDs, and Recipes. There are three functions in Seeq Formula which can add properties to the capsules in a condition: toCondition() - Dedicated function to transform a signal into a condition which contains a capsule for each value change in the input signal. The value of the signal is stored as a property of the capsule toCapsules() - Dedicated function to transform a signal into a condition which contains a capsule for each valid sample in the input signal. The value of the signal is stored as a property of the capsule. setProperty() - Flexible function which is used to assign properties to each capsule in a condition. It is most commonly used in SQL queries to attach transactional information from a data source to a capsule in a condition. toCondition() This function creates a capsule for every value change in a signal. This may be useful on a Batch ID signal or operating mode signal. The toCondition() function creates a new capsule for each value change and automatically assigns the signal value to a capsule property called 'Value'. Using the toCondition() operator on the Compressor Stage example data creates a capsule for each distinct value in the signal. The following image shows the condition created from performing toCondition() on the Compressor Stage Example Data. A capsule is created for each distinct value in the signal. This property may be viewed by adding the Value property to the Capsules Pane. The .toCapsules() operator works similiarly, but instead creates a new condition with a capsule for each sample point (regardless of whether the value has changed). setProperties() This flexible function is used to assign properties to a condition. Users must assign both a property name and value. The following syntax is an example of how the .setProperties() operator can be used in Formula to assign properties to the capsules in a condition. This example assigns a property of "Batch" with a value of '23' to each capsule in a condition. $condition.transform($capsule-> $capsule.setProperty('Batch',23)) In the next example, a High Power condition was created using Value Search tool (power >25). The following syntax can be used to assign a property called "averagePower" to each capsule in the High Power condition. The value of this property is calculated as the average Compressor Power during each High Power condition. Executing this Formula results in a new condition that contains the averagePower property for each capsule. Using Condition Properties Condition properties can be used in different ways, such as to filter the capsules in a Condition or to aggregate the data in Histogram Condition Filtering Capsule properties can be displayed in the Capsule Pane by adding a column to the table. These property columns may also be sorted in ascending or descending order. Once capsules within a condition have properties assigned, the filter() operator may be used in Formula to create new conditions containing only a subset of the original capsules. For example, the following syntax generates a new condition that only has the capsules where the Value property is equal to OFF. $condition.filter($capsule-> $capsule.getProperty('Value').isEqualTo('OFF')) Histogram Within the Histogram tool, users can select Condition as the aggregation type to create bins using capsule properties. The following example creates a Histogram based upon the Value property in the toCondition() condition. The output is a Histogram with a count of the number of capsules with a Value equal to each of the four stages of operation:
I have a condition with several capsules of various lengths; how do I determine the time period or length of each capsule? For example, my first capsule is 24 hours long, and then the next capsule is only about 3 hours. I'm looking for a way where I can get this information for all of my capsules.