[Kst] extragear/graphics/kst
Ted Kisner
tskisner.public at gmail.com
Mon Oct 3 22:12:01 CEST 2005
SVN commit 466965 by tskisner:
Healpix datasource is now self-contained. Remove configure checks for external library- only dependency is cfitsio.
M +0 -47 configure.in.in
M +1 -4 kst/datasources/Makefile.am
M +1 -1 kst/datasources/healpix/Makefile.am
M +67 -8 kst/datasources/healpix/healpix_tools.h
A kst/datasources/healpix/healpix_tools_fits.cpp [License: GPL (v2+)]
A kst/datasources/healpix/healpix_tools_pix.cpp [License: GPL (v2+)]
A kst/datasources/healpix/healpix_tools_proj.cpp [License: GPL (v2+)]
--- trunk/extragear/graphics/kst/configure.in.in #466964:466965
@@ -193,53 +193,6 @@
KDE_CHECK_LIB(cfitsio, fftopn, ,[FITSIO_SUBDIR=""], -lm )
AM_CONDITIONAL(include_fitsio_datasource, test -n "$FITSIO_SUBDIR")
-# Healpix Test
-# check for chealpix or hpic
-#
-ac_healpix_includes=""
-ac_healpix_libraries=""
-AC_ARG_WITH(healpix,
- AC_HELP_STRING([--with-healpix=DIR],[where the root of chealpix or HPIC is installed ]),
- [ ac_healpix_includes="-I$withval/include"
- ac_healpix_libraries="-L$withval/lib"
- ])
-
-all_includes_save="$all_includes"
-all_includes="$all_includes $ac_healpix_includes"
-have_chealpix_h=no
-have_hpic_h=no
-KDE_CHECK_HEADER([chealpix.h], [AC_DEFINE(HAVE_CHEALPIX_H, 1, [If we have chealpix header]) have_chealpix_h=yes HEALPIXINCLUDES="$ac_healpix_includes"], [], [])
-if test $have_chealpix_h = no; then
- KDE_CHECK_HEADER([hpic.h], [AC_DEFINE(HAVE_HPIC_H, 1, [If we have HPIC header]) have_hpic_h=yes HEALPIXINCLUDES="$ac_healpix_includes"], [], [])
-fi
-all_includes="$all_includes_save"
-
-ldflags_save="$LDFLAGS"
-LDFLAGS="$LDFLAGS $ac_healpix_libraries"
-KDE_CHECK_LIB([chealpix], [nside2npix], [HEALPIXLIBS="$ac_healpix_libraries -lm -lcfitsio -lchealpix $HEALPIXLIBS"], [], [])
-if test $ac_cv_lib_chealpix_nside2npix = no; then
- KDE_CHECK_LIB([hpic], [nside2npix], [HEALPIXLIBS="$ac_healpix_libraries -lm -lcfitsio -lhpic $HEALPIXLIBS"], [], [])
-fi
-LDFLAGS="$ldflags_save"
-
-if test $ac_cv_lib_chealpix_nside2npix = yes; then
- if test $have_chealpix_h = yes; then
- AC_SUBST(HEALPIXLIBS)
- AC_SUBST(HEALPIXINCLUDES)
- AC_DEFINE(KST_HAVE_CHEALPIX, 1, [If we have the chealpix library.])
- fi
-else
- if test $ac_cv_lib_hpic_nside2npix = yes; then
- if test $have_hpic_h = yes; then
- AC_SUBST(HEALPIXLIBS)
- AC_SUBST(HEALPIXINCLUDES)
- AC_DEFINE(KST_HAVE_HPIC, 1, [If we have the HPIC library.])
- fi
- fi
-fi
-AM_CONDITIONAL(include_healpix, test -n "$HEALPIXLIBS")
-
-
AC_DEFUN([KST_CHECK_MDI],
[
AC_MSG_CHECKING(whether to use kmdi lib from kdelibs)
--- trunk/extragear/graphics/kst/kst/datasources/Makefile.am #466964:466965
@@ -5,6 +5,7 @@
if include_fitsio_datasource
FITSIO_SUBDIR=lfiio
FITSIMAGE_SUBDIR=fitsimage
+HEALPIX_SUBDIR=healpix
endif
if include_cdf
@@ -15,9 +16,5 @@
NETCDF_SUBDIR=netcdf
endif
-if include_healpix
-HEALPIX_SUBDIR=healpix
-endif
-
SUBDIRS=ascii qimagesource $(FITSIMAGE_SUBDIR) dirfile frame indirect $(PIOLIB_SUBDIR) $(FITSIO_SUBDIR) $(CDF_SUBDIR) $(NETCDF_SUBDIR) $(HEALPIX_SUBDIR)
--- trunk/extragear/graphics/kst/kst/datasources/healpix/Makefile.am #466964:466965
@@ -4,7 +4,7 @@
kstdata_healpix_la_LIBADD=$(HEALPIXLIBS)
kstdata_healpix_la_LDFLAGS=$(all_libraries) -module -avoid-version
-kstdata_healpix_la_SOURCES=healpix.cpp healpix_tools.cpp
+kstdata_healpix_la_SOURCES=healpix.cpp healpix_tools_pix.cpp healpix_tools_proj.cpp healpix_tools_fits.cpp
METASOURCES=AUTO
--- trunk/extragear/graphics/kst/kst/datasources/healpix/healpix_tools.h #466964:466965
@@ -18,14 +18,30 @@
#ifndef HEALPIX_TOOLS_H
#define HEALPIX_TOOLS_H
+#include <math.h>
+#include <fitsio.h>
#include <kstdatasource.h>
-#ifdef KST_HAVE_CHEALPIX
-# include <chealpix.h>
-#else
-# include <hpic.h>
-#endif
+# ifdef HEALPIX_PI
+# undef HEALPIX_PI
+# endif /* define pi... */
+# define HEALPIX_PI M_PI
+# ifdef HEALPIX_INVPI
+# undef HEALPIX_INVPI
+# endif /* define 1/pi... */
+# define HEALPIX_INVPI M_1_PI
+
+# ifdef HEALPIX_PISQ
+# undef HEALPIX_PISQ
+# endif /* define pi squared... */
+# define HEALPIX_PISQ 9.86960440108936
+
+# ifdef HEALPIX_HALFPI
+# undef HEALPIX_HALFPI
+# endif /* define half pi... */
+# define HEALPIX_HALFPI M_PI_2
+
# ifdef HEALPIX_NSIDE_MAX
# undef HEALPIX_NSIDE_MAX
# endif /* max nside value */
@@ -136,13 +152,56 @@
float *fkeyvals;
char **fkeycoms;
} healpix_keys;
+
+ static size_t healpix_ctab[0x100];
+ static size_t healpix_utab[0x100];
+
+ static const size_t healpix_jrll[] = {2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4};
+ static const size_t healpix_jpll[] = {1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7};
+
+ static int healpix_doneinit = 0;
+ void healpix_init();
- int healpix_dnull(double val);
- int healpix_fnull(float val);
- int healpix_inull(int val);
+ int healpix_is_dnull(double val);
+ int healpix_is_fnull(float val);
+ int healpix_is_inull(int val);
char **healpix_strarr_alloc(size_t nstring);
int healpix_strarr_free(char **array, size_t nstring);
int healpix_nsidecheck(size_t nside);
+ size_t healpix_nside2npix(size_t nside);
+ size_t healpix_npix2nside(size_t npix);
+ size_t healpix_nside2factor(size_t nside);
+ size_t healpix_factor2nside(size_t factor);
+
+ int healpix_xy2pix(size_t x, size_t y, size_t *pix);
+ int healpix_x2pix(size_t x, size_t *pix);
+ int healpix_y2pix(size_t y, size_t *pix);
+ int healpix_pix2xy(size_t pix, size_t *x, size_t *y);
+
+ int healpix_nest2xyf (size_t nside, size_t pix, size_t *x,
+ size_t *y, size_t *face_num);
+ int healpix_xyf2nest (size_t nside, size_t x, size_t y,
+ size_t face_num, size_t *pix);
+ int healpix_ring2xyf (size_t nside, size_t pix, size_t *x,
+ size_t *y, size_t *face_num);
+ int healpix_xyf2ring (size_t nside, size_t x, size_t y,
+ size_t face_num, size_t *pix);
+
+ int healpix_nest2ring (size_t nside, size_t pnest, size_t *pring);
+ int healpix_ring2nest(size_t nside, size_t pring, size_t *pnest);
+ int healpix_ang2pix_ring(size_t nside, double theta, double phi,
+ size_t *pix);
+ int healpix_ang2pix_nest(size_t nside, double theta, double phi,
+ size_t *pix);
+ int healpix_pix2ang_ring(size_t nside, size_t pix, double *theta,
+ double *phi);
+ int healpix_pix2ang_nest(size_t nside, size_t pix, double *theta,
+ double *phi);
+ int healpix_degrade_nest(size_t oldnside, size_t oldpix, size_t newnside,
+ size_t * newpix);
+ int healpix_degrade_ring(size_t oldnside, size_t oldpix, size_t newnside,
+ size_t * newpix);
+ int healpix_neighbors(size_t nside, int ordering, size_t pixel, long *parray);
int healpix_proj_car(double mintheta, double maxtheta, double minphi,
double maxphi, double xmax, double ymax, double theta,
More information about the Kst
mailing list