Closed pascalgross closed 4 years ago
values which are not available in the source are set to 0.0
Yes, this behavior is discussed in #15 #51
In short, "regridding" is just a sparse matrix multiply; the output matrix from a sparse matrix multiply is zero by default.
Can I somehow define, which value is used, if no value can be interpolated?
Filling unmapped points with non-zeros values will make the entire regridding operation non-linear (not like y = A*x
anymore), so it is not possible to enable a non-zero default by just changing the regridding weights. One hack I can think of is to use https://github.com/JiaweiZhuang/xESMF/issues/15#issuecomment-371646763 to convert unmapped points to nan
and then convert nan
to a user-specified value. Or, use masks (#22) instead of hacking nan
s. Welcome more clever suggestions...
A side question: how did you make the map plots? They look quite fancy...
Okay, thank you. I'll have a look on that.
The shown maps are a combination of OpenStreetMaps and the image, which I generate like shown above. I use a tool called QGIS which allows me to combine different geo-referenced layers. QGIS allows me to manipulate these layers in color and transparancy etc.
Setting the unmapped points to nan is solving the whole problem. The rasterio library handles them correctly and the image is generated as wanted! Thank you!
Great, glad to hear that
I use the following code to:
This works fast as hell and is exactly what I needed. With one problem: values which are not available in the source are set to 0.0
The results in "shadows" for values outside the source grid. This is the actual result and this is what I expected.
Can I somehow define, which value is used, if no value can be interpolated?