Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap grdmix #1437

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Wrap grdmix #1437

wants to merge 3 commits into from

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Aug 11, 2021

Description of proposed changes

Wrapping the grdmix function which does "Blending and transforming grids and images". For a GMT example, see https://docs.generic-mapping-tools.org/6.2/gallery/ex52.html

Parameters/Aliases to wrap:

  • A alpha/transparency?
  • C construct
  • D deconstruct
  • E boundary
  • G outgrid
  • I shading/intensity?
  • M monochrome
  • N normalize
  • Q opaque
  • R region
  • V verbose
  • W weights
  • f coltypes

The initial implementation here will focus on the construct -C and deconstruct -D methods. Construct involves taking e.g. 3 grids and turning them into 1, whereas deconstruct turns 1 image into 3 separate RGB files (there are a few other possible combinations like 2-band and 4-band inputs but let's not go there yet).

In a pure xarray world, 'construct' would turn an xarray.DataArray of shape (3, 180, 360) to (1, 180, 360) suitable for plotting using grdimage. The 'deconstruct option seems less useful in real life, but it does allow us to turn the @earth_day_01d.tif file into 3 separate files to be 'construct'ed later 🙂

First part of addressing #578, closes #370.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

Initial commit for wrapping the grdmix function for #578
which does blending and transforming of grids and images.
Original GMT `grdmix` documentation is at
https://docs.generic-mapping-tools.org/6.2/grdmix.html.
Aliased non-common optional parameters construct (C),
deconstruct (D) and normalize (N). Added one unit test
to deconstruct the earth_day_01d.tif image into 3 bands.
@weiji14 weiji14 added the feature Brand new feature label Aug 11, 2021
@weiji14 weiji14 added this to the 0.5.0 milestone Aug 11, 2021
@weiji14 weiji14 self-assigned this Aug 11, 2021
@willschlitzer
Copy link
Contributor

@weiji14 Are you planning on getting this into v0.5.0?

@weiji14
Copy link
Member Author

weiji14 commented Oct 23, 2021

@weiji14 Are you planning on getting this into v0.5.0?

I was, but there's some complication with the API design (see #1555), so might need to move it to v0.6.0.

@weiji14 weiji14 modified the milestones: 0.5.0, 0.6.0 Oct 23, 2021
@weiji14 weiji14 modified the milestones: 0.6.0, 0.7.0 Mar 13, 2022
@weiji14 weiji14 modified the milestones: 0.7.0, 0.9.0 Jun 15, 2022
@weiji14 weiji14 removed this from the 0.9.0 milestone Mar 6, 2023
@seisman seisman added this to the 0.12.0 milestone Dec 11, 2023
@seisman seisman removed this from the 0.12.0 milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants