Skip to content
Snippets Groups Projects
Commit f47dfbe3 authored by Xia, Ning's avatar Xia, Ning :penguin:
Browse files

add utility for notebook

parent c96918ee
No related branches found
No related tags found
No related merge requests found
import numpy as np
import matplotlib.pyplot as plt
import h5py as h5
from typing import List, Tuple
def plot_temp_over_time(
data: List[np.ndarray],
time: List[np.ndarray],
legend: List[str],
x_label: str,
y_label: str,
is_save: bool = False,
file_name: str = "image.svg",
) -> None:
"""Plotting The temperature data obtained from any number of temperature sensors over time. The data should be stored in a list, with each element of the list representing the data collected by one sensor. The data from each sensor must include uncertainty, so each element of the list should be an numpy.ndarray of size (2,n), with n meaning the number of data collected by that sensor.
Args:
data (list[np.ndarray]): temprature data, each element of the list must be a numpy.ndarray with size (2,n), n means number of data.
time (list[np.ndarray]): time step.
legend (list[str]): label of sensors
x_label (str): label of x axis.
y_label (str): label of y axis.
is_save (bool, optional): if the plot should be saved. Defaults to False.
file_name (str, optional): name of the image file be saved. Defaults to "image.svg".
"""
pass
def get_plot_data_from_dataset(
data_path: str, group_path: str
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""Get the necessary data from the dataset to plot.
Args:
data_path (str): path to dataset.
group_path (str): path in HDF5 to group containing the measurement data.
Returns:
tuple[np.ndarray, np.ndarray, np.ndarray]: Data for plot in a tuple (temperature, time step, label of data).
"""
pass
def get_start_end_temprature(
temprature_data: np.ndarray, threshold: float
) -> Tuple[float, float]:
"""The sensor values at the beginning and end of the experiment are obtained from the maximum and minimum values in the data set and a threshold. The uncertainty of the values is also output.
Args:
temprature (np.ndarray): dataset, muss be a numpy.ndarray with 2 dimension.
threshold (float): Threshold for deciding whether the data will be counted as a value before the start of the experiment.
Returns:
tuple[float, float]: high temprature, low temprature.
"""
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment