02-21-2022 03:04 AM
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
Solved! Go to Solution.
02-22-2022 01:50 AM
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 😉
02-22-2022 07:05 AM
Hi Shok83,
You can use the descreptive stataistics ina row oriented mode for this.
Greetings
Walter
02-22-2022 02:18 PM
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
02-22-2022 02:25 PM
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
02-23-2022 12:23 AM
Hy,
dann klappt das mit Walters Vorschlag.
Gruß
02-23-2022 01:11 AM
Thanks a lot. I tested your solution and it works!
🕺
02-23-2022 07:59 AM
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?
02-23-2022 08:15 AM
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
02-23-2022 08:23 AM
That's OK, if I want a personalised channel name I think the best option is:
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.