Closed santisoler closed 5 years ago
This makes sense. I have also received suggestions to pad the subgrid with zeros if the window size exceeds the grid extent, but I think this will result in quite significant errors. Therefore I am happy to implement this check in 2896c0e301237317f3b5ba8952b6f990a3b10df3. I am closing this issue now, but feel free to reopen it if you have more queries.
Part of https://github.com/openjournals/joss-reviews/issues/1544.
When extracting a subgrid, an error is raised if its center falls outside the data range: https://github.com/brmather/pycurious/blob/759fc520c22503f0b40b6a63faa4e632dd9f1e88/pycurious/grid.py#L96-L98
That's a nice thing to check! I would add another check: if the window is too big it may reach regions beyond the data range, what may cause errors afterwards but would be hard to track where they were originated. What do you think?