Skip to content

vancky/callHorizonMatlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

callHorizonMatlab

Call horizons online matlab version . A matlab version of callhorizons. But not the same ,you have to read horizons_doc carefully ,and check the data carefully .

Baisc Useage

download file queryHorizons.m in your matlab path

runtests('queryHorizonsTest');% run the test

Initialization for discrete epochs ,only supply for the jd or mjd format,you can use cspice to do more time transform.

A test script is added for use of doing scripts to get ephemeris from JPL

target=queryHorizons('499');% for Mars 
target=target.set_discreteepochs([2457446.177083, 2457446.182343,2457448.182343]);
target=target.get_ephemerides('O44');% lijiang Station
% you can get elements like 
target=target.get_elements() % sun centered
target=target.get_elements('SSB') % SSB centered

initialization for equal interval epochs, supply for format 'YYYY-MM-DD [HH-MM-SS]'

target=queryHorizons('Ceres');
target=target.set_epochrange('2016-02-26', '2016-10-25', '1d')
target=target.get_ephemerides('O44');
target=target.get_vectors();% get vector in (J2000,  earth mean equator plane,SSB center)

get data

''''
target.originSrc % the origin source from Horizon 
target.data      % the formated ephemrides from source , a matlab table format 
target.official_name % check the name of object
target.getitme('RA',1)  % get the first RA
target.data{1,'RA'} % the same to the up 
target.getitme('RA',:)  % get all RA  
target.fields % show all items  
''''

importants

  • get_ephemerides , default station is O44(lijiang Observatory,you can change it in line 278),default reference system is J2000
  • get_elements,default center is 10(sun,you can change it in line 444),default reference frame is J2000,default reference plane is ecliptic and mean equinox of J2000.
  • get_vectors ,default center is 0(Solar System barycenter,SSB), default reference frame is J2000,default reference plane is earth mean equator and equinox . Any suggests or comments ,contact vanckyli[at]gmail.com ! Have fun!
  • when run test file failed ,you may set a break point in the last lines of get_ephemerides() or get_elements() or get_vectors() functions, to the print src(pos4:pos5) and comparison with self.data table !Sometimes , it is failed for JPL updating it's ephemeris !

Releases

No releases published

Packages

No packages published

Languages