Jump to content

Sanman Mehta

Super Seeqer
  • Posts

    35
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by Sanman Mehta

  1. Here is an example of Scatter plot push.

    @Asset.Display()    
    def Display(self,metadata,analysis):
            #define name of worksheet
            worksheet = analysis.worksheet(self.definition['Name']+' Scatter')
            #define name of workstep
            workstep = worksheet.workstep('Trends')
            # make sure workstep is in Scatter Plot view
            workstep.view = 'Scatter Plot'
            # define the display items - need to have at least the 2 signals you want in scatterplot
            workstep.display_items = [{
                'Item': self.Temperature(metadata)
            },{
                'Item': self.Relative_Humidity(metadata)
            }]
            # define the 2 scatterplot signals
            workstep.scatter_plot_series = {
                'X': {'ID': self.Temperature(metadata)},
                'Y': {'ID': self.Relative_Humidity(metadata)}
            }
            return workstep

    #Thanks @Kjell Raemdonck for the code snippet

    • Like 2
  2. TLDR

    Asset trees are great way to scale your analysis to N number of assets.  Currently one needs working knowledge of SPy(Seeq-python) to build multi layered asset tree.  With the attached jupyter notebook, Add-on tool can be created as shown here so that users can generate their own multi layered asset trees in their workbenches which can then be shared with colleagues.

    Pre-Requisite: Seeq Data Lab (powered by SPy module)

    Detail steps:

    1. Get a CSV file (can be done in excel and saved as CSV format) that has hierarchy of your asset tree structure.  The columns in screenshot below represent various hierarchical levels (columns A,B,C &D). You don't need exactly 4 columns, the solution supports any number of columns/hierarchical levels.  

    2. Include a column for "Process Value" (column F in screenshot below) which are your tag values and a column for "Asset Tree Name" which will appear in the tree and are the common attribute names among assets (column E in screenshot below).

    image.png

    3. Use the attached jupyter notebook and create Add-on tool so any user can access the tool from Tools pane in workbench. This is one time step and should be done by someone who has experience with Seeq Data Lab.  The Tool name can be "Create Asset Tree from CSV File". Here is KB article on setting up new Add-on tool. https://support.seeq.com/space/KB/961675391/Add-on%20Tool%20Administration%20and%20Development

    4. Use attached csv file and have your colleague who knows nothing about python, run the tool.  UI is self explanatory as seen below.

    image.png

    5. Refresh the workbench from which user created the Asset Tree and watch the results appear like so: 

    image.png

    Optional step 6: If there is no Add-on tool available, or you would like to build it step by step then add calculations, roll ups etc., check out the jupyter notebook named step_by_step_asset_tree attached below.

    Example_SDL_Asset Tree (1).csv

     

     

    Step_by_step_asset_tree.ipynb

    Create_asset_tree_with_dynamic_class_R58_or_later.ipynb

    • Like 1
    • Thanks 1
  3. Hi Banderson, you can create a duration signal from each capsule in a condition, using "signal from condition" tool. As you may know these point and click tools create a Seeq formula underneath.  So after using point and click signal from condition tool, you can find the syntax of formula in item properties of that calculation.  You can copy this syntax and paste it in Formula and use it to further develop your calculations.

    • Like 4
  4. Starting with Seeq R.21.0.44.0 release, user can specify maxValue() and maxKey() on a signal during a capsule to return the scalar values of maximum value and associated time stamp respectively.  The example below shows that on Temperature signal, during 16th October (capsule), maxValue() function results in 106.07 ºF and maxKey() function results in associated timestamp 2019-10-16 02:18 am i.e. when maximum temperature occurred.  See the 1st image for this example in Seeq:

    Feel free to try out these formulas on your own:

    $temperature.maxKey(capsule('2019-10-16T00:00Z','2019-10-17T00:00Z'))
    
    $temperature.maxValue(capsule('2019-10-16T00:00Z','2019-10-17T00:00Z'))

    Capture.JPG

    Oh one more thing, you can also create signals that return one value from each capsule within a condition. Where value can be maxValue(), minValue(), maxKey(), minKey().

    Below is one such example and an image showing that you can create signal that represents minimum values at minimum key (time) on daily basis:

    $signal.aggregate(minValue(), $condition, minKey())

    As always detailed information can be found in formula tool panel documentation search box in Seeq application.

    Capture2.JPG

    Still want more Seeq info?  Check out what else is new in R21.0.44.00: https://seeq12.atlassian.net/wiki/spaces/KB/pages/571375775/What+s+New+in+R21.0.44

     

     

  5. There are many ways to accomplish this task.  See below for one example formula that you can paste into the formula tool and apply to input signal.  You can also checkout the comments to see how it works and ways to tweak it.  The transform function is very powerful and it allows the user to evaluate expressions from input signals to create new derived signals with applied logic.

    $boolean = $signal.transform($s ->sample($s.getkey(), 1 * $s.getValue().isValid()), 1 d).toStep()
    //in the above formula, $signal is the input signal that has missing data gaps.
    //boolean variable is created and will return either 1 or 0 based on whether "isValid()" is true or not respectively.  When there is gaps in the data the //resulting signal is zero and when there is valid value, the result is 1.
    
      
    $boolean * $signal.setMaxInterpolation(1wk).validValues()
    //the next step is to use the calculated $boolean signal above and multiply it (0 or 1) with original input signal to get actual values and gaps will be //replaced with zeros.
    //$signal again is the input signal with missing data.
    //setMaxInterpolation (1wk) can be increased as needed to fill the data gap with zero.

     

    • Like 1
×
×
  • Create New...