Skip to content

Improve gmtmath -Q behavior#5362

Merged
Esteban82 merged 6 commits intomasterfrom
gmtmath-q-improve
Jun 21, 2021
Merged

Improve gmtmath -Q behavior#5362
Esteban82 merged 6 commits intomasterfrom
gmtmath-q-improve

Conversation

@PaulWessel
Copy link
Member

See #5348 for background and explanations. This PR implements those suggestions to make it simpler to select the output unit or have no unit conversion on output, as well as improved documentation as to what is happening. Closes $5348.

See #5348 for background and explanations.  This PR implements those suggestions to make it simpler to select the unit or have no unit conversion on output, as well as improved documentation as to what is happening.  Closes $5348.
@PaulWessel PaulWessel added the new core module feature PR that implements a new core module feature label Jun 19, 2021
@PaulWessel PaulWessel self-assigned this Jun 19, 2021
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Jun 21, 2021
@Esteban82
Copy link
Member

With the division it works. however, when I try MUL all the result were 1/2.54 or 1/2.542

gmt math -Qi 1c 1c MUL = 0.155
gmt math -Qn 1c 1c MUL = 0.155
gmt math -Qc 1c 1c MUL = 0.3937
gmt math -Q  1c 1c MUL = 0.3937

Only when the units are in inches I get 1

gmt math -Qi 1i 1i MUL = 1
gmt math -Qn 1i 1i MUL = 1

@PaulWessel
Copy link
Member Author

Yes, and can't help that. If you specify units then GMT will convert them to inches. Now you have 1/2.54 inside. If you dont want that conversion, dont give units.

@Esteban82
Copy link
Member

So, should I approve this feature, right? And then avoid using units? Maybe a warning message could be add in the docs.

@PaulWessel
Copy link
Member Author

Give me a minute to update the docs and if you think they are clear then you can approve.

@PaulWessel
Copy link
Member Author

Should now make it clear that using units on input gives internal INCHES, and if that is not desired then do not use units. See new section in man page called Scalar math with units.

@Esteban82 Esteban82 merged commit e91e479 into master Jun 21, 2021
@Esteban82 Esteban82 deleted the gmtmath-q-improve branch June 21, 2021 23:19
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 new core module feature PR that implements a new core module feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants