Skip to content
Snippets Groups Projects

DTU mean sea surface correction

Merged Stefan Hendricks requested to merge feature/dtu_mss into master
8 files
+ 277
28
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 95
0
;*========================================================================
;* compute_delta_h.pro - Compute difference in elevation for 2 ellipsoids
;*
;* 15-Apr-2004 Terry Haran tharan@colorado.edu 492-1847
;* National Snow & Ice Data Center, University of Colorado, Boulder
;* $Header: /NSIDC_CVS/FILES/tmh/glas/ellipsoid/compute_delta_h.pro,v 1.2 2004/05/10 21:16:30 haran Exp $
;*========================================================================*/
;+
; NAME:
; compute_delta_h
;
; PURPOSE:
; Compute difference in elevation for two ellipsoids at a given
; latitude using a simplified empirical equation.
;
; CATEGORY:
; Glas.
;
; CALLING SEQUENCE:
; delta_h = compute_delta_h(a1, b1, a2, b2, phi)
;
; ARGUMENTS:
; Inputs:
; a1 - equatorial radius in meters of ellipsoid 1.
; b1 - polar radius in meters of ellipsoid 1.
; a2 - equatorial radius in meters of ellipsoid 2.
; b2 - polar radius in meters of ellipsoid 2.
; phi - array of latitudes in degrees.
; Outputs:
; None.
; Result:
; Elevation in meters that should be added to an elevation meters
; for ellipsoid 1 to obtain an elevation in meters for ellipsoid 2.
;
; KEYWORDS:
; None.
;
; EXAMPLE:
; h2 = h1 + compute_delta_h(a1, b1, a2, b2, phi)
;
; ALGORITHM:
; Check for valid input.
; Force phi into range -90 <= phi <= 90
; Initialize double precision constant (dtor) for converting
; degrees to radians.
; Initialize equatorial (a) and polar (b) radii for each
; ellipsoid.
; delta_h = -(delta_a * cos(phi)^2 + delta_b * sin(phi)^2)
; where
; delta_a = a2 - a1
; delta_b = b2 - b1
; delta_h = h2 - h1
;
; REFERENCE:
; Astronomical Algorithms, Jean Meeus, 1991, Willmann-Bell, Inc.
; pp. 77-82
;-
function compute_delta_h, a1, b1, a2, b2, phi
; Check for valid input
if n_params() ne 5 then $
message, "syntax: delta_h = compute_delta_h(a1, b1, a2, b2, phi)"
; force phi into range -90 <= phi <= 90
i = where(phi lt -90.0d, count)
if count gt 0 then $
phi[i] = -90.0d
i = where(phi gt 90.0d, count)
if count gt 0 then $
phi[i] = 90.0d
; Initialize double precision constant (dtor) for converting
; degrees to radians.
pi = atan(1.0d) * 4
dtor = pi / 180
delta_a = a2 - a1
delta_b = b2 - b1
; delta_h = -(delta_a * cos(phi)^2 + delta_b * sin(phi)^2)
phir = phi * dtor
sinsqphi = sin(phir)
sinsqphi = sinsqphi * sinsqphi
cossqphi = 1 - sinsqphi
return, -(delta_a * cossqphi + delta_b * sinsqphi)
end
Loading