You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Behavior of makecpt and grd2cpt under modern mode #823
Under modern mode, both grd2cpt and makecpt now set the (hidden) current CPT file. All modules that read a CPT file can access this by giving -C without any argument. This begs the question if those two modules need to write anything to stdout anymore (under modern mode). Alternatively, we could consider a new switch to turn off stdout output since
gmt makecpt -Chot -T0/100 > /dev/null
looks bad in scripts and examples and varies with OS. I can see situations where you want to make two different CPTs and use them so in that case we do want to save the CPT to a user file. Given that, we may need to introduce that option, but we are running out of letters. Suggestions?
That is true; it would reposition a GMT4-style -H (header) option for new usage, and since there never was an -H in those modules it should not be any problems. But since this is modern mode there is no prior history of -H. Since we are adding a new feature we can decide what this option does:
Let -H mean "do not write CPT to stdout". This would soften the transition from classic to modern mode in that makecpt would still by default write the CPT to stdout, and doing that and feeding the CPT to grdimage would work as before. The downside is that the elegance of modern mode (no need to explicitly reference the CPT file) is defeated by having to use -H when you create a CPT. It seems that behavior ought to be the default behavior in modern mode going forward.
Let -H mean "also write the CPT to stdout". In the rare cases when you find it easier to have two or more CPTs created and want to refer to them by name as they are given to various modules. This would allow classic mode behavior if you are willing to add that -H option. However, one of the design goals of modern mode was to keep things simple, and we already acknowledge that not everything possible in classic mode can translate to modern.
I think cleaner and shorter modern mode script should be the goal, hence I think option 2 is best. Note again that this only applies for modern mode - there is no -H in classic.
Activity
seisman commentedon Jun 4, 2019
Seems -H is still available for makecpt and grd2cpt.
PaulWessel commentedon Jun 4, 2019
That is true; it would reposition a GMT4-style -H (header) option for new usage, and since there never was an -H in those modules it should not be any problems. But since this is modern mode there is no prior history of -H. Since we are adding a new feature we can decide what this option does:
I think cleaner and shorter modern mode script should be the goal, hence I think option 2 is best. Note again that this only applies for modern mode - there is no -H in classic.
seisman commentedon Jun 4, 2019
Option 2 seems good to me.
Let makecpt and grd2cpt get -H under modern mode
joa-quim commentedon Jun 4, 2019
Yes, agree too.
PaulWessel commentedon Jun 4, 2019
Will fix issue in movie since there are separate sessions. Here we need to save a cpt locally.
Update modern mode script given -H option to makecpt/grd2cpt (#827)
PaulWessel commentedon Jun 5, 2019
Hi @seisman, feel free to close this if happy with #827.
Enable makecpt to save to a cpt file via output (H) parameter
Wrap makecpt (#329)
Add a gallery example for logo (GenericMappingTools#823)