pysteps icon indicating copy to clipboard operation
pysteps copied to clipboard

Optimizing the parameters for the optical flow calculation

Open ladc opened this issue 1 year ago • 9 comments

[RMI/ KNMI / site specific] Is more better, and how to check this? Number of frames, other parameters

ladc avatar Jul 15 '24 09:07 ladc

This can be done using ray as suggested by @dnerini

see example: https://colab.research.google.com/drive/1pMAJZ8AZe7gUDgCogenfdlc-ayX6kVVM?usp=sharing

ladc avatar Jul 15 '24 09:07 ladc

Lukas-Kanade from openCV provides some uncertainty information about the u,v components, can we use this?

ladc avatar Jul 15 '24 09:07 ladc

see example: https://colab.research.google.com/drive/1pMAJZ8AZe7gUDgCogenfdlc-ayX6kVVM?usp=sharing

if possible, one by product of this issue could be adding this example as a tutorial to the pysteps documentation

dnerini avatar Jul 15 '24 09:07 dnerini

Hi!! As I mentioned yday ... I implemented in this example the INCA motion which uses the errors of previous nowcating to correct the latest kind-of-TREC motion vector computation. It uses numba but I am not sure this is required as a new library in pySTEPS but maybe we can think if these errors are useful for task 8 (velocity perturbation settings) or can help in optimizing the optical flow calculation. Here is the link to the example

aitaten avatar Jul 16 '24 06:07 aitaten

Hi!! As I mentioned yday ... I implemented in this example the INCA motion which uses the errors of previous nowcating to correct the latest kind-of-TREC motion vector computation. It uses numba but I am not sure this is required as a new library in pySTEPS but maybe we can think if these errors are useful for task 8 (velocity perturbation settings) or can help in optimizing the optical flow calculation. Here is the link to the example

wouldn't this be rather a new feature to be implemented?

dnerini avatar Jul 17 '24 12:07 dnerini

Hi!! As I mentioned yday ... I implemented in this example the INCA motion which uses the errors of previous nowcating to correct the latest kind-of-TREC motion vector computation. It uses numba but I am not sure this is required as a new library in pySTEPS but maybe we can think if these errors are useful for task 8 (velocity perturbation settings) or can help in optimizing the optical flow calculation. Here is the link to the example

wouldn't this be rather a new feature to be implemented?

I am not sure if you want me to implement these things in pySTEPS or not. I think the kind-of-TREC (using numba, so adding this dependency thing you mentioned) can be implemented in motion sublibrary. The previous nowcast errors computation and the introduction of those into the final vector motion can be also added but I am not sure the best place to do so. So any recommendation is welcome 😄 The think is that can be done and also understood as a correction to the error vector (so again in motion sublibrary) or as a preprocessing step (feature sublibrary). Also, in operations, this is not the way is done ... these errors are saved from the previous time steps. And last but not least, do we want to introduce the NWP wind correction as well?

aitaten avatar Jul 18 '24 07:07 aitaten

Hi!! So, this is the link to the colab code. Can @dnerini tell me if I should link it in the repo or upload the notebook? And @sidekock, please have a look at let me know what would you change in the explanation 🤝

aitaten avatar Jul 19 '24 11:07 aitaten

thanks! essentially the colab needs to be exported as jupyter notebook (.ipynb) and saved in the examples/ folder, same as with the my_first_nowcast.ipynb file. Rember to clear all output cells before exporting the jupyter from colab.

Then we can link it in the docs, same as the existing tutorial, see here: https://github.com/pySTEPS/pysteps/blob/d77fe738a98ac3f647d977e998a3c218192228ca/doc/source/index.rst?plain=1#L35

All this can be done in one PR, can you open one? I'll be happy to review it!

dnerini avatar Jul 19 '24 11:07 dnerini

Looks good. Maybe we can change Note to Caution? It's a bit more alerting, no? But this is a very minor comment

sidekock avatar Jul 19 '24 12:07 sidekock