mahos.meas.odmr.ODMRIO#

class mahos.meas.odmr.ODMRIO(logger=None)#

IO class for ODMR.

save_data(filename: str, data: ODMRData, note: str = '') bool#

Save data to filename. return True on success.

load_data(filename: str) ODMRData | None#

Load data from filename. return None if load is failed.

export_data(filename: str, data: ODMRData | list[mahos.msgs.odmr_msgs.ODMRData], params: dict | None = None) bool#

Export the data to text or image files.

Parameters:
  • filename – supported extensions: text: .txt and .csv. image: .png, .pdf, and .eps.

  • data – single data or list of data

  • params.normalize_n (int) – number of points for normalization. (0 for no-normalization)

  • params.complex_conv (str) – (real | imag | abs[olute] | angle) conversion method for complex data.

  • params.offset (list[float]) – offset along y-axis

  • params.base_line (bool) – set True to draw base lines

  • params.xmin (float) – lower limit of x-axis

  • params.xmax (float) – upper limit of x-axis

  • params.ymin (float) – lower limit of y-axis

  • params.ymax (float) – upper limit of y-axis

  • params.figsize (tuple[float, float]) – matplotlib figure size (w, h)

  • params.fontsize (float) – matplotlib fontsize

  • params.dpi (float) – matplotlib dpi

  • params.label (list[str]) – matplotlib labels

  • params.color_fit (list[str]) – matplotlib colors for fit data

  • params.color (list[str]) – matplotlib colors for data

  • params.color_bg (list[str]) – matplotlib colors for background data

  • params.linewidth (list[float]) – matplotlib linewidths for data

  • params.linewidth_fit (list[float]) – matplotlib linewidths for fit data

  • params.marker (list[str]) – matplotlib markers for data

  • params.marker_bg (list[str]) – matplotlib markers for background data

  • params.show_fit (bool) – set True to plot fit data

  • params.show_std (bool) – set True to plot estimated std. dev.

  • params.legend (str|None) – legend location (best|upper left|…). None to disable legend.