Opened 10 years ago

Closed 9 years ago

#603 closed defect (duplicate)

Subsets are not transformed to indexes when arithmetic expression is used

Reported by: Piero Campalani Owned by: Vlad Merticariu
Priority: critical Milestone: 9.0.x
Component: petascope Version: development
Keywords: subset arithmetic expression Cc: mantovani@…, Vlad Merticariu, Alex Dumitru
Complexity: Medium

Description

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 by Piero Campalani, 10 years ago

Cc: Vlad Merticariu Alex Dumitru added

comment:2 by abeccati, 10 years ago

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 by Piero Campalani, 10 years ago

Alan,
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:

dimensionIntervalElement:
      axisName [ : crsName ] ( dimensionIntervalExpr )

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

A scalar expression includes arithm. expressions:

numericScalarExpr:
    | numericScalarExpr addOp numericScalarTerm
    | numericScalarTerm

comment:4 by Piero Campalani, 10 years ago

Priority: majorcritical

comment:5 by Piero Campalani, 10 years ago

Priority: criticalminor

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

comment:6 by Piero Campalani, 10 years ago

Priority: minorcritical

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

comment:7 by Peter Baumann, 9 years ago

Owner: changed from Piero Campalani to Vlad Merticariu
Status: newassigned

comment:8 by Vlad Merticariu, 9 years ago

Resolution: duplicate
Status: assignedclosed

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.