; docformat = 'rst' ;+ ;This function computes the altitude, in kilometers, from the Solar Zenith ;Angle (SZA), in degrees. A SZA of 0 degrees corresponds to altitude of ;53km and is capped at 90 degrees with an altitude of 110km. ; ; :Examples: ; altitude = sza_alt(sza_degrees) ;- ;+ ; :Params: ; sza : in, required, type=double ; The Solar Zenith Angle, in degrees used to compute the altitude. The ; sza is bound from 0 to 90 degrees. ; ; :Returns: ; Returns the computed altitude, in kilometers, which is bound from 53km ; to 110km. ;- function sza_alt,sza if ~real_numeric_type(sza) then begin doc_library, 'sza_alt' return, -1 endif sza_x=[0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0,90.0,92.5,95.0] alt_y=[53.4130,53.4319,53.4904,53.6093,53.7977,54.0812,54.5244,55.4421,57.3910,59.7231,66.1693,75.2379,93.9918] computed_altitude=interpol(alt_y,sza_x,sza,/quadratic)<110 ; Ignore floating-point operand errors due to invalid inputs result = check_math(mask=128) return,computed_altitude ; return,(1+(sza/90)^8)*55<110 ;55km at zero SZA, growing to 110km at 90 SZA in a smooth curve, capped at 110km end