clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

2D Tiff plot option #282

Closed AsianHam closed 3 years ago

AsianHam commented 3 years ago

Created an plotting option that plots via GDAL and creates TIFF files

To use, set plot type to '2d_gtiff'

Currently does not work on macOS.

donnaaboise commented 3 years ago

How are you installing GDAL? I've had some trouble installing it recently - I use it for supporting plot2kml (for Google Earth plotting) in VisClaw.

mandli commented 3 years ago

Heh, that has been a source of frustration for awhile. GDAL versioning also is an issue.

rjleveque commented 3 years ago

I've been using conda environments and haven't had problems with gdal recently, although I don't think I'm using many parts of it, so there may be issues I'm not aware of.

The .yml file I use includes (among many other things):

channels:
- conda-forge
dependencies:
- gdal
- libgdal
rjleveque commented 3 years ago

@AsianHam: Thanks for contributing a PR!

Unfortunately, the gdal_merge.py file that is included in this PR is GPL licensed, and hence we cannot include it in Clawpack (without making all of Clawpack GPL, which we don't want to do).

Since that code comes from a different developer, I think it would be best to simply list it as a dependency, with a pointer to where to obtain the code for those who want to use it. And with an informative error message for users who don't have it installed.

Also, I'd like to try this out, but am working on a Mac. What is the issue that keeps it from working on MacOS?

mandli commented 3 years ago

I have not any issues installing GDAL but the significant version differences have been an issue. The conda version for instance I believe is pretty old at this point, which also causes problems. The major issue we did have though we think was a weird incompatibility with libtiff library and GDAL that is used with the GeoTIFF functionality. This seemed to be only a problem on MacOS but it was a versioning problem as far as I could see (version incompatibilities between GDAL and libtiff).

AsianHam commented 3 years ago

I'll remove gdal_merge and pr again.

macOS gives "unknown attribute" errors when gdal attempts to edit the metadata in the TIFF files.

I've installed gdal via brew and python (pip install), both seem to have the same results on macOS.

On Fri, Aug 6, 2021, 8:30 PM Kyle Mandli @.***> wrote:

I have not any issues installing GDAL but the significant version differences have been an issue. The conda version for instance I believe is pretty old at this point, which also causes problems. The major issue we did have though we think was a weird incompatibility with libtiff library and GDAL that is used with the GeoTIFF functionality. This seemed to be only a problem on MacOS but it was a versioning problem as far as I could see (version incompatibilities between GDAL and libtiff).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clawpack/visclaw/pull/282#issuecomment-894577342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBXSXSIYCRRO2OAZTD4CDDT3R5CDANCNFSM5BWWXFCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

mandli commented 3 years ago

Do you need gdal_merge though to do AMR plotting? If so I would say leave it and just say that the MacOS version is broken right now.

AsianHam commented 3 years ago

You do, but installing GDAL should install it for you.

I've had some edge cases in the past where installing GDAL didn't include gdal_merge, so I kept a version on hand for simplicity.

On Sat, Aug 7, 2021 at 9:41 PM Kyle Mandli @.***> wrote:

Do you need gdal_merge though to do AMR plotting? If so I would say leave it and just say that the MacOS version is broken right now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clawpack/visclaw/pull/282#issuecomment-894729221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBXSXQJUOHU26RS3K5WFWTT3XOD3ANCNFSM5BWWXFCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

mandli commented 3 years ago

Oh, so you are just going to chalk this up to the awesome that is GDAL installation woes? That's fine with me.

rjleveque commented 3 years ago

@mandli: I pointed out above that gdal_merge.py is GPL licensed, which is why I suggested removing it and listing it as a dependency instead.

mandli commented 3 years ago

@rjleveque I think our replies must have crossed as I never saw your post. Sorry about that.

rjleveque commented 3 years ago

Seems fine to merge this now, sorry for the delay!