Skip to content

Behavior of makecpt and grd2cpt under modern mode #823

Closed

Description

@PaulWessel

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?

Activity

  1. seisman commented on Jun 4, 2019

    @seisman
    Member

    Seems -H is still available for makecpt and grd2cpt.

  2. PaulWessel commented on Jun 4, 2019

    @PaulWessel
    ContributorAuthor

    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:

    1. 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.
    2. 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.

  3. seisman commented on Jun 4, 2019

    @seisman
    Member

    Option 2 seems good to me.

  4. joa-quim commented on Jun 4, 2019

    @joa-quim
    Member

    Yes, agree too.

  5. reopened this on Jun 4, 2019
  6. PaulWessel commented on Jun 4, 2019

    @PaulWessel
    ContributorAuthor

    Will fix issue in movie since there are separate sessions. Here we need to save a cpt locally.

  7. PaulWessel commented on Jun 5, 2019

    @PaulWessel
    ContributorAuthor

    Hi @seisman, feel free to close this if happy with #827.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions