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
get_orbit_nr()
: to get the orbit number corresponding to the specified timeget_pericenter()
: To get the time of the pericenter for the given orbit numberget_start_time()
: To get the start time of the given orbit numberget_stop_time()
: To get the stop time of the given orbit number
>>> 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/')
- 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
- 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