RIQ Utils¶
M
pynasonde.vipir.riq.utils — low-level helpers for null-terminated strings, phase unwrapping, and index parity.
pynasonde.vipir.riq.utils
¶
Utility helpers for processing VIPIR RIQ (raw IQ) records.
This module bundles a few small helpers that are shared across the RIQ parsers and datatypes:
odd/evencheck integer parity without treating zero as odd.trim_nullandlen_trim_nullhandle null-terminated strings that appear in VIPIR binary structures.unwrapkeeps phase angles within the[-pi, pi]interval so downstream routines can reason about angular differences coherently.
unwrap(phase)
¶
Unwrap radian phase to the range [-PI, PI].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phase |
float Input phase in radians. |
required |
Returns:
| Type | Description |
|---|---|
Unwrapped phase. |
Source code in pynasonde/vipir/riq/utils.py
len_trim_null(string)
¶
Get the length of the string after stripping null characters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string |
str Input string to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
Length of the string after nulls are stripped. |
Source code in pynasonde/vipir/riq/utils.py
trim_null(string)
¶
Remove null characters (ASCII 0) from the string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string |
str Input string to trim. |
required |
Returns:
| Type | Description |
|---|---|
Trimmed string with null characters replaced by spaces. |
Source code in pynasonde/vipir/riq/utils.py
even(i)
¶
Determine if the argument is even. Zero is considered even.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i |
int Integer to check for evenness. |
required |
Returns:
| Type | Description |
|---|---|
True if even, False if odd. |
odd(i)
¶
Determine if the argument is odd. Zero is considered even.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i |
int Integer to check for oddness. |
required |
Returns:
| Type | Description |
|---|---|
True if odd, False if even. |