Supporting Date/Time as Range of makecpt
|Target version:||Candidate for next minor release|
I would be most pleased if you would consider in one of the next GMT releases a fix that makecpt can support date/time as Range (-T) as asked/answered in User-Forumon 11/11/14.
Thank you in advance,
#3 Updated by Paul over 3 years ago
- Status changed from New to Feedback
should mean 3-month intervals which have different number of days, just like when -Ba3o is used. Basically, we will then support the same increments as in -B, such as days, weeks, Gregorian weeks, months, etc.
I see the following changes to be involved:
- No longer use atof to parse min/max/inc since these could be dates, so use GMT_scanf as elsewhere.
- From these, build a coordinate array as is done in basemap plotting. Normally, these will be equidistant but not for time, necessarily.
- Set -f0T when min and max contains the "T" used to indicate date-time string so that the i/o machinery will work.
- Write date-time strings into the output cpt files (well, if -fo0t is used then relative time is written).
- Parsing of CPT files needs to use GMT_scanf since there may be date-strings.
#4 Updated by Paul about 24 hours ago
- Status changed from Feedback to Resolved
- Assignee changed from Remko to Paul
- % Done changed from 0 to 100
After reimplementing the parsing of -T in modules like makecpt and gmtmath we can now accept things like -T2017/2018/1o and get an uneven but monthly interval. This now carries through to CPT files which can now use an absolute time axis. As an example, see
gmt makecpt -T2017T/2018T/1o -Cjet > t.cpt
which is part of a new test script (tests/makecpt/timecpt.sh). In r19803