Skip to content
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

Failed rasterization #79

Open
Vicent-Ribas opened this issue Aug 31, 2023 · 1 comment
Open

Failed rasterization #79

Vicent-Ribas opened this issue Aug 31, 2023 · 1 comment

Comments

@Vicent-Ribas
Copy link

Vicent-Ribas commented Aug 31, 2023

Hello,

Thank you for putting this together. I am running a script to generate percentile 95th output of a LAS file. This is my code:

print("Computing rasterization of the prepared las file. Requires laspy 1.7") tile = pyfor.cloud.Cloud(lasin) tile.crs = src grid = tile.grid(cell_size=20) # this function utilizes Z as the variable pct95ht = pyfor.metrics.grid_percentile (grid, 95) pct95ht.write(rstat)

It works most of the times, but it is the second time I get this error:

File "myfile.py", line 130, in rasterdomht pct95ht = pyfor.metrics.grid_percentile (grid, 95) File "mypath\pyfor\metrics.py", line 77, in grid_percentile return grid.raster(lambda z: np.percentile(z, percentile), "z") File "mypath\pyfor\rasterizer.py", line 55, in raster array[bin_summary["bins_y"], bin_summary["bins_x"]] = bin_summary[dim] IndexError: index 78 is out of bounds for axis 1 with size 78

I have Python 3.8.1 in a Conda environment.

Thank you!

@Vicent-Ribas
Copy link
Author

I believe this has something to do with the bug report pandas-dev/pandas#35275, but I would have expected that the .reset_index() when the .agg function is called would prevent this to happen. However, I've found that only sometimes I get this error, with no explanation so far...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant