Linear
FieldScan
Source code in cmtj/utils/linear.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
amplitude_scan(start, stop, steps, theta, phi, back=False)
staticmethod
Compute a linear magnitude sweep. Angles given in deg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
float
|
start of the sweep |
required |
stop |
float
|
end of the sweep |
required |
steps |
int
|
number of steps |
required |
theta |
float
|
polar angle in deg. |
required |
phi |
float
|
azimuthal angle in deg. |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, np.ndarray]
|
linear amplitude, field vectors |
Source code in cmtj/utils/linear.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
angle2vector(theta, phi, amplitude=1)
staticmethod
Convert spherical coordinates to cartesian coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta |
polar angle in degrees. |
required | |
phi |
azimuthal angle in degrees. |
required | |
amplitude |
amplitude of target vector. |
1
|
Returns:
Type | Description |
---|---|
CVector
|
cartesian vector. |
Source code in cmtj/utils/linear.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
cvector2angle(vector)
staticmethod
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector |
CVector
|
cartesian vector. |
required |
Returns:
Type | Description |
---|---|
Tuple
|
//github.com/numpy/numpy/issues/5228 |
Source code in cmtj/utils/linear.py
50 51 52 53 54 55 56 57 |
|
phi_scan(start, stop, steps, amplitude, theta)
staticmethod
Compute a linear phi angle sweep. Angles given in deg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
float
|
azimuthal angle start of the sweep |
required |
stop |
float
|
azimuthal angle end of the sweep |
required |
steps |
int
|
number of steps |
required |
amplitude |
float
|
amplitude of the scanned field |
required |
theta |
float
|
polar angle in deg. |
required |
Source code in cmtj/utils/linear.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
theta_scan(start, stop, steps, amplitude, phi)
staticmethod
Compute a linear theta angle sweep. Angles given in deg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
float
|
polar angle start of the sweep |
required |
stop |
float
|
polar angle end of the sweep |
required |
steps |
int
|
number of steps |
required |
amplitude |
float
|
amplitude of the scanned field. |
required |
phi |
float
|
azimuthal angle in deg. |
required |
Source code in cmtj/utils/linear.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
vector2angle(x, y, z)
staticmethod
Convert cartesian coordinates to spherical coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
x coordinate of the vector. |
required | |
y |
y coordinate of the vector. |
required | |
z |
z coordinate of the vector. |
required |
Returns:
Type | Description |
---|---|
Tuple
|
//github.com/numpy/numpy/issues/5228 |
Source code in cmtj/utils/linear.py
36 37 38 39 40 41 42 43 44 45 46 47 48 |
|