mangadap.util.misc module¶
A catch-all module with miscellaneous utility functions.
Revision history¶
2015: Original implementation by K. Westfall (KBW)20 May 2015: (KBW) Documentation and Sphinx tests04 Jun 2015: (KBW) Added where_not29 Jul 2016: (KBW) Change asarray to atleast_1d17 Nov 2016: (KBW) Addedhigh_pass_filter()
26 Jan 2017: (KBW) Createdmangadap.util.filter
and removed the filtering and smoothing functions from this file.07 Jul 2017: (KBW) Removed where_not function.
Copyright © 2019, SDSS-IV/MaNGA Pipeline Group
-
mangadap.util.misc.
line_coeff
(p1, p2)[source]¶ Given two points on a line return the slope and intercept calculated as
\[\begin{split}m &= \frac{y_1 - y_2}{x_1 - x_2} \\ b &= y_2 - m\ x_2\end{split}\]Parameters: - p1 (array-like) – A two-element \((x_1,y_1)\) array with one of the two points on the line.
- p2 (array-like) – A two-element \((x_2,y_2)\) array with one of the two points on the line.
Returns: The slope (\(m\)) and intercept (\(b\)) of the line, respectively.
Return type: float
Warning
Performs no checks of the input.