GLEON / rLakeAnalyzer

An R version of Lake Analyzer
43 stars 26 forks source link

Is buoyancy frequency calculation correct? #100

Closed dlbade closed 4 years ago

dlbade commented 5 years ago

As a bit of a check to see if I was calculating buoyancy frequency correctly I stumbled across this. https://rdrr.io/cran/rLakeAnalyzer/man/buoyancy.freq.html

When I run the program it spits out values that are not quite what I expected. I think it’s resulting in the value of N2 and I was expecting N (as N has the units of frequency). My values of N2 match the output. This is just a realm I’m not the most knowledgeable on. I’m not sure which value is used or reported conventionally. I just assumed N was what should be calculated because of the name buoyancy "frequency".

hdugan commented 5 years ago

Yes, it looks like the function is missing the sqrt. Should be an easy fix to implement.

lawinslow commented 5 years ago

Eh, I'll point out the very documentation you link to has BF output documented as:

Returns a vector of buoyancy frequency in units sec^-2

and BF is often used/described in the literature as N^2 https://science.sciencemag.org/content/264/5162/1120/tab-pdf

I say skip the API breaking change.

hdugan commented 5 years ago

I agree with Luke, since it's documented as units sec^-2, best to leave as is. Although I agree that it's often reported as s^-1.

dlbade commented 5 years ago

You're correct. I totally missed that the units were described in the website I listed. This follow-up question is unimportant to my endeavors: is buoyancy frequency used to calculate anything else? In this case the units may matter. Otherwise it's just a matter of the user knowing what units are being output. I've seen both forms used in my quick look through some literature.