Commit 94fca51a authored by Cédric Crettaz's avatar Cédric Crettaz 🖥
Browse files

Update app.py with the new formula.

parent 6d81d654
......@@ -171,6 +171,7 @@ def get_model_water_quality_observed(
totalChlorine=None,
chlorateEstimation=None,
meta_datetime=None,
cl=None,
):
"""
If meta_datetime is provided then all the attrs are assigned meta_datetime as dateModified meta date
......@@ -184,6 +185,7 @@ def get_model_water_quality_observed(
:param totalChlorine:
:param chlorateEstimation:
:param meta_datetime:
:param cl:
:return:
comments by IBATECH:
......@@ -221,13 +223,18 @@ def get_model_water_quality_observed(
'totalChlorine',
'chlorateEstimation',
'dateObserved',
'location'
'location',
'cl'
]
# Handle the timestamp
meta_datetime = meta_datetime.replace("T", " ")
meta_datetime = meta_datetime.replace("Z", "")
if pH is not None:
# Calculate CL-
cl = 2.41840247818555 - 0.0438725641757871 * pH + 0.670467600246094 * freeChlorine - 0.669365973598627 * totalChlorine - 0.00302592842093426 * redox
for v in values:
key = v
val = locals()[v] # gets var value from var name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment