CNR-Engineering / PyTelTools

Python Telemac Tools for post-processing tasks (includes a workflow)
https://github.com/CNR-Engineering/PyTelTools/wiki
GNU General Public License v3.0
32 stars 15 forks source link

Error in SynchMax #22

Closed krober10nd closed 1 year ago

krober10nd commented 1 year ago

Hi Luc, I'm trying to execute the SynchMax node but it's force closing with this error message in the terminal. Any idea what I may be doing wrong? Thanks again for all your help, I really think this GUI can be useful there's just a learning curve.

The max operator works correctly. Another note: the node SynchMax takes almost no time to run.

Screenshot 2023-03-01 at 11 02 27 PM Screenshot 2023-03-01 at 11 02 52 PM
lucduron commented 1 year ago

The tool "SynchMax" is indeed buggy, I can reproduce the problem. I will fix it soon, thank you for reporting this.

Many tools are very fast as they only add some post-processes for the node "Write Serafin" and "SynchMax" is among them.

lucduron commented 1 year ago

I commited a fix for SynchMax, let me know if you still have troubles.

krober10nd commented 1 year ago

Thank you Luc! It now appears to work. I haven't visualized yet the result in BK but will do shortly. However, I used select variables node to also export what I assume is the scalar velocity (norm of velocity vectors) at the time of maximum water depth (based on my selection in the SynchMax node). However I don't see this variable in the resulting output file?

Screenshot 2023-03-02 at 9 10 28 AM Screenshot 2023-03-02 at 9 09 59 AM
lucduron commented 1 year ago

Hi Keith, Indeed the variables computed on-the-fly are not taken into consideration... I forgot this specific issue which adds a complexity. I will have a look to include it but I will probably not have time before next week. A workaround is to add a node "Write Serafin" before "SynchMax" (it will create an intermediate Serafin file) to compute and write this variable. Regards, Luc

CHLNDDEV commented 1 year ago

Perhaps it makes sense to have an additional operator called "norm" which computes the magnitude of a vector? I am trying to study the code to implement it myself but it's quite complex with many pathways.

lucduron commented 1 year ago

Dear Keith, I added a new commit which should fix your problem. The on-the-fly computed variables are now written and even one of them can be used as the reference variable. Can you confirm me that everything is OK? (I changed the order of variables, the "EXTRACTED TIME" is now at the end). The computation of the norm is already implemented, what do you want to modify? Add new custom vectors? Regards, Luc

krober10nd commented 1 year ago

Thank you very much! I will install the latest version and test tomorrow.

lucduron commented 1 year ago

Could you test the correction? If everything is OK, you can close this issue.

krober10nd commented 1 year ago

Hey Luc, Sorry for the delay. I tested this workflow using H in the SychMax node and it wrote out a file with all the derived variables so seems correct.

Thank you!

Screenshot 2023-03-08 at 11 14 50 AM Screenshot 2023-03-08 at 11 14 22 AM