Position of Chandrayaan-1

One line solution: irfpy.cy1orb.pvat2 module. It does not use SPICE.

Setup

Prepare the dataset, and specify it to .irfpyrc.

[cy1orb]
pvatbase=file:///Users/futaana/mnt/moon/saraopvat

Usage

To get the position of spacecraft, one can use either of the function.

>>> import datetime
>>> from irfpy.cy1orb import pvat2 as pvat
>>> t = datetime.datetime(2009, 5, 10, 3, 10)
>>> pos_lse = pvat.getlsepos(t)
>>> print(pos_lse)

Notes on dataset (Advanced topic)

The orbit and attitude data is stored in a gzip ascii data files, and placed in a directory. The time resolution is 1 sec, and the functions in pvat2 module return in most cases the data at the neighboring time of the specified time.

In this sense, the following two data must return the same values.

>>> t0 = datetime.datetime(2009, 1, 30, 13, 59, 28, 900000)
>>> t1 = datetime.datetime(2009, 1, 30, 13, 59, 29, 100000)
>>> pos0 = getmepos(t0)
>>> pos1 = getmepos(t1)
>>> print(pos0 == pos1)
True

But the following return the different value.

>>> t2 = datetime.datetime(2009, 1, 30, 13, 59, 29, 600000)
>>> pos2 = getmepos(t2)
>>> print(pos0 == pos2)
False