cherab.nagdis.experiment.create_datasetยถ

cherab.nagdis.experiment.create_dataset(wvf_path: Path | None = None, video_dir: Path | None = None, mask_dir: Path | None = None, wireframe_path: Path | None = None, save_path: Path | None = None, sample_rate: int = 1000000, video_fps: int = 100000) DatasetSourceยถ

Create a dataset from the waveform, video, and mask files.

This function creates a dataset from the waveform, video, and mask files. The trigger, II_gate, Vf_A, Vf_D, V_probe, and I_sat signals are extracted from CH1, CH3, CH4, CH8, CH9, and CH10 traces in waveform file, respectively.

Note

The minimum time step of dataset is assumed to be 1 ยตs (i.e., 1 MHz sample rate), and time-related coordinates are represented as int64 in microseconds to avoid floating point precision issues.

Parameters:
wvf_path: Path | None = Noneยถ

The path to the *.wvf waveform file. If None, a file dialog will be opened.

video_dir: Path | None = Noneยถ

The path to the directory containing the *.tif files. If None, a directory dialog will be opened.

mask_dir: Path | None = Noneยถ

The path to the directory containing the *.npy mask files. If None, a directory dialog will be opened.

wireframe_path: Path | None = Noneยถ

The path to the wireframe image file. If None, the wireframe image will not be added.

save_path: Path | None = Noneยถ

The path to save the dataset as a NetCDF file. If None, the dataset will not be saved.

sample_rate: int = 1000000ยถ

The sample rate of the waveform data in Hz, by default 1 MHz.

video_fps: int = 100000ยถ

The video frame rate in Hz, by default 100 kHz.

Returns:

xarray.Dataset โ€“ The created dataset.

Raises:

FileNotFoundError โ€“ If the specified mask directory or video directory does not exist, or if no tif files are found in the video directory.