Main TPM functions¶
- pytpm.tpm.tpm_state(s)¶
Return state name given state id.
Given an integer id for a state, this function returns a descriptive name for the state.
Parameters : s : int
State id.
Returns : n : str
State name.
Examples
>>> tpm.tpm_state(tpm.TPM_S06) 'Helio. mean FK5' >>> tpm.tpm_state(tpm.TPM_S04) 'IAU 1958 Galactic' >>> tpm.tpm_state(tpm.TPM_S20) 'Topo. obs. HA/Dec' >>> tpm.tpm_state(tpm.TPM_S19) 'Topo. obs. Az/El'
- pytpm.tpm.tpm_data(tstate, action)¶
Compute and set dependent TSTATE data.
Given a TSTATE and an action, this function will perform the action and set the various dependent properties of the TSTATE object.
Parameters : tstate : tpm.TSTATE
The TPM state structure to be changed.
action : int
The action to perform.
Notes
The action can be one of
- TPM_INIT
Perform initialization.
- TPM_FAST
Calculate all fast changing properties.
- TPM_MEDIUM
Calculate all properties that change at a medium rate.
- TPM_SLOW
Calculate all properties that change slowly.
- TPM_REFRACTION
Cacluate refraction coefficients.
- TPM_ALL
Perform all calculations except TPM_REFRACTION.
The TPM manual has more details on these quantities.
- pytpm.tpm.proper_motion(v6, end, start)¶
Apply proper motion to the given V6C vector.
Parameters : v6 : tpm.V6C
A V6C object containing positions and velocities.
end : float
Ending/final time in days (can be Julian date).
start : float
Starting/initial time in days (can be Julian date).
Returns : v : tpm.V6C
A V6C object containing the new position.
Notes
Given starting time and end time, this function applies proper motion to the coordinates in the given V6C object. A simple linear multiplication of velocity with time is performed, followed by addition of this increment to the position coordinates.
The difference, end - start, should be the number of days in the time interval. Hence Julian dates can be used. The velocities in V6C are stored as AU/day and hence time interval must be in days.
- pytpm.tpm.tpm(pvec, s1, s2, ep, eq, tstate)¶
Apply transition between to states.
On completion the pvec object will contain state vectors obtained during all transitions needed for the s1 to s2 transition. Specifically, pvec[s2] will have the V6C vector corresponding to the target state s2.
Parameters : pvec : tpm.PVEC
A PVEC object with appropriate V6 members.
s1 : int
Starting state (0 <= s1 < N_TPM_STATES).
s2 : int
End state (0 <= s2 < N_TPM_STATES).
ep : float
Epoch of state vector corresponding to s1, as a Julian date.
eq : float
Equinox as a Julian date. It can be of s1 and or s2, depending on the specific transition.
tstate : tpm.TSTATE
A TSTATE object with appropriate initial values.
Returns : s : int
Final state (must be equal to s2).
Notes
This is the main TPM function. It looks up the state tables and performs all required transformations to take the state vector at pvec[s1] from state s1 to state s2. It stores the resulting state vector in pvec[s2]. Intermediate states are stored in their respective positions in pvec.
For more information see the TPM manual.