swvo.io.RBMDataSet.utils#
Functions
|
transforms cartesian coordinates x, y to polar coordinates theta (in rad) and radius |
|
Get the file path for a given file stem and preferred extension. |
|
Join two variables along the first axis. |
|
Load a file in any supported format and return its content. |
|
Convert MATLAB datenum to Python datetime. |
|
transforms polar coordinates theta (in rad) and radius to cartesian coordinates x, y |
|
Convert Python datetime to MATLAB datenum. |
|
Reads all datasets (variables) from a NetCDF file, including those in groups. |
|
Round datetime object to the nearest second. |
- swvo.io.RBMDataSet.utils.join_var(var1: ndarray[tuple[Any, ...], dtype[generic]], var2: ndarray[tuple[Any, ...], dtype[generic]]) ndarray[tuple[Any, ...], dtype[generic]][source]#
Join two variables along the first axis.
- swvo.io.RBMDataSet.utils.get_file_path_any_format(folder_path: Path, file_stem: str, preferred_ext: str, nc_mode: bool) Path | None[source]#
Get the file path for a given file stem and preferred extension.
- swvo.io.RBMDataSet.utils.read_all_datasets_netcdf(file_path: str | Path) dict[str, Any][source]#
Reads all datasets (variables) from a NetCDF file, including those in groups.
This function recursively traverses all groups and variables in a NetCDF-4 file and stores their data in a dictionary. The key for each dataset is its full hierarchical path.
- swvo.io.RBMDataSet.utils.load_file_any_format(file_path: Path) dict[str, Any][source]#
Load a file in any supported format and return its content.
- swvo.io.RBMDataSet.utils.round_seconds(obj: datetime) datetime[source]#
Round datetime object to the nearest second.
- swvo.io.RBMDataSet.utils.python2matlab(datenum: datetime) float[source]#
Convert Python datetime to MATLAB datenum.
- swvo.io.RBMDataSet.utils.matlab2python(datenum: float | Iterable[float]) Iterable[datetime] | datetime[source]#
Convert MATLAB datenum to Python datetime.
- swvo.io.RBMDataSet.utils.pol2cart(theta: ndarray[tuple[Any, ...], dtype[float64]], radius: ndarray[tuple[Any, ...], dtype[float64]]) tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]][source]#
transforms polar coordinates theta (in rad) and radius to cartesian coordinates x, y
- swvo.io.RBMDataSet.utils.cart2pol(x: ndarray[tuple[Any, ...], dtype[float64]], y: ndarray[tuple[Any, ...], dtype[float64]]) tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]][source]#
transforms cartesian coordinates x, y to polar coordinates theta (in rad) and radius