irfpy.mexpvat.orbnum
¶
Module for orbit number
This module depends on the spice kernel file.
The file name is ORMM_MERGED_xxxxx.ORB
where
xxxxx is a version number.
You can specify the file name or give only directory name for auto detection.
Normally you cn start the OrbnumKernel class to instance, or simple use of method default_orbnum().
Note
Note that the script is a copy from vex version. Refactoring may construct simple structure, but due to time constraint, I kept it as independent module.
- class irfpy.mexpvat.orbnum.OrbnumKernel(ormmuri)[source]¶
Bases:
object
Open the ORMM file from a given URI.
- Parameters
ormm – ORMM uri. Orbit kernel file. If
ormm
specifies a file or a uri, the Iformm
is a local directory name (not starting with “file://”), the largest version number file inside the given directory is used as a file.
They are ok. > s = orbnum.OrbnumKernel(’http://rhea.umea.irf.se/~peje/mex/MEX/kernels/orbnum/ORMM_MERGED_00784.ORB’) > s = orbnum.OrbnumKernel(‘/Users/futaana/mnt/mars/spice/kernels/orbnum/ORMM_MERGED_00784.ORB’) > s = orbnum.OrbnumKernel(‘/Users/futaana/mnt/mars/spice/kernels/orbnum/’)
The last example is the most robust way of programing, as the update of the kernel file is automatically considered.
Note that this is not ok. > s = orbnum.OrbnumKernel(’file:///Users/futaana/mnt/venus/spice/kernels/orbnum/’)
- irfpy.mexpvat.orbnum.default_orbnum()[source]¶
Return the Orbnum class with default setting.
You have to add mexpvat orbnrfile entry in RC.
- irfpy.mexpvat.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) 9197
- irfpy.mexpvat.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) 2005-06-07 16:37:52