Observer¶
A PyGRO object that defines a given observer in space-time. Useful to assign initial conditions to Geodesic objects.
- class pygro.observer.Observer[source]View on GitHub¶
The
Observerclass represent PyGRO representation of physical observers in space-time. It is built by specifying either a frame or a co-frame uniquely identifying a tetrad in space-time. This can than be used to fire geodesics from the observer’s position giving a physical meaning to the intial values of the 4-velocity components for the integrated geodesic.- __init__(metric: Metric | None, x: Sequence[int | float], frame: list[str] | None = None, coframe: list[str] | None = None)[source]View on GitHub¶
Initializes the
Observerclass. Accepts the following arguments:- Parameters:
metric (Metric) – The
Metricobject to link to theGeodesicEngineand from which the geodesic equations and all the related symbolic quantities are retrieved. If not provided, theGeodesicEnginewill be linked to the last initializedMetric.x (Sequence[Union[int, float]]) – The space-time position of the observer (must be a 4-dimensional array of numbers).
frame/coframe (list[str]) – The symbolic definitions of either the observer’s frame or coframe in the tetrad formalism (accepts a list of four strings, one for each tetrad). See the tutorial Define a space-time Observer for more details.
- convert_3vector(vector: Sequence[int | float], type: Literal['time-like', 'null'])[source]View on GitHub¶
Converts a 3-vector in the reference frame of the
Observerinto a 4-vector in space-time. The user must specify the components of the 3-vectorvand the desired 4-vectortypethat can either betime-likeorgeodesic.- Parameters:
vector (Sequence[Union[int, float]]) – A 3-dimensional sequence of numbers corresponding to the components of the 3-vector in the Observer’s reference frame.
type (Literal['time-like', 'null']) – The vector normalization. It accepts strings with either
"time-like"(\(g_{\mu\nu}u^\mu u^\nu = -1\)) or"null"(\(g_{\mu\nu}u^\mu u^\nu = 0\)).
- from_f1(theta_obs: float, phi_obs: float, type=typing.Literal['time-like', 'null'], v: float | None = None)[source]View on GitHub¶
Returns a 4-vector corresponding to the initial 4-velocity for a time-like or null geodesic (depending on the
typeargument) fired with anglestheta_obsandphi_obsfrom the \(f_1\) vector. See Define a space-time Observer for an illustrative example of this functionality.- Parameters:
theta_obs (float) – The angle \(\theta_{\rm obs}\) in the local observer’s frame.
phi_obs (float) – The angle \(\phi_{\rm obs}\) in the local observer’s frame.
type (Literal['time-like', 'null']) – The vector normalization. It accepts strings with either
"time-like"(\(g_{\mu\nu}u^\mu u^\nu = -1\)) or"null"(\(g_{\mu\nu}u^\mu u^\nu = 0\)).v (float) – The modulus of the spatial velocity of the geodesic. To be specified in the
time-like case.
- from_f2(theta_obs: float, phi_obs: float, type=typing.Literal['time-like', 'null'], v: float | None = None)[source]View on GitHub¶
As
from_f1()method, but for the vector \(f_2\).
- from_f3(theta_obs: float, phi_obs: float, type=typing.Literal['time-like', 'null'], v: float | None = None)[source]View on GitHub¶
As
from_f1()method, but for the vector \(f_3\).