Opened 12 years ago
Closed 11 years ago
#376 closed defect (fixed)
Aggregation operations in petascope don't work on multiband covs
Reported by: | Piero Campalani | Owned by: | abeccati |
---|---|---|---|
Priority: | blocker | Milestone: | 9.0 |
Component: | petascope | Version: | 8.4 |
Keywords: | wcps multiband operation | Cc: | j.oosthoek@…, uagha |
Complexity: | Hard |
Description (last modified by )
Petascope seems to provide wrong (and different at every request) results to operations applied on multiband coverages, whether the operation is applied on a single band or not.
Simple examples on the rgb
test coverage:
- AVG on 1 RGB cell (should return the cell itself?):
for m in (rgb) return encode( trim(m, {x:"CRS:1"(200:200),y:"CRS:1"(200:200)}), "csv") ==> {"242 27 103"} for m in (rgb) return encode( avg( trim(m, {x:"CRS:1"(200:200),y:"CRS:1"(200:200)}) ), "csv") ==> {"0 8.70018e-313 7.19645e-262"}
- AVG on 1 RGB cell, only the RED band (should return the single value itself):
for m in (rgb) return encode( trim(m, {x:"CRS:1"(200:200),y:"CRS:1"(200:200)}), "csv") ==> {242} for m in (rgb) return encode( avg( trim(m, {x:"CRS:1"(200:200),y:"CRS:1"(200:200)}) ), "csv") ==> {0}
- ADD over a multiple bands:
for m in (rgb) return encode( trim(m, {x:"CRS:1"(200:201),y:"CRS:1"(200:201)}), "csv") ==> {"242 27 103","242 27 103"} for m in (rgb) return encode( add( (float)trim(m, {x:"CRS:1"(200:200),y:"CRS:1"(200:201)}) ), "csv") ==> {"7.26573e-262 3.61544e-313 8.49162e-314"} ==> {"484 7563062 16"} without (float) cast ==> {"484 7563062 0"} without (float) cast
- ADD over a single band:
for m in (rgb) return encode( trim(m.red, {x:"CRS:1"(200:201),y:"CRS:1"(200:201)}), "csv") ==> {242,242} for m in (rgb) return encode( add( (float)trim(m.red, {x:"CRS:1"(200:200),y:"CRS:1"(200:201)}) ), "csv") ==> {8.10648e+16}
. Multiplication of multi-band results (but maybe this is not implemented at all):
for m in (rgb) return encode( (float)trim(m,{x:"CRS:1"(200:200),y:"CRS:1"(200:200)}) * (float)trim(m,{x:"CRS:1"(200:200),y:"CRS:1"(200:200)}), "csv") ==> Error: Could not evaluate rasdaman query: 'select csv((float)(((m[200:200,200:200])*((float)(m[200:200,200:200]))))) from rgb AS m' Cause: Error evaluating rasdaman query: 'select csv((float)(((m[200:200,200:200])*((float)(m[200:200,200:200]))))) from rgb AS m
Change History (15)
comment:1 by , 12 years ago
Description: | modified (diff) |
---|
comment:2 by , 12 years ago
- I get "Error: Exception: Base type typeName: typeID: 7 typeSize: 16 struct { typeName: RAS_DOUBLE typeID: 15 typeSize: 8 red, typeName: RAS_DOUBLE typeID: 15 typeSize: 8 green } as ElementType is not supported yet." for
- I get 242.0
- Similarly gives "Error: Exception: Base type typeName: typeID: 7 typeSize: 16 struct { typeName: RAS_DOUBLE typeID: 15 typeSize: 8 red, typeName: RAS_DOUBLE typeID: 15 typeSize: 8 green } as ElementType is not supported yet."
- I'm sure if you don't use the encode it will be fine as well like 2.
- If you remove the casts it will work
comment:3 by , 12 years ago
Summary: | Bad (and time-varying) WCPS operations results with multi-band coverages → Aggregation operations in petascope don't work on multiband covs |
---|
So in conclusion the real bug seems to be that aggregation operations over composite types do not work in petascope, but they work just fine in rasql.
comment:4 by , 12 years ago
Priority: | blocker → major |
---|
Wait, why is this blocker? You can certainly work around it.
comment:5 by , 12 years ago
Yes, the problem seems to reside indeed in the "csv" encoding, so no RasQL problem.
This works:
for m in (rgb) return avg(trim(m.1, {x:"CRS:1"(200:200),y:"CRS:1"(200:200)}) )
However condensing in parallel on a tuple still is not available:
Error: Exception: Base type typeName: typeID: 7 typeSize: 16 struct { typeName: RAS_DOUBLE typeID: 15 typeSize: 8 red, typeName: RAS_DOUBLE typeID: 15 typeSize: 8 green } as ElementType is not supported yet.
comment:6 by , 11 years ago
Yes, csv should is meant to be used for array results, it doesn't make sense for scalars.
comment:7 by , 11 years ago
Milestone: | 8.5 → 9.0 |
---|
comment:8 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied, changeset:0f7748d2366f67968c7f49308a8c1fcb0026e0f2
comment:9 by , 11 years ago
Cc: | added |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Re-opening since the associated WCPS test (n.85) fails again now:
select avg_cells(c[100:102,241:243]) from rgb AS c
I get this error:
SEVERE: rasj[0] RasRNPImplementation.getResponse: type not supported: typeName: typeID: 7 typeSize: 16 struct { typeName: RAS_DOUBLE typeID: 15 typeSize: 8 red, typeName: RAS_DOUBLE typeID: 15 typeSize: 8 green }
comment:10 by , 11 years ago
Priority: | major → blocker |
---|
comment:11 by , 11 years ago
I think it is unnecessary to reopen this, as the issue is in rasql and you have already opened #638
comment:12 by , 11 years ago
Ah sorry, I didn't read your comment fully.
That should not happen, do you have the latest master?
comment:13 by , 11 years ago
Yes, maybe I did not include the very latest patches: I am recompiling now to make sure (do you get that too btw?)
comment:15 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Ok, re-compiling the query runs fine. WCPS test n.85 valid again.