Replies: 2 comments 1 reply
-
Hi Liduin, the The function is defined as: def var_fun(stokes):
return slope * stokes + offset Try this; _, _, _, _, _, st_var = variance_stokes_linear(ds.dts.st,sections=sections,acquisitiontime=ds.userAcquisitionTimeFW)
_, _, _, _, _, ast_var = variance_stokes_linear(ds.dts.ast,sections=sections,acquisitiontime=ds.userAcquisitionTimeFW)
_, _, _, _, _, rst_var = variance_stokes_linear(ds.dts.rst,sections=sections,acquisitiontime=ds.userAcquisitionTimeBW)
_, _, _, _, _, rast_var = variance_stokes_linear(ds.dts.rast,sections=sections,acquisitiontime=ds.userAcquisitionTimeBW)
ds_calibrated = ds.dts.calibrate_double_ended(
sections = sections,
st_var=st_var,
ast_var=ast_var,
rst_var=rst_var,
rast_var=rast_var,
method='wls',
) Do be careful when using this variance relationship, and verify the linear fit performed by the I assume you read this document: https://github.com/dtscalibration/python-dts-calibration/blob/main/examples/temperature_variance_from_stokes.pdf ? |
Beta Was this translation helpful? Give feedback.
-
Hi Bart, Thanks for the quick response and answer! I better understand what's going on now. Yes I did, thanks for double checking. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Currently I'm trying to calibrate a double ended setup (merged measurements from 2 single ended channels) of about 800 m. One step is to determine the stokes variance. Given the description in the documentation I should take the "variance_stokes_linear" function. This function has an output of 6 variables, namely slope, offset, sort_mean, sort_var, resid, var_fun. From the documentation (and from the code) it is not clear to me which variables I have to use in the calibrate_double_ended function. All output variables from the variance stokes function are not multi-dimensional while the calibrate_double_ended function seems to expect this for the st_var, ast_var, etc. variables.
I'm currently stuck on the error message: "ValueError: operands could not be broadcast together with shapes (3139,9) (39,) " when trying to run:
slope, offset, st_sort_mean, st_sort_var, resid, var_fun = variance_stokes_linear(ds.dts.st,sections=sections,acquisitiontime=ds.userAcquisitionTimeFW)
slope, offset, ast_sort_mean, ast_sort_var, resid, var_fun = variance_stokes_linear(ds.dts.ast,sections=sections,acquisitiontime=ds.userAcquisitionTimeFW)
slope, offset, rst_sort_mean, rst_sort_var, resid, var_fun = variance_stokes_linear(ds.dts.rst,sections=sections,acquisitiontime=ds.userAcquisitionTimeBW)
slope, offset, rast_sort_mean, rast_sort_var, resid, var_fun = variance_stokes_linear(ds.dts.rast,sections=sections,acquisitiontime=ds.userAcquisitionTimeBW)
ds_calibrated = ds.dts.calibrate_double_ended(
sections = sections,
st_var=st_sort_var,
ast_var=ast_sort_var,
rst_var=rst_sort_var,
rast_var=rast_sort_var,
method='wls',
)
I probably am doing something wrong, but I cannot figure out what. Do you have any ideas on how to correctly apply both the variance_stokes_linear function as well as the calibrate_double_ended?
note: I am using the dtscalibration version 3.1.0.
Best regards,
Liduin
Beta Was this translation helpful? Give feedback.
All reactions