Skip to content

Mechanism for passing -Tlist via a file#7569

Merged
joa-quim merged 3 commits intomasterfrom
makecpt-mem-list
Jul 17, 2023
Merged

Mechanism for passing -Tlist via a file#7569
joa-quim merged 3 commits intomasterfrom
makecpt-mem-list

Conversation

@PaulWessel
Copy link
Member

Se #7558 for background. This WIP branch will examine the input data header record and if it contains "LIST" then we treat the nodes as we do a list. WIth that, a file like

# LIST
0
100
200
451

called t.txt will give

gmt makecpt -Cred,green,blue -Tt.txt
0	red	100	red	L
100	green	200	green	L
200	blue	451	blue	B
B	black
F	white
N	128

i.e., same as gmt makecpt -Cred,green,blue -T0,100,200,451, while without the header record we get the normal interpolation:

gmt makecpt -Cred,green,blue -Tf.txt
0	red	100	red	L
100	red	200	red	L
200	blue	451	blue	B
B	black
F	white
N	128

@joa-quim, if this allows you to do what you need to do from Julia, perhaps this is an acceptable solution? If so let me know and I will add documentation of the feature.

Se #7558 for background.  This WIP branch will examine the input data header record and if it contains "LIST" then we tread the nodes as we do a list.  WIth that, a file like

# LIST
0
100
200
451

called t.txt will give

gmt makecpt -Cred,green,blue -Tt.txt
0	red	100	red	L
100	green	200	green	L
200	blue	451	blue	B
B	black
F	white
N	128

oi.e., same as gmt makecpt -Cred,green,blue -T0,100,200,451, while without the header record  we get

gmt makecpt -Cred,green,blue -Tf.txt
0	red	100	red	L
100	red	200	red	L
200	blue	451	blue	B
B	black
F	white
N	128
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Jun 23, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Jun 23, 2023
@PaulWessel PaulWessel requested a review from joa-quim June 23, 2023 12:47
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I may be able to use this from Julia (or do the conversion there directly), but this fixes CLI bug so good to go.

@PaulWessel
Copy link
Member Author

No bug in CLI. How would makecpt know that your input file is not really an interpolation file but a list of nodes? -Tlist and -Tfile are identical if you give a file. This PR simply makes it possible to communicate this.

@PaulWessel PaulWessel changed the title WIP Mechanism for passing -Tlist via a file Mechanism for passing -Tlist via a file Jun 26, 2023
@joa-quim joa-quim merged commit d09bb58 into master Jul 17, 2023
@joa-quim joa-quim deleted the makecpt-mem-list branch July 17, 2023 20:25
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants