Skip to content

Conversation

@rajeeja
Copy link
Contributor

@rajeeja rajeeja commented Dec 8, 2025

Thanks @brianpm for reporting this bug: to_raster demanded an exactly 1D (n_face,) array, so data with extra length‑1 axes (e.g., ('time', 'n_face')) errored or rasterized incorrectly. Fix: loosen the check to allow singleton dims, squeeze them, and pass that squeezed data into the rasterizer so to_raster works and produces a proper (non-flat) raster.

Please check if this works for you now.

@rajeeja rajeeja requested a review from erogluorhan December 8, 2025 18:34
@rajeeja
Copy link
Contributor Author

rajeeja commented Dec 12, 2025

@erogluorhan We can auto-set bounds just for the rasterization (or via an extent kwarg) so users still get a meaningful image without having to call set_global(). What do you think?

xarray’s .plot() sets xlim/ylim from coord..

@erogluorhan
Copy link
Member

@erogluorhan We can auto-set bounds just for the rasterization (or via an extent kwarg) so users still get a meaningful image without having to call set_global(). What do you think?

xarray’s .plot() sets xlim/ylim from coord..

Thanks for this, Rajeev! It makes complete sense to me to provide some auto-set here. So, applying xarray's way here would work in a way to set axes extent based on the min-max x and y that is in the grid rather than setting to global, right?, So, it will work for our rasterization, correct?

Also, since this "axes extent" thing was the actual reason behind #1393 , could you modify the description of this PR to reflect that (the current description can still reflect what additional features we are implementing about multi dims, but it is not the reason behind the reported issue)

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

Successfully merging this pull request may close these issues.

3 participants