Open vbkrish73 opened 6 months ago
I will look into it but it needs volume aggregation
A start, at line #1042
ic = np.logical_or(iBc, iTc) # index of steps with changes
if 'volume' in self.ts:
# create a new zero array with the size of ts
volume_bins = np.zeros(np.size(self.ts['volume']))
volume_bins[ic] = 1
volume_bins = np.cumsum(volume_bins)
volume = np.zeros(np.size(self.ts['volume']))
volume[ic] = np.bincount(volume_bins, weights=self.ts['volume'])
volume[~ic] = np.nan
ts[~ic, :] = np.nan # set elements without action to NaN
# index values cant be integer because of the nans in the arrays.
pftseries = {'date': pfdate,
'box value': ts[:, 0],
'box index': ts[:, 1],
'column index': ts[:, 2],
'trend': ts[:, 3],
'filled boxes': ts[:, 4],
}
if volume is not None:
pftseries['box volume'] = volume
Great project!
Pl do consider adding VAP