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 If ormm 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/’)

show_list()[source]
get_pericenter(onr)[source]

Return the pericenter time in datetime instance.

Parameters

onr – Orbit number

get_start(onr)[source]
get_stop(onr)[source]
get_orbit_nr(t)[source]

Return the orbit number corresponding to the given time.

Parameters

t (datetime.datetime) – Time

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
irfpy.mexpvat.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))
2005-06-07 13:16:15
irfpy.mexpvat.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))
2005-06-07 19:59:27