Functions > Auto-Freeze was meant for a similar situation, but it
works differently: if you check Auto-Freeze and then disactivate an x
range peaks in this range are frozen. So it won't work for you.
Here is a Lua script that removes all PseudoVoigt functions outside of
the active range (assuming that the active range has no gaps).
m = F:calculate_expr("min(x if a)")
M = F:calculate_expr("max(x if a)")
for i,f in F:get_components() do
if f:get_template_name() == "PseudoVoigt" then
c = f:get_param_value("center")
if c < m or c > M then
F:execute("del %" ..
f.name)
end
end
end
And below is a similar script that removes all functions that have
Center defined.
pcall() in Lua is so-called protected call. Here it catches errors
from getting Center of a function (such as Linear) that has no Center
defined.
m = F:calculate_expr("min(x if a)")
M = F:calculate_expr("max(x if a)")
for i,f in F:get_components() do
pcall(function()
c = f:get_param_value("Center")
if c < m or c > M then
F:execute("del %" ..
f.name)
end
end)
end
Best,
Marcin
> --
>
http://groups.google.com/group/fityk-users
> ---
> You received this message because you are subscribed to the Google Groups
> "fityk-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
fityk-users...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.