 |
H3C HEALPix library for PostgreSQL
(version 1.2)
|
Go to the documentation of this file.
36 #ifndef H3C_DEFAULT_NSIDE
37 #define H3C_DEFAULT_NSIDE 32768
41 #ifndef H3C_DEFAULT_MEM_BLOCK
42 #define H3C_DEFAULT_MEM_BLOCK 100
46 #ifndef H3C_DEFAULT_NEARBY_MEM_BLOCK
47 #define H3C_DEFAULT_NEARBY_MEM_BLOCK 8
51 #ifndef H3C_DEFAULT_MAX_IPIX
52 #define H3C_DEFAULT_MAX_IPIX 2000000
55 #define H3C_DEBUG DEBUG1
57 #define H3C_ERROR ERROR
59 #define H3C_STEP_ALLOC 50
60 #define H3C_LIST(a,n) n = H3C_STEP_ALLOC; \
61 a = (h3c_ipix_t *)malloc(sizeof(h3c_ipix_t)*H3C_STEP_ALLOC);
62 #define H3C_PUSH(a,b,c,val) if ((++b)%H3C_STEP_ALLOC == 0){\
63 if (c > H3C_DEFAULT_MAX_IPIX) h3c_log(H3C_ERROR, "too much ipix: abort");\
64 c += H3C_STEP_ALLOC; a=(h3c_ipix_t*)realloc(a, sizeof(h3c_ipix_t)*c);}\
72 void h3c_log(
int level,
char *fmt, ...);
81 int h3c_get_order_old(
int nside);
82 int h3c_number_ipix_old(
int nside);
83 h3c_coord_t h3c_radius_old(
int nside);
85 h3c_ipix_t *
h3c_disk_ipix(h3c_coord_t, h3c_coord_t, h3c_coord_t,
int,
int *) ;
86 int h3c_disk_ipix_it(h3c_coord_t, h3c_coord_t, h3c_coord_t,
int, h3c_ipix_t *,
int);
87 h3c_coord_t
h3c_dist(h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t);
88 h3c_coord_t
h3c_sindist(h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t);
90 int h3c_polygon_ipix_it(h3c_coord_t *, h3c_coord_t *,
int,
int, h3c_ipix_t *,
int);
91 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);
94 h3c_coord_t ra0, h3c_coord_t dec0, h3c_coord_t radius);
97 h3c_coord_t in_dec1[],
100 h3c_coord_t in_dec2[]);
101 h3c_coord_t
h3c_polygon_area(h3c_coord_t *in_ra, h3c_coord_t *in_dec,
int n);
102 void h3c_box_2_polygon(h3c_coord_t in_ra, h3c_coord_t in_dec,
103 h3c_coord_t width, h3c_coord_t height,
104 h3c_coord_t poly_ra[4], h3c_coord_t poly_dec[4]);
105 void h3c_pix2ang_nest(
long nside, h3c_ipix_t ipnest, h3c_coord_t *theta, h3c_coord_t *phi);
106 void h3c_ang2pix_nest(
long nside, h3c_coord_t theta, h3c_coord_t phi, h3c_ipix_t *ipnest);
107 void h3c_ring2nest(
long nside, h3c_ipix_t ipring, h3c_ipix_t *ipnest);
109 h3c_ipix_t *h3c_query_disc (h3c_coord_t ra, h3c_coord_t dec, h3c_coord_t radius,
int nside,
int *count);
h3c_ipix_t h3c_npix(int nside)
get the number of ipix in the entire sphere
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
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
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)
int h3c_order(int nside)
get the order from the nside number
h3c_coord_t h3c_radius(int nside)
get the max radius of ipix for a given nside
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
h3c_coord_t h3c_polygon_area(h3c_coord_t *in_ra, h3c_coord_t *in_dec, int n)
calculate the area of a polygon
h3c_coord_t h3c_theta2dec(h3c_coord_t)
get the declination from the theta value
h3c_ipix_t * h3c_polygon_ipix(h3c_coord_t *, h3c_coord_t *, int, int, int *)
retrieve the ipix list for a polygon
h3c_coord_t h3c_dec2theta(h3c_coord_t)
get the theta value from the declination
void h3c_debug_init_clock()
initalize the debugger timer
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
int h3c_poly_is_convex(int n, h3c_coord_t *, h3c_coord_t *)
verify if the polygon is convex
h3c_coord_t h3c_dist(h3c_coord_t, h3c_coord_t, h3c_coord_t, h3c_coord_t)
calculate the distance between 2 points
void h3c_log(int level, char *fmt,...)
print statistics
h3c_coord_t h3c_ra2phi(h3c_coord_t)
get the phi value from the right ascension
h3c_coord_t h3c_phi2ra(h3c_coord_t)
get the right ascension from the phi value