|
H3C HEALPix library for PostgreSQL
(version 1.2)
|
usefull functions in the library heaplix for PostgreSQL More...
#include <math.h>#include <sys/time.h>#include <time.h>#include "common.h"#include "h3c_util.h"#include "h3c_math.h"#include "h3cpp_healpix.h"#include <postgres.h>
Include dependency graph for h3c_util.c:Go to the source code of this file.
Macros | |
| #define | LIMIT_CIRCLE_ORDER_0 2/60. |
| get the ipix list of a cone and group them More... | |
| #define | LIMIT_POLYGONE_ORDER_0 1/60. |
| get the ipix list of a polygone and group them More... | |
Functions | |
| void | h3c_log (int level, char *fmt,...) |
| print statistics More... | |
| void | h3c_debug_init_clock () |
| initalize the debugger timer | |
| h3c_coord_t | h3c_theta2dec (h3c_coord_t theta) |
| get the declination from the theta value More... | |
| h3c_coord_t | h3c_dec2theta (h3c_coord_t dec) |
| get the theta value from the declination More... | |
| h3c_coord_t | h3c_phi2ra (h3c_coord_t phi) |
| get the right ascension from the phi value More... | |
| h3c_coord_t | h3c_ra2phi (h3c_coord_t ra) |
| get the phi value from the right ascension More... | |
| int | h3c_order (int nside) |
| get the order from the nside number More... | |
| h3c_ipix_t | h3c_npix (int nside) |
| get the number of ipix in the entire sphere More... | |
| h3c_coord_t | h3c_radius (int nside) |
| get the max radius of ipix for a given nside More... | |
| h3c_ipix_t * | h3c_disk_ipix (h3c_coord_t ra, h3c_coord_t dec, h3c_coord_t radius, int nside, int *count) |
| (c++ interface) get the ipix list of a cone More... | |
| h3c_coord_t | h3c_dist (h3c_coord_t ra1, h3c_coord_t dec1, h3c_coord_t ra2, h3c_coord_t dec2) |
| calculate the distance between 2 points More... | |
| h3c_coord_t | h3c_sindist (h3c_coord_t ra1, h3c_coord_t dec1, h3c_coord_t ra2, h3c_coord_t dec2) |
| calculate the sinus distance (to be compatible with Q3C) More... | |
| char | h3c_in_ellipse (h3c_coord_t alpha, h3c_coord_t delta0, h3c_coord_t alpha1, h3c_coord_t delta01, h3c_coord_t d0, h3c_coord_t e, h3c_coord_t PA0) |
| verify if a point is inside an ellipse More... | |
usefull functions in the library heaplix for PostgreSQL
Definition in file h3c_util.c.
| #define LIMIT_CIRCLE_ORDER_0 2/60. |
get the ipix list of a cone and group them
| ra | right ascension |
| dec | declination |
| radius | radius of the cone |
| nside | nside level |
| list | the list of ipix to return (OUT) |
| listsize | size of list |
ex: list=[1,3,4,4,6,8] => {1-3,4,6-8}
list[2n]=min of a subset, list[2n+1]=max of a subset
Definition at line 351 of file h3c_util.c.
| #define LIMIT_POLYGONE_ORDER_0 1/60. |
get the ipix list of a polygone and group them
| in_ra | |
| in_dec | |
| n | number of points |
| nside | nside level |
| list | the ipix list to fill |
| number | of element of the ipix list |
Definition at line 533 of file h3c_util.c.
| h3c_coord_t h3c_dec2theta | ( | h3c_coord_t | dec | ) |
get the theta value from the declination
| dec | declination |
Definition at line 136 of file h3c_util.c.
| h3c_ipix_t* h3c_disk_ipix | ( | h3c_coord_t | ra, |
| h3c_coord_t | dec, | ||
| h3c_coord_t | radius, | ||
| int | nside, | ||
| int * | count | ||
| ) |
(c++ interface) get the ipix list of a cone
| ra | right ascension |
| dec | declination |
| radius | radius of the cone |
| nside | nside level |
Definition at line 225 of file h3c_util.c.
References h3cpp_disk_ipix().
Here is the call graph for this function:| h3c_coord_t h3c_dist | ( | h3c_coord_t | ra1, |
| h3c_coord_t | dec1, | ||
| h3c_coord_t | ra2, | ||
| h3c_coord_t | dec2 | ||
| ) |
calculate the distance between 2 points
| ra1 | right ascention of the first point |
| dec1 | declination of the first point |
| ra2 | right ascention of the second point |
| dec2 | declination of the second point |
Definition at line 460 of file h3c_util.c.
| char h3c_in_ellipse | ( | h3c_coord_t | alpha, |
| h3c_coord_t | delta0, | ||
| h3c_coord_t | alpha1, | ||
| h3c_coord_t | delta01, | ||
| h3c_coord_t | d0, | ||
| h3c_coord_t | e, | ||
| h3c_coord_t | PA0 | ||
| ) |
verify if a point is inside an ellipse
Definition at line 615 of file h3c_util.c.
| void h3c_log | ( | int | level, |
| char * | fmt, | ||
| ... | |||
| ) |
print statistics
| level | INFO |
| fmt | format |
| ... | optional argument used in format |
Definition at line 57 of file h3c_util.c.
| h3c_ipix_t h3c_npix | ( | int | nside | ) |
get the number of ipix in the entire sphere
| nside | nside level |
Definition at line 194 of file h3c_util.c.
| int h3c_order | ( | int | nside | ) |
get the order from the nside number
| nside | nside level |
Definition at line 173 of file h3c_util.c.
References h3c_log().
Here is the call graph for this function:| h3c_coord_t h3c_phi2ra | ( | h3c_coord_t | phi | ) |
get the right ascension from the phi value
| phi |
Definition at line 149 of file h3c_util.c.
| h3c_coord_t h3c_ra2phi | ( | h3c_coord_t | ra | ) |
get the phi value from the right ascension
| ra | right ascension |
Definition at line 161 of file h3c_util.c.
| h3c_coord_t h3c_radius | ( | int | nside | ) |
get the max radius of ipix for a given nside
| nside | nside level |
Definition at line 204 of file h3c_util.c.
| h3c_coord_t h3c_sindist | ( | h3c_coord_t | ra1, |
| h3c_coord_t | dec1, | ||
| h3c_coord_t | ra2, | ||
| h3c_coord_t | dec2 | ||
| ) |
calculate the sinus distance (to be compatible with Q3C)
| ra1 | right ascention of the first point |
| dec1 | declination of the first point |
| ra2 | right ascention of the second point |
| dec2 | declination of the second point |
Definition at line 486 of file h3c_util.c.
| h3c_coord_t h3c_theta2dec | ( | h3c_coord_t | theta | ) |
get the declination from the theta value
| theta |
Definition at line 125 of file h3c_util.c.