:py:mod:`aces.sefd.plotting` ============================ .. py:module:: aces.sefd.plotting .. autoapi-nested-parse:: Tooling to support the plotting of SEFD figures Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: aces.sefd.plotting.fitfunc2 aces.sefd.plotting.linfunc aces.sefd.plotting.fit_gauss aces.sefd.plotting.find_mode aces.sefd.plotting.make_sefd_cmap Attributes ~~~~~~~~~~ .. autoapisummary:: aces.sefd.plotting.logger .. py:data:: logger .. py:function:: fitfunc2(p, x) .. py:function:: linfunc(p, x) .. py:function:: fit_gauss(x: numpy.ndarray, y: numpy.ndarray, p0: list[float], fkey: str = 'gau') -> tuple[tuple[float, Ellipsis], float, float, float] Given the bin centers and counts for data that has been binned, an attempt to fit a gaussian to said binned data will be performed. Args: x (np.ndarray): The bin centers of the binned data y (np.ndarray): The bin counts per bins of the binned data p0 (list[float]): Initial guess parameters of the desired model to fit fkey (str, optional): Model to fit to the data. Defaults to 'gau'. Raises: ValueError: Raised when an unkown key / fit function is suppliede Returns: tuple[tuple[float,...], float, float, float]: Contains the best fit parameters, the x and y of the model evaluated with best fit parameters, and the reduced chi2 .. py:function:: find_mode(data: numpy.ma.MaskedArray, parameters: dict[Any, Any]) -> float Estimates and returns the mode of those input data that lie within the limits set by the parameters. The mode is determined by fitting a guassian function to the peak of the histogram of the logarithms of the values. :param data: np.array of real values :param parameters: dictionary giving the data value bounds :return: .. py:function:: make_sefd_cmap(ssl: float, ssu: float) -> tuple[matplotlib.colors.LinearSegmentedColormap, matplotlib.colors.Normalize] Construct a colour map that is appropriate (targeted) for SEFD plotting Args: ssl (float): Lower limit of the SEFD values to plot (Tsys) ssu (float): Upper limit of the SEFD values to plot (Tsys) Returns: tuple[mpl.colors.LinearSegmentedColormap, mpl.colors.Normalize]: The colours and normalise matplotlib instances to use