GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Let grdimage resample 2nd grid used for intensities by PaulWessel · Pull Request #5363 · GenericMappingTools/gmt

Conversation

@PaulWessel

@PaulWessel PaulWessel commented Jun 20, 2021

Copy link
Copy Markdown
Contributor

This follows up on issue #5347. Turns out -I already can handle a second datagrid combined with the derive-modifiers, but the two grids have to have the same size and registration. This PR changes this so that if -I specifies a second data grid from which intensities shall be derived (rather than from the input grid), we ensure the secondary grid is resampled to the resolution of the primary grid if it is not already matching. I added a new test script that shows the use of different resolution grids. Closes #5347.

twogrids

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@PaulWessel
Let grdimage resample 2nd grid used for intensities
a384b7a
If -I specifies a second data grid from which intensities shall be derived (rather than from the input grid), we ensure the secondary grid is resampled to the resolution of the primary grid if it is not matching.
@PaulWessel PaulWessel added the new feature PR that implements a new feature or capability in GMT label Jun 20, 2021
@PaulWessel
PaulWessel requested review from Esteban82, joa-quim, maxrjones and seisman June 20, 2021 01:19
@PaulWessel PaulWessel self-assigned this Jun 20, 2021
@joa-quim

joa-quim commented Jun 20, 2021

Copy link
Copy Markdown
Member

I think that it should also check that GRD2 totally encloses GRD1.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Jun 20, 2021

Copy link
Copy Markdown
Contributor Author

Yes, that is reasonable, too. Maybe later today. It is Father's Day in the US and that means forced meals, activities and fewer therapeutic debugging sessions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82

Esteban82 commented Jun 20, 2021

Copy link
Copy Markdown
Member

Happy Father's Day!! It is also in Argentina.

It would be possible to use irregular grid like the following link from the forum?

https://forum.generic-mapping-tools.org/uploads/default/original/2X/f/fd6eb02da35af9f2471aa44c9a3ab56bea2e6671.png

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Jun 20, 2021

Copy link
Copy Markdown
Contributor Author

Likewise @Esteban82 . I am not sure I understand what you mean by "irregular grids" since all grids in GMT have to be equidistant and not irregular?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82

Esteban82 commented Jun 20, 2021

Copy link
Copy Markdown
Member

With "irregular" I mean its shape (not the spacing between nodes). Like the previous link where there is no data in the edges.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Jun 20, 2021

Copy link
Copy Markdown
Contributor Author

And by shape you mean there are NaNs? The shape of all grids is rectangular but many only have data in some of that rectangle. I think NaNs are fine - you just are not going to get any shading from that part.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel
Ensure secondary grid covers the same area as the primary grid
676d36e
@vercel
vercel Bot temporarily deployed to Preview June 20, 2021 23:36 Inactive
@PaulWessel

PaulWessel commented Jun 20, 2021

Copy link
Copy Markdown
Contributor Author

OK @joa-quim I added a region check, insisting that the secondary grid covers the same region (or more).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joa-quim
joa-quim reviewed Jun 20, 2021
View reviewed changes
Comment thread src/grdimage.c Outdated
if (Grid_orig && (I_data->header->n_columns != Grid_orig->header->n_columns || I_data->header->n_rows != Grid_orig->header->n_rows)) {
char int_z_grd[GMT_VF_LEN] = {""}, *res = "gp";
if (I_data->header->wesn[XLO] > region[XLO] || I_data->header->wesn[XHI] < region[XHI] || I_data->header->wesn[YLO] > region[YLO] || I_data->header->wesn[YHI] < region[YHI]) {
GMT_Report (API, GMT_MSG_ERROR, "Your secondary data grid given vie -A does not cover the same area as the primary grid - aborting\n");

@joa-quim joa-quim Jun 20, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. via not vie

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PaulWessel PaulWessel Jun 21, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not via -A... but -I. Fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@PaulWessel
Update grdimage.c
f519255
@vercel
vercel Bot temporarily deployed to Preview June 21, 2021 00:25 Inactive
joa-quim
joa-quim approved these changes Jun 21, 2021
View reviewed changes
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Jun 21, 2021
@PaulWessel
PaulWessel merged commit f90d8ea into master Jun 21, 2021
@PaulWessel
PaulWessel deleted the grdimage-resmple branch June 21, 2021 00:54
@maxrjones maxrjones added new core module feature PR that implements a new core module feature and removed new feature PR that implements a new feature or capability in GMT labels Nov 17, 2021

This branch was previously deployed

1 inactive deployment
Preview — f5192553 Deployed Jun 21, 2021 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@joa-quim joa-quim joa-quim approved these changes
@seisman seisman Awaiting requested review from seisman
@maxrjones maxrjones Awaiting requested review from maxrjones
@Esteban82 Esteban82 Awaiting requested review from Esteban82

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@PaulWessel PaulWessel

Labels

add-changelog Add PR to the changelog new core module feature PR that implements a new core module feature

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Allow grdview -G option in grdimage

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@PaulWessel @joa-quim @Esteban82 @maxrjones
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.