stefanfluck / palmpy

Package supporting the generation of static driver files for simulations with the PALM model system. Check out the Wiki and engage in the Discussions!
GNU General Public License v3.0
18 stars 4 forks source link

typo in yres #75

Open mohhefny opened 1 year ago

mohhefny commented 1 year ago

I think there is a typo in yres in this line as it is written as xres. Usually xres = yres, however I think it should be yres, or?

https://github.com/stefanfluck/palmpy/blob/97b949e67b4ee8b7fdd90db6443c4d8bb4596353/palmpy/staticcreation/geodatatools.py#L111

stefanfluck commented 1 year ago

you are right. As it is now it currently can only handle xres=yres.

Changing the typo in line 111 as mentioned works, but only when still using xres=yres. Using xres!=yres, it returns the following error:

Warning 1: Producing a Golden Surfer style file with DX and DY instead of CELLSIZE since the input pixels are non-square. Use the FORCE_CELLSIZE=TRUE creation option to force use of DX for even though this will be distorted. Most ASCII Grid readers (ArcGIS included) do not support the DX and DY parameters.

Also the result is distorted, but I feel something is wrong somehow. I have to go to the gdal python binding documentation to figure out why it returns this error and why the distortion is not as expected. Also, in the docstring to rasterandcuttlm(), i mentioned "choose yres symmetrically to xres", so I was aware of this when writing it. I have a feeling I have to dig into this, as just looking at the code I don't remember why there are both x_res and xres and y_res and yres respectively in there. It does not help that gdal python docs are not conclusive sometimes.

Suggestion: only use xres=yres currently.