![]() |
H3C HEALPix library for PostgreSQL
(version 1.2)
|
usefull functions in the library heaplix for PostgreSQL More...
Go to the source code of this file.
Functions | |
void | h3c_debug_init_clock () |
initalize the debugger timer | |
void | h3c_log (int level, char *fmt,...) |
print statistics More... | |
h3c_coord_t | h3c_theta2dec (h3c_coord_t) |
get the declination from the theta value More... | |
h3c_coord_t | h3c_dec2theta (h3c_coord_t) |
get the theta value from the declination More... | |
h3c_coord_t | h3c_phi2ra (h3c_coord_t) |
get the right ascension from the phi value More... | |
h3c_coord_t | h3c_ra2phi (h3c_coord_t) |
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, h3c_coord_t, h3c_coord_t, int, int *) |
(c++ interface) get the ipix list of a cone More... | |
h3c_coord_t | h3c_dist (h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t) |
calculate the distance between 2 points More... | |
h3c_coord_t | h3c_sindist (h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t) |
calculate the sinus distance (to be compatible with Q3C) More... | |
h3c_ipix_t * | h3c_polygon_ipix (h3c_coord_t *, h3c_coord_t *, int, int, int *) |
retrieve the ipix list for a polygon More... | |
char | h3c_in_ellipse (h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t) |
verify if a point is inside an ellipse More... | |
int | h3c_poly_is_convex (int n, h3c_coord_t *, h3c_coord_t *) |
verify if the polygon is convex More... | |
int | h3c_check_sphere_circle_intersect_poly (int n, h3c_coord_t in_ra[], h3c_coord_t in_dec[], h3c_coord_t ra0, h3c_coord_t dec0, h3c_coord_t radius) |
check if a circle intersects a vertex of a polygon More... | |
int | h3c_check_poly_intersect_poly (int n1, h3c_coord_t in_ra1[], h3c_coord_t in_dec1[], int n2, h3c_coord_t in_ra2[], h3c_coord_t in_dec2[]) |
check if a polygon intersects a vertex of an other polygon More... | |
h3c_coord_t | h3c_polygon_area (h3c_coord_t *in_ra, h3c_coord_t *in_dec, int n) |
calculate the area of a polygon More... | |
usefull functions in the library heaplix for PostgreSQL
Definition in file h3c_util.h.
int h3c_check_poly_intersect_poly | ( | int | n1, |
h3c_coord_t | in_ra1[], | ||
h3c_coord_t | in_dec1[], | ||
int | n2, | ||
h3c_coord_t | in_ra2[], | ||
h3c_coord_t | in_dec2[] | ||
) |
check if a polygon intersects a vertex of an other polygon
n1 | number of vertex of the 1st polygon |
in_ra1 | right ascention of the point of the 1st polygon |
in_dec1 | declination of the point of the 1st polygon |
n2 | number of vertex of the 1st polygon |
in_ra2 | right ascention of the point of the 1st polygon |
in_dec2 | declination of the point of the 1st polygon |
Definition at line 575 of file h3c_poly_more.c.
int h3c_check_sphere_circle_intersect_poly | ( | int | n, |
h3c_coord_t | in_ra[], | ||
h3c_coord_t | in_dec[], | ||
h3c_coord_t | ra0, | ||
h3c_coord_t | dec0, | ||
h3c_coord_t | radius | ||
) |
check if a circle intersects a vertex of a polygon
n | number of vertex |
in_ra | polygon right ascention |
in_dec | polygon declination |
ra0 | right ascension of the circle |
dec0 | declination of the circle |
radius | radius of the circle |
Definition at line 320 of file h3c_poly_more.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().
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().
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.
int h3c_poly_is_convex | ( | int | n, |
h3c_coord_t * | in_ra, | ||
h3c_coord_t * | in_dec | ||
) |
verify if the polygon is convex
n | number of points |
in_ra | right ascension of the polygon points |
in_dec | declination of the polygon points |
@warn the convex polygons are just a particular case of this ensemble
In reality the function return true if the function h3c_check_sphere_point_in_poly_convex can be applied to verify if a point is inside the polygon.
Definition at line 220 of file h3c_poly_more.c.
References h3c_check_sphere_point_in_poly_convex(), and h3c_poly_center().
h3c_coord_t h3c_polygon_area | ( | h3c_coord_t * | in_ra, |
h3c_coord_t * | in_dec, | ||
int | n | ||
) |
calculate the area of a polygon
in_ra | right ascentions of the points of the polygon |
in_dec | declinations of the points of the polygon |
nnumber | of vertex of the polygon |
Definition at line 649 of file h3c_poly_more.c.
h3c_ipix_t* h3c_polygon_ipix | ( | h3c_coord_t * | in_ra, |
h3c_coord_t * | in_dec, | ||
int | n, | ||
int | nside, | ||
int * | count | ||
) |
retrieve the ipix list for a polygon
ra | right ascention of the points |
dec | declination of the points |
n | number of points |
nside | nside level |
get the ipix where center is inside the polygon
P: the center of ipix vect(OQ) = normalized (vect(OA) ^ vect(OB)) dist = pi/2 - acos(vect(OP).vect(OQ))
Definition at line 426 of file h3c_poly_more.c.
References h3c_log().
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.