Opened 6 years ago

Closed 6 years ago

#1751 closed defect (fixed)

WCPS_Error with axis iterator when it should be coverage iterator

Reported by: Bang Pham Huu Owned by: Vlad Merticariu
Priority: major Milestone: 9.7
Component: petascope Version: development
Keywords: Cc: Dimitar Misev, Vlad Merticariu
Complexity: Medium

Description

for $c in (SD), $l in (LeapYears) return encode(
  coverage YearlyAvg 
  over $y y(0:9)
  values max($c[
    unix(($y*365 + $l[i($y)]): ($y*365 + 364 + $l[i($y)])), 
    E(0), 
    N(6900000)]),
"json")

<ows:ExceptionText>Cannot find axis iterator with alias '$l[i($y'.</ows:ExceptionText>

$l should be treated as coverage iterator

Change History (3)

comment:1 by Dimitar Misev, 6 years ago

Milestone: 9.69.7

comment:2 by Bang Pham Huu, 6 years ago

Owner: changed from Bang Pham Huu to Vlad Merticariu
Status: newassigned

comment:3 by Bang Pham Huu, 6 years ago

Resolution: fixed
Status: assignedclosed

Vlad's comment

I also included a system test that computes monthly averages from 1 year of simulated daily data. The query looks like this:

for $c in (test_AverageChloro), $d in (DaysPerMonth) return encode(
  coverage monthlyAvg
  over $x x(0:11)
  values avg($c[unix(add($d[i(0:$x)]) - $d[i($x)]:add($d[i(0:$x)]) - 1)])
, "json")

It computes 12 values, and the domain on which each avg is computed starts from the beginning of the month on which the iterator is (that is add($d[i(0:$x)]) - $d[i($x)]) and ends on the last day of the month on which the iterator is (add($d[i(0:$x)])). That boils down to 0:30, 31:58, 59:89... Note that this is a grid subset so between 0:30 there are 31 values. 
Note: See TracTickets for help on using tickets.