harphub / harpIO

IO functions for HARP
https://harphub.github.io/harpIO/
Other
6 stars 16 forks source link

Ops methods for harp_fcst objects #38

Closed andrew-MET closed 11 months ago

andrew-MET commented 3 years ago

There is often a need to perform math operations on 2 harp_fcst objects. For example, to compute the wind speed / direction from the vector components, or to compute combined probabilities.

A flexible way to do this via the Ops group of generic functions in R is needed.

It will need to match the names of each element (fcst_model) between the harp_fcst lists before performing the operation.

The easiest of doing mathematical operations between 2 ensemble objects will be to gather the members first, join the two objects thus only have 2 columns to work on, and then spread the members at the end . Something similar will need to be done for "harp_ens_probs" objects with the threshold columns.