Skip to content

openstb.simulator.result_converter.matlab

Classes:

Name Description
MATLABConverter

Convert simulation results to a MATLAB file.

MATLABConverter

MATLABConverter(filename, format='5', long_field_names=False, do_compression=False, oned_as='row')

Bases: ResultConverter

Convert simulation results to a MATLAB file.

This writes the data with the following variables:

  • baseband_frequency: the frequency used to baseband the data
  • ping_start_time: seconds since the start of the trajectory that the pings were sent
  • pressure: the simulated pressure at each receiver
  • pressure_dimensions: string array giving the order of dimensions in pressure.
  • sample_time: seconds since the start of its ping that each sample was captured

Parameters:

Name Type Description Default
filename path - like

The path to save the converted results at.

required
format Literal['5'] | Literal['4']

Parameters passed to scipy.io.savemat when writing the data; see its docstring for details.

'5'
long_field_name Literal['5'] | Literal['4']

Parameters passed to scipy.io.savemat when writing the data; see its docstring for details.

'5'
do_compression Literal['5'] | Literal['4']

Parameters passed to scipy.io.savemat when writing the data; see its docstring for details.

'5'
oned_as Literal['5'] | Literal['4']

Parameters passed to scipy.io.savemat when writing the data; see its docstring for details.

'5'
Source code in openstb/simulator/result_converter/matlab.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def __init__(
    self,
    filename: os.PathLike[str] | str,
    format: Literal["5"] | Literal["4"] = "5",
    long_field_names: bool = False,
    do_compression: bool = False,
    oned_as: Literal["row"] | Literal["column"] = "row",
):
    self.filename = Path(filename)
    self.format = format
    self.long_field_names = long_field_names
    self.do_compression = do_compression
    self.oned_as = oned_as

    if self.filename.exists():
        raise ValueError(
            _("output file {filename} already exists").format(
                filename=self.filename
            )
        )