Geometry#

The geometry package provides routines for projecting and de-projecting sky images.

mpol.geometry.flat_to_observer(x: Tensor, y: Tensor, omega: float = 0.0, incl: float = 0.0, Omega: float = 0.0) tuple[Tensor, Tensor][source]#

Rotate the frame to convert a point in the flat (x,y,z) frame to observer frame (X,Y,Z).

It is assumed that the +Z axis points towards the observer. It is assumed that the model is flat in the (x,y) frame (like a flat disk), and so the operations involving z are neglected. But the model lives in 3D Cartesian space.

In order,

  1. rotate about the z axis by an amount omega -> x1, y1, z1

  2. rotate about the x1 axis by an amount -incl -> x2, y2, z2

  3. rotate about the z2 axis by an amount Omega -> x3, y3, z3 = X, Y, Z

Inspired by exoplanet/keplerian.py

Note that the (x,y) here are not the same as the x_centers_2D or y_centers_2D attached to the mpol.coordinates.GridCoords object. The (x,y) referred to here are the ‘perifocal frame’ of the orbit, whereas the (X,Y,Z) are the sky or observer frame. Typically, the sky observer frame is oriented such that X is North (pointing up) and Y is East (pointing left). For more detail, see the exoplanet docs or Murray and Correia.

Parameters:
  • x (torch.Tensor) – A tensor representing the x coordinate in the plane of the orbit.

  • y (torch.Tensor) – A tensor representing the y coordinate in the plane of the orbit.

  • omega (float) – Argument of periastron [radians]. Default 0.0.

  • incl (float) – Inclination value [radians]. Default 0.0.

  • Omega (float) – Position angle of the ascending node in [radians]. Default 0.0

Returns:

Two tensors representing (X, Y) in the observer frame.

Return type:

2-tuple of torch.Tensor

mpol.geometry.observer_to_flat(X: Tensor, Y: Tensor, omega: float = 0.0, incl: float = 0.0, Omega: float = 0.0) tuple[Tensor, Tensor][source]#

Rotate the frame to convert a point in the observer frame (X,Y,Z) to the flat (x,y,z) frame.

It is assumed that the +Z axis points towards the observer. The rotation operations are the inverse of the flat_to_observer() operations.

In order,

  1. inverse rotation about the Z axis by an amount Omega -> x2, y2, z2

  2. inverse rotation about the x2 axis by an amount -incl -> x1, y1, z1

  3. inverse rotation about the z1 axis by an amount omega -> x, y, z

Inspired by exoplanet/keplerian.py

Note that the (x,y) here are not the same as the x_centers_2D or y_centers_2D attached to the mpol.coordinates.GridCoords object. The (x,y) referred to here are the ‘perifocal frame’ of the orbit, whereas the (X,Y,Z) are the sky or observer frame. Typically, the sky observer frame is oriented such that X is North (pointing up) and Y is East (pointing left). For more detail, see the exoplanet docs or Murray and Correia.

Parameters:
  • X (torch.Tensor) – A tensor representing the x coordinate in the plane of the sky.

  • Y (torch.Tensor) – A tensor representing the y coordinate in the plane of the sky.

  • omega (float) – A tensor representing an argument of periastron [radians] Default 0.0.

  • incl (float) – A tensor representing an inclination value [radians]. Default 0.0.

  • Omega (float) – A tensor representing the position angle of the ascending node in [radians]. Default 0.0

Returns:

Two tensors representing (x, y) in the flat frame.

Return type:

2-tuple of torch.Tensor