environmentaltools.common.mat
- environmentaltools.common.mat(file_name: str, variable: str = 'x', julian: bool = False)[source]
Read MATLAB .mat files and extract time series data.
Loads MATLAB files using scipy.io.loadmat and converts time values to pandas datetime format. Assumes data structure with timestamps in first column and values in second column.
- Parameters:
file_name (str) – Path to .mat file.
variable (str) – Variable name to extract from .mat file structure. Defaults to “x”.
julian (bool) – If True, keeps julian date format. If False, converts to datetime using matplotlib date conversion. Defaults to False.
- Returns:
Time series with datetime index and ‘Q’ column containing values.
- Return type:
pd.DataFrame