3 -------------------------------------------------------------------------------
5 G.Landais (CDS) : HEALPix library inspired from Q3C (Sergey Koposov)
7 -------------------------------------------------------------------------------
10 To work with H3C you need to have PostgreSQL database installed (version 8.1
11 or later). For the installation of PostgreSQL refer to the PostgreSQL manual.
13 Then, you have to download the 64bits library of the Nasa and install
14 the C and C++ library.
16 Attention!! -fPIC option had to be set during the Nasa-Healpix compilation
17 (if not set, export CFLAGS=-fPIC ;export CPPFLAGS=-fPIC)
19 You can download a version here: http://sourceforge.net/projects/healpix/
22 -------------------------------------------------------------------------------
25 1) ./configure [options]
28 4) in PostgreSQL shell:
29 create extension cds_h3c;
31 COMPILATION PARAMETERS (configure):
32 --with-HEALPix64 Use the 64bits HEALPix library (Nasa)
34 --with-HEALPix-lib Path to the HEALPix library (libhealpix_cxx.a)
35 --with-HEALPix-include Path to the HEALPix include (healpix_base.h ..)
36 --with-HEALPix-src (32bits only) path containing the sources
37 --with-fitsio Fitsio home directory [default=/usr]
38 --with-long-double Use long double [default NO]
39 --with-as4-include libas4 library (CDS) to use box function
40 (the include directory)
41 --with-as4-lib libas4 library (CDS) to use box function
42 (the directory where is located the library)
44 COMPILATION PARAMETERS (Makefile)
45 MUTE=-D_H3C_MUTE to be in a mute mode (only errors)
46 LIMIT_POLYGONE_ORDER_x (x=0,1,2) limit in degree to decrease the HEALPix order
47 LIMIT_CIRCLE_ORDER_x (x=0,..,4) limit in degree to decrease the HEALPix order
49 NOTE(*):the default nside is H3C_DEFAULT_NSIDE = 32768 (order=15)
50 For efficiency, working with order 15 needs to use a particular
51 version of the 64bits library of the Nasa.
53 If you don't have it, use the --with-HEALPix64=no
54 of the configure options.
55 Then, change the order default value with adding -DH3C_DEFAULT_NSIDE=xxx
56 (xxx=nside value, <= 8192) in the Makefile (OPT=....)
58 -------------------------------------------------------------------------------
59 PREPARATION OF TABLES before using H3C
61 Index the tables using H3C:
62 CREATE INDEX idx_name ON table (h3c_ang2ipix(ra,de));
64 -------------------------------------------------------------------------------
67 /* HEALPix cell on ra=0, de=0 using the default nside */
68 SELECT h3c_ang2ipix(0,0);
69 /* HEALPix cell on ra=0, de=0 using nside=8192 */
70 SELECT h3c_ang2ipix(0,0,8192);
71 /* cone search arround ra=0, de=0 with radius=2arcmin */
72 SELECT ra,de FROM table WHERE h3c_radial_query(ra,de,0,0,2/60.);
73 /* Crossmatch table1 & table2 using the positions */
74 SELECT table1.ra,table1.de FROM table1, table2 WHERE h3c_join(table1.ra,table1.de,table2.ra,table2.de,2/3600.);