uob-positron-imaging-centre / up4

Post-processor for particle data.
https://uob-positron-imaging-centre.github.io/up4/
GNU General Public License v3.0
9 stars 1 forks source link

Tutorial for 'Data Visualisation' doesn't work #32

Open Aran55336 opened 11 months ago

Aran55336 commented 11 months ago

Hi, trying to use up4 to visualise velocity fields, noticed the tutorial code doesn't work, even with the test file provided. I think one of the commands has been changed from vector_field to vectorfield, and an index is required for the command vec_field_plotter.unit_vector_plot, but when i make those two changes, I still get an error saying argument 'axis': 'builtins.VectorGrid' object cannot be interpreted as an integer.

DanW97 commented 11 months ago

What branch are you using?

Aran55336 commented 11 months ago

Just the default upppp branch I believe, I followed the instructions on there for download.

DanW97 commented 11 months ago

Ah, that'll be the issue.

The plotting interface is in the middle of a major rework into a saner entity. I'm working on it currently, I've just had a lot of stuff on my plate lately, so I haven't had time to finish off the rework.

For now, please use the new-plotting-interface branch. The way to use the newer iteration of the plotting interface can be found in tests/test-interface.py is as follows:

plotter = up4.Plotter2D(vec_field)

fig = plotter.unit_vector_plot(axis, selection="depth_average")
fig.update_layout(width=600, height=600)
fig.update_xaxes(title="x position (mm)")
fig.update_yaxes(title="y position (mm)")

The key difference is that the two plotters focus on whether the plot is 2D or 3D, introducing Plotter2D and Plotter3D. For Plotter2D, you have the following arguments you can pass:

I'll leave this issue open until the rework is merged into the default branch.

Aran55336 commented 10 months ago

I had to reinstall as I think the new plotting interface was updated recently (tried running after switching branches but it said the Plotter2D command didn't exist), but now it doesn't seem to reinstall. I get this error when building wheels for up4 " error: cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'python pyo3/extension-module' --crate-type cdylib -- failed with code 101". I have tried reinstalling rust to see if it was out of date but no difference.

DanW97 commented 10 months ago

Interesting. What version of Rust are you using?

Can you try running cargo clean and pip uninstall up4 to ensure that you are starting fresh. And then when installing from the new-plotting-interface branch run:

RUST_BACKTRACE=1 python3 -m pip install . -vvv > install.txt 2>&1

and attach the created file.

Aran55336 commented 10 months ago

Of course, attached is the file! install.txt

DanW97 commented 8 months ago

Hi @Aran55336, once #34 is merged, hopefully your issues are all resolved!

DanW97 commented 2 months ago

Hi @Aran55336, #34 is now merged, have you tried the tutorial since?

Aran55336 commented 2 months ago

Hi @Aran55336, #34 is now merged, have you tried the tutorial since?

That's great to hear! I haven't tried it since, but I will be working with some interesting DEM after summer and so will probably have a little play around then!