Jump to content

New union capsule based on two different capsules

Go to solution Solved by Thorsten Vogt,

Recommended Posts

I would like generate new capsules, grouped as -> start of capsules from first capsules until end of second capsules

When doing just a union $c = $a.union($b) the capsules in $c are not getting grouped as needed.

thanks for any help




Link to comment
Share on other sites

Thanks for the hint Joe, I checked the composite Condition but I still don´t figured out yet how to:

after rethinking I need to re-specify what I´m trying to achieve. On the same capsule layer, on the first found Capsule-1 extend the end of this Capsule-1

until the start of Capsule-2. Then again extend Capsule-3-end until start of Capsule 4 and so on.

To only make this on the capsule-pairs 1/2 3/4 5/6 ... maybe somehow count up?



Link to comment
Share on other sites

  • Solution


you might want to check the following way:

As you need to specify which is the first capsule you want to start with you need to define a bounding condition. In my example I use a monthly condition to do the calculation:


Next I created a signal that puts the value 1 at the start of each capsule:

$condition.removeLongerThan(40h).toSamples($c -> sample($c.startKey(), 1), 0s)


This signal is used to build the running sum of these values:


The calculated value can be used to extend the original condition with a property containing the capsule number during each month:

$condition.removeLongerThan(1d).setProperty('Capsule Number', $count, startValue())


Then two new conditions can be created to include only capsules with odd and even capsule numbers:

$conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) > 0)
$conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) == 0)


A composite condition can be used to join the odd and even ones:


Hope this helps.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...