import dascore as dc
patch = (
dc.get_example_patch()
.update_attrs(data_units="rad", gauge_length=10)
.radians_to_strain()
)
assert patch.attrs.data_type == "strain"RadiansToStrain
RadiansToStrain(
*args ,
gauge_length: Any = None,
wave_length: float | None[float, None] = None,
stress_constant: float = 0.79,
refractive_index: float | None[float, None] = None,
)-> None
Convert data in radians to strain (rate).
This applies the simple formula found in Lindsey, Rademacher, and Ajo-Franklin (2020) to convert data whose units have a radians component to strain.
Parameters
| Parameter | Description |
|---|---|
| gauge_length (\(L_g\)) |
The gauge length in meters. Only used for phase that is not already normalized per unit length (rad or rad/s); ignored for rad/m and rad/(m*s). |
| wave_length (\(\lambda\)) |
The laser wavelength in m. Defaults to the patch’s laser_wavelengthattr, else 1550e-9. |
| stress_constant (\(\zeta\)) | The stress constant. |
| refractive_index (\(n\)) |
The refractive index of the cable. Defaults to the patch’srefractive_index attr, else 1.445.
|
Examples
Equation 3 of Lindsey, Rademacher, and Ajo-Franklin (2020): \[ \epsilon_{xx}(t, x_j) = \frac{\lambda}{4 \pi n L_{g} \zeta} \Delta \Phi \]
For phase already normalized per length (rad/m or rad/(m*s)), the gauge-length division is omitted. Outputs are strain or strain/s, respectively; no time integration is performed.
The output data_type is set from the converted data units; it is “strain_rate” when they are strain per unit time (eg rad/s becomes strain/s) and “strain” otherwise.
Methods
| Name | Description |
|---|---|
| check | Refuse a patch which does not carry what the operation needs. |
| chunk_contract | Return what a chunk of the output needs of the input, or None. |
| get_metadata | Return strain metadata and the factor for phase units. |
| halo | Return how far along an axis the kernel reads to fill a sample. |
| kernel | Return scaled strain data, or unchanged non-phase data. |
| model_copy | Copy the model, dropping cached values the update invalidates. |
| new | Create new instance with some attributed updated. |
| radians_to_strain | Convert data in radians to strain (rate). |
| reconcile | Return metadata or a patch holding the final data; default as is. |
| run | Run the operation: check, get_metadata, kernel, reconcile, record. |