-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Higher level calibration function #37
Higher level calibration function #37
Conversation
Pull main branch from PhasorPy with phasor module
…ntation of higher function `phasor_calibrate`
Hi @cgohlke, I created this PR so we can start discussing the approach of the higher level function Particularly, I have questions with the optional arguments passed to other functions, such as |
I also renamed the |
I think the split into higher level |
This is a recurring issue. |
That makes a lot of sense! We can approach future implementations following that guidelines. |
I can't seem to find a link to the previous discussion right now. I don't particular like the |
We mentioned it in #32, but I agree that it may be confusing using Maybe if we add some math equations to the docstring it can be more visual what I agree, lets discuss on monday. |
@cgohlke I forgot to ask what do you think about the inputs of the function. Should it be the already calculated |
I think the function should accept phasor coordinates, which are the central "data structure" of this library. Some file formats (REF, R64, IFLI) do not contain signals but phasor or polar coordinates. At some point we will add high level |
That's a good Idea, having higher level |
Sorry, that's not really what I meant. Usually, signals of reference measurements are in separate files and that will require separate io and calibration steps. Some file formats like R64, IFLI, FLIF already contain referenced data or contain calibration information. Only in those cases the phasor coordinates will be returned calibrated. Otherwise they need to be calibrated, which I would keep separate, something like: mean, real, imag, frequency = io.phasor_from_ptu(filename)
mean_ref, real_ref, imag_ref, _ = io.phasor_from_ptu(filename_ref)
real, imag = phasor_calibrate(real, imag, real_ref, imag_ref, frequency, lifetime, ...) |
Re phasor_transform(
real,
imag,
*polar_from_reference_phasor(
*phasor_center(
reference_real,
reference_imag,
skip_axes,
method,
),
*phasor_from_lifetime(
frequency,
lifetime,
fraction,
preexponential,
unit_conversion,
),
),
) |
…pt all parameters from inside functions. Updated examples
…to calibration-function
…ibrate`. Update `plot` module to use `phasor_transform` instead of `phasor_calibrate`
@cgohlke I added the tests and modified the introduction tutorial. I think this is ready for review, but there may be some aspects to improve. |
This is almost ready. Can you pull in the recent changes from main? |
@cgohlke I am getting some errors in testing, I believe is with the fetch datasets, but I am not sure. |
You can follow the "Details" links next to the failed test runs and see exactly what failed. There's also an option to re-run failed checks. All tests pass now. |
I just noticed that the It would be nice to have a tutorial using a real world dataset that can demonstrate this and other advanced features of the new |
I missed the It would be great to have an interesting dataset that we can use for this. We could generate an suitable dataset here but we can only get .fbd files, which are not so good for a tutorial I think. But we can have something and look for files from another lab with access to other hardware. |
I think a small, multi-harmonic FBD dataset might be OK for this. The |
Description
This PR renames the
phasor_calibrate
function tophasor_transform
and adds the higher level functionphasor_calibrate
for easier calibration....
Release note
Summarize the changes in the code block below to be included in the
release notes:
Checklist