Logo
  • GETTING STARTED
  • SCIENCE
  • FUNCTIONS

EXAMPLES

  • Time Phase Relation Theoretical
  • Doppler Theoretical in four scenarios
  • Density Through the Orbit and Absorption Column
  • Density and Ionization Parameter in the Orbital Path of Radiation
  • Ionization Map of 4U0114+65
  • Ns pulse shape in Vela X-1
  • Fe XXV Doppler Shifts Cen X-3
  • CONTRIBUTE
  • REFERENCES
xraybinaryorbit
  • EXAMPLES
  • Time Phase Relation Theoretical

Third Kepler's Law¶

In the case of eccentric orbits, the compact object travels at different velocities throughout the orbit, moving faster at periastron (the closest point to the star) and slower at apoastron (the farthest point from the star).

This function uses the principle of constant areolar velocity, which states that a line segment joining a compact object and the donnor star sweeps out equal areas during equal intervals of time. This principle provides a good and easy approximation for translating orbital phase to time and vice versa.

In [1]:
Copied!
import xraybinaryorbit
from xraybinaryorbit import *
import xraybinaryorbit from xraybinaryorbit import *

HELLO, nice to see you! :)

PLEASE READ THIS, IT'S VERY IMPORTANT:

These are the units that must be used within this package:

- Rstar: Solar radius
- Mstar: Solar masses
- Inclination: Sexagesimal degrees
- Periapsis: Sexagesimal degrees
- Semimajor: Stellar radius
- Periods: Days (Periods in the case of the period_sliding_window function will support any units)
- Iphase: Radians

A list of the functions contained in this package will be displayed by runing the function list_functions().

As these functions use a lot of parameters, which can sometimes be difficult to handle, we have implemented a user-friendly method for parameter input:
A form will be displayed, and the parameters will be saved in the directory for further interactions. These saved parameters will be used if new parameters are not provided.
For the function to work, the submit button must be pressed.
If the parameters are already saved within the working directory, setting "load_directly=True" no form will be displayed and that parameters will be used within the function.
Alternatively, the parameters can be provided as lists in the following format: parameter_list=[parameters] for the theoretical functions or as bound_list = [lower_bounds], [upper_bounds] for the fitting functions.

Please, take into account that fits in general will take A LOT of time to complete.

If you need help, contact graciela.sanjurjo@ua.es.

In [2]:
Copied!
orbital_phase_to_time?
orbital_phase_to_time?
Signature:
orbital_phase_to_time(
    ph,
    precision=0.01,
    load_directly=False,
    parameter_list=None,
)
Docstring:
Convert orbital phase to time using the shared helper implementation.

The spatial scale and component masses are unnecessary for this conversion
when the orbital period is supplied directly, so the public interface keeps
only the four parameters required by the calculation.

Parameters
----------
ph : array-like
    Orbital phase array.
precision : float, optional
    Resolution of the internal phase grid. Default is 0.01.
load_directly : bool, optional
    Passed to ``_manage_parameters``.
parameter_list : sequence, optional
    Values for ``iphase``, ``orbitalperiod``, ``eccentricity`` and
    ``periapsis``.

Returns
-------
ph : numpy.ndarray
    Input orbital phases.
time : numpy.ndarray
    Time corresponding to each phase, in seconds.
W : numpy.ndarray
    Orbital angular velocity, in rad s^-1.
File:      ~/Desktop/git/xraybinaryorbit/xraybinaryorbit/theoretical/orbital_velocity_related.py
Type:      function
In [3]:
Copied!
ph=np.arange(0,1,0.010)

phase,time, W= orbital_phase_to_time(ph,precision=0.0001, load_directly=True)
plt.plot(time, phase)
plt.plot(phase,W)
plt.xlabel("Time (s)")
plt.ylabel("Orbital phase")
ph=np.arange(0,1,0.010) phase,time, W= orbital_phase_to_time(ph,precision=0.0001, load_directly=True) plt.plot(time, phase) plt.plot(phase,W) plt.xlabel("Time (s)") plt.ylabel("Orbital phase")
iphase: 0.0
orbitalperiod: 2.0
eccentricity: 0.2
periapsis: 200.0
Out[3]:
Text(0, 0.5, 'Orbital phase')
No description has been provided for this image
In [4]:
Copied!
plt.plot(ph, W)
plt.plot(ph, W)
Out[4]:
[<matplotlib.lines.Line2D at 0x151539bb0>]
No description has been provided for this image
In [5]:
Copied!
t = np.arange(0,4*24*60*60)
phase,time,W= orbital_time_to_phase(t ,precision=0.001,load_directly=True)
plt.plot(time, phase)
t = np.arange(0,4*24*60*60) phase,time,W= orbital_time_to_phase(t ,precision=0.001,load_directly=True) plt.plot(time, phase)
iphase: 0.0
orbitalperiod: 2.0
eccentricity: 0.2
periapsis: 200.0
Out[5]:
[<matplotlib.lines.Line2D at 0x151821a30>]
No description has been provided for this image
In [6]:
Copied!
t = np.array([0,0.2*24*60*60,1*24*60*60,1.5*24*60*60,3*24*60*60 ])
phase,time,W= orbital_time_to_phase(t ,precision=0.001,load_directly=True)
plt.plot(time, W,".")
t = np.array([0,0.2*24*60*60,1*24*60*60,1.5*24*60*60,3*24*60*60 ]) phase,time,W= orbital_time_to_phase(t ,precision=0.001,load_directly=True) plt.plot(time, W,".")
iphase: 0.0
orbitalperiod: 2.0
eccentricity: 0.2
periapsis: 200.0
Out[6]:
[<matplotlib.lines.Line2D at 0x15180a540>]
No description has been provided for this image
In [ ]:
Copied!

Previous Next

Built with MkDocs using a theme provided by Read the Docs.
« Previous Next »