pyrtc.utils
General utility helpers shared across pyrtc.
The utilities in this module cover several small but widely used concerns: configuration validation, file-path helpers, timing helpers, dtype encoding, basic numerical helpers, and lightweight socket/process convenience functions.
They are kept here because they are broadly reusable across components and do not belong to a single subsystem.
Functions
|
|
|
|
|
|
|
|
|
Append a numpy array to a binary file on disk. |
|
Bind a TCP socket, retrying across a short range of ports. |
|
Return the intensity centroid |
|
|
|
|
|
|
|
|
|
Deprecated: use |
|
Convert a NumPy dtype to a unique float. |
|
Convert a unique float back to the original NumPy dtype. |
|
Return Gaussian weights on a |
|
Generates a binary mask of size NxN with a circular aperture of radius R and a central obscuration of radius r. |
|
Generate a file path based on the current date and time. |
|
Append '_tmp' to the filename part of the given file path, before the file extension. |
|
|
|
|
|
Measure repeated execution-time statistics for a callable. |
|
|
|
|
|
|
|
Import and return |
|
Raise the calling thread's scheduling priority (Linux only). |
|
|
|
Load a YAML file and return the parsed Python object. |
|
Import an optional dependency, or raise |
|
|
|
Pin the calling thread to the given CPU core(s). |
|
Pin the calling thread and raise its priority, logging what applied. |
|
Return a config value or a typed default. |
|
|
|
Dispatch configuration validation based on the component class hierarchy. |
|
|
|
|
|
Exceptions
|
Raised when a component configuration does not meet pyrtc expectations. |