%------------------------------------------------------------------------------------------------------------- % Setting coordinates of observer, input 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 [observer, frame] = set_observer (lat, lon, alt, varargin) if nargin == 1; name = lat; [~ , found] = cspice_bods2c(name); if (found); observer = name; frame = strcat(observer,'_TOPO'); else disp('The point of surface or the frame DYN_TOPO for the body are not specified') end else if nargin == 2; observer = 'DYN'; frame = strcat(observer,'_TOPO'); alt=0; end if nargin == 3; observer = 'DYN'; frame = strcat(observer,'_TOPO'); end cspice_pdpool('TKFRAME_DYN_TOPO_ANGLES',[-lon; -90 + lat; 180]); cspice_lmpool(horzcat('DYN_LATLON = (', num2str(lat), ',', num2str(lon), ',', num2str(alt), ' )' )); %cspice_lmpool(horzcat('TKFRAME_DYN_TOPO_ALT = (',num2str(alt),' )')); end return