FESOM / tripyview

Triangular plotting for FESOM2
MIT License
4 stars 3 forks source link

Fix volume mean in load_index_fesom2 #135

Closed alxthor closed 1 month ago

alxthor commented 1 month ago

When trying to plot time series of volume averages of 3D FESOM data with multiple regions defined in the template_var_t, I noticed that for the first box region results seem plausible, but for second they seem 3 orders of magnitude too small, for third 6 OOM too small, and for fourth 9 OOM too small. This attempts to fix this:

I think there are 2 problems:

  1. Old code overwrote data variable. → Only calculation of first box would be correct and subsequent calculations would compute mean/int of already weighted data, because every region iterated over uses the same data variable. Fix this by defining new variable

  2. idx_IN was not used for volume average/integral operations → Always global mean would be computed. Fix by doing selection before calculation of weights like in the other cases

patrickscholz commented 1 month ago

I see the problem and took this into account!