mahos.meas.hbt.HBTIO#

class mahos.meas.hbt.HBTIO(logger=None)#
save_data(filename: str, data: HBTData, note: str = '') bool#

Save data to filename. return True on success.

load_data(filename: str) HBTData | None#

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

export_data(filename: str, data: HBTData | list[mahos.msgs.hbt_msgs.HBTData], 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 (bool) – set True to normalize data.

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

  • 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.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.show_fit (bool) – set True to plot fit data. normalize must be also True to show fit data.

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