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

Add inline example for blockmean #1729

Merged
merged 7 commits into from
Feb 13, 2022
Merged

Add inline example for blockmean #1729

merged 7 commits into from
Feb 13, 2022

Conversation

michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Feb 8, 2022

Description of proposed changes

Addresses #1686

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • 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

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Feb 8, 2022
@michaelgrund michaelgrund added this to the 0.6.0 milestone Feb 8, 2022
pygmt/src/blockm.py Outdated Show resolved Hide resolved
Co-authored-by: Will Schlitzer <schlitzer90@gmail.com>
@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Feb 11, 2022
pygmt/src/blockm.py Outdated Show resolved Hide resolved
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
@seisman
Copy link
Member

seisman commented Feb 13, 2022

/format

@seisman seisman merged commit e2e1daa into main Feb 13, 2022
@seisman seisman deleted the inline-example-blockmean branch February 13, 2022 06:30
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Feb 13, 2022
@weiji14 weiji14 mentioned this pull request Mar 13, 2022
13 tasks
@crystalratna
Copy link

I was searching how to add -C (Use the center of the block as the output location) in pygmt.blockmean command line.
Thank you.

@yvonnefroehlich
Copy link
Member

I was searching how to add -C (Use the center of the block as the output location) in pygmt.blockmean command line. Thank you.

Thanks @crystalratna for trying out PyGMT and apologizes for the late response!

Currently, there is no alias available for -C for the pygmt.blockmean function in PyGMT. Maybe you can try C=True (related to https://docs.generic-mapping-tools.org/dev/blockmean.html#c), but I am not sure about this.
Ping @GenericMappingTools/pygmt-maintainers for help on this, please.

If this comment is meant as a request for adding an alias for -C for the pygmt.blockmean function, please open a separate issue. Probably this comment was overlooked as it is written in a merged PR.

Please see the extended line example below:

# sourec: https://www.pygmt.org/dev/api/generated/pygmt.blockmean.html#pygmt.blockmean
# last acces: 2022/11/06
import pygmt
# Load a table of ship observations of bathymetry off Baja California
data = pygmt.datasets.load_sample_data(name="bathymetry")
# Calculate block mean values within 5 by 5 minute bins
data_bmean = pygmt.blockmean(
    data=data,
	region=[245, 255, 20, 30],
	spacing="5m",
	C=True,  # Use the center of the block as the output location
)

@crystalratna
Copy link

crystalratna commented Nov 7, 2022

@yvonnefroehlich Thank you. I tried and it seems to work.

sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Co-authored-by: Will Schlitzer <schlitzer90@gmail.com>
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants