Exporters: getting data out of ixdat
¶
Here is an example of an ixdat csv file (exported from a CyclicVoltammagram
measurement using its default ECExporter
.):
https://github.com/ixdat/tutorials/blob/main/loading_appending_and_saving/co_strip.csv
The csv_exporter
module¶
Classes for exporting measurement data
-
class
ixdat.exporters.csv_exporter.
CSVExporter
(measurement=None, delim=', t')[source]¶ The default exporter, which writes delimited measurement data row-wise to file
-
export
(path_to_file=None, measurement=None, v_list=None, tspan=None)[source]¶ Export a given measurement to a specified file.
To improve flexibility with inheritance, this method allocates its work to: - CSVExporter.prepare_header_and_data() - CSVExporter.write_header() - CSVExporter.write_data()
Parameters: - measurement (Measurement) – The measurement to export. Defaults to self.measurement.
- path_to_file (Path) – The path to the file to write. If it has no suffix, a .csv suffix is appended. Defaults to “{measurement.name}.csv”
- v_list (list of str) – The names of the data series to include. Defaults in CSVExporter to all VSeries and TSeries in the measurement. This default may be overwritten in inheriting exporters.
- tspan (timespan) – The timespan to include in the file, defaults to all of it
-
prepare_header_and_data
(measurement, v_list, tspan)[source]¶ Prepare self.header_lines to include metadata and value-time pairs
Parameters: - measurement (Measurement) – The measurement being exported
- v_list (list of str) – The names of the ValueSeries to include
- tspan (timespan) – The timespan of the data to include in the export
-
The ec_exporter
module¶
The ecms_exporter
module¶
-
class
ixdat.exporters.ecms_exporter.
ECMSExporter
(measurement=None, delim=', t')[source]¶ A CSVExporter that by default exports potential, current, selector, and all MID
-
default_v_list
¶ The default v_list for ECExporter is V_str, J_str, and sel_str
-
export
(path_to_file=None, measurement=None, v_list=None, tspan=None, mass_list=None, mol_list=None)[source]¶ Export a given measurement to a specified file.
To improve flexibility with inheritance, this method allocates its work to: - CSVExporter.prepare_header_and_data() - CSVExporter.write_header() - CSVExporter.write_data()
Parameters: - measurement (Measurement) – The measurement to export. Defaults to self.measurement.
- path_to_file (Path) – The path to the file to write. If it has no suffix, a .csv suffix is appended. Defaults to “{measurement.name}.csv”
- v_list (list of str) – The names of the data series to include. Defaults in CSVExporter to all VSeries and TSeries in the measurement. This default may be overwritten in inheriting exporters.
- tspan (timespan) – The timespan to include in the file, defaults to all of it
-
The spectrum_exporter
module¶
-
class
ixdat.exporters.spectrum_exporter.
SpectrumExporter
(spectrum, delim=', ')[source]¶ An ixdat CSV exporter for spectra. Uses pandas.
-
export
(spectrum, path_to_file)[source]¶ Export spectrum to path_to_file.
Parameters: - spectrum (Spectrum) – The spectrum to export if different from self.spectrum
- path_to_file (str or Path) – The path of the file to export to. Note that if a file already exists with this path, it will be overwritten.
-
-
class
ixdat.exporters.spectrum_exporter.
SpectrumSeriesExporter
(spectrum_series, delim=', ')[source]¶ An exporter for ixdat spectrum series.
-
export
(spectrum_series=None, path_to_file=None, spectra_as_rows=True)[source]¶ Export spectrum to path_to_file.
Parameters: - spectrum (Spectrum) – The spectrum to export if different from self.spectrum
- path_to_file (str or Path) – The path of the file to export to. Note that if a file already exists with this path, it will be overwritten.
- spectra_as_rows (bool) – This specifies the orientation of the data exported. If True, the scanning variabe (e.g. wavelength) increases to the right and the time variable increases downward. If False, the scanning variable increases downwards and the time variable increases to the right. Either way it is clarified in the file header. Defaults to True.
-
The sec_exporter
module¶
-
class
ixdat.exporters.sec_exporter.
SECExporter
(measurement, delim=', t')[source]¶ Adds to CSVExporter the export of the Field with the SEC spectra
-
default_v_list
¶ The default v_list for SECExporter is that from EC and tracked wavelengths
-
prepare_header_and_data
(measurement, v_list, tspan)[source]¶ Do the standard ixdat csv export header preparation, plus SEC stuff.
- The SEC stuff is:
- export the spectroelectrochemistry spectra
- export the actual reference spectrum
- add lines to the main file header pointing to the files with the
- above two exports.
-