DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate new Channel with maximum of 2 or more channels

Solved!
Go to solution

Hello,

 

how I can generate a new channel with maximum of each value of two or more channels?

 

Wie kann ich einen neuen Kanal generieren, der sich aus dem Maximum der Einzelwerte von zwei oder mehr Datenkanälen ergibt?

 

thanks

Shok83

0 Kudos
Message 1 of 11
(2,529 Views)

Hallo Shok83,

 

das habe ich noch nicht ganz verstanden. Möchtest du einen Kanal mit den Maximalwerten der Quellkanäle? also bei 2 Quellkanäle einen Kanal mit den 2 Max-Werten? Oder möchtest du die Quellkanäle quasi übereinander legen und im Ergebniskanal die gleiche Anzahl von Werten wie die Quellkanäle haben allerdings mit den jeweilig größeren Werten?

 

Gruß

 

p.s. Hoffe deutsch war ok 😉

0 Kudos
Message 2 of 11
(2,500 Views)
Solution
Accepted by topic author Shok83

Hi Shok83,

 

You can use the descreptive stataistics ina row oriented mode for this.

Walter_Rick_0-1645535121394.png

Greetings

Walter

Message 3 of 11
(2,485 Views)

Danke vorab, dass du dich meinem Problem annimmst.

 

Ich mache ein Beispiel.

Ich habe 3 unterschiedliche Kanäle mit der gleichen Länge. Jetzt würde ich gerne einen Kanal erzeugen, der aus den 3 Kanälen Zeile für Zeile jeweils den größten Wert enthält.

 

A: 

1

5

9

 

B:

2

3

4

 

C:

1

8

7

 

Zu erzeugender Kanal müsste dann so aussehen:

Z:

2

8

9

 

Schön wäre es, wenn es dafür bereits eine Kanalfunktion gibt, wie es zum Beispiel die Funktion für die Mittelwertbildung von 2 oder mehreren Kanälen gibt.

 

Gruß

Shok83

 

 

0 Kudos
Message 4 of 11
(2,475 Views)

Hello Walter,

 

Thanks for your reply. I will check this "descreptive statastics" tomorrow. Maybe it's that, what I'm looking for. Later I will give you a response.

 

Regards 

Shok83

0 Kudos
Message 5 of 11
(2,471 Views)
Solution
Accepted by topic author Shok83

Hy,

 

dann klappt das mit Walters Vorschlag.

Gruß

0 Kudos
Message 6 of 11
(2,458 Views)

Thanks a lot. I tested your solution and it works!

🕺

0 Kudos
Message 7 of 11
(2,445 Views)

Sounds great. I was also interested in a solution like this.

 

Just one question, my code looks like this (I use Python instead of VBS, but the syntax is very similar)

dd.ChnResult = dd.ChnStatisticsChannelCalc( dd.Data.GetChannels('Room temperatures/Temperature_*'), 16, 0, 0, False, True, False, 'NameName')

 

I can create a channel with the maximum values directly with DIAdem built-in functions, which is great!

Only little drawback, I am not able to specify the group and the name, but it automatically creates a channel called "Maximum" in the currently selected group.

 

Do you think there is a way to specify the name? In case it is not feasible I was thinking of using dd.Data.Move function to move the channel in the position I fancy. Anyone has a better idea?

0 Kudos
Message 8 of 11
(2,436 Views)

Hi panta1978,

 

No, it is not possible to specify the result channel name. The result is always sorted in the default group (which can be specified before the calculation) and the result channels are stored in the variable dd.ChnResult which is an array of channel objects.

 

Greetings

Walter

0 Kudos
Message 9 of 11
(2,432 Views)

That's OK, if I want a personalised channel name I think the best option is:

  • Set the current group
  • Calculate Maximum and/or other statistical channels
  • Rename them

Attached my code that creates 3 channels (respectively, max, min, and mean) and renames them.

dd.Data.Root.ChannelGroups('Room temperatures').Activate()
dd.ChnResult = dd.ChnStatisticsChannelCalc( dd.Data.GetChannels('Room temperatures/Temperature_*'), 56, 0, 0, False, True, False, 'NameName')
dd.ChnResult.Item(1).Name = 'MyMinChan'
dd.ChnResult.Item(2).Name = 'MyMaxChan'
dd.ChnResult.Item(3).Name = 'MyMeanChan'

 Thanks.

0 Kudos
Message 10 of 11
(2,424 Views)