Closed HMEUW closed 4 months ago
These look like very useful plots! So +1 from me for including these somewhere. I think a good place for them would be the plots extension (hydropandas/extensions/plots).
The first one can be included as a method in CollectionPlots
class. We do need to include some checking whether the selection of points represent piezometers and whether the metadata for those piezometers is available (or handle the case when it isn't).
The second is more generic and applicable to all kinds of data, so that one could be placed under the ObsPlots
class and doesn't require much checking, I think.
Usage would then look something like this:
import hydropandas as hpd
oc = hpd.ObsCollection.from_dino("dino.zip")
axes = oc.plots.piezometers(names=["pb01", "pb02", "pb03"]) # TODO: think of a good name
pb01 = oc["obs"].iloc[0]
axes = pb01.plots.series_and_monthly_stats() # TODO: think of a good name here too
Would you be willing to submit a PR, @HMEUW ?
I will try to open a Pull Request soon.
Just created a pull request for the 'section and observations'-plot.
I will create the code for the 'annual mean and observations'-plot when I received your feedback on my first submission.
I heard you were interested in this @HMEUW.
If you want to provide colors to plot based on names the enum standard library is very usefull. You can assign a number to a string, based on the name within an Enum class. Quick pseudocode example:
oc = hpd.ObsCollection(data=[["obs2"], ["obs3"], ["obs1"]], index=["name2", "name3", "name1"], columns=["obs"]) # not a real obscollection with data just as an example
color = Enum("color", ["name1", "name2", "name3"], start=0)
for obs in obscollection.obs:
plt.plot(obs.values, color=f"C{color[obs.name].value}")
The PR was added a while ago and already used by others. New plots are always welcome. I will close this issue.
I have recently created some plots of my observations. I think these might be usefull for other users as well, and can be included in HydroPandas. What do others think about that?
Section and observations Left a section with characteristics of observation wells and bandwidth of observations; on right side all observations.![image](https://user-images.githubusercontent.com/117160147/212028157-929465fc-5214-48fd-a3fc-37aff3193fe5.png)
Annual mean and observations Left annual mean per month; right side all observations. I highlighed 10 sept 2022 because of severe precipitation on that day.![image](https://user-images.githubusercontent.com/117160147/212028677-66b79632-ed49-4efc-9b0a-9d78e7a56c80.png)