Coverage for pesummary/gw/conversions/utils.py: 0.0%

5 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-05-02 08:42 +0000

1# Licensed under an MIT style license -- see LICENSE.md 

2 

3import numpy as np 

4 

5__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"] 

6 

7 

8def magnitude_from_vector(vector): 

9 """Return the magnitude of a vector 

10 

11 Parameters 

12 ---------- 

13 vector: list, np.ndarray 

14 The vector you wish to return the magnitude for. 

15 """ 

16 vector = np.atleast_2d(vector) 

17 return np.linalg.norm(vector, axis=1)