threshold module
Define an object to hold a single multipactor threshold.
Also define a place-holder to mark when a minimum or maximum of threshold was reached.
- class ThresholdFilter(*args, **kwargs)[source]
Bases:
ProtocolFunction taking in a
Threshold, and returning a boolean.This resolves, in contrary to classic:
THRESHOLD_FILTER_T = Callable[["Threshold"], bool]
- _abc_impl = <_abc._abc_data object at 0x7466cbc5db00>
- _is_protocol = True
- _is_runtime_protocol = False
- class Threshold(sample_index, nature, way, detecting_instrument, position, color=(1.0, 1.0, 1.0))[source]
Bases:
objectHolds a single multipactor threshold.
Todo
Handle isolated mp zones? Characterized by two Threshold objects at same position, same indexes. One is upper, other is lower. One is enter, other is exit
- Parameters:
- way: Literal['enter', 'exit']
If the threshold was measured during an entry or an exit of the multipator band
- detecting_instrument: str | Literal['any', 'all']
Name of the instrument that detected this threshold.
- create_thresholds(multipactor, growth_array, detecting_instrument, position, threshold_predicate=None, color=None)[source]
Create threshold objects corresponding to a single detecting instrument.
- Parameters:
multipactor (
ndarray[tuple[Any,...],dtype[bool]]) – Array where True means multipactor and False no multipactor, according todetecting_instrument.growth_array (
ndarray[tuple[Any,...],dtype[double]]) – Holds1.0where power grows,-1.0where it decreases, and0.0at transition points. Used to determine threshold nature (lower/upper).detecting_instrument (
str|Literal['any','all']) – Name ofInstrumentthat created themultipactorarray.position (
float) – Position ofInstrumentthat created themultipactorarray.threshold_predicate (
ThresholdFilter|None, default:None) – Function filtering the created thresholds.color (
tuple[float,float,float] |None, default:None) – Color of the detecting instrument.
- Returns:
All multipactor thresholds detected by the
Instrumentnameddetecting_instrument, filtered bypredicate.- Return type:
- class PowerExtremum(sample_index, nature, info, smooth=True)[source]
Bases:
objectPlace-holder for reaching a minimum or maximum of power.
- Parameters:
- create_power_extrema(growth_array)[source]
Create power extrema.
Supports triangular-like and seesaw profiles. Seesaw detection does not work properly if
growth_arraywas generated usingnoisy_array_is_growing()(ForwardPower). Prefer usingnot_noisy_array_is_growing()(PowerSetpoint).