Open mcguirepatr opened 1 year ago
@mcguirepatr thanks. Interesting idea to directly put into a format readable by a program like gnuplot. However, we would need to include that as an output 'option'. We couldn't make this the new default output format since several users have the scripts reading the current output format, including the new AquaCropPlotter tool (https://github.com/Risk-Team/AquaCropPlotter) which will likely also become available via the FAO AquaCrop homepage. For now, if you want to continue with your output format, I'd suggest you simply keep rebasing your branch with the adapted output. With git rebase, this is done automatically and you keep up-to-date with the newest official AquaCrop version on the main of https://github.com/KUL-RSDA/AquaCrop/
Thanks for the feedback, Michel! I will look into the AquaCropPlotter code that you pointed me to. That sounds cool! Yes, I think an output 'option' would be worthwhile; this would make the AquaCrop data more easily plottable, especially by programs like gnuplot, but also by other programs like Python (i.e., with pandas).
But even without having this option, can you at least consider changing the lines in the code that have headers with broken strings with spaces, like I refer to above for 'WC 9', which could become 'WC09'? This would make the data more easily readable by gnuplot or Python/pandas. I guess you could make the changes in both AquaCrop and AquaCropPlotter. That way the data columns correspond correctly to the labels for the data columns.
I will also try out the rebasing suggestion that you gave me.
Thx. Agree that the historical decision for the header of the output format is not favorable for reading the data in other code/programs. Including your suggestion (will be discussed) will only be possible for the next official release (~ likely August 2024). Programs of other users will stop working if we squeeze it in now.
Hello: I wasn't sure whether to raise a pull request or an issue for this. The fork I made to the repository now has a branch, which I call output_format1. This is to get the output so that it can be plotted by gnuplot on a linux machine. Most of the changes I have in here are actually debug print statements, which probably you don't want to merge into the trunk. But there are a few things that would make my life a bit easier if I don't need to change my local branch copy each time the base repository trunk is changed.
For example, some of the data columns have headers, which in the trunk are broken strings with spaces in between them (for example, 'WC 9'). I think I fixed them with code something like this:
Also, some of the output lines could have a
#
at the beginning, to signify that they are comments. And some of the output lines that are in the middle of the output files could be skipped entirely, so that a program like gnuplot could plot the uninterrupted columns of data.Anyways, the code in this PR minus the debugging print statements produces output that is easily plottable by gnuplot. Maybe it's useful in some way? Patrick McGuire