GenericMappingTools / GenericMappingTools/gmt
Unify potential supplement modules to use z positive up for relief
- Dominant language
- C
- Stars
- 979
- Forks
- 414
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 54
Description
**Description of the desired feature**
Except for **grdredpol**, all potential modules either accept a topographic grid or profile, and/or in some cases create a topographic grid or profile. Topographic input to modules computing flexure (**gmtflexure**, **grdflexure**, **gravfft -T**) all agree that the load surface has z positive up. However, the signs of other input and output data vary across the supplement which leads to frustration and confusion (I speak as a user now):
1. Modules mostlly written by @joa-quim expects topographic reliefs to have z positive up (**gmtgravmag3d**, **gravfft**, **grdgravmag3d**) while modules mostly written by me expects the relief to be positive down (**gmtflexure**, **grdflexure**, **talwani2d**, **talwani3d**, with **gravprisms** unsure). Some of this is inherited from various algorithms.
2. Some modules have an option to flip the positive direction of z: **-D** in **grdgravmag3d** and **-A** in **gravprisms**, **talwani2d** and **talwani3d**, but the rest do not.
3. The documentation for several modules are unclear or do not state what the positive z-direction is.
4. Modules that take options like water depth or compensation depth at times expect a z-level (so sign is important) and at other times expect a distance (so is a positive quantity), but the documentation mixes this up in unfortunate ways.
Because this supplement is only used by geophysicists doing grav, mag, flexure, any changes we do have limited impact. Here are suggestions for changes to make this supplement self-consistent.
1. We **declare** there are bugs and fix all modules so that the z-axis for topography is positive up by default. This will introduce a breaking change in some of the modules listed in (1), but bug fixes usually are.
3. We **remove** those options but leave their effect as is under the hood for backwards compatibility. Or, we also remove the parsing and effect so that users actually find out about this issue.
4. We **improve** the documentation by having a common statement include block at the top of each module that clarifies the coordinate system used.
5. Instead of options to flip signs, the documentation can simply state that if your grid is positive down you can flip the sign on input by appending **+s**-1, and for data tables you can use **-i2+s**-1 (or whatever column z is). These are _common_ modifiers available to any module in GMT so having to add **-A -D** and waste limited option letters is bad style anyway.
6. ???
I think it is a nice goal to have the entire supplement agree on where positive z goes, and because of the limited impact I am willing to declare bugs to fix this mess. However, happy to hear comments from @GenericMappingTools/core.
Contributor guide
Assessment
This issue has not been assessed yet.