On 11/28/2010 5:52 PM, Clifford Sobchuk wrote:
> Hi Folks, I am trying to manipulate some vectors and I can't get what I want.
> What I have is a list of vectors that are brought in via RCOLS:
>
> ($sector,$rtcRate,$subPack,$time,$badPhy, $goodMac, $goodPhy)
>
> I am trying to calculate a value on a per unit time where there are :
>
> $sectors = 1..3;
> $rtcRate = 1..12;
> $subPack = 1..4;
> $time = serialized number representing mmddYYYYHHMM;
> $badPhy = number of bad physical packets per subpacket per rtcRate per sector.
> $goodMac = number of good MAC bytes subpacket per rtcRate per sector - not 
> used for this calculation
> $goodPhy = number of good physical packets per subpacket per rtcRate per 
> sector.
>
> Example of data:
> 1,1,1,111620100000,0.00,605865.00,46605.00
> 1,1,2,111620100000,0.00,46189.00,3553.00
> 1,1,3,111620100000,0.00,18616.00,1432.00
> 1,1,4,111620100000,273.00,9529.00,733.00
>
>
> What I need is to get a per sector throughput value per unit time where the 
> throughput is calculated as:
>
> rtcRatePacksize * Sum($goodPhy)/ (number of elements in a time capture) 
> across all $subPack for each $rtcRate per unit time.
>
> So the return vector should have throughput for each time change, like so:
> 203.234 111620100000
> 204.221 111620100030
> 220.111 111620100100
>
> My thought to do this was to create index vectors for the $sectors, $rtcRate, 
> $subPack and $time that were their uniq index values.
> $sectInd=uniq($sector);$rtcRateInd=uniq($rtcRate);$subPackInd=uniq($subPack);$timeStamp=uniq($time);
>
> Then I would do:
>
> ($packRate)=where ($goodPhy, $sectors==$sectInd & $rtcRate=$rtcRateInd & 
> $subPack==$subPackInd & $time=$timeStamp)->sum();
>
> but I get the following error:
>
> Runtime error: PDL: PDL::Ops::eq(a,b,c): Parameter 'b'
> PDL: Mismatched implicit thread dimension 0: should be 48384, is 3
>
> So it seems I am not applying the indices correctly. Where can I find 
> examples of doing this sort of operation?

I'm not sure about the calculation but your
use of $rtcRate=$rtcRateInd and $time=$timeStamp
in the where() argument seems odd...

--Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to