irfpy.vels.mode
¶
ELS mode related module.
Constants are defined:
- irfpy.vels.mode.MODE_E128 = <irfpy.vels.mode.__ModeE128 object>¶
E128 mode constant.
- irfpy.vels.mode.MODE_E32 = <irfpy.vels.mode.__ModeE32 object>¶
E32 mode constant.
- irfpy.vels.mode.MODE_UNKNOWN = <irfpy.vels.mode.__ModeUnknown object>¶
Unknown mode constant.
- irfpy.vels.mode.guess_mode_from_level(tm_level)[source]¶
Return the mode instance.
- Parameters
tm_level (
numpy.array
with (128,) shape. High energy first.) – An array of TM level.- Returns
Algorithm used is as follows.
Take a difference between the monitor level and reference level for E128 and E32x4 mode. Take the 64 steps with smallest difference out of 128 steps for each mode, and calculate squared sum. The values can be proxies for resembleness of monitor level to E128 and E32x4 respectively. Smaller one (20% margin) is returned as the mode applied.