New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -Fe for step-up sampling in sample1d #7488
Conversation
See the forum post for details. This interpolator keeps the previous value until we pass a new input node and then we step up to that value.
src/gmt_support.c
Outdated
@@ -1358,8 +1358,8 @@ GMT_LOCAL bool gmtsupport_is_penstyle (char *word) { | |||
if (n == 0) return (false); | |||
|
|||
if (!strncmp (word, "dotdash", 7U) || !strncmp (word, "dashdot", 7U) \ | |||
|| !strncmp (word, "dash", 4U) || !strncmp (word, "dot", 3U) \ | |||
|| !strncmp (word, "solid", 5U)) return (true); | |||
|| !strncmp (word, "dash", 4U) || !strncmp (word, "dot", 3U) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't replace those spaces by tabs. Using the spaces like that is the only way of keep the alignment with the first character after the parentesis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it was an auto think. I will fix it.
src/gmt_support.c
Outdated
@@ -10323,7 +10338,7 @@ GMT_LOCAL unsigned int gmtsupport_contour_old_T_parser (struct GMT_CTRL *GMT, ch | |||
} | |||
else { | |||
GMT_Report (GMT->parent, GMT_MSG_ERROR, | |||
"Option -T: Give low and high labels either as :LH or :<low>,<high>.\n"); | |||
"Option -T: Give low and high labels either as :LH or :<low>,<high>.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here and below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a few more but dont want to go over all of this manually. As you know I am not in favour of 80character screens so feel these break-the-line adds longer code and more opportunities for tab/space shits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's has nothing to do about the the line width but only on a good alignment with above line. Tee price of indenting with tabs is that we must do a mix of tabs and spaces to keep that alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to revert some of these then no problem, go right ahead.
Great Paul!! I test it. It works. But I found a bug when the input has two records
|
OK, I was checking for the first point first but need to do the end first, then first, then the rest. Now works, I think? |
I found a new issue.
|
With the GMT_Splines.sh also found some issues. Maybe the sames (see #7490).
|
-Fe requires monotonously increasing data but this data set is not that, so not an appropriate test |
Ok, I see. So, would I need to pre process my data with another tool? |
Well, it only make sense for cumulative data since we step up |
In the case of the forum, yes, it is cumulative. But it might not be always the case specially with dates. |
Perhaps you can give me some examples of how -Fe would work on regular data such as in GMT_splines.sh. I approached the problem as specific to cumulative data, or at least a monotonically increasing data set, but presumably we could do something similar for monotonically decreasing data. Not sure what expectation is for other data sets though. |
This is a simple animation that I want to make. Look at the labels. Messi.mp4When I interpolate the data (with sample1d -Fe) I got this table.
times.txt:
Full script
|
I guess 19 is not a multiple of 3, but 21 is. Remember, you are stepping every 3 and nodes are always a multiple of the increment. |
Ok, thanks, I didn't know that. Altough with dates it doesn't make much sense to have steps that are multiple of the increment. |
See the forum post for details. This interpolator keeps the previous value until we pass a new input node and then we step up to that value.
@Esteban82, I think this reproduces your example but I do not know if it is generally correct since I only tested it on yours.