FlightAware Discussions

Barometric Compensation Algorithm


I noticed some of the traffic being tracked on my receiver are flying underground. Intuitively, I knew this could not be. So I Googled and learned. I get why it is happening.

So, is there a chart, a rule of thumb, an algorithm, or some such that I could use to make the adjustment based on the pressure deviation from 29.92?

Blue Sky question. Is there a method where I could input the correction factor so that the data on my dump1090-fa/ page is more accurate?

Thanks for any input.


This is the best read i found on the topic:

You can dive into


and convert the altitude in the updateData() function i suppose.

Just need to get the current altimeter somehow, i’ll leave that to your imagination, there are boxes on the webpage to enter minimum altitude, this could be a way.


My notes say (P in hPa, h in feet):

# h = (1 - (P / 1013.25)**0.190284) * 145366.45
# P = (1 - h / 145366.45)**(1/0.190284) * 1013.25

This is essentially what the reported altitude is, it’s really reporting a pressure P, interpreted as a height h assuming a standard atmosphere. Of course, the atmosphere is never standard…

One rule of thumb I’ve seen is 30ft per 1hPa difference from 1013.25; this is a fairly rough approximation.

If what you want to know is height above MSL (or AGL, if you know the local terrain height) then a simpler approach for ADS-B equipped aircraft is to use the GNSS/GPS altitude, which is a geometric height above the ellipsoid and so is unaffected by pressure. (nb: you do need to adjust for the geoid height to get height AMSL, but that doesn’t vary a lot over smaller distances)


Yep. Just the MSL. I am not clear on if you are saying there is an option I can click that sill provide this info. Can you elaborate on what you mean by the ellipsoid?


Geometric altitude (= GPS height above ellipsoid) is reported by skyview when you select an aircraft:


The geometric altitude that is reported is a height above the WGS84 ellipsoid. This ellipsoid is a standardized approximation of the shape of the Earth, basically a slightly squashed sphere with specific dimensions. Local gravitational variation means that sea level doesn’t exactly follow the ellipsoid; the difference is the “geoid height”. There are fairly complex models (EGM96 et al) that model the shape of the geoid.

See e.g. https://www.unavco.org/software/geodetic-utilities/geoid-height-calculator/geoid-height-calculator.html for an online converter. For example if I plug in somewhere near Cambridge, UK it says:

Latitude: 52° N = 52° 0' 0" N

Longitude: 0° E = 0° 0' 0" E

GPS ellipsoidal height: 1000 (meters)

Geoid height: 46.300 (meters)

Orthometric height (height above EGM96 geoid which approximates mean sea level): 953.7 (meters)

(Note: orthometric height = GPS ellipsoidal height - geoid height)

i.e. a “geometric altitude” of 1000m near Cambridge is actually 953m above MSL.

The geoid height doesn’t vary much unless you move long distances, so you can probably just find the geoid height for your receiver location once and use that for the aircraft you see.


Got it. Thanks. I found the place to obtain the Geometric Altitude on the flight data page.



Thanks for the idea. Instead of doing the conversion, could I replace the Barometric altitude with the Geometric Altitude in the popup hint that pops when one points at an airplane?


It’s not updated as frequently by the transponder and not all aircraft transmit it.

But sure you can do that.
I’ll point you in the right direction, you’ll figure out the rest:

<div class="infoData infoRowContent"><span id="highlighted_altitude">n/a</span></div>

and in script.js:

$("#highlighted_altitude").text(format_altitude_long(highlighted.altitude, highlighted.vert_rate, DisplayUnits));         

The index.html span id references $("#highlighted_altitude").text(in script.js

So you could for example duplicate those two with different name to also display geometric altitude.
That way there is not nothing displayed when the geometric altitude is missing.


Thank you! I am digging in.


Just a bit stuck.

Added this to script.js

$("#highlighted_gps_altitude").text(format_altitude_long(highlighted.alt_geom, highlighted.geom_rate, DisplayUnits));

Then I added this right underneath the Highlighted Altitude Division on index.html.

div class=“infoRow”>

<div class="infoHeading infoRowTitle">GPS Altitude: </div>

<div class="infoData infoRowContent"><span id="highlighted_gps_altitude">n/a</span></div>

My page almost works. http://hmbatc.net. The highlight popup shows the added div labeled GPS Altitude but the value is always N/A.

I hacked the addition to script.js:

$("#highlighted_gps_altitude").text(format_altitude_long(highlighted.alt_geom, highlighted.geom_rate, DisplayUnits));

from this:

$(’#selected_altitude_geom’).text(format_altitude_long(selected.alt_geom, selected.geom_rate, DisplayUnits));

I am stymied.


Open the developer mode of your browser and it should display some debugging information when you load the page.

But as i was explaining more i actually tried the page and it is working fine.

Did you Ctrl-F5 in the browser to clear the cache?
Otherwise it partially loads an old version.

Oh and you can probably reduce the gain a bit, what are you running right now?


I suggest you have it automatically pull your local pressure from aviationweather.gov.
Specifically via https://aviationweather.gov/metar/data?ids=AIRPORT-IDENTIFIER-HERE&format=raw&date=&hours=0

Choose your local airport. Simple scripting to get that data. You only need to get your closest airport. It will be close enough for any aircraft you can pickup.

For aircraft at and above 18,000 feet, you would want the ALT to be set to 29.92 in-Hg. So, I would suggest omitting any of those aircraft from referencing your local pressure.


Thanks for helping me with this.

Thanks for the F5 tip. Would have drove me crazy tracking that one down as it was working.

I tried to find out what the gain was set to. I am sure it was the default as I didn’t know I could even do it. I set gain to 30.

I am a computer geek, not a radio geek so a lot of this stuff is new to me. I appreciate links that educate.


Thank you for the input. I am going with GPS Altitude for now. Will implement a correction for devastation script some other rainy weekend.


30 is probably unnecessary low.

If you have a Pro Stick Plus, try 38 in your location.

Basically you want to turn up the gain as high as you can without losing aircraft when they are flying low and close to your antenna.

Think of the gain as volume and the receiver can’t understand something that is too loud.
But if it is too quiet the receiver can’t understand it either.
Of course you only have one volume control for all the aircraft, which can be very far away and very close.
So it’s almost always a compromise.

(The antenna “hears” better towards the horizon than 30 degrees or up. So if a plane passes at more than 20000 ft it is either far enough away or at a weaker receiving angle of the antenna, so it never overloads the receiver. But if the plane is flying at 5000 ft or lower, it is much easier for it to be too loud to be heard.
Also don’t worry about the receiver, it can “hear” perfectly fine as soon as the strong signal is over. So it can still hear the other airplanes)

If you want some more reading on the topic: Thoughts on optimizing gain