shaharkadmiel / pySW4

Setup, run, post process, and visualize numerical simulations. Primarily SW4
http://shaharkadmiel.github.com/pySW4
GNU General Public License v3.0
28 stars 14 forks source link

pySW4 does not encode projection string correctly in write_hdr #13

Closed firstkingofrome closed 6 years ago

firstkingofrome commented 6 years ago

Issue: pySW4 does not convert projection strings to bytes when using write_hdr function from rfileIO Work Around: manually cast projection string before calling write header, i.e. write_hdr(file,1, 4, 1, 0, 3.5, 28.0, proj_str.encode(),1): Solution: in write_hddr function encode the projection string before attempting to save it to the file

megies commented 6 years ago

Are you using Python 3? (No idea if the code even works on Python 3 though..)

firstkingofrome commented 6 years ago

Yes, I am using python 3.4.3, I didn't realize python3 wasn't supported (most of the code seems to work fine on python3, this is the first issue that I have encountered).

On Tue, Apr 10, 2018 at 12:50 AM, Tobias Megies notifications@github.com wrote:

Are you using Python 3? (No idea if the code even works on Python 3 though..)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shaharkadmiel/pySW4/issues/13#issuecomment-380007640, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9L5bXHqz5DH2BCre4Z_xyq8J01h5_4ks5tnGQugaJpZM4TNXRU .

megies commented 6 years ago

I see. Probably there might be more similar problems down the road on Python 3..

In principle those should be easy to fix, just properly need to decode/encode strings coming in/out of pySW4. Somebody would have to work on it though, I won't have time to do so..

shaharkadmiel commented 6 years ago

Indeed an easy fix... I will work on it later this week... at EGU at the moment...

firstkingofrome commented 6 years ago

Ok Thank you (I am probably just going to stick with python 2 because I have also run into some more complicated issues with GDAL under python 3).

megies commented 6 years ago

I think we should keep this open as a reminder..

shaharkadmiel commented 6 years ago

should be fixed in master