Allow plot/plot3d -SE, -SJ, -SW options to parse appended map units#6282
Merged
PaulWessel merged 10 commits intomasterfrom Feb 2, 2022
Merged
Allow plot/plot3d -SE, -SJ, -SW options to parse appended map units#6282PaulWessel merged 10 commits intomasterfrom
PaulWessel merged 10 commits intomasterfrom
Conversation
For the units that accept dimensions in map units (geo ellipse and rotated rectangle), users can indicate the unit of the data (if read from file) rather than having to append the unit to the columns in the data. E.g., -SEd means that the major and minor axes read from file will be in spherical degrees and not km.
Member
|
|
Member
Author
|
Thanks, will check shortly. |
Member
Author
|
Should be fixed - give it a try. |
Member
|
A bunch of tests now fail: Some are just image diff failures and others report |
Member
Author
|
OK, will check that after a break. I think I know why. |
Member
Author
|
The assertions failures are now gone. I get this: the two map_units.sh are new tests so no PS comparisons yet. |
maxrjones
approved these changes
Feb 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #6271 discussion and comments for background. This PR implements the recommended solution of specifying the map dimension unit as an option to embedding them in the data file.
For the symbols that accept dimensions in map units (geo-ellipse, rotated geo-rectangle, geo-wedge, including the degenerate versions of ellipse and rectangle), users can indicate the unit of the dimensional parameters (if read from file) rather than having to append the unit to the columns in the data file itself. E.g., -SEd means that the major and minor axes read from file will be in spherical degrees and not km. Same for -SE-, -SJ, -SJ-, and -SW (including optional +i for nonzero inner radius). I added two identical examples (for plot and plot3d) to show that it works. This behavior mirrors that of appending plot units c|i|p when users want to indicate what unit the nondimensional values read from the data table should be considered to have.
The implementation required minor changes to gmt_parse_symbol_option function to handle the lone map unit and to set the appropriate scaling needed in the modules to convert the dimensionless value to km. I also updated the documentation for -SE -SJ and -SW to discuss the use of such units.
In implementing this feature I became aware of several cut/paste bugs in psxyz.c that were also fixed:
No PostScript files added as these will go in dvc.