irfpy.vexpvat.orbnum

Module for orbit number

Preparation

The orbit number data is retrieved from SPICE kernel. The needed file is usually with the name of ORVV_MERGED_xxxxx.ORB where xxxxx is a version number.

Prepare the irfpy setting file, ~/.irfpyrc with the following:

[vexpvat]
orbnruri = /path/to/the/directory/including/kernel/file/

Usage

Simply call the following functions

>>> import datetime
>>> print(get_orbit_nr(datetime.datetime(2009, 3, 15, 13, 0, 0)))
1059
>>> print(get_pericenter(1059))
2009-03-15 05:14:59
class irfpy.vexpvat.orbnum.OrbnumKernel(orvvuri)[source]

Bases: object

Orbit number kernel.

Note

This class provides low-level handling of kernel file. Use high level functions as

Open the ORVV file.

Parameters

orvv – ORVV file name, or the directory that contains the file. Orbit number kernel file. If orvv is a local directory name, the file with the largest version number is used.

>>> s = orbnum.OrbnumKernel('/Volumes/scidata/data/venus/spice/kernels/orbnum/ORVV_MERGED_00356.ORB')   
>>> s = orbnum.OrbnumKernel('/Volumes/scidata/data/venus/spice/kernels/orbnum/')   
show_list()[source]
get_pericenter(onr)[source]

Return the pericenter time in datetime instance.

Parameters

onr – Orbit number

get_orbit_nr(t)[source]

Return the orbit number corresponding to the given time.

Parameters

t (datetime.datetime) – Time

get_start(onr)[source]

Start time of the corresponding orbit number

Parameters

onr – Orbit number

Returns

The start time

get_stop(onr)[source]

End time of the corresponding orbit number

Parameters

onr – Orbit number

Returns

The end time

irfpy.vexpvat.orbnum.default_orbnum()[source]

Return the Orbnum class with default setting.

You have to add vexpvat orbnrfile entry in RC.

>>> onr = default_orbnum()
irfpy.vexpvat.orbnum.get_orbit_nr(t)[source]

Return the orbit number for the specified time.

Parameters

t – Time

Returns

The orbit number

>>> import datetime
>>> t = datetime.datetime(2011, 3, 15, 10, 30)
>>> onr = get_orbit_nr(t)
>>> print(onr)
1789
irfpy.vexpvat.orbnum.get_pericenter(onr)[source]

Return the time of pericener

Parameters

onr – Orbit number

Returns

The time of the pericenter

>>> t = get_pericenter(1789)
>>> print(t)
2011-03-15 03:33:07
irfpy.vexpvat.orbnum.get_start_time(onr)[source]

Return the start time of the orbit

Parameters

onr – Orbit number.

Returns

The start time

>>> print(get_start_time(1789))
2011-03-14 15:32:39
irfpy.vexpvat.orbnum.get_stop_time(onr)[source]

Return the stop time of the orbit

Parameters

onr – Orbit number.

Returns

The stop time

>>> print(get_stop_time(1789))
2011-03-15 15:33:36