FLO-2DSoftware / qgis-flo-2d-plugin

A plugin for pre-processing/post-processing FLO-2D models
5 stars 7 forks source link

Storm Drain Editor - Profile Plot #1193

Closed rpachaly closed 1 month ago

rpachaly commented 4 months ago

I was looking for creating the multiple plots (https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/issues/67) and I found out that SWMMIO (https://github.com/pyswmm/swmmio) has the profile plot.

See the plot:

profiles

See the code example:

EspressoMachine.zip

I see two drawbacks here:

  1. Distribution of swmmio library along with FLO-2D Plugin
  2. The plot requires matplotlib

About the matplotlib, we can add a profile plot for the Storm Drain editor that does not use the FLO-2D Plot (pyqtgraph).

FLO-2DNoemi commented 4 months ago

I like the plots from the example. Can we use matplotlib to create/add the plots in our FLO-2D plugin instead of using swmmio library? Would it be too time consuming to add this code to our plugin using matplotlib?

On Tue, Mar 5, 2024 at 3:50 PM Robson Pachaly @.***> wrote:

I was looking for creating the multiple plots (#1191 https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/issues/67) and I found out that SWMMIO (https://github.com/pyswmm/swmmio) has the profile plot.

See the plot:

profiles.png (view on web) https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/39889306/2c0b5d67-d0c9-4246-ae6f-aca88162da8f

See the code example:

EspressoMachine.zip https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/files/14502317/EspressoMachine.zip

I see two drawbacks here:

  1. Distribution of swmmio library along with FLO-2D Plugin
  2. The plot requires matplotlib

About the matplotlib, we can add a profile plot for the Storm Drain editor that does not use the FLO-2D Plot (pyqtgraph).

— Reply to this email directly, view it on GitHub https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/issues/1193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE32O3TIPM3K2LCHQ5AYQ2DYWZD27AVCNFSM6AAAAABEH7U5VKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TAMRXGI2DSNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rpachaly commented 4 months ago

The plugin uses PyQtGraph instead of Matplotlib for plotting. I had this discussion with Karen a few weeks ago. PyQtGraph prioritizes performance, while Matplotlib offers more customization option. In general, I think Matplotlib is better but changing pyqtgraph to matplotlib will be time consuming.

If we create another dialog and add the matplotlib there will be easier. I'll create a prototype.

SWMMIO has other advantages in terms of retrieving data from SWMM models and runs. Maybe it is good to distribute it along the plugin.

FLO-2DKaren commented 4 months ago

Not only the distribution of the swmmio but also fixing it when it doesn't like some complex thing that we have.

FLO-2DKaren commented 4 months ago

Still looks like a valid method.

rpachaly commented 4 months ago

Here it goes the prototype for the profile plot. Before I push this branch, I want to explore some stuff on the swmmio library.

https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/39889306/86a041d9-42df-44ae-bef4-e7b02436d794

Let me know what you think @FLO-2DKaren @FLO-2DNoemi @FLO-2DJJ

FLO-2DKaren commented 4 months ago

Good prototype overview.

Ideas Expand/Collapse to the window so we can expand it to the whole screen quickly.

You already mentioned that you will use a window that doesn't lock QGIS.

I wonder if you can use a pan and zoom on the plot? That would be super cool. Like how some plots have a drag bar at the top and bottom so you can zoom.

I wonder if we can read hdf5 data instead of swmm.inp and swmm.rpt? It might be faster.

rpachaly commented 4 months ago

Expand/Collapse to the window so we can expand it to the whole screen quickly.

I'll add this

You already mentioned that you will use a window that doesn't lock QGIS.

I tried this first, but I got some errors updating the plot. It is doable, I just wanted to have the prototype ready before spending more time into this feature.

I wonder if you can use a pan and zoom on the plot?

Good idea, I'll explore this

I wonder if we can read hdf5 data instead of swmm.inp and swmm.rpt? It might be faster.

This could be a problem because we depend on the swmmio library and it only reads .inp/.rpt. I'll think about this.

rpachaly commented 4 months ago

I added some other stuff to the profile plot. I'll push this branch so you can test it.

https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/39889306/a79ebeb7-342d-4a2c-91b0-278600d6625a

FLO-2DNoemi commented 4 months ago

Robson,

It looks great!. I will send you my comments later today or tomorrow.

One of the nice things about having all these plots in the plugin and eventually adding the water surface elevation profile animation is that we can get rid of a lot of INP tables that are now required only to read the INP from EPA SWMM GUI.

Noemi

On Fri, Mar 8, 2024 at 2:03 PM Robson Pachaly @.***> wrote:

I added some other stuff to the profile plot. I'll push this branch so you can test it.

https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/assets/39889306/a79ebeb7-342d-4a2c-91b0-278600d6625a

— Reply to this email directly, view it on GitHub https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/issues/1193#issuecomment-1986416581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE32O3WRIMUADX2RXXGTF6TYXIRRHAVCNFSM6AAAAABEH7U5VKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWGQYTMNJYGE . You are receiving this because you were mentioned.Message ID: @.***>

FLO-2DKaren commented 4 months ago

You don't know this but the read swmm data that is already in the plugin is super slow. It takes several seconds to load data on a large project like North Mesa. That's the reason I suggested the hdf5. Keep it in your mind and we'll discuss it more.

rpachaly commented 3 months ago

See https://github.com/FLO-2DSoftware/qgis-flo-2d-plugin/issues/801#issuecomment-2030238243

FLO-2DKaren commented 2 months ago

testing and documenting today 5/15/2024

FLO-2DKaren commented 1 month ago

I don't think there are any issues with this other than it is a little slow. Let's close it for now.