Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#219 closed defect (fixed)

WCPS overlay operator works wrong way round

Reported by: mase@… Owned by: arezaeim
Priority: major Milestone: 8.4
Component: petascope Version: 8.3
Keywords: Cc:
Complexity:

Description

I was having trouble getting the overlay operator in WCPS to work until I realised that it is defined the opposite way round in WCPS and rasdaman.

In the WCPS standard section 7.1.21 binaryInducedExpr there is a definition of the overlay operator such that:

For C1 overlay C2 the result should be

value(C2,p) if value(C1,p) = 0 or value (C1,p) otherwise.

If I execute a WCPS query like the following in Petascope:

for c in (bgs_rs) return
encode(

(coverage const2
over $px x(0:2)
value list <0;1;1>)
overlay
(coverage const
over $px x(0:2)
value list <2;2;0>)

, "csv")

it is converted to the rasql query

select csv(((< [0:2] 0, 1, 1>)overlay(< [0:2] 2, 2, 0>))) from bgs_rs AS c

which gives the result

{2,2,1}

According to the WCPS definition the result should be {2,1,1}.

The definition of "a overlay b" in the rasql guide is "(b != 0) * b + (b == 0) * a" so rasql is giving the result expected from the generated rasql query.

I posted a message on the rasdaman-users list and Peter Baumann replied on 9th Sept that the sense of overlay in WCPS and rasql are indeed the opposite way round. Therefore Petascope needs fixing to swap the order when converting a WCPS overlay query to rasql.

Change History (3)

comment:1 Changed 4 years ago by dmisev

  • Owner changed from dmisev to arezaeim
  • Status changed from new to assigned

comment:2 Changed 4 years ago by dmisev

  • Resolution set to fixed
  • Status changed from assigned to closed

I submitted a fix.

Note: See TracTickets for help on using tickets.