Opened 4 years ago

Closed 3 years ago

#603 closed defect (duplicate)

Subsets are not transformed to indexes when arithmetic expression is used

Reported by: pcampalani Owned by: vmerticariu
Priority: critical Milestone: 9.0.x
Component: petascope Version: development
Keywords: subset arithmetic expression Cc: mantovani@…, vmerticariu, mdumitru
Complexity: Medium


Petascope does not translate subsets to grid indexes when an airthmetic expression is put:

for c in (eobstest)
return encode (
    c[Lat( 0 ), Long(50), t("1950-01-01")]
, "csv")

# RasQL: c[0,50,151]  -> OK
for c in (eobstest)
return encode (
    c[Lat( 0 + 100 - 100 ), Long(50), t("1950-01-01")]
, "csv")

# RasQL: c[0,50,0+100-100] = c[0,50,0] -> WRONG

Change History (8)

comment:1 Changed 4 years ago by pcampalani

  • Cc vmerticariu mdumitru added

comment:2 Changed 4 years ago by abeccati

Seems related to #596 if I am not mistaken and is this expected in the WCPS standard? If it is a deviation keyword should be added until we address this so it gets listed in the petascope guide.

comment:3 Changed 4 years ago by pcampalani

the issue addressed in #596 is actually different: parser errors when putting arithm. expressions in an IntervalExpr Vs wrong (missing) conversion to grid coordinates when arithm. expressions are put into a dimensionIntervalExpr.

All this stuff is expected in theWCPS standards, if I'm not wrong:

      axisName [ : crsName ] ( dimensionIntervalExpr )

      scalarExpr : scalarExpr
    | domain ( coverageName , axisName , crsName )

A scalar expression includes arithm. expressions:

    | numericScalarExpr addOp numericScalarTerm
    | numericScalarTerm

comment:4 Changed 3 years ago by pcampalani

  • Priority changed from major to critical

comment:5 Changed 3 years ago by pcampalani

  • Priority changed from critical to minor

Lowering priority: you can always put the single-scalar result of an arithmetic expression in place of the expression itself.

comment:6 Changed 3 years ago by pcampalani

  • Priority changed from minor to critical

What I say in comment:5 does not hold when variables needs to be used in the expression.

comment:7 Changed 3 years ago by pbaumann

  • Owner changed from pcampalani to vmerticariu
  • Status changed from new to assigned

comment:8 Changed 3 years ago by vmerticariu

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

Closing as duplicate of ticket #596, the issue is not different, as suggested in a comment above, but occurs exactly because expressions are not supported in WCPS intervals.

In order to fix this, we need a 2-step evaluation: first evaluate the interval expressions and then use the results in the final rasql query. I am continuing the discussion in #596.

Note: See TracTickets for help on using tickets.