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 vvy: The y coordinate of the vector vvz: The z coordinate of the vector vkx: The x coordinate of the unit vector kky: The y coordinate of the unit vector kkz: The z coordinate of the unit vector ktheta: 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 skyy: The y coordinate of the planet’s position on the skyz: The z coordinate of the planet’s position on the skyvx: The x coordinate of the planet’s velocity on the skyvy: The y coordinate of the planet’s velocity on the skyvz: The z coordinate of the planet’s velocity on the skyLambda: The latitudinal hotspot offset in radians (north positive)Phi: The longitudinal hotspot offset in radians (east positive)theta: The eyeball phase anglegamma: 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 baseexp: 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
occultedby the body(ies) of index(ices)occultors.- Return
- The error code
- Parameters
nt: The size of the time arraytime: The array of times at which to evaluate the orbitsnp: The number of particles (bodies) in the systembody: An array of BODY pointers corresponding to all the bodies in the systemsettings: An instance of the SETTINGS class containing all settingsocculted: The index of the body being occultednoccultors: Size of occultor arrayoccultors: The indices of the occultors ofoccultednoccultations: The number of occultations to look foroccultation_times: The times of each of the occultations, computed by this functionoccultation_inds: The indices of the occultors corresponding to each of the occultations identified by this functionoccultation_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
-
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 arraytime: The array of times at which to evaluate the orbitsnw: The size of the wavelength gridwavelength: The wavelength grid in micronscontinuum: The continuum flux (i.e., the total flux without occultations) of the system on a time/wavelength gridnp: The number of particles (bodies) in the systembody: An array of BODY pointers corresponding to all the bodies in the systemsettings: An instance of the SETTINGS class containing all settings