ppo.c

Main interface to the photodynamical routines.

Functions

void Rodrigues(double *vx, double *vy, double *vz, double kx, double ky, double kz, double theta)

The Rodrigues rotation formula in 3D, given a vector v, a unit vector k normal to the plane of rotation, and the angle of rotation theta in radians. The rotation is applied in-place to the vector v.

Parameters
  • vx: The x coordinate of the vector v
  • vy: The y coordinate of the vector v
  • vz: The z coordinate of the vector v
  • kx: The x coordinate of the unit vector k
  • ky: The y coordinate of the unit vector k
  • kz: The z coordinate of the unit vector k
  • theta: The angle of rotation in radians

void GetAngles(double x, double y, double z, double vx, double vy, double vz, double Lambda, double Phi, double *theta, double *gamma)

Computes the phase angle theta and the rotation angle gamma at a given point in a planet’s orbit.

Parameters
  • x: The x coordinate of the planet’s position on the sky
  • y: The y coordinate of the planet’s position on the sky
  • z: The z coordinate of the planet’s position on the sky
  • vx: The x coordinate of the planet’s velocity on the sky
  • vy: The y coordinate of the planet’s velocity on the sky
  • vz: The z coordinate of the planet’s velocity on the sky
  • Lambda: The latitudinal hotspot offset in radians (north positive)
  • Phi: The longitudinal hotspot offset in radians (east positive)
  • theta: The eyeball phase angle
  • gamma: The eyeball rotation angle

int ipow(int base, int exp)

Raises an integer to an integer power.

Return
The result of base^exponent
Parameters
  • base: The base
  • exp: The exponent

int NextOccultation(int nt, double time[nt], int np, BODY **body, SETTINGS settings, int occulted, int noccultors, int occultors[noccultors], int noccultations, double occultation_times[noccultations], int occultation_inds[noccultations], double occultation_durs[noccultations])

Computes the time(s) of the next occultation(s) of the body of index occulted by the body(ies) of index(ices) occultors.

Return
The error code
Parameters
  • nt: The size of the time array
  • time: The array of times at which to evaluate the orbits
  • np: The number of particles (bodies) in the system
  • body: An array of BODY pointers corresponding to all the bodies in the system
  • settings: An instance of the SETTINGS class containing all settings
  • occulted: The index of the body being occulted
  • noccultors: Size of occultor array
  • occultors: The indices of the occultors of occulted
  • noccultations: The number of occultations to look for
  • occultation_times: The times of each of the occultations, computed by this function
  • occultation_inds: The indices of the occultors corresponding to each of the occultations identified by this function
  • occultation_durs: The duration of each of the occultations identified by this function

int Orbits(int nt, double time[nt], int np, BODY **body, SETTINGS settings)

Evolves the orbital positions of all bodies forward in time with either a Keplerian or an N-body solver.

Return
The error code
Parameters
  • nt: The size of the time array
  • time: The array of times at which to evaluate the orbits
  • np: The number of particles (bodies) in the system
  • body: An array of BODY pointers corresponding to all the bodies in the system
  • settings: An instance of the SETTINGS class containing all settings

int Flux(int nt, double time[nt], int nw, double wavelength[nw], double continuum[nt *nw], int np, BODY **body, SETTINGS settings)

Computes the full light curve for all bodies in the system.

Return
The error code
Parameters
  • nt: The size of the time array
  • time: The array of times at which to evaluate the orbits
  • nw: The size of the wavelength grid
  • wavelength: The wavelength grid in microns
  • continuum: The continuum flux (i.e., the total flux without occultations) of the system on a time/wavelength grid
  • np: The number of particles (bodies) in the system
  • body: An array of BODY pointers corresponding to all the bodies in the system
  • settings: An instance of the SETTINGS class containing all settings