how to set the weights of field combiner in python?
-
Here is an example I used in the past (with Sim4Life v3.0), maybe it works for you?
sim = document.AllSimulations[0] results = sim.Results() sim_combiner = results.GetSimulationCombiner() sim_combiner.UpdateAttributes() weights = sim_combiner.GetChannelWeights() for n, channel in enumerate(weights): power, phase = weights[channel] weights[channel] = power, 45*n for channel in weights: print channel, weights[channel] sim_combiner.SetChannelWeight(channel, *weights[channel]) -
sorry, I gave you some code for the Simulation Combiner, not the Field Combiner...
This is how you can use the GetWeights and SetWeights functions for the field combiner:>>> field_combiner.GetWeights() ((1+0j), (1+0j)) >>> field_combiner.SetWeights( ( (2+0j), (-3+0j) ) )
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login