Modpath Timeseries Class way of work #1734
-
From a steady state simulation (like that one of Example 01a in the Modpath documentation) I want to plot particles positions at different time instants. For that simulation 21 particles are released and then tracked in the time series simulation at time intervals of 1000 days. The ex01a_mf6.timeseries7 files looks like this: It is sorted following a time instant grouping philosophy. However, when loaded with flopy using the TimeSeriesFile Class it gets reordered in a recarray containing one entry per particle id. That recarray entry contains all the times in the timeseries for that particle. So, flopy is giving me a hard time to plot those 21 particles at the different time instants stored in the timeseries files. First, because the timeseries array read with 'flopy.utils.TimeseriesFile' is structuredthat way (kind of thinking on per particle IDs rather than in per time instant). Second, because (from inspecting the source code) all that plot_timeseries does is to parse a travel_time argument to plot_pathlines. Then the latter plots all particles at all time instants in the timeseries that are lower equal than the travel_time. Thus I always get past times plotted together with the one I want. I'll try to build a minimum working example (the week run out on me), but the following code snippet could explain a bit of the problem. It already has a modflow model object (gwf), modpath object and modpath ouput files have been created.
I had to use ts._data to identify the unique time instants in the timeseries file. That way, the code snippet would result in all particles being plotted for all times in the timeseries before the fifth time instant in the timeseries file, instead of only those particles present in the model at that time instant. Am I missing some obvious way to plot particles for a specific time instant in the timeseries file? I'll post the example as soon as I can, but I wonder if the TimeSeriesFile class and plot_timeseries should not be revised, to be aimed to time instants instead of individual particles. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I just looked into this and the Once this PR is accepted, you'll be able to filter particles by a specific time instance: example usage: mview.plot_timeseries(ts_array, travel_time=f"== {times[5]}", layer="all", marker='o', markercolor= ts_colors[5], lw=0) |
Beta Was this translation helpful? Give feedback.
@javgs-bd
I just looked into this and the
travel_time
argument does not currently support a logical equal. I've put in a PR to fix this issue and add support for this; PR #1736.Once this PR is accepted, you'll be able to filter particles by a specific time instance:
example usage: