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
Problems using pycno (handling of nulls) #176
Comments
Are you able to share any of your data to create a reproducible example? |
sample_data.zip |
cool, thanks for raising this (and sharing your data). So in the first example, I think everything is working as intended. There's no actual error, just a warning coming from astropy that there are still some sections of nan values in the intermediate raster produced during the convolution phase. In this case those nan's become zeros (which is appropriate here because the total area of your output kernel is the same as the total input variable). See a discussion of the The interpolation completes just fine (with the correct sum, so your original input volume is preserved) so I don't think there's a real issue, you should be able to continue using that just fine. That's definitely a bug-inducing typo when |
Okay, great! Yeah, we're planning to incorporate land use data in the future so that we don't assume uniformity in population distributions. Thanks for the heads up on the grid, too -- I generated it in QGIS, so I'll have to see if something went wrong there. |
sweet. hope it comes together nicely. Not sure if you're wedded to a rectangular grid, but we also have hexagonal gridding here in tobler if you want to explore some other options. Not sure why qgis produces those artifacts |
those county boundaries may not be planar enforced |
I'm currently trying to use tobler for pycnophylactic interpolation, but I'm running into some problems. When I run pycno_interpolate normally, regardless of the cellsize I pick, I get this error from astropy: "WARNING: nan_treatment='interpolate', however, NaN values detected post convolution. A contiguous region of NaN values, larger than the kernel size, are present in the input array. Increase the kernel size to avoid this. [astropy.convolution.convolve]".
I thought there might be some conflict with how nulls are handled and the data I'm using, so I tried to use "handle_null = False" to turn this off, but I'm getting "NameError: name 'smooth2d' is not defined". I checked the source code, and it looks like the smooth2d method is sometimes referred to as smooth2D and sometimes as smooth2d, which seems to be causing issues.
The text was updated successfully, but these errors were encountered: