Bug #1131

[5.4.2] gmt set not honoring TIME_SYSTEM argument

Added by Matthias 11 days ago. Updated 10 days ago.

Status:ResolvedStart date:2017-07-13
Priority:NormalDue date:
Assignee:Remko% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:other Platform:Linux

Description

The documentation for TIME_SYSTEM specifies "This parameter is not stored in the gmt.conf file but is translated to the respective values of TIME_EPOCH and TIME_UNIT". The following MWE shows that this is not happening in GMT 5.4.2

gmt set FONT_ANNOT_PRIMARY=12p TIME_SYSTEM=MJD

Inspection of the generated gmt.conf shows that FONT_ANNOT_PRIMARY has been set, but TIME_EPOCH and TIME_UNIT have not.

#
# GMT 5.4.2 Defaults file
#
# FONT Parameters
#
FONT_ANNOT_PRIMARY             = 12p,Helvetica,black

Setting TIME_EPOCH and TIME_UNIT manually results in them being written to gmt.conf.

gmt set FONT_ANNOT_PRIMARY=12p TIME_SYSTEM=MJD TIME_EPOCH=1858-11-17T00:00:00 TIME_UNIT=d

#
# GMT 5.4.2 Defaults file
#
# FONT Parameters
#
FONT_ANNOT_PRIMARY             = 12p,Helvetica,black
#
# Calendar/Time Parameters
#
TIME_EPOCH                     = 1858-11-17T00:00:00
TIME_UNIT                      = d

I have another machine accessible with gmt 5.3.1, this was still working on that version. It was already broken on 5.4.1.

Associated revisions

Revision 18555
Added by Remko 11 days ago

First step in fixing issue #1131

Revision 18556
Added by Remko 11 days ago

Second step in fixing issue #1131

Revision 18557
Added by Remko 11 days ago

Second step in fixing issue #1131

Revision 18558
Added by Remko 11 days ago

Last step in fixing issue #1131

Revision 18559
Added by Remko 11 days ago

Backported r18555 through r18558 to fix issue #1131

History

#1 Updated by Remko 11 days ago

I can duplicate this bug, Also in the SVN version (5.4.3).
Note: it only applies when you do not already have TIME_UNIT and TIME_EPOCH in a local gmt.conf or ~/.gmt/gmt.conf
This also applies to some other settings that translate to multiple settings like FONT, FONT_ANNOT.

#2 Updated by Remko 11 days ago

  • Assignee set to Remko
  • % Done changed from 0 to 30
There are three cases to deal with:
  • Straight conversions when using GMT4 compatibility (e.g. LABEL_FONT to FONT_LABEL)
  • GMT4-compatible conversions that require a bit more work (e.g. ANNOT_FONT_SIZE_PRIMARY to FONT_ANNOT_PRIMARY)
  • Shorthands line TIME_SYSTEM that needs translation to TIME_UNIT and TIME_EPOCH

Each of these currently fails. I'm fixing this step by step.

#3 Updated by Remko 11 days ago

  • Status changed from New to Resolved
  • Target version set to Candidate for next bugfix release
  • % Done changed from 30 to 100

The fix is in. Both in branch and trunk.

#4 Updated by Matthias 10 days ago

Thanks a lot for the quick fix, your effort is sincerely appreciated!

Also available in: Atom PDF