TwiceAsNice
2019-02-18
|
Functions | |
int | fs_sexa (char *out, double a, int w, int fracbase) |
Converts a sexagesimal number to a string. More... | |
int | f_scansexa (const char *str0, double *dp) |
convert sexagesimal string str AxBxC to double. More... | |
int | extractISOTime (const char *timestr, struct ln_date *iso_date) |
Extract ISO 8601 time and store it in a tm struct. More... | |
void | getSexComponents (double value, int *d, int *m, int *s) |
void | getSexComponentsIID (double value, int *d, int *m, double *s) |
int | numberFormat (char *buf, const char *format, double value) |
Fill buffer with properly formatted INumber string. More... | |
const char * | timestamp () |
Create an ISO 8601 formatted time stamp. More... | |
double | rangeHA (double r) |
rangeHA Limits the hour angle value to be between -12 —> 12 More... | |
double | range24 (double r) |
range24 Limits a number to be between 0-24 range. More... | |
double | range360 (double r) |
range360 Limits an angle to be between 0-360 degrees. More... | |
double | rangeDec (double r) |
rangeDec Limits declination value to be in -90 to 90 range. More... | |
double | get_local_sidereal_time (double longitude) |
get_local_sidereal_time Returns local sideral time given longitude and system clock. More... | |
double | get_local_hour_angle (double local_sideral_time, double ra) |
get_local_hour_angle Returns local hour angle of an object More... | |
int extractISOTime | ( | const char * | timestr, |
struct ln_date * | iso_date | ||
) |
Extract ISO 8601 time and store it in a tm struct.
timestr | a string containing date and time in ISO 8601 format. |
iso_date | a pointer to a ln_date structure to store the extracted time and date (libnova). |
int f_scansexa | ( | const char * | str0, |
double * | dp | ||
) |
convert sexagesimal string str AxBxC to double.
x can be anything non-numeric. Any missing A, B or C will be assumed 0. Optional - and + can be anywhere.
str0 | string containing sexagesimal number. |
dp | pointer to a double to store the sexagesimal number. |
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[].
out | a pointer to store the sexagesimal number. |
a | the sexagesimal number to convert. |
w | the number of spaces in the whole part. |
fracbase | is the number of pieces a whole is to broken into; valid options:
|
double get_local_hour_angle | ( | double | local_sideral_time, |
double | ra | ||
) |
get_local_hour_angle Returns local hour angle of an object
local_sideral_time | Local Sideral Time |
ra | RA of object |
double get_local_sidereal_time | ( | double | longitude | ) |
get_local_sidereal_time Returns local sideral time given longitude and system clock.
longitude | Longitude in INDI format (0 to 360) increasing eastward. |
void getSexComponents | ( | double | value, |
int * | d, | ||
int * | m, | ||
int * | s | ||
) |
void getSexComponentsIID | ( | double | value, |
int * | d, | ||
int * | m, | ||
double * | s | ||
) |
int numberFormat | ( | char * | buf, |
const char * | format, | ||
double | value | ||
) |
Fill buffer with properly formatted INumber string.
buf | to store the formatted string. |
format | format in sprintf style. |
value | the number to format. |
double range24 | ( | double | r | ) |
range24 Limits a number to be between 0-24 range.
r | number to be limited |
double range360 | ( | double | r | ) |
range360 Limits an angle to be between 0-360 degrees.
r | angle |
double rangeDec | ( | double | r | ) |
rangeDec Limits declination value to be in -90 to 90 range.
r | declination angle |
double rangeHA | ( | double | r | ) |
rangeHA Limits the hour angle value to be between -12 —> 12
r | current hour angle value |
const char * timestamp | ( | ) |
Create an ISO 8601 formatted time stamp.
The format is YYYY-MM-DDTHH:MM:SS