Skip to content

Add attributes to generated variables.#45

Merged
dcherian merged 3 commits intomainfrom
add-attrs
Jul 2, 2025
Merged

Add attributes to generated variables.#45
dcherian merged 3 commits intomainfrom
add-attrs

Conversation

@dcherian
Copy link
Copy Markdown
Contributor

@dcherian dcherian commented Jun 30, 2025

xref #22

Comment thread src/rasterix/raster_index.py
@benbovy
Copy link
Copy Markdown
Member

benbovy commented Jul 1, 2025

This looks like a nice feature to have. I'm wondering, however, do we want to be opinionated and always add those CF attributes? Or should it rather be optional and provide a RasterIndex option or something like xproj's write_crs_info()? Or even find a way to handle that via xproj (e.g., add a hook in xproj.ProjIndexMixin)?

@dcherian
Copy link
Copy Markdown
Contributor Author

dcherian commented Jul 1, 2025

I'm wondering, however, do we want to be opinionated and always add those CF attributes?

I like opinionated, there's no real downside to it.

even find a way to handle that via xproj (e.g., add a hook in xproj.ProjIndexMixin)?

This would be quite nice, and would remove one reason RasterIndex needs to track CRS. But how?

@benbovy
Copy link
Copy Markdown
Member

benbovy commented Jul 1, 2025

would remove one reason RasterIndex needs to track CRS

I was rather thinking about writing those attributes via calling ds.proj.write_crs_info(), which would still need RasterIndex to track CRS (i.e., be "CRS-aware" from xproj's point of view).

@dcherian
Copy link
Copy Markdown
Contributor Author

dcherian commented Jul 1, 2025

but the write_crs_info hook could provide the CRS to the index? Does xproj handle multiple CRS in the same Dataset though?

@dcherian dcherian enabled auto-merge (squash) July 2, 2025 19:18
@dcherian dcherian merged commit bbe7b0c into main Jul 2, 2025
9 checks passed
@dcherian dcherian deleted the add-attrs branch July 2, 2025 19:19
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.

2 participants