AsciiDataIo

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

Bases: glotaran.io.interface.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 (NOT IMPLEMENTED).

Methods Documentation

load_dataset(file_name: str) xr.Dataset | xr.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

1

https://glotaran.github.io/legacy/file_formats

save_dataset(dataset: xarray.core.dataarray.DataArray, file_name: str, *, comment: str = '', file_format: glotaran.builtin.io.ascii.wavelength_time_explicit_file.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.