Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altitude-based correction for O2.sat #103

Closed
aappling-usgs opened this issue Aug 28, 2015 · 4 comments
Closed

Altitude-based correction for O2.sat #103

aappling-usgs opened this issue Aug 28, 2015 · 4 comments

Comments

@aappling-usgs
Copy link
Contributor

We're discussing the pressure-based correction in Issue #102, so this issue is just about altitude.

The literature gives a few ways to correct O2.sat for barometric pressure. In general, these follow the form:

O2.sat.corrected = O2.sat(from garcia, weiss, etc.) * press.cor

where the form of press.cor is what varies. Staehr et al. 2010 cite USGS memos #81.11 and #81.15 (both 1981) for these two options:

press.corr <- (baro * 0.0987 - 0.0112)/100 # baro is pressure in millibars
press.corr <- (0.0000005 * altitude^2 - 0.0118 * altitude + 99.979)/100

I cannot find the altitude-based equation or the words 'altitude' or 'elevation' anywhere in USGS memo #81.11. If anybody finds the original source of this equation, I'd like to add it to the help file.

Alternatively, I do have the following code from @robohall to estimate barometric pressure from elevation. Bob cites John Colt's book (I assume this is an edition of Colt, John. “1 - Solubility of Atmospheric Gases in Freshwater.” In Computation of Dissolved Gas Concentration in Water as Functions of Temperature, Salinity and Pressure (Second Edition), edited by John Colt, 1–71. London: Elsevier, 2012. http://www.sciencedirect.com/science/article/pii/B9780124159167000012). The numbers are also consistent with http://psas.pdx.edu/RocketScience/PressureAltitude_Derived.pdf.

# temp is degC, alt is m, and bpst is in inches of Hg.  Temp is usually relative to a standard, 15 degC.  value returned is mmHg
bpcalc<- function(bpst, alt, temp) {
  bpst*25.4*exp((-9.80665*0.0289644*alt)/(8.31447*(273.15+temp)))
}
bpcalc(29.92,2400,15) # example using standard temperature and pressure, elevation of 2400 m

With this equation, we could relate the pressure correction to altitude by first calculating pressure from altitude and then computing the pressure correction from pressure as before.

Here are the equations I propose (note that I've replaced bpst with 29.92 inches Hg in the following calculation because that's the standard pressure at sea level):

Pmb = (1/0.750061683) * 25.4 * 29.92 * exp((-9.80665*0.0289644*altitude)/(8.31447*(273.15 + t)))
# same equations as in issue #102:
u = 10 ^ (8.10765 - 1750.286 / (235 + t)) # t is temperature in degrees C, log appears to be log10
DO' = DO * (Pmb*0.750061683 - u) / (760 - u) # 0.750061683 mmHg/mb

As with the Antoine equation for u (see Issue #102), I'm unclear on the value to use for temperature (t) in the Pmb equation. Should it be local air temperature, local water temperature, or standard air temperature (15 deg C)? @robohall, @lawinslow, @rBatt

@robohall
Copy link

I have been always unclear on what the t to use in the altitude to pressure conversion. For sure it is NOT water temperature, as surface water has nothing to do with this conversion.

bpcalc<- function(bpst, alt, temp) {
bpst_25.4_exp((-9.80665_0.0289644_alt)/(8.31447*(273.15+temp)))
}
bpcalc(29.92,2400,15) # example using standard temperature and pressure, elevation of 2400 m

This is essentially the barometric formula
https://en.wikipedia.org/wiki/Barometric_formula
and more specifically it is eq 2 in that article. It uses “standard temperature” whichis 288.15, aka 15deg C, so it appears that my use of 15 deg is more or less correct.

Bob

On Aug 28, 2015, at 10:31 AM, Alison Appling <notifications@github.commailto:notifications@github.com> wrote:

We're discussing the pressure-based correction in Issue #102#102, so this issue is just about altitude.

The literature gives a few ways to correct O2.sat for barometric pressure. In general, these follow the form:

O2.sat.corrected = O2.sat(from garcia, weiss, etc.) * press.cor

where the form of press.cor is what varies. Staehr et al. 2010 cite USGS memos #81#81 and #81#81 (both 1981) for these two options:

press.corr <- (baro * 0.0987 - 0.0112)/100 # baro is pressure in millibars
press.corr <- (0.0000005 * altitude^2 - 0.0118 * altitude + 99.979)/100

I cannot find the altitude-based equation or the words 'altitude' or 'elevation' anywhere in USGS memo #81#81. If anybody finds the original source of this equation, I'd like to add it to the help file.

Alternatively, I do have the following code from @robohallhttps://github.com/robohall to estimate barometric pressure from elevation. Bob cites John Colt's book (I assume this is an edition of Colt, John. “1 - Solubility of Atmospheric Gases in Freshwater.” In Computation of Dissolved Gas Concentration in Water as Functions of Temperature, Salinity and Pressure (Second Edition), edited by John Colt, 1–71. London: Elsevier, 2012. http://www.sciencedirect.com/science/article/pii/B9780124159167000012). The numbers are also consistent with http://psas.pdx.edu/RocketScience/PressureAltitude_Derived.pdf.

temp is degC, alt is m, and bpst is in inches of Hg. Temp is usually relative to a standard, 15 degC. value returned is mmHg

bpcalc<- function(bpst, alt, temp) {
bpst_25.4_exp((-9.80665_0.0289644_alt)/(8.31447*(273.15+temp)))
}
bpcalc(29.92,2400,15) # example using standard temperature and pressure, elevation of 2400 m

With this equation, we could relate the pressure correction to altitude by first calculating pressure from altitude and then computing the pressure correction from pressure as before.

Here are the equations I propose (note that I've replaced bpst with 29.92 inches Hg in the following calculation because that's the standard pressure at sea level):

Pmb = (1/0.750061683) * 25.4 * 29.92 * exp((-9.80665_0.0289644_altitude)/(8.31447*(273.15 + t)))

same equations as in issue #102:

u = 10 ^ (8.10765 - 1750.286 / (235 + t)) # t is temperature in degrees C, log appears to be log10
DO' = DO * (Pmb*0.750061683 - u) / (760 - u) # 0.750061683 mmHg/mb

As with the Antoine equation for u (see Issue #102#102), I'm unclear on the value to use for temperature (t) in the Pmb equation. Should it be local air temperature, local water temperature, or standard air temperature (15 deg C)? @robohallhttps://github.com/robohall, @lawinslowhttps://github.com/lawinslow, @rBatthttps://github.com/rBatt


Reply to this email directly or view it on GitHubhttps://github.com//issues/103.

@aappling-usgs
Copy link
Contributor Author

Great - I'd like to go with a temperature of 15 degrees C. I've found a little more information to support this: see p12 of http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770009539.pdf. There it says, "The quantity T[M,b] is a multi-valued constant dependent on L[M,b] and H[b]." L[M,b] is the standard temperature lapse rate that's absent from wikipedia's Eq. 2, H[b] is the altitude, and b is the index of altitude used in Table 4 of that document. Note that both P[b] and T[M,b] are indexed by b, and the text next says, "The reference-level value for P[b] for b=0 is the defined sea-level value, P0=101325.0 N/m2." So I think the reference-level value for T[M,b] is also the defined sea-level value of 288.15 K = 15 degrees C.

@jzwart
Copy link
Member

jzwart commented Aug 28, 2015

Yup, go with 288.15K; more support of this in Jacobs 1999 Introduction to Atmospheric Chemistry (see equation 2.9 for the barometric equation). And I agree on the indexing of b - but I don't think any lakes or streams will be above this bottom atmospheric layer so no need to include a lookup table for any of the other atmospheric layers, so we can keep these as constants as in Bob's code. see https://en.wikipedia.org/wiki/U.S._Standard_Atmosphere#1976_version for other layer values.

@jzwart
Copy link
Member

jzwart commented Aug 28, 2015

Yup, go with 288.15K; more support of this in Jacobs 1999 Introduction to
Atmospheric Chemistry (see equation 2.9 for the barometric equation). And I
agree on the indexing of b - but I don't think any lakes or streams will be
above this bottom atmospheric layer so no need to include a lookup table
for any of the other atmospheric layers, so we can keep these as constants
as in Bob's code. see
https://en.wikipedia.org/wiki/U.S._Standard_Atmosphere#1976_version for
other layer values.

On Fri, Aug 28, 2015 at 1:52 PM, Alison Appling notifications@github.com
wrote:

Great - I'd like to go with a temperature of 15 degrees C. I've found a
little more information to support this: see p12 of
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770009539.pdf.
There it says, "The quantity T[M,b] is a multi-valued constant dependent on
L[M,b] and H[b]." L[M,b] is the standard temperature lapse rate that's
absent from wikipedia's Eq. 2
https://en.wikipedia.org/wiki/Barometric_formula, H[b] is the altitude,
and b is the index of altitude used in Table 4 of that document. Note that
both P[b] and T[M,b] are indexed by b, and the text next says, "The
reference-level value for P[b] for b=0 is the defined sea-level value,
P0=101325.0 N/m2." So I think the reference-level value for T[M,b] is also
the defined sea-level value of 288.15 K = 15 degrees C.


Reply to this email directly or view it on GitHub
#103 (comment)
.

Jacob A. Zwart
PhD Candidate
University of Notre Dame
Jones Lab & MFE
263 Galvin Life Sciences
Notre Dame, IN 46556
269.370.2788
https://jayzlimno.wordpress.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants