zea.data.legacy_file¶
Functions
|
Warn and auto-convert focus distances stored in wavelengths to metres. |
|
Convert a dictionary with sortable keys to a sorted list of values. |
|
Infer n_tx from n_frames and n_ax. |
|
Format probe parameters for legacy file. |
|
Format scan parameters for legacy file. |
- zea.data.legacy_file.check_focus_distances(scan_parameters)[source]¶
Warn and auto-convert focus distances stored in wavelengths to metres.
Some older files store
focus_distancesin wavelengths rather than metres. This helper detects the pattern (values ≥ 1 and â‰inf) and converts them usingsound_speed / center_frequency.- Parameters:
scan_parameters (
dict) – Raw scan parameter dict loaded from HDF5.- Returns:
The same dict, with
focus_distancesconverted when needed.- Return type:
dict
- zea.data.legacy_file.dict_to_sorted_list(dictionary)[source]¶
Convert a dictionary with sortable keys to a sorted list of values.
Note
This function operates on the top level of the dictionary only. If the dictionary contains nested dictionaries, those will not be sorted.
Example
>>> from zea.data.legacy_file import dict_to_sorted_list >>> input_dict = {"number_000": 5, "number_001": 1, "number_002": 23} >>> dict_to_sorted_list(input_dict) [5, 1, 23]
- Parameters:
dictionary (
dict) – The dictionary to convert. The keys must be sortable.- Returns:
The sorted list of values.
- Return type:
list