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
open_stds: check for unknown band references #1844
Conversation
In the example above, the expression refers to
is probably not correct. Also note that for Somewhat related and needed for openEO: it would be great if |
I'm confused. The "right" band names as defined in
I fully support this, there might be other arbitrary band names that should be considered. Indeed, how does this relate to @marisn contributions?
Agreed! In general, I'd pledge for a better integration of the band reference concept into the temporal framework. |
You are right, the use of S2_B4 as band suffix to the list of input strds's is wrong and is not used in the actual mapcalc expression
I have not tested it, but preferably the band names would be appended as suffixes only to the expression, not to the list of input strds's, e.g.
should work. If not, that could be a relatively easy enhancement to |
@metzm The message refers to |
Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com>
This would for a new PR. |
From the C library point of view, this message is incorrect as S2_B4 is as valid band reference as NDVI or slope_deg. Still common C library rules do not apply to t.* modules (intentionally?). |
@metzm Supported band references are provided by |
|
This then applies to t.* modules only, as rasters can have any band reference. That includes known and unknown to g.bands. If it is not known to g.bands, it simply lacks any extra metadata but still can serve as an identifier, as it is used by i.* modules. |
OK, unfortunately I am not able to track all changes related to band reference support. The original idea was that BTW, @marisn recently added support for band reference to |
…f registered maps
@metzm I changed PR based on your notes. Now
|
It was too restrictive. Markus M. even considered band reference naming scheme to be too restrictive – thus now anything goes. Individual modules or library functions still can enforce presence of band reference entry in metadata managed by g.bands iff there is functionality depending on a particular band (e.g. a specific band for cloud detection). Current implementation of band references allows to assign a semantic tag to any data not only satellite data. E.g. there is no satellite with a NDVI band but one might want to include NDVI in classification of imagery. |
OK, make sense to me. |
My motivation for custom band names comes from the need in openEO to allow custom band names, even to rename band names. From #1796 :
|
…#1844) Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com>
…#1844) Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com>
t.rast.mapcalc
on unknown band reference (in this caseS2_B4
):t.rast.mapcalc inputs=s2_tile_5606.S2_8A,s2_tile_5606.S2_B4 output=ndvi basename=ndvi expression="float(s2_tile_5606.S2_8A - s2_tile_5606.S2_4) / (s2_tile_5606.S2_8A + s2_tile_5606.S2_4)" --o
fails with unclear error message:
This PR introduces a proper error message: