This is the continuation of an unsolved problem I had (see this thread if you like). I have a Landsat image and I would like to estimate the satellite azimuth for my location. As the satellite follows a near-polar orbit (see Landsat Handboook), the satellite must have an azimuth angle different than 0°, getting bigger as it moves poleward. If I have the coordinates of the corners of my image, I can estimate how the image is tilted against North direction (estimate the azimuth). So, the idea is:
to choose one of the two sides of my image (wether the left or right) to get the angle of the normalized direction (see also How to calculate orientation of line segments using open source GIS?)
to use the coordinates of the chosen corners (e.g. lower and upper left, as
a
andb
variables, see below) in the following MATLAB function (inspired gist.github.com/604912)function d = line_dir( ax, ay, bx, by ) dx= bx - ax; dy= by - ay; m= sqrt((dx^2)+(dy^2)); r= atan2(dx/m, dy/m); d= (-r*180)/(pi); if d<0 d=-d end end
However, the coordinates of the corners in the metadata file refers to the background image, not the real image (see the figure below to understand), so can I find now the real corners of the image, to then find the azimuth angle?