Closed JamesSample closed 1 year ago
Welcome to GitHub, @RolfVogt!
Any comments on the issue above, please? Thanks!
Yes, SAA is the equivalent sum of sulfate, chloride and nitrate
Attached is an exel file with the model for calculating organic anions based on TOC and pH in an e-mail in the "Hruska model" folder. In the folder with "All data" you will find the Hruska model tested on the 1000 lake data in columns BY - CC.
The bicarbonate may be calculated based on alkalinity as done in column CY in the "1000 lake" data. Unfortunately, the alkalinity in the ICPw data are very inconsistent and thus not possible to use. Instead we need to calculate the bicarbonate based on the ion balance: [HCO3-] = ANC - Org. Charge + H+. If the [HCO3] < 0 then it is set to 0.
NH4 and K may assumed 0.
@RolfVogt I've added a function here to calculate organic anions using the Hruska model and another one here that estimates bicarbonate as
$$HCO3 = ANC + H - OrgAnions$$
I have checked that calculate_organic_anions
produces the same results as in your Excel spreadsheet, but please take a brief look at the functions and check they look sensible (no need to look at the code in detail).
Thanks!
@JamesSample I need to ask you to replace the site density from 13.5 to 17.4
The rest looks good
Thanks @RolfVogt !
Is 17.4 a good general default? The way the function is currently setup, it assumes a default of 13.5, but users can override this by passing any value they wish when they call the function. So I can either change the default from 13.5 to 17.4, or I can override the default in this particular analysis by passing 17.4 from the notebook.
Thanks.
The values 10.2 for site density has been the default a long time, but when I optimized the Oliver model based on the 1000 lakes data I found that 13.5 was a better value as this gave an overall average charge balance (CB) of 0. Using the Hruska model I did the same exercise and reached the value of 17.4.
Perhaps what I need to do is when the ICPw data are washed is to detn. what value for site density that provides overall best charge balance in all the ICPw samples that have all major anions and cations so that CB can be calculated. I also then can assess the data to see if there are some structural differences in the dataset governing very different site density. I would not be surprised if we find a significant different value for the sites that show an increase I the sen slopes of Ca vs. sites with negative sen slopes.
So, the best would be to force users to explicitly specify a value each time they call the function, but you can state that the literature value is 10.2
From Rolf's Word document (e-mail received 15.04.2023):
Most of these can be easily calculated based on data we have in the database. However, a few clarifications would be helpful:
What is meant by SAA and organic anions?
I'm not familiar with these terms/abbreviations.
What is the appropriate parameter for HCO3-?
We don't have HCO3- as a parameter in the database. For ICPW we ask Focal Centres to report pH and alkalinity (in ueq/l). Does this allow us to estimate HCO3-?
What parameters should be mandatory for calculating ANC?
We usually calculate ANC as
$$ANC = (Ca + Mg + Na + K + NH_4) - (Cl + SO_4 + NO_3)$$
(all expressed in ueq/l). However, not all Focal Centres report complete data for all variables. In order to avoid too many NULL results, we sometimes assume some parameters can be set to zero if they are not reported.
Which parameters can be assumed to be zero for the ANC calculation if they are not explicitly reported?