measures
Measurung module
This module provides functions to compute various measures on sections and spans.
PapotoParameterMeasure
Bases: ParameterMeasure
Class to compute PAPOTO parameter measures.
check_validity
check_validity()
Check the validity of the measure.
Source code in src/mechaphlowers/data/measures.py
195 196 197 | |
compute_papoto
compute_papoto(
measures_converted,
) -> tuple[ndarray, ndarray, ndarray, ndarray, ndarray]
Compute the PAPOTO parameter and validity from the converted measures.
Assumes that measures_converted contains the following keys: 'a', 'HL', 'VL', 'HR', 'VR', 'H1', 'V1', 'H2', 'V2', 'H3', 'V3'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
dictionary of converted measures |
required |
Returns:
| Name | Type | Description |
|---|---|---|
mean_parameter |
ndarray
|
mean of the three PAPOTO parameters computed from the three pairs of points (1-2, 2-3, 1-3) |
validity |
ndarray
|
validity criteria computed from the three PAPOTO parameters |
parameter_1_2 |
ndarray
|
PAPOTO parameter computed from points 1 and 2 |
parameter_2_3 |
ndarray
|
PAPOTO parameter computed from points 2 and 3 |
parameter_1_3 |
ndarray
|
PAPOTO parameter computed from points 1 and 3 |
Source code in src/mechaphlowers/data/measures.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
input_conversion
Convert inputs to the required format.
Source code in src/mechaphlowers/data/measures.py
185 186 187 188 189 | |
measure_method
measure_method(
a: ndarray | float | int,
HL: ndarray | float | int,
VL: ndarray | float | int,
HR: ndarray | float | int,
VR: ndarray | float | int,
H1: ndarray | float | int,
V1: ndarray | float | int,
H2: ndarray | float | int,
V2: ndarray | float | int,
H3: ndarray | float | int,
V3: ndarray | float | int,
angle_unit: str = 'grad',
)
Compute the PAPOTO measure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
Length of the span |
required |
|
ndarray
|
horizontal angle of the left part of the span |
required |
|
ndarray
|
vertical angle of the left part of the span |
required |
|
ndarray
|
horizontal angle of the right part of the span |
required |
|
ndarray
|
vertical angle of the right part of the span |
required |
|
ndarray
|
horizontal angle of point 1 |
required |
|
ndarray
|
vertical angle of point 1 |
required |
|
ndarray
|
horizontal angle of point 2 |
required |
|
ndarray
|
vertical angle of point 2 |
required |
|
ndarray
|
horizontal angle of point 3 |
required |
|
ndarray
|
vertical angle of point 3 |
required |
Returns: None
Source code in src/mechaphlowers/data/measures.py
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 125 | |
select_points_in_dict
staticmethod
select_points_in_dict(point_1, point_2, data)
Select points from the input array.
Source code in src/mechaphlowers/data/measures.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
uncertainty
uncertainty(
draw_number: int = 1000,
angle_error: float = 0.01,
seed: int = 42,
) -> dict
Estimate uncertainty on the PAPOTO parameter using Monte Carlo method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
Number of Monte Carlo random draws. Defaults to 1000. |
1000
|
|
float
|
Magnitude of angle measurement error (uniform in [-angle_error, +angle_error]). Defaults to 0.01. |
0.01
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary with statistics over valid and non-valid draws. |
Raises:
| Type | Description |
|---|---|
MeasurementDataNotAvailable
|
If measure_method() has not been called first. |
Source code in src/mechaphlowers/data/measures.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
ParameterMeasure
Bases: ABC
Class to compute measures on parameters.
parameter
abstractmethod
property
parameter
Property to get the computed parameter.
validity
property
validity
Method to compute validity criteria.
check_validity
check_validity()
Method to check validity of the measure.
Source code in src/mechaphlowers/data/measures.py
49 50 51 | |
measure_method
abstractmethod
measure_method(*args, **kwargs)
Abstract method to be implemented by subclasses.
Source code in src/mechaphlowers/data/measures.py
35 36 37 38 | |
uncertainty
uncertainty(*args, **kwargs)
Method to compute uncertainty.
Source code in src/mechaphlowers/data/measures.py
40 41 42 | |
param_calibration
param_calibration(
measured_parameter: float,
measured_temperature: float,
section_array: SectionArray,
cable_array: CableArray,
span_index: int,
sagging_temperature: float = 15.0,
) -> float
Compute an approximation of the parameter at sagging temperature (usually 15 degrees Celsius), based on the measured parameter, at a given temperature.
This approximation is computed using only one loop of a Newton-Raphson method, more precision is not needed.
This method only works for one span at a time, so span index must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
parameter value measured, using papoto method usually |
required |
|
float
|
temperature at which the parameter was measured |
required |
|
SectionArray
|
Section array |
required |
|
CableArray
|
Cable array |
required |
|
int
|
index of the span to compute the parameter for |
required |
Source code in src/mechaphlowers/data/measures.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |