You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After discussion with @FransRoelofsen: making e.g. a streamfunction plot or a cross-section plot requires manually adding top and bottom coordinates to the DataArray -- this while we provide the GRB file during reading to infer the grid topology.
It seems like a minor effort to add top and bottom data by default: it's been read from the GRB file anyway, and we require the GRB file to read budget and head results.
The text was updated successfully, but these errors were encountered:
I think the streamfunction and cross-section plots are odd in this aspect, as they are the only two functions that I can think of now where we require the user to add their top and bottom in the coords of a DataArray provided to the function.
It is more consistent with other functions in the public API to require the top and bottom grids to be provided as argument instead of as coordinates. With some utility methods to the Discretization packages people can relatively easily fetch the tops and bottoms. Or from the GRB path.
Something like:
# imod.visualize.cross_sections.pydefcross_section(da, top, bottom, colors=None, levels=None, **other_kwargs):
...
# imod.util.spatial.pydeftop_and_bottom_from_grb(grb_path):
...
returntop, bottom# When there is a Modflow6Simulation in the script:>>>dis_pkg=gwf_model["dis"]
>>>cross_section(da, *dis_pkg.get_top_bot())
# Or from grb file>>>top, bottom=top_and_bottom_from_grb("path/to/file.grb")
>>>cross_section(da, top, bottom)
Notice that I made colors and levels kwargs now, that's probably worthy a separate issue to investigate.
After discussion with @FransRoelofsen: making e.g. a streamfunction plot or a cross-section plot requires manually adding top and bottom coordinates to the DataArray -- this while we provide the GRB file during reading to infer the grid topology.
It seems like a minor effort to add top and bottom data by default: it's been read from the GRB file anyway, and we require the GRB file to read budget and head results.
The text was updated successfully, but these errors were encountered: