-
Notifications
You must be signed in to change notification settings - Fork 346
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
Adding new grdmix module #3291
Adding new grdmix module #3291
Conversation
@PaulWessel I think it's a good opportunity to document what files should be added/updated when a new module is added. |
Yes, with the new cmake glue there was no need to touch CMakeFiles anymore. I have not touched the docs yet (other than adding grdmix.rst itself). But for the C side it seems no need - all is auto. Docs still need to be added into the website. |
Working strictly with PPM files I can show that this works as expected: gmt grdmix BlueMarble_06m.ppm @BlackMarble_06m.ppm [email protected] -Gnewmap.ppm Converting the latter to png yields this: |
After using Change_Layout everything runs fine but I get this image: So supposedly that means bug in lines 12534-38. Can you see anything obvious, @joa-quim ? |
Will change grdmath call once #3319 is merged. |
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel These warnings are not directly related to OpenMP. I see a lot of warnings like this when OpenMP is disabled on macOS.
|
They are related to OpenMP because Windows OpenMP forces us to switch to signed loop variables where we wish to use OpenMP. Since our GMT_* struct variables for positively definite quantities are unsigned (e.g., n_columns, n_rows), we get these stupid messages. We cannot change n_columns to be signed since it is an API definition. We suddenly cannot add casts (int) to those macros because Linux now suddenly has a hissy-fit. So not sure what we can do but swallow the warnings... |
VS has #pragma macros to shut up specific warnings. Don't gcc & llvm have that? |
Yes we can do -Wno-*** I think, but we then basically loose the ability of the compiler to warn us. Can't you step on Bill Gate's balls and have him allow unsigned loop variables like the rest of the world? |
I mean, we could do things like
and then we may only get those warnings on Windows, which seems fair since it is Bill's fault. |
It puzzles me a lot, since we are doing the (int) casts in the master branch and everything works fine. |
yes, but the OpenMP pragmas creates new C code that is then compiled (all under the hood) and that is probably where the warnings are coming from. Not sure though. |
Blame the OMPeers. Were them who imposed the signed ints at that version. And you know I never liked those unsigned that keep biting us with this. |
I think this one is now ready to be merged, guys? |
Description of proposed changes
Experimental module to blend two grids or images using weights from a third, or to just add transparency to an existing single image. The immediate goal is to get this to work:
gmt grdmix @BlueMarble_06m.tif @BlackMarble_06m.tif [email protected] -Gnewmap.png
but it is still screwing. At least 2 hours from scratch got me pretty far. I added the dummy alpha.png to the cache for now - it will be removed once this all works. I expect to add all the usual resolutions for those images though up to 30s.