84int tty_read(
int fd,
char *buf,
int nbytes,
int timeout,
int *nbytes_read);
99int tty_read_expanded(
int fd,
char *buf,
int nbytes,
long timeout_seconds,
long timeout_microseconds,
int *nbytes_read);
109int tty_read_section(
int fd,
char *buf,
char stop_char,
int timeout,
int *nbytes_read);
137int tty_nread_section(
int fd,
char *buf,
int nsize,
char stop_char,
int timeout,
int *nbytes_read);
153long timeout_microseconds,
183int tty_connect(
const char *
device,
int bit_rate,
int word_size,
int parity,
int stop_bits,
int *
fd);
196void tty_error_msg(
int err_code,
char *err_msg,
int err_msg_len);
253int fs_sexa(
char *out,
double a,
int w,
int fracbase);
282 int numberFormat(
char *buf,
const char *format,
double value);
346 void get_hrz_from_equ(
struct ln_equ_posn *
object,
struct ln_lnlat_posn *observer,
double JD,
struct ln_hrz_posn *position);
355 void get_equ_from_hrz(
struct ln_hrz_posn *
object,
struct ln_lnlat_posn *observer,
double JD,
356 struct ln_equ_posn *position);
398 double rad2as(
double rad);
410 double m2au(
double m);
419 double calc_delta_magnitude(
double mag_ratio,
double *spectrum,
double *ref_spectrum,
int spectrum_size);
428 double calc_photon_flux(
double rel_magnitude,
double filter_bandwidth,
double wavelength,
double steradian);
437 double calc_rel_magnitude(
double photon_flux,
double filter_bandwidth,
double wavelength,
double steradian);
479 void baseline_2d_projection(
double alt,
double az,
double baseline[3],
double wavelength,
double uvresult[2]);
double estimate_secondary_size(double star_size, double dropoff_ratio)
estimate the size of an object occulting a star in star_size units.
int tty_write_string(int fd, const char *buffer, int *nbytes_written)
Writes a null terminated string to fd.
void tty_set_generic_udp_format(int enabled)
double estimate_geocentric_elevation(double latitude, double sea_level_elevation)
estimate_geocentric_elevation Returns an estimation of the actual geocentric elevation
double rangeDec(double r)
rangeDec Limits declination value to be in -90 to 90 range.
double calc_rel_magnitude(double photon_flux, double filter_bandwidth, double wavelength, double steradian)
calc_rel_magnitude Returns the relative magnitude of the object with the given photon flux measured a...
double estimate_secondary_mass(double star_mass, double star_drift, double orbit_radius)
estimate the mass of an object with known mass orbiting around a star.
void baseline_2d_projection(double alt, double az, double baseline[3], double wavelength, double uvresult[2])
baseline_2d_projection Returns the coordinates of the projection of a single baseline targeting the o...
int tty_read_section(int fd, char *buf, char stop_char, int timeout, int *nbytes_read)
read buffer from terminal with a delimiter
void getSexComponentsIID(double value, int *d, int *m, double *s)
int f_scansexa(const char *str0, double *dp)
convert sexagesimal string str AxBxC to double. x can be anything non-numeric. Any missing A,...
double get_local_hour_angle(double local_sidereal_time, double ra)
get_local_hour_angle Returns local hour angle of an object
int tty_connect(const char *device, int bit_rate, int word_size, int parity, int stop_bits, int *fd)
Establishes a tty connection to a terminal device.
double calc_photon_flux(double rel_magnitude, double filter_bandwidth, double wavelength, double steradian)
calc_photon_flux Returns the photon flux of the object with the given magnitude observed at a determi...
void tty_set_debug(int debug)
tty_set_debug Enable or disable debug which prints verbose information.
void get_alt_az_coordinates(double hour_angle, double dec, double latitude, double *alt, double *az)
get_alt_az_coordinates Returns alt-azimuth coordinates of an object
double estimate_field_rotation_rate(double Alt, double Az, double latitude)
estimate_field_rotation_rate Returns an estimation of the field rotation rate of the object
double estimate_distance(double parsecs, double parallax_radius)
estimate_distance Convert parallax arcseconds into meters
double estimate_orbit_radius(double obs_lambda, double ref_lambda, double period)
estimate the orbit radius of an object with known mass orbiting around a star.
double get_local_sidereal_time(double longitude)
get_local_sidereal_time Returns local sidereal time given longitude and system clock.
int tty_disconnect(int fd)
Closes a tty connection and flushes the bus.
const char * SolarSystem[]
void tty_set_auto_reset_udp_session(int flag)
automatically reset UDP session on write
int tty_timeout_microseconds(int fd, long timeout_seconds, long timeout_microseconds)
double rangeHA(double r)
rangeHA Limits the hour angle value to be between -12 —> 12
void getSexComponents(double value, int *d, int *m, int *s)
int tty_read(int fd, char *buf, int nbytes, int timeout, int *nbytes_read)
read buffer from terminal
double estimate_absolute_magnitude(double dist, double delta_mag)
estimate_absolute_magnitude Returns an estimation of the absolute magnitude of an object given its di...
double range180(double r)
range180 Limits an angle to be between -180 to +180 degrees
double m2au(double m)
m2au Convert meters into astronomical units
double range24(double r)
range24 Limits a number to be between 0-24 range.
int tty_read_section_expanded(int fd, char *buf, char stop_char, long timeout_seconds, long timeout_microseconds, int *nbytes_read)
read buffer from terminal with a delimiter
void get_hrz_from_equ(struct ln_equ_posn *object, struct ln_lnlat_posn *observer, double JD, struct ln_hrz_posn *position)
get_hrz_from_equ Calculate horizontal coordinates from equatorial coordinates.
double estimate_field_rotation(double hour_angle, double field_rotation_rate)
estimate_field_rotation Returns an estimation of the field rotation rate of the object
const char * indi_timestamp()
Create an ISO 8601 formatted time stamp. The format is YYYY-MM-DDTHH:MM:SS.
int tty_timeout(int fd, int timeout)
double as2rad(double as)
as2rad Convert arcseconds into radians
double estimate_star_mass(double delta_mag, double ref_mass)
estimate the star mass in ref_size units e.g. sun masses or kgs
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
double baseline_delay(double alt, double az, double baseline[3])
baseline_delay Returns the delay in meters of a single baseline targeting the object by coordinates
void tty_error_msg(int err_code, char *err_msg, int err_msg_len)
Retrieve the tty error message.
int tty_write(int fd, const char *buffer, int nbytes, int *nbytes_written)
Writes a buffer to fd.
void tty_reset_udp_session(int fd, int only_if_timeout_happened)
create new UDP session to prevent packet conflict
double time_ns()
Get a unix timestamp with nanosecond precision.
double calc_delta_magnitude(double mag_ratio, double *spectrum, double *ref_spectrum, int spectrum_size)
calc_delta_magnitude Returns the difference of magnitudes given two spectra
int extractISOTime(const char *timestr, struct ln_date *iso_date)
Extract ISO 8601 time and store it in a tm struct.
void get_equ_from_hrz(struct ln_hrz_posn *object, struct ln_lnlat_posn *observer, double JD, struct ln_equ_posn *position)
ln_get_equ_from_hrz Calculate Equatorial EOD Coordinates from horizontal coordinates
int fs_sexa(char *out, double a, int w, int fracbase)
Converts a sexagesimal number to a string. sprint the variable a in sexagesimal format into out[].
int numberFormat(char *buf, const char *format, double value)
Fill buffer with properly formatted INumber string.
int tty_nread_section(int fd, char *buf, int nsize, char stop_char, int timeout, int *nbytes_read)
read buffer from terminal with a delimiter
int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long timeout_microseconds, int *nbytes_read)
read buffer from terminal with a delimiter
void tty_clr_trailing_read_lf(int enabled)
void tty_set_gemini_udp_format(int enabled)
int tty_nread_section_expanded(int fd, char *buf, int nsize, char stop_char, long timeout_seconds, long timeout_microseconds, int *nbytes_read)
read buffer from terminal with a delimiter
double rad2as(double rad)
rad2as Convert radians into arcseconds
std::vector< uint8_t > buffer