Jump to content

Chris Orr

Seeq Team
  • Posts

    17
  • Joined

  • Last visited

  • Days Won

    8

Community Answers

  1. Chris Orr's post in Capsule from condition / Duration between features was marked as the answer   
    Hey there, 
    The key here is using the `aggregate` function, with a minValue() argument. The aggregate function handles Conditions, rather than capsules. You can also output the minValue() at the minKey(), which is the timestamp when the minimum value occurs. Then, transforming that value into a new Condition, of zero-length capsules as the start, will create capsules at the minimum point, which will ultimately be used as the starting point to connect to when your signal == 25.2
    $searchCondition = $originalCondition.removeLongerThan(30d).grow(1hr) //notice the .grow(1hour) to expand your capsules in case the minimum happens earlier // Assuming $signal is your signal of interest and $originalCondition is the condition with the capsules of interest $minValueTimes = $signal.aggregate(minValue(), $searchCondition, minKey()) // Convert the times of minimum values into a new condition with zero-length capsules $newConditionAtMinValues = $minValueTimes.toCondition().starts() // Output the new condition $newConditionAtMinValues Then create a Value Search to find when your Signal = 25.2 (no screenshot for this one 🙂 )
    Finally, you can use the Composite Condition tool to "join" the two capsules:

     
    And your ultimate goal was calculating the duration between those periods, so you can use the "Signal from Condition" tool to calculate it's Duration like this:

     
    Performing it all in one, giant Formula, would look like this:
    where $originalCondition is your derivative > .001 condition, and $signal is your base signal. 
    $searchCondition = $originalCondition.removeLongerThan(30d).grow(1hr) // Assuming $signal is your signal of interest and $originalCondition is the condition with the capsules of interest $minValueTimes = $signal.aggregate(minValue(), $searchCondition, minKey()) // Convert the times of minimum values into a new condition with zero-length capsules $newConditionAtMinValues = $minValueTimes.toCondition().starts() // Perform your value search $valueSearch = $signal < 36.2 // Join the two conditions $JoinedCondition = $newConditionAtMinValues.join($valueSearch.beforeStart(0ns), 40hr, true) // Calculate the duration of the joined Condition $JoinedCondition.aggregate(totalDuration('hours'), $JoinedCondition, durationKey())  
    Hope that helps!!
    -Chris Orr
×
×
  • Create New...