Add new greenspline option -K for statistics output to file or stdout#8162
Add new greenspline option -K for statistics output to file or stdout#8162PaulWessel merged 9 commits intomasterfrom
Conversation
See #8158 for some background. This PR instead adds -K option that will wrote a data table with header and 7-8 values which makes it easier to access.
|
Isn't -K a global option? |
|
And where is that |
No, see movie -K for instance. But, I agree there is no point using -K if there are other letters available, e.g., -F, -M . I will change it to -F instead. |
|
If we add an enum we must run src/gmt_make_enum_dicts.sh to update that include file for the API. Idid I forget? |
|
But what is the validator compares against to know the number of enums has changed? And what is right, the 261c or 263? |
|
It looks fine. I test it with this:
Statistics.txt: Small IssueThe creation of that file depends on
So, maybe should be clarify in the docs? Or maybe we should a modifier to |
|
Sorry, forget. Just pushed it to master now. It is 263. |
|
Will switch from -K to -F and will update docs etc to say -E is needed. |
Need to requires a file since -E with no file will write to stdou; cannot have two such stdouts.
|
Switched to -F, requires -E, and -F must set a file since -E has an optional file and will write to stdout. Cannot both write to stdout. |
|
@Esteban82, please update build and check again since there were several changes. |
|
I got an error: |
|
Me too! Will fix... |
Ancient -F check now removed.
|
Fixed. |
|
OOPS: More changes: I will instead use option letter -M. The reason is two-fold:
|
|
Ok. BTW I will be away from my PC for the following days. |
Restore backwards check for -F (for -r).
|
OK, the new feature is now set via -E[misfitfile][+rreportfile]. The benefits are
Give @Esteban82 is off, perhaps @joa-quim can have a look. Should be harmless since only about a report to a file. Fixed synopsis message and a few issue related to freeing files that were forgotten in gpsgridder and green spline. gpsgridder now has the same -E modifier etc. |
See #8158 for some background. Rather than messing with the verbose output, this PR instead adds -K option that will wrote a data table with header and 7-8 values which makes it easier to access. Updated docs as well. Suggest @Esteban82 gives this a try and report back if there are any issues or request. You will see I basically write both the misfit and variance statistics to the file (variance first, then misfit) and then if -W is active we append one more output (chi^2) at the end. This ensures that the first 7 columns are in a fixed order and the 8th optional column is only there if -W is set. @joa-quim, done merge this into master until @Esteban82 has given it a try later today.