%------------------------------------------------------------------------------------------------------------- % Getting coordinates of observer, after function set_observer(). Output in degree, % Reference: http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/MATLAB/ % Tested : Matlab R2011b % By : Poltavsky Sasha 04.05.2012 % URL : www.bible-exodus.narod2.ru/articles/astro_ephemeris/jpl_ephemeris/jpl_ephemeris.html#get_kernel_data %-------------------------------------------------------------------------------------------------------------- function [lat, lon, alt, sslat, sslon] = get_observer (observer, varargin) if nargin == 0 ; observer = 'DYN'; end [val, found] = cspice_gdpool( horzcat('TKFRAME_',observer, '_TOPO_ANGLES'), 2, 1 ); lat=90+val; if ~found; error(horzcat('the latitude of ',observer,' was not found in the pool!')); end [val, found] = cspice_gdpool( horzcat('TKFRAME_',observer, '_TOPO_ANGLES'), 1 ,1); lon= - val; if ~found; error(horzcat('the longtitude of ',observer,' was not found in the pool!')); end %[val, found] = cspice_gdpool( horzcat('TKFRAME_',observer, '_TOPO_ALT'), 1 ,1); alt = val; %[alt, found] = cspice_gdpool( horzcat(observer, '_LATLON'), 3 ,1); %if ~found; error(horzcat('the altitude of ',observer,' was not found in the pool!')); end alt=0; if lat < 0; sslat = sprintf('% 2.2fS',abs(lat)); else sslat = sprintf('% 2.2fN',abs(lat)); end if lon < 0; sslon = sprintf('% 2.2fW',abs(lon)); else sslon = sprintf('% 2.2fE',abs(lon)); end end