Skip to content
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

feature: flopy.plot.crosssection plot cell centres (DISU) #2299

Closed
kerrybardot opened this issue Sep 2, 2024 · 5 comments · Fixed by #2318
Closed

feature: flopy.plot.crosssection plot cell centres (DISU) #2299

kerrybardot opened this issue Sep 2, 2024 · 5 comments · Fixed by #2318
Assignees
Milestone

Comments

@kerrybardot
Copy link

I appreciate the plotting utilities in flopy - flopy.plot.crosssection

I use the plot_array and plot_grid.. but the plot_grid only plots the lines - would be nice if there was an option to plot cell centres (and be able to change the marker size/color).

I can extract the grid xyz cell centres gwf.modelgrid.xcellcenters - but it's not obvious how to plot cell centres on DISU cross-sections
(Unless I have missed something...)

Thanks!

@kerrybardot kerrybardot changed the title feature: disu plot cell centres feature: flopy.plot.crosssection plot cell centres (DISU) Sep 2, 2024
@wpbonelli
Copy link
Member

I think an option to plot cell centers or vertices should not be hard to add, since PlotCrossSection already sets them as attributes for internal use at init time: xcenters/xvertices/yvertices (note the absence of ycenters, xcenters can be x or y depending on the projection).

Maybe centers/vertices switches on plot_grid()?

For consistency we might offer the same on PlotMapView?

@jlarsen-usgs

@langevin-usgs
Copy link
Contributor

Maybe we should add separate methods, plot_nodes and plot_vertices, to both PlotMapView and PlotCrossSection? If we add them as separate methods, then we can send back the plotting object for further user manipulation?

@wpbonelli wpbonelli self-assigned this Sep 3, 2024
@kerrybardot
Copy link
Author

kerrybardot commented Sep 4, 2024 via email

@wpbonelli wpbonelli added this to the 3.10 milestone Sep 4, 2024
@jlarsen-usgs
Copy link
Contributor

I think that plotting cell centers shouldn't be too difficult to implement for cross sections and map view plots. For cross sections, there are a couple of considerations/calculations that need to be made. A standard cross section plots the distance along the provided cross section line on the x-axis. To get the location of the actual cell center, we will need to calculate that distance using the same/similar intersection routine as we currently do to draw cross sections. More or less, we'll need to calculate where the cross sectional line cross the cell center plane for a given view ("x" or "y" dimension). Unfortunately it's not quite as simple as plotting a point in the center of the cell if we want to represent the location correctly.

As far as the geographic coordinate plotting in cross section and in map view, we can just grab the cell centers from the modelgrid and plot those.

I think it would also be worthwhile to add an optional array to a plot_centers() method, so the user can represent additional data on the scatter plot.

@jlarsen-usgs
Copy link
Contributor

I looked into this for a few minutes this afternoon, and it should be relatively easy to implement using some of the existing methods in flopy's geometry utility that are primarily used for plotting particle locations and paths in cross section. @wpbonelli I can put together an initial PR to add this enhancement to the plotting routines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants