You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dandavies99 There are two models associated with the function for converting water level to flow: CurvaDescarga, and NivelFuncion.
NivelFuncion: Stores the conversion function in a string field using postgres arithmetic syntax, for example: 0.35*(H^2.19) + 1.76*H , where H is the water level in centimeters.
This function is multi-level for a single station, so you can have something like this:
curvadescarga_id level function
1 30 2.14*H # applies from 0 to 30 cm
1 120 0.35*(H^2.19) + 1.76*H # applies from 30 to 120 cm
CurvaDescarga model associates the group of functions to a station in a given date (start date)
All the postgres code about CurvaDescarga/NivelFuncion you see in the project is to convert water level to flow trying to speeding up the calculations when massive amounts, and because there was also required that some of them applies automatically, triggers were made when:
a conversion function change
for previewing flow data even when not validated
after validating water level
If you would like to try the code for converting water level to flow using this multilevel approach I recommend removing the triggers and implementing it manually and see if its convenient for you.
Please let me know if you need further explanation.
@pxjacomex - What do these do? Should the model be defined in
models.py
? It's hard for us to understand because the function is basically pure SQL.The text was updated successfully, but these errors were encountered: