AsciiDataIo

class glotaran.builtin.io.ascii.wavelength_time_explicit_file.AsciiDataIo(format_name: str)[source]

Bases: DataIoInterface

Initialize a Data IO plugin with the name of the format.

Parameters:

format_name (str) – Name of the supported format an instance uses.

Methods Summary

load_dataset

Reads an ascii file in wavelength- or time-explicit format.

save_dataset

Save data from xarray.Dataset to a file.

Methods Documentation

load_dataset(file_name: str, *, prepare: bool = True) Dataset | DataArray[source]

Reads an ascii file in wavelength- or time-explicit format.

See [1] for documentation of this format.

Parameters:

fname (str) – Name of the ascii file.

Returns:

dataset

Return type:

xr.Dataset

Notes

save_dataset(dataset: DataArray | Dataset, file_name: str, *, comment: str = '', file_format: DataFileType = DataFileType.time_explicit, number_format: str = '%.10e')[source]

Save data from xarray.Dataset to a file.

NOT IMPLEMENTED

Parameters:
  • dataset (xr.Dataset) – Dataset to be saved to file.

  • file_name (str) – File to write the data to.