The calculation engine in the TotalPropagatedError Django application computes Total Propagated Uncertainty (TPU) for hydrographic surveys. It is driven by a custom Python module named APRIORIENGINE
, which models both Total Horizontal Uncertainty (THU) and Total Vertical Uncertainty (TVU).
User inputs from the TPU web form are POSTed and used to configure the engine:
engine = apriori.APRIORIENGINE()
engine.positionsensorname = request.POST['PositionSensor']
engine.patchtestreliabilityPITCH = float(request.POST['patchtestreliabilityPITCH'])
engine.sectorangle = int(request.POST['SectorAngle'])
Key inputs include:
After populating input values, the engine calls:
engine.configure()
This performs:
The main computational steps are:
engine.thu()
engine.tvu()
These are calculated using Root-Sum-Square (RSS) propagation:
total_error = √(error₁² + error₂² + ... + errorₙ²)
The engine includes built-in standards for acceptable uncertainty levels.
thuacceptance = engine.testagainstspecification(engine.permittedhorizontalaccuracies, engine.thucombinedtotal)
tvuacceptance = engine.testagainstspecification(engine.permittedverticalaccuracies, engine.tvucombinedtotal)
Sample loop for computing depth vs. angle TVU values:
for angle in range(-engine.sectorangle, engine.sectorangle):
tvuangle.sectorangle = angle
tvuangle.tvu()
meanresults.append([angle, tvuangle.tvucombinedtotalsummary[1][2]])
inputtable
– original configurationoutputtable
– calculated THU/TVUthuplot
, tvuplot
– error visualizationsbeamgeometryplot
, swathplot
– diagnostic graphsSaved using the current session:
engine.saveconfiguration(request.session.session_key)
Includes:
All state is tied to the Django session key, ensuring multi-user concurrency and secure, isolated computations.
If we are using an AUV, ROV or SROV, we also need to account for:
The purpose of this Web App is to provide a useful resource on HOW we as an industry compute apriori estimations of:
We aim to make the user interface very simple and intuitive. The following steps should be followed:
Once you have configured the engine, hit the "Compute" button. The engine will take your configuration, run the computations and present the results below. The graphs and tables will represent your configuration. When you are happy with the result use the browsers built-in print to pdf or screen shot into your reports. Thats it!
The user interface contains a series of lists for all engine inputs. This is done for a very specific reason. For the sensors, we will validate the sensor against manufacturer specification before it becomes supported. We do this to ensure the the engine calculation is trustworthy. For the environmental offets, speeds, etc we control the inputs to ensure the user does not make a typo error. The back end engine (python) uses unit tests and regression to ensure all combinations work with all combinations. Thats a lot of tests and ensures the engine works..
GGTPUis a native python tool developed by Reach Subsea to compute the Total Horizontal Uncertainty (THU) and Total Vertical Uncertainty (TVU) of a multibeam survey of the seabed. Together, THU and TVU produce a model of Total Propoageted Uncertainty (TPU).
The traditional mechanism for computation of apriori has been an excel spreadsheet, often based on the TPU sheet from Hare et al. circa 1990. Excel is excellent at blending data and graphical results so has been the goto tool. Unfortunately Excel is also cursed with formulas, or rather the errors, bugs, typos of formulas within a cell. They can be very hard to debug, and easy to mistakenly fail to make a reference to the wrong cell in another sheet. Simple formulas are not a problem. When we are trying to compute an accurate TVU we need complex formulas. As an example, our existing THU exel sheet contains a cell with the following formula for the heading uncertainty...
=SQRT((((Input_Variables!D49*COS(RADIANS(Input_Variables!D39)))^2)+(((COS(RADIANS(Input_Variables!C39)))^2+((SIN(RADIANS(Input_Variables!C39)))*(SIN(RADIANS(Input_Variables!D39))))^2)*-Input_Variables!C49^2)+(((SIN(RADIANS(Input_Variables!C39)))^2+((COS(RADIANS(Input_Variables!C39)))*(SIN(RADIANS(Input_Variables!D39))))^2)*Input_Variables!E49^2)-(Input_Variables!D49*-Input_Variables!C49*(COS(RADIANS(Input_Variables!D39)))*(SIN(RADIANS(Input_Variables!D39)))*(SIN(RADIANS(Input_Variables!C39))))-(Input_Variables!D49*Input_Variables!E49*(COS(RADIANS(Input_Variables!D39)))*(SIN(RADIANS(Input_Variables!D39)))*(COS(RADIANS(Input_Variables!C39))))-(-Input_Variables!C49*Input_Variables!E49*((COS(RADIANS(Input_Variables!D39)))^2)*(SIN(RADIANS(Input_Variables!C39)))*(COS(RADIANS(Input_Variables!C39)))))*((RADIANS(THU!C16)^2)))
There are hundreds of cell formula within a TPU sheet. As you can see, this is a complex formulae for a single cell, so not easy to debug and maintain.
GGApriori takes a new path for uncertainty computations. We have coded the entire calculation process in native python. This makes it much easier to debug, share and manage. As new requirements arise, such as USBL, AUV, ROV, SROV they can be added with ease. The code is correctly managed and version controlled on github.
The user interface is also modernised. instead of an excel sheet with Excel graphics, we now have a web based user interface which anyone can easily access. The underlying code is hidden away from the casual user to prevent errors being introduced.
[IHOExclusiveOrder]
vstaticerror=0.15
vvariableerror=0.0075
vpercentwaterdepth=0.75
hsigma=2.45
vsigma=1.96
[IHOSpecialOrder]
vstaticerror=0.25
vvariableerror=0.0075
vpercentwaterdepth=0.75
hsigma=2.45
vsigma=1.96
[IHOOrder1a]
vstaticerror=0.5
vvariableerror=0.013
vpercentwaterdepth=1.3
hsigma=2.45
vsigma=1.96
mbessensors.ini
positionsensors.ini
attitudesensors.ini
draftsensors.ini
tidesensors.ini
Some sensors provide combined attitude and position information. An inertial sensor such as a ROVINS is a good example. In this situation the ROVINS equipment specification will appear in both attitudesensor.ini AND positionsensor.ini. This keeps the system clean and simple. Below is an example of the attitude.ini file.
[PosMVWavemaster5]
rollaccuracy=0.02
pitchaccuracy=0.02
heaveaccuracy=0.05
headingaccuracy=0.03
[Seapath320-5+]
rollaccuracy=0.08
pitchaccuracy=0.08
heaveaccuracy=0.05
headingaccuracy=0.04
[PosMVWavemaster5EllipsoidalReduction]
rollaccuracy=0.02
pitchaccuracy=0.02
heaveaccuracy=0
headingaccuracy=0.03