eliocamp / metR

Tools for Easier Analysis of Meteorological Fields
https://eliocamp.github.io/metR/
140 stars 22 forks source link

Error in WaveFlux function #110

Closed salvatirehbein closed 4 years ago

salvatirehbein commented 4 years ago

I found the following problem trying to use the WaveFlux function (ps not found):

Error in eval(predvars, data, env) : objeto 'ps' não encontrado

I think that it should be psi instead of ps in the 2nd line below:

dt[, `:=`(psi.dx = Derivate(psi ~ lonrad, cyclical = TRUE), 
        psi.dxx = Derivate(ps ~ lonrad, 2), cyclical = TRUE), 
        by = lat]
eliocamp commented 4 years ago

Thanks! That poor function is a bit orphaned since I'm now using another function to compute wave activity fluxes using streamfunction from reanalysis directly, which is the better way, I think. It might need some love. There are a lot of other formulas with various assumptions.

It's now fixed in the development version, which you can install with

devtools::install_github("eliocamp/metR@dev")