Latitude & longitude & air pressure

AI Thread Summary
To calculate the air pressure at a specific location using nearby METAR station data, one can weight the pressure measurements based on the distance from the stations. A suggested formula involves using the distances and pressures to create a weighted average, ensuring that closer stations have more influence on the final pressure calculation. However, challenges arise when stations are equidistant but have differing pressures, potentially leading to inaccurate results. It is also important to consider variations in pressure due to altitude and temperature, which complicates the model further. Ultimately, while mathematical methods can provide estimates, practical solutions like using a barometer may be more effective for accurate readings.
wachovia
Messages
10
Reaction score
0
Hi there,

I have a peculiar question. Imagine that you are in a Earth position, obtained by google, that gives you the latitude and longitude. Those values are given in the decimal notation (ex: lat=20.44 ; long=-8.5).

Now imagine that you want to know the air pressure in your position. So, you will get it from metar statios (metereologic stations along the countries). If you visit the three closer metar stations, you won't be able to do
PressureInPosition=(Pressure1 + Pressure2 + Pressure3)/3
, because the air pressure in the metar station that is closer from your position has more weight to the calculus of the final air Pressure in you position.

I also know the latitude and longitude of the three metar stations and I also know the distance between my position and those stations.

How can I calculate the pressure in my position based on weights?

Thanks

Wachovia
 
Physics news on Phys.org
I suppose you could weight the pressure measurements by the great circle distance from your position.

P = \frac{D_1P_1 + D_2P_2 + D_3P_3 }{D_1 + D_2 + D_3}
 
Another method would be to assume the pressure follows a linear function from one station to the another. You can model it as 3 points, a,b,c forming a plane , with coordinates x and y being the latitude and longtitude, and z being the air pressure. Your air pressure would be the value of z at a point lying on the plane.

So if you remember your early geometry days, of where a line perpendicular to the x-y plane ( at your coordinates ) intersects a plane formed by points a, b,c you could do it that way.
 
and just hope there isn't something like a weather front between you and some of the stations.
 
256bits
, can I use the decimal values of latitude and longitude to x and y ? Or should I convert them to another value?
 
MisterX said:
I suppose you could weight the pressure measurements by the great circle distance from your position.

P = \frac{D_1P_1 + D_2P_2 + D_3P_3 }{D_1 + D_2 + D_3}

You are giving the greatest weightage to the station which is farthest away. How would that work?!
 
I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by p=a_1 + a_2d + a_3d^2., where d=\sqrt(x^2+y^2). Plug in the values of d at the three locations to get the values of the three constants. The value of a_1 would be the pressure at your location.
A really good calculation would need to correctly incorporate the variation of pressure with temperature and altitude though.
Why not just get a barometer? Cheaper than a GPS device.
 
Last edited:
physwizard said:
You are giving the greatest weightage to the station which is farthest away. How would that work?!

Absolutly true
 
physwizard said:
I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by p=a_1 + a_2d + a_3d^2., where d=\sqrt(x^2+y^2). Plug in the values of d at the three locations to get the values of the three constants. The value of a_1 would be the pressure at your location.
A really good calculation would need to correctly incorporate the variation of pressure with temperature and altitude though.
Why not just get a barometer? Cheaper than a GPS device.

What is x and y ? decimal latitude and longitude? Or can D be the distances that I'v already calculated?
 
Last edited:
  • #10
wachovia said:
What is x and y ? decimal latitude and longitude? Or can D be the distances that I'v already calculated?

d is the distance along the surface of the earth(taken at the same altitude) of these stations. If you assume the Earth as a sphere, you can approximately get x and y by x=(Rcos\theta_2)\phi_2-(Rcos\theta_1)\phi_1 and y=R(\theta_2-\theta_1) . Where the subscripts 2 and 1 indicate respectively the station and your location. θ and \phi are the latitudes and longitudes respectively. If you assume the Earth as an ellipsoid(more accurate) these calculations would be more complex. The expression for calculating distance d=\sqrt(x^2+y^2) assumes that the points are close enough that you can neglect the curvature of the earth. If not, then you would have to actually find the distance along the geodesic connecting the two points.
 
Last edited:
  • #11
physwizard said:
You are giving the greatest weightage to the station which is farthest away. How would that work?!

poorly

my apologies

This should be betterP =\left( \frac{P_1}{D_1} + \frac{P_2}{D_2} + \frac{P_3}{D_3}\right)\frac{1}{\frac{1}{D_1} + \frac{1}{D_2} + \frac{1}{D_3} } = \frac{D_2 D_3 P_1 + D_1 D_3 P_2 + D_1 D_2 P_3}{D_2 D_3 + D_1 D_3 + D_1 D_2 }
 
  • #12
physwizard said:
I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by p=a_1 + a_2d + a_3d^2., where d=\sqrt(x^2+y^2). Plug in the values of d at the three locations to get the values of the three constants. The value of a_1 would be the pressure at your location.

There is a problem with this technique. Consider what happens if two stations have similar values of d but are geographically separated and have different pressure. One could end up with unreasonably large or small values of a_1. See the attached picture for an example.

I think that the method employed should only generate pressures that are between the pressures given by the stations.
 

Attachments

  • quadratic_polyfit.png
    quadratic_polyfit.png
    2.1 KB · Views: 491
Last edited:
  • #13
physwizard said:
I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by p=a_1 + a_2d + a_3d^2., where d=\sqrt(x^2+y^2). Plug in the values of d at the three locations to get the values of the three constants. The value of a_1 would be the pressure at your location.
A really good calculation would need to correctly incorporate the variation of pressure with temperature and altitude though.
Why not just get a barometer? Cheaper than a GPS device.


What if the three locations are equidistant from you but with different pressures?
Our almost equidistant and with different pressures? You can get VERY strange results.

Edit: oops MisterX beat me to it
 
  • #14
MisterX said:
There is a problem with this technique. Consider what happens if two stations have similar values of d but are geographically separated and have different pressure. One could end up with unreasonably large or small values of a_1.

Quite true. This would lead to an inconsistency(many valued). Isotropy cannot be assumed in general.
Actually, if you assume everything is at the same altitude, we can assume an equation like this:
p = a + bx + cy for the purpose of interpolation.
If the altitudes are different, the z direction would need to be factored in as well.
The right way to model this really would be to take into account the physics and other factors like temperature.
 
Last edited:
  • #15
Even pilots don't need this kind of accuracy...
The differences in the values that will be obtained will be neligible.
Just use the data from the closest station.
 
  • #16
, can I use the decimal values of latitude and longitude to x and y ? Or should I convert them to another value?
Yes you can use latitude-longitude values.

the basic equation of a plane is Ax + By +Cz + D = 0
what you would be doing is finding the equation of a graph relating air pressure ( z) with the location ( x and y )

How to find the plane with 3 points.
http://www.math.washington.edu/~king/coursedir/m445w04/notes/vector/equations.html

Given points P, Q, R in space, find the equation of the plane through the 3 points.

Example: P = (1, 1, 1), Q = (1, 2, 0), R = (-1, 2, 1). We seek the coefficients of an equation ax + by + cz = d, where P, Q and R satisfy the equations, thus:

a + b + c = d
a + 2b + 0c = d
-a + 2b + c = d

Subtracting the first equation from the second and then adding the first equation to the third, we eliminate a to get

b - c = 0
4b + c = 2d

Adding the equations gives 5b = 2d, or b = (2/5)d, then solving for c = b = (2/5)d and then a = d - b - c = (1/5)d.

So the equation (with a nonzero constant left into choose) is d(1/5)x + d(2/5)y + d(2/5)z = d, so one choice of constant gives

x + 2y + 2z = 5

or another choice would be (1/5)x + (2/5)y + (2/5)z = 1

the x and y are your latitude and longtitude.
the z is your air pressure.


then when you have found your equation substute x and y for your own location to give you your z which is your air pressure.

As I stated before, this assumes a linear location-pressure relationship, so if the stations are not too far apart that asumption may be true.

Qnce you have your equation you do all sorts of things with it, such as change of pressure with direction, direction of maximum change, ie directional derivatives, gradient, it could become useful depending on what your plan is.
knowing dot cross product, analytical geometry and calculus applied to such would be helpful.
 
Last edited:
  • Like
Likes 1 person
  • #17
256bits said:
Yes you can use latitude-longitude values.

the basic equation of a plane is Ax + By +Cz + D = 0
what you would be doing is finding the equation of a graph relating air pressure ( z) with the location ( x and y )

How to find the plane with 3 points.
http://www.math.washington.edu/~king/coursedir/m445w04/notes/vector/equations.html



the x and y are your latitude and longtitude.
the z is your air pressure.


then when you have found your equation substute x and y for your own location to give you your z which is your air pressure.

As I stated before, this assumes a linear location-pressure relationship, so if the stations are not too far apart that asumption may be true.

Qnce you have your equation you do all sorts of things with it, such as change of pressure with direction, direction of maximum change, ie directional derivatives, gradient, it could become useful depending on what your plan is.
knowing dot cross product, analytical geometry and calculus applied to such would be helpful.

The air pressure has a decrease variaton from north to south.
If I have three points, aligned from north to south with Pressures : p1=1020hPa ; p2=1017hPa ; p3=1013hPa and a point P, who's at south of the point 3, the pressure in P must be smaller then p3 (1013hPa).

Can your fomula present that result?
 
  • #18
MisterX said:
poorly

my apologies

This should be better


P =\left( \frac{P_1}{D_1} + \frac{P_2}{D_2} + \frac{P_3}{D_3}\right)\frac{1}{\frac{1}{D_1} + \frac{1}{D_2} + \frac{1}{D_3} } = \frac{D_2 D_3 P_1 + D_1 D_3 P_2 + D_1 D_2 P_3}{D_2 D_3 + D_1 D_3 + D_1 D_2 }

Its not a true solution. If I have, for example three points from North to south, with pressures p1=1020 ; p2=1017 and p3=1013. And if I'm in a position that is at south of p3, there, air pressure must be smaller then p3, but with your formula, I have a value near 1014 or 1015.. That's not right, we can't use Air pressure calcution with weights :)
 
  • #20
wachovia said:
The air pressure has a decrease variaton from north to south.
If I have three points, aligned from north to south with Pressures : p1=1020hPa ; p2=1017hPa ; p3=1013hPa and a point P, who's at south of the point 3, the pressure in P must be smaller then p3 (1013hPa).

Can your fomula present that result?

If that is the case then a simple equation of a line through 3 points would be sufficient, or an approximation of the best fit line, and then extrpolate to your 4th point.

you should note that with only 3 points as your data set, there could be many equations that can describe the variation of pressure over the surface ( line in the special case of 3 data points in a row ) , which is why I suggested as taking the linear model approach.

What you are actually asking is what equation descibes the variation of air pressure given 3 points, and that is impossible to say. For example, a sinusoidal variation with frequency/amplitude dependancy could apply, so could some sort of quadratic function, ..., etc, and all are equally valid since the a priori function is unknown. Each equation would necessarily have a different weighting value applied to the points and subsequentaly your 4th point is basically unknown until you can actually describe the relationship. Without the function, assume the most basic and that would be linear.
 
  • #21
physwizard said:
I can suggest quadratic interpolation. Set the origin at your current location and assume that the pressure is given by p=a_1 + a_2d + a_3d^2., where d=\sqrt(x^2+y^2). Plug in the values of d at the three locations to get the values of the three constants. The value of a_1 would be the pressure at your location.
A really good calculation would need to correctly incorporate the variation of pressure with temperature and altitude though.
Why not just get a barometer? Cheaper than a GPS device.

Theres's not missing the a4 and also the respective d ?

I tried your formula (without the third pressure and x,y position) and its not working, it gaves me a big value (1824347.62).. I don't know why!

a1=1018
a2=1018
a3=1018

x2=40.2
x3=40.9

y2=-8.55
y3=-8.65
 
Back
Top