asascience-open / xreds

XArray Environmental Data Services
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Support for vector virtual variables and tile generation #28

Open srstsavage opened 5 months ago

srstsavage commented 5 months ago

It would be great if xreds could create virtual variables from scalar component variables based on standard names (e.g. eastward_sea_water_velocity and northward_sea_water_velocity are detected and a virtual vector variable sea_water_velocity with magnitude and direction is created, and rendered tiles represent magnitude as grid color and direction as an arrow or barb, etc).

Some ncWMS code detecting vectors:

https://github.com/Reading-eScience-Centre/edal-java/blob/6cf2e669fffe0f4701297ac385c1ecd1c6047627/cdm/src/main/java/uk/ac/rdg/resc/edal/dataset/cdm/CdmDatasetFactory.java#L241

Any thoughts on the desirability of this behavior, or how it should be implemented? Core behavior, or in a plugin or extension?

abkfenris commented 5 months ago

Matt and I were recently chatting about this (I was thinking winds), and I'd love to see this as more generalized Xpublish plugin.

Maybe we hack something up during the code sprint?

srstsavage commented 5 months ago

Ah, yes! Would totally make sense as a general xpublish plugin so it can be used elsewhere.

Would it make more sense to move this discussion to https://github.com/orgs/xpublish-community/discussions?

abkfenris commented 5 months ago

Ya, I think it's probably worth considering them as a whole new type of plugins.

While there is a way to make them with the existing dataset providers, that may not work as soon as folks get creative and replace them (like Matt's subsetting plugin), so we probably want to make them explicit so they can be reused.

mpiannucci commented 5 months ago

@srstsavage So we have to support virtual variables in a few different ways already and its not fully fleshed out, but here is a quick overview:

I would like to see the extension behavior be xpublish native as well so i agree with alex

abkfenris commented 5 months ago

General discussion over https://github.com/orgs/xpublish-community/discussions/25