Hello
There is no abs() nor sign() funtions, so I tried a workarround using sqr_fc and sqrt_fc but i think there is somethig wrong with sqrt_fc function:
dpf.operators.math.sqrt_fcdoes not yield the expected result
dpf.operators.math.pow_fc with factor 0.5 does de job
Or am I missing something?
Thank you in advance and best regards
Jose Luis
Example:
>>>
sq = dpf.operators.math.sqr_fc()
sq.inputs.fields_container.Connect(sv_max)
aa=sq.outputs.fields_container.GetData()
op = dpf.operators.math.sqrt_fc(aa)
op.inputs.fields_container.Connect(my_fields_container)
sv_maxa = op.outputs.fields_container.GetData()
>>> sv_max[0].Data
[-0.143837430514395, 0.0639757635071874,...
>>> aa[0].Data
[0.0206892064169835, 0.00409289831632757, ...
>>> sv_maxa[0].Data
[0.816496326286349, 1.22474414708361, ... #this is not correct we don not obatin abs(sv_max)!
>>>
sq = dpf.operators.math.sqr_fc()
sq.inputs.fields_container.Connect(sv_max)
bb=sq.outputs.fields_container.GetData()
op = dpf.operators.math.pow_fc()
op.inputs.fields_container.Connect(bb)
op.inputs.factor.Connect(0.5)
sv_maxc = op.outputs.fields_container.GetData()
>>> bb[0].Data
[0.0206892064169835, 0.00409289831632757, ...
>>>
sv_maxc[0].Data
[0.143837430514395, 0.0639757635071874, ... # this is correct: we obtain abs(sv_max)
Do you plan to add sign() and abs() functions in the future to this great tool?
Hello There is no abs() nor sign() funtions, so I tried a workarround using
sqr_fc
andsqrt_fc
but i think there is somethig wrong withsqrt_fc
function:dpf.operators.math.sqrt_fc
does not yield the expected resultdpf.operators.math.pow_fc
with factor 0.5 does de jobOr am I missing something?
Thank you in advance and best regards
Jose Luis
Example:
Do you plan to add sign() and abs() functions in the future to this great tool?