Commit 54b951b1 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Switched to single precision for model fitting.

Changed configure behaviour towards CFLAGS and LDFLAGS: automatic settings are now applied only if the --enable-automatic-flags configure option is set (thanks to S.Pascual).
Version number pushed to 2.9.0.
parent 3b59ee2e
......@@ -91,6 +91,9 @@ distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
......@@ -8,7 +8,7 @@ dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90
dnl (Unicos 10.0.0.8) C compiler.
dnl
dnl This macro is a modification of Ville Laurikari's VL_PROG_CC_WARNINGS
dnl @version 1.3 (2009-04-01)
dnl @version 1.4 (2009-09-08)
dnl @authors Emmanuel Bertin <bertin@iap.fr> Ville Laurikari <vl@iki.fi>
dnl
AC_DEFUN([ACX_PROG_CC_OPTIM], [
......@@ -101,8 +101,8 @@ EOF
rm -f conftest.*
fi
if test -n "$prog_cc_optim_flags"; then
CFLAGS="$CFLAGS $prog_cc_optim_flags"
LDFLAGS="$LDFLAGS $prog_ld_optim_flags"
AM_CFLAGS="$CFLAGS $prog_cc_optim_flags"
AM_LDFLAGS="$LDFLAGS $prog_ld_optim_flags"
else
prog_cc_optim_flags=""
prog_ld_optim_flags=""
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for sextractor 2.8.9.
# Generated by GNU Autoconf 2.63 for sextractor 2.9.0.
#
# Report bugs to <bertin@iap.fr>.
#
......@@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='sextractor'
PACKAGE_TARNAME='sextractor'
PACKAGE_VERSION='2.8.9'
PACKAGE_STRING='sextractor 2.8.9'
PACKAGE_VERSION='2.9.0'
PACKAGE_STRING='sextractor 2.9.0'
PACKAGE_BUGREPORT='bertin@iap.fr'
 
ac_unique_file="src/makeit.c"
......@@ -792,6 +792,9 @@ ac_includes_default="\
#endif"
 
ac_subst_vars='LTLIBOBJS
AM_LDFLAGS
AM_CPPFLAGS
AM_CFLAGS
ATLAS_ERROR
ATLAS_WARN
ATLAS_LIB
......@@ -915,6 +918,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_automatic_flags
enable_icc
enable_dependency_tracking
enable_static
......@@ -1500,7 +1504,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sextractor 2.8.9 to adapt to many kinds of systems.
\`configure' configures sextractor 2.9.0 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1570,7 +1574,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sextractor 2.8.9:";;
short | recursive ) echo "Configuration of sextractor 2.9.0:";;
esac
cat <<\_ACEOF
 
......@@ -1578,6 +1582,9 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-automatic-flags
Let the configure script choose the compilation
flags (off by default)
--enable-icc Enable special mode for compilation with the Intel
compiler (off by default)
--disable-dependency-tracking speeds up one-time build
......@@ -1697,7 +1704,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sextractor configure 2.8.9
sextractor configure 2.9.0
generated by GNU Autoconf 2.63
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
......@@ -1711,7 +1718,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by sextractor $as_me 2.8.9, which was
It was created by sextractor $as_me 2.9.0, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
$ $0 $@
......@@ -2414,7 +2421,7 @@ fi
 
# Define the identity of the package.
PACKAGE='sextractor'
VERSION='2.8.9'
VERSION='2.9.0'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -2606,11 +2613,20 @@ $as_echo "*********** Configuring: $PACKAGE $VERSION ($date) **********" >&6; }
# Initialize the list of compilers to consider
cclist="cc gcc"
 
# Backup and reset the input CFLAGS and LDFLAGS
mycflags="$CFLAGS"
CFLAGS=""
myldflags="$LDFLAGS"
LDFLAGS=""
# Provide special option for choosing automatically the compilation flags.
{ $as_echo "$as_me:$LINENO: checking if compilation flags are set automatically" >&5
$as_echo_n "checking if compilation flags are set automatically... " >&6; }
# Check whether --enable-automatic-flags was given.
if test "${enable_automatic_flags+set}" = set; then
enableval=$enable_automatic_flags; use_autoflag="yes"
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
use_autoflag="no"
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
 
# Provide special option for the Linux Intel C compiler
{ $as_echo "$as_me:$LINENO: checking for Linux Intel C compiler mode" >&5
......@@ -4430,6 +4446,10 @@ if test "$ac_res" != no; then
 
fi
 
# Override automatic CFLAGS and LDFLAGS with those of user
if test "$use_autoflag" = "yes"; then
CFLAGS=""
LDFLAGS =""
 
msg="for C compiler optimization flags"
{ $as_echo "$as_me:$LINENO: checking $msg" >&5
......@@ -4507,8 +4527,8 @@ EOF
rm -f conftest.*
fi
if test -n "$prog_cc_optim_flags"; then
CFLAGS="$CFLAGS $prog_cc_optim_flags"
LDFLAGS="$LDFLAGS $prog_ld_optim_flags"
AM_CFLAGS="$CFLAGS $prog_cc_optim_flags"
AM_LDFLAGS="$LDFLAGS $prog_ld_optim_flags"
else
prog_cc_optim_flags=""
prog_ld_optim_flags=""
......@@ -4518,6 +4538,7 @@ fi
{ $as_echo "$as_me:$LINENO: result: $prog_cc_optim_flags" >&5
$as_echo "$prog_cc_optim_flags" >&6; }
 
fi
# Check whether --enable-static was given.
if test "${enable_static+set}" = set; then
enableval=$enable_static; p=${PACKAGE-default}
......@@ -5299,7 +5320,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5302 "configure"' > conftest.$ac_ext
echo '#line 5323 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
......@@ -8074,11 +8095,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:8077: $lt_compile\"" >&5)
(eval echo "\"\$as_me:8098: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:8081: \$? = $ac_status" >&5
echo "$as_me:8102: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -8364,11 +8385,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:8367: $lt_compile\"" >&5)
(eval echo "\"\$as_me:8388: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:8371: \$? = $ac_status" >&5
echo "$as_me:8392: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -8468,11 +8489,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:8471: $lt_compile\"" >&5)
(eval echo "\"\$as_me:8492: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:8475: \$? = $ac_status" >&5
echo "$as_me:8496: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
......@@ -10855,7 +10876,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 10858 "configure"
#line 10879 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
......@@ -10955,7 +10976,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 10958 "configure"
#line 10979 "configure"
#include "confdefs.h"
 
#if HAVE_DLFCN_H
......@@ -13383,11 +13404,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13386: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13407: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13390: \$? = $ac_status" >&5
echo "$as_me:13411: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -13487,11 +13508,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13490: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13511: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:13494: \$? = $ac_status" >&5
echo "$as_me:13515: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
......@@ -15051,11 +15072,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15054: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15075: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15058: \$? = $ac_status" >&5
echo "$as_me:15079: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -15155,11 +15176,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15158: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15179: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:15162: \$? = $ac_status" >&5
echo "$as_me:15183: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
......@@ -17352,11 +17373,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17355: $lt_compile\"" >&5)
(eval echo "\"\$as_me:17376: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:17359: \$? = $ac_status" >&5
echo "$as_me:17380: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -17642,11 +17663,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17645: $lt_compile\"" >&5)
(eval echo "\"\$as_me:17666: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:17649: \$? = $ac_status" >&5
echo "$as_me:17670: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
......@@ -17746,11 +17767,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17749: $lt_compile\"" >&5)
(eval echo "\"\$as_me:17770: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:17753: \$? = $ac_status" >&5
echo "$as_me:17774: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
......@@ -23568,7 +23589,7 @@ fi
 
 
CC="$PTHREAD_CC"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"
LIBS="$PTHREAD_LIBS $LIBS"
fi
if test $use_pthreads = "yes"; then
......@@ -24342,7 +24363,7 @@ LIBS=""
 
if test x$acx_fftw_ok = xyes; then
if test x$fftw_libdir = x; then
if test xno = xyes; then
if test xyes = xyes; then
{ $as_echo "$as_me:$LINENO: checking for fftwf_execute in -lfftw3f" >&5
$as_echo_n "checking for fftwf_execute in -lfftw3f... " >&6; }
if test "${ac_cv_lib_fftw3f_fftwf_execute+set}" = set; then
......@@ -24508,7 +24529,7 @@ _ACEOF
fi
fi
if test x$acx_fftw_ok = xyes && test x$use_pthreads = xyes; then
if test xno = xyes; then
if test xyes = xyes; then
{ $as_echo "$as_me:$LINENO: checking for fftwf_init_threads in -lfftw3f" >&5
$as_echo_n "checking for fftwf_init_threads in -lfftw3f... " >&6; }
if test "${ac_cv_lib_fftw3f_fftwf_init_threads+set}" = set; then
......@@ -24837,7 +24858,7 @@ _ACEOF
fi
fi
else
if test xno = xyes; then
if test xyes = xyes; then
{ $as_echo "$as_me:$LINENO: checking for fftwf_execute in -lfftw3f" >&5
$as_echo_n "checking for fftwf_execute in -lfftw3f... " >&6; }
if test "${ac_cv_lib_fftw3f_fftwf_execute+set}" = set; then
......@@ -25003,7 +25024,7 @@ _ACEOF
fi
fi
if test x$acx_fftw_ok = xyes && test x$use_pthreads = xyes; then
if test xno = xyes; then
if test xyes = xyes; then
{ $as_echo "$as_me:$LINENO: checking for fftwf_init_threads in -lfftw3f" >&5
$as_echo_n "checking for fftwf_init_threads in -lfftw3f... " >&6; }
if test "${ac_cv_lib_fftw3f_fftwf_init_threads+set}" = set; then
......@@ -27712,33 +27733,29 @@ fi
# Link with gprof option
if test "$use_gprof" = "yes"; then
if test "$use_icc" = "yes"; then
CFLAGS="$CFLAGS -pq"
AM_CFLAGS="$AM_CFLAGS -pq"
else
CFLAGS="$CFLAGS -pg"
AM_CFLAGS="$AM_CFLAGS -pg"
fi
use_static="no"
fi
 
# Static linking option
if test "$use_static" = "yes"; then
LDFLAGS="-static -shared-libgcc $LDFLAGS"
AM_LDFLAGS="-static -shared-libgcc $AM_LDFLAGS"
fi
 
# Override automatic CFLAGS and LDFLAGS with those of user
#if test -n "$mycflags"; then
#CFLAGS="$mycflags"
#fi
#if test -n "$myldflags"; then
#LDFLAGS="$myldflags"
#fi
 
# Display compiler and linker flags
{ $as_echo "$as_me:$LINENO: result: ***************************************************************" >&5
$as_echo "***************************************************************" >&6; }
{ $as_echo "$as_me:$LINENO: result: Compile cmdline: $CC $CFLAGS" >&5
$as_echo "Compile cmdline: $CC $CFLAGS" >&6; }
{ $as_echo "$as_me:$LINENO: result: Link cmdline: $CC $LDFLAGS $LIBS" >&5
$as_echo "Link cmdline: $CC $LDFLAGS $LIBS" >&6; }
{ $as_echo "$as_me:$LINENO: result: Compile cmdline: $CC $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS" >&5
$as_echo "Compile cmdline: $CC $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS" >&6; }
{ $as_echo "$as_me:$LINENO: result: Link cmdline: $CC $AM_LDFLAGS $LDFLAGS $LIBS" >&5
$as_echo "Link cmdline: $CC $AM_LDFLAGS $LDFLAGS $LIBS" >&6; }
{ $as_echo "$as_me:$LINENO: result: Default XSLT URL: $xsl_url" >&5
$as_echo "Default XSLT URL: $xsl_url" >&6; }
{ $as_echo "$as_me:$LINENO: result: ***************************************************************" >&5
......@@ -28127,7 +28144,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sextractor $as_me 2.8.9, which was
This file was extended by sextractor $as_me 2.9.0, which was
generated by GNU Autoconf 2.63. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -28190,7 +28207,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
sextractor config.status 2.8.9
sextractor config.status 2.9.0
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
......
......@@ -6,7 +6,7 @@ define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)
# This is your standard Bertin source code...
AC_INIT(sextractor, 2.8.9, [bertin@iap.fr])
AC_INIT(sextractor, 2.9.0, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER(config.h)
......@@ -32,11 +32,16 @@ AC_MSG_RESULT([*********** Configuring: $PACKAGE $VERSION ($date) **********])
# Initialize the list of compilers to consider
cclist="cc gcc"
# Backup and reset the input CFLAGS and LDFLAGS
mycflags="$CFLAGS"
CFLAGS=""
myldflags="$LDFLAGS"
LDFLAGS=""
# Provide special option for choosing automatically the compilation flags.
AC_MSG_CHECKING([if compilation flags are set automatically])
AC_ARG_ENABLE(automatic-flags,
[AC_HELP_STRING([--enable-automatic-flags],
[Let the configure script choose the compilation flags \
(off by default)])],
use_autoflag="yes"
AC_MSG_RESULT([yes]),
use_autoflag="no"
AC_MSG_RESULT([no]))
# Provide special option for the Linux Intel C compiler
AC_MSG_CHECKING([for Linux Intel C compiler mode])
......@@ -57,7 +62,12 @@ AC_PROG_CC([$cclist])
# C Compiler: Check that it is ANSI C and POSIX-compliant
AM_PROG_CC_STDC
AC_ISC_POSIX
ACX_PROG_CC_OPTIM
# Override automatic CFLAGS and LDFLAGS with those of user
if test "$use_autoflag" = "yes"; then
CFLAGS=""
LDFLAGS =""
ACX_PROG_CC_OPTIM
fi
AC_DISABLE_STATIC
#AC_DISABLE_SHARED
AC_PROG_LIBTOOL
......@@ -182,13 +192,13 @@ if test "$use_pthreads" = "yes"; then
# CC, CFLAGS and LIBS are system and compiler-dependent
ACX_PTHREAD
CC="$PTHREAD_CC"
[CFLAGS="$CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"]
[AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"]
LIBS="$PTHREAD_LIBS $LIBS"
fi
AM_CONDITIONAL(USE_THREADS, test $use_pthreads = "yes")
################ handle the FFTW library (Fourier transforms) ################
ACX_FFTW($fftw_libdir,$fftw_incdir,$use_pthreads,no,
ACX_FFTW($fftw_libdir,$fftw_incdir,$use_pthreads,yes,
[use_fftw=yes],[use_fftw=no])
if test "$use_fftw" = "yes"; then
LIBS="$FFTW_LIBS $LIBS"
......@@ -214,30 +224,26 @@ fi
# Link with gprof option
if test "$use_gprof" = "yes"; then
if test "$use_icc" = "yes"; then
CFLAGS="$CFLAGS -pq"
AM_CFLAGS="$AM_CFLAGS -pq"
else
CFLAGS="$CFLAGS -pg"
AM_CFLAGS="$AM_CFLAGS -pg"
fi
use_static="no"
fi
# Static linking option
if test "$use_static" = "yes"; then
LDFLAGS="-static -shared-libgcc $LDFLAGS"
AM_LDFLAGS="-static -shared-libgcc $AM_LDFLAGS"
fi
# Override automatic CFLAGS and LDFLAGS with those of user
#if test -n "$mycflags"; then
#CFLAGS="$mycflags"
#fi
#if test -n "$myldflags"; then
#LDFLAGS="$myldflags"
#fi
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_LDFLAGS)
# Display compiler and linker flags
AC_MSG_RESULT([***************************************************************])
AC_MSG_RESULT([Compile cmdline: $CC $CFLAGS])
AC_MSG_RESULT([Link cmdline: $CC $LDFLAGS $LIBS])
AC_MSG_RESULT([Compile cmdline: $CC $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS])
AC_MSG_RESULT([Link cmdline: $CC $AM_LDFLAGS $LDFLAGS $LIBS])
AC_MSG_RESULT([Default XSLT URL: $xsl_url])
AC_MSG_RESULT([***************************************************************])
......
......@@ -55,6 +55,9 @@ MANS = $(dist_man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
.TH SEXTRACTOR "1" "August 2009" "SWarp 2.8.9" "User Commands"
.TH SEXTRACTOR "1" "September 2009" "SWarp 2.9.0" "User Commands"
.SH NAME
sex \- extract a source catalog from an astronomical FITS image
.SH SYNOPSIS
......
......@@ -98,6 +98,9 @@ DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
......@@ -7,7 +7,7 @@
*
* Author: E.BERTIN (IAP)
*
* Contents: Routines dealing with double precision FFT.
* Contents: Routines dealing with float precision FFT.
*
* Last modify: 26/06/2009
*
......@@ -59,7 +59,7 @@ void fft_init(int nthreads)
{
if (!fftw_init_threads())
error(EXIT_FAILURE, "*Error*: thread initialization failed in ", "FFTW");
fftw_plan_with_nthreads(prefs.nthreads);
fftwf_plan_with_nthreads(prefs.nthreads);
}
#endif
#endif
......@@ -87,11 +87,11 @@ void fft_end(void)
firsttimeflag = 0;
#ifdef USE_THREADS
#ifdef HAVE_FFTW_MP
fftw_cleanup_threads();
fftwf_cleanup_threads();
#endif
QPTHREAD_MUTEX_DESTROY(&fftmutex);
#endif
fftw_cleanup();
fftwf_cleanup();
}
return;
......@@ -99,21 +99,21 @@ void fft_end(void)
/****** fft_conv ************************************************************
PROTO void fft_conv(double *data1, double *fdata2, int *size)
PROTO void fft_conv(float *data1, float *fdata2, int *size)
PURPOSE Optimized 2-dimensional FFT convolution using the FFTW library.
INPUT ptr to the first image,
ptr to the Fourier transform of the second image,
image size vector.
OUTPUT -.
NOTES For data1 and fdata2, memory must be allocated for
size[0]* ... * 2*(size[naxis-1]/2+1) doubles (padding required).
size[0]* ... * 2*(size[naxis-1]/2+1) floats (padding required).
AUTHOR E. Bertin (IAP)
VERSION 26/03/2007
***/
void fft_conv(double *data1, double *fdata2, int *size)
void fft_conv(float *data1, float *fdata2, int *size)
{
fftw_plan plan;
double *fdata1,*fdata1p,*fdata2p,
fftwf_plan plan;
float *fdata1,*fdata1p,*fdata2p,
real,imag, fac;
int i, npix,npix2;
......@@ -125,18 +125,18 @@ void fft_conv(double *data1, double *fdata2, int *size)
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
QFFTWMALLOC(fdata1, double, npix2);
plan = fftw_plan_dft_r2c_2d(size[1], size[0], data1,
(fftw_complex *)fdata1, FFTW_ESTIMATE|FFTW_DESTROY_INPUT);
QFFTWMALLOC(fdata1, float, npix2);
plan = fftwf_plan_dft_r2c_2d(size[1], size[0], data1,
(fftwf_complex *)fdata1, FFTW_ESTIMATE|FFTW_DESTROY_INPUT);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK(&fftmutex);
#endif
fftw_execute(plan);
fftwf_execute(plan);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
fftw_destroy_plan(plan);
fftwf_destroy_plan(plan);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK(&fftmutex);
#endif
......@@ -157,18 +157,18 @@ void fft_conv(double *data1, double *fdata2, int *size)
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
plan = fftw_plan_dft_c2r_2d(size[1], size[0], (fftw_complex *)fdata1,
plan = fftwf_plan_dft_c2r_2d(size[1], size[0], (fftwf_complex *)fdata1,
data1, FFTW_ESTIMATE|FFTW_DESTROY_INPUT);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK(&fftmutex);
#endif
fftw_execute(plan);
fftwf_execute(plan);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
fftw_destroy_plan(plan);
fftwf_destroy_plan(plan);
/* Free the fdata1 scratch array */
QFFTWFREE(fdata1);
#ifdef USE_THREADS
......@@ -180,7 +180,7 @@ void fft_conv(double *data1, double *fdata2, int *size)
/****** fft_rtf ************************************************************
PROTO double *fft_rtf(double *data, int *size)
PROTO float *fft_rtf(float *data, int *size)
PURPOSE Optimized 2-dimensional FFT "in place" using the FFTW library.
INPUT ptr to the image,
ptr to image size vector.
......@@ -189,11 +189,11 @@ NOTES Input data may end up corrupted.
AUTHOR E. Bertin (IAP)
VERSION 26/03/2007
***/
double *fft_rtf(double *data, int *size)
float *fft_rtf(float *data, int *size)
{
fftw_plan plan;
fftw_complex *fdata;
int npix2;
fftwf_plan plan;
fftwf_complex *fdata;
int npix2;
/* Convert axis indexing to that of FFTW */
npix2 = ((size[0]/2) + 1) * size[1];
......@@ -202,22 +202,22 @@ double *fft_rtf(double *data, int *size)
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
QFFTWMALLOC(fdata, fftw_complex, npix2);
plan = fftw_plan_dft_r2c_2d(size[1], size[0], data,
QFFTWMALLOC(fdata, fftwf_complex, npix2);
plan = fftwf_plan_dft_r2c_2d(size[1], size[0], data,
fdata, FFTW_ESTIMATE|FFTW_DESTROY_INPUT);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK(&fftmutex);
#endif
fftw_execute(plan);
fftwf_execute(plan);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK(&fftmutex);
#endif
fftw_destroy_plan(plan);
fftwf_destroy_plan(plan);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK(&fftmutex);
#endif
return (double *)fdata;
return (float *)fdata;
}
......@@ -22,16 +22,16 @@
/*------------------------------- Other Macros ------------------------------*/
#define QFFTWMALLOC(ptr, typ, nel) \
{if (!(ptr = (typ *)fftw_malloc((size_t)(nel)*sizeof(typ)))) \
{if (!(ptr = (typ *)fftwf_malloc((size_t)(nel)*sizeof(typ)))) \
error(EXIT_FAILURE, "Not enough memory for ", \
#ptr " (" #nel " elements) !");;}
#define QFFTWFREE(ptr) fftw_free(ptr)
#define QFFTWFREE(ptr) fftwf_free(ptr)
/*--------------------------- structure definitions -------------------------*/
/*---------------------------------- protos --------------------------------*/
extern void fft_conv(double *data1, double *fdata2, int *size),
extern void fft_conv(float *data1, float *fdata2, int *size),
fft_end(),
fft_init(int nthreads);
extern double *fft_rtf(double *data, int *size);
extern float *fft_rtf(float *data, int *size);
......@@ -74,6 +74,9 @@ CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
......@@ -71,6 +71,9 @@ CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
......@@ -9,7 +9,7 @@
*
* Contents: Fit an arbitrary profile combination to a detection.
*
* Last modify: 07/08/2009
* Last modify: 07/09/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -18,19 +18,7 @@
#include "config.h"
#endif
#ifdef HAVE_MATHIMF_H
#include <mathimf.h>
#else
#define _GNU_SOURCE
#include <math.h>
#endif
#ifdef HAVE_LOGF
#define LOGF logf
#else
#define LOGF log
#endif
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -47,11 +35,11 @@
#include "psf.h"
#include "profit.h"
static double prof_interpolate(profstruct *prof, double *posin);
static double interpolate_pix(double *posin, double *pix, int *naxisn,
static float prof_interpolate(profstruct *prof, float *posin);
static float interpolate_pix(float *posin, float *pix, int *naxisn,
interpenum interptype);
static void make_kernel(double pos, double *kernel, interpenum interptype);
static void make_kernel(float pos, float *kernel, interpenum interptype);
/*------------------------------- variables ---------------------------------*/
......@@ -74,7 +62,7 @@ INPUT Pointer to PSF structure.
OUTPUT A pointer to an allocated profit structure.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 26/04/2008
VERSION 07/09/2009
***/
profitstruct *profit_init(psfstruct *psf)
{
......@@ -123,7 +111,7 @@ profitstruct *profit_init(psfstruct *psf)
nprof++;
}
QMALLOC(profit->covar, double, profit->nparam*profit->nparam);
QMALLOC(profit->covar, float, profit->nparam*profit->nparam);
profit->nprof = nprof;
return profit;
......@@ -168,7 +156,7 @@ OUTPUT Pointer to an allocated fit structure (containing details about the
fit).
NOTES It is a modified version of the lm_minimize() of lmfit.
AUTHOR E. Bertin (IAP)
VERSION 29/05/2009
VERSION 07/09/2009
***/
void profit_fit(profitstruct *profit,
picstruct *field, picstruct *wfield,
......@@ -178,7 +166,8 @@ void profit_fit(profitstruct *profit,
patternstruct *pattern;
psfstruct *psf;
checkstruct *check;
double psf_fwhm, a , cp,sp, emx2,emy2,emxy, dchi2, err;
double emx2,emy2,emxy, a , cp,sp;
float psf_fwhm, dchi2, err;
int i,j,p, nparam, ncomp, nprof;
nparam = profit->nparam;
......@@ -225,7 +214,7 @@ void profit_fit(profitstruct *profit,
return;
}
QMALLOC(profit->resi, double, profit->nresi);
QMALLOC(profit->resi, float, profit->nresi);
/* Create pixmap at PSF resolution */
profit->modnaxisn[0] =
......@@ -238,8 +227,8 @@ void profit_fit(profitstruct *profit,
profit->modnaxisn[0] = profit->modnaxisn[1];
/* Allocate memory for the complete model */
QCALLOC(profit->modpix, double, profit->modnaxisn[0]*profit->modnaxisn[1]);
QMALLOC(profit->psfpix, double, profit->modnaxisn[0]*profit->modnaxisn[1]);
QCALLOC(profit->modpix, float, profit->modnaxisn[0]*profit->modnaxisn[1]);
QMALLOC(profit->psfpix, float, profit->modnaxisn[0]*profit->modnaxisn[1]);
/* Allocate memory for the partial model */
QMALLOC(profit->pmodpix, float, profit->modnaxisn[0]*profit->modnaxisn[1]);
......@@ -252,14 +241,14 @@ void profit_fit(profitstruct *profit,
profit_resetparams(profit);
the_gal++;
//the_gal++;
/* Actual minimisation */
profit->niter = profit_minimize(profit, PROFIT_MAXITER);
profit_residuals(profit,field,wfield, 10.0, profit->param,profit->resi);
/*
QMEMCPY(profit->paraminit, oldparaminit, double, nparam);
QMEMCPY(profit->paraminit, oldparaminit, float, nparam);
if (profit_setparam(profit, PARAM_ARMS_PITCH, 160.0, 130.0, 175.0)==RETURN_OK)
{
oldchi2 = profit->chi2;
......@@ -269,7 +258,7 @@ the_gal++;
profit->niter = profit_minimize(profit, PROFIT_MAXITER);
if (profit->chi2 > oldchi2)
{
memcpy(profit->paraminit, oldparaminit, nparam*sizeof(double));
memcpy(profit->paraminit, oldparaminit, nparam*sizeof(float));
profit->chi2 = oldchi2;
profit->niter = oldniter;
}
......@@ -378,7 +367,7 @@ the_gal++;
obj2->poserra_prof = (float)sqrt(pmx2);
obj2->poserrb_prof = (float)sqrt(pmy2);
obj2->poserrtheta_prof = theta*180.0/PI;
obj2->poserrtheta_prof = (float)(theta/DEG);
}
if (FLAG(obj2.poserrcxx_prof))
......@@ -395,7 +384,7 @@ the_gal++;
if (FLAG(obj2.prof_mx2))
{
memset(profit->modpix, 0,
profit->modnaxisn[0]*profit->modnaxisn[1]*sizeof(double));
profit->modnaxisn[0]*profit->modnaxisn[1]*sizeof(float));
for (p=0; p<profit->nprof; p++)
prof_add(profit->prof[p], profit);
profit_moments(profit);
......@@ -542,11 +531,11 @@ the_gal++;
{
pprofit = *profit;
memset(pprofit.paramindex, 0, PARAM_NPARAM*sizeof(int));
memset(pprofit.paramlist, 0, PARAM_NPARAM*sizeof(double *));
memset(pprofit.paramlist, 0, PARAM_NPARAM*sizeof(float *));
pprofit.nparam = 0;
QMALLOC(pprofit.prof, profstruct *, 1);
pprofit.prof[0] = prof_init(&pprofit, PROF_DIRAC);
QMALLOC(pprofit.covar, double, pprofit.nparam*pprofit.nparam);
QMALLOC(pprofit.covar, float, pprofit.nparam*pprofit.nparam);
pprofit.nprof = 1;
profit_resetparams(&pprofit);
if (profit->paramlist[PARAM_X] && profit->paramlist[PARAM_Y])
......@@ -559,7 +548,7 @@ the_gal++;
profit_residuals(&pprofit,field,wfield, 10.0, pprofit.param,pprofit.resi);
dchi2 = 0.5*(pprofit.chi2 - profit->chi2);
obj2->prof_class_star = dchi2 < 50.0?
(dchi2 > -50.0? 2.0/(1.0+exp(dchi2)) : 2.0) : 0.0;
(dchi2 > -50.0? 2.0/(1.0+expf(dchi2)) : 2.0) : 0.0;
if (profit->flux > 0.0 && pprofit.flux > 0.0)
obj2->prof_concentration = -2.5*log10(pprofit.flux / profit->flux);
else if (profit->flux > 0.0)
......@@ -593,20 +582,21 @@ INPUT Profile-fitting structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 22/10/2008
VERSION 07/09/2009
***/
void profit_psf(profitstruct *profit)
{
double posin[2], posout[2], dnaxisn[2],
double flux;
float posin[2], posout[2], dnaxisn[2],
*pixout,
xcout,ycout, xcin,ycin, invpixstep, flux, norm;
xcout,ycout, xcin,ycin, invpixstep, norm;
int d,i;
psf = profit->psf;
psf_build(psf);
xcout = (double)(profit->modnaxisn[0]/2) + 1.0; /* FITS convention */
ycout = (double)(profit->modnaxisn[1]/2) + 1.0; /* FITS convention */
xcout = (float)(profit->modnaxisn[0]/2) + 1.0; /* FITS convention */
ycout = (float)(profit->modnaxisn[1]/2) + 1.0; /* FITS convention */
xcin = (psf->masksize[0]/2) + 1.0; /* FITS convention */
ycin = (psf->masksize[1]/2) + 1.0; /* FITS convention */
invpixstep = profit->pixstep / psf->pixstep;
......@@ -684,15 +674,15 @@ VERSION 23/05/2008
***/
int profit_minimize(profitstruct *profit, int niter)
{
double lm_opts[5], info[LM_INFO_SZ];
float lm_opts[5], info[LM_INFO_SZ];
int m,n;
/* Allocate work space */
n = profit->nparam;
m = profit->nresi;
memset(profit->resi, 0, profit->nresi*sizeof(double));
memset(profit->covar, 0, profit->nparam*profit->nparam*sizeof(double));
memset(profit->resi, 0, profit->nresi*sizeof(float));
memset(profit->covar, 0, profit->nparam*profit->nparam*sizeof(float));
profit_boundtounbound(profit, profit->paraminit);
/* Perform fit */
......@@ -700,9 +690,9 @@ int profit_minimize(profitstruct *profit, int niter)
lm_opts[1] = 1.0e-18;
lm_opts[2] = 1.0e-18;
lm_opts[3] = 1.0e-18;
lm_opts[4] = 1.0e-6;
lm_opts[4] = 1.0e-5;
niter = dlevmar_dif(profit_evaluate, profit->paraminit, profit->resi,
niter = slevmar_dif(profit_evaluate, profit->paraminit, profit->resi,
n, m, niter, lm_opts, info, NULL, profit->covar, profit);
profit_unboundtobound(profit, profit->paraminit);
......@@ -713,7 +703,7 @@ int profit_minimize(profitstruct *profit, int niter)
/****** profit_printout *******************************************************
PROTO void profit_printout(int n_par, double* par, int m_dat, double* fvec,
PROTO void profit_printout(int n_par, float* par, int m_dat, float* fvec,
void *data, int iflag, int iter, int nfev )
PURPOSE Provide a function to print out results to lmfit.
INPUT Number of fitted parameters,
......@@ -729,7 +719,7 @@ NOTES Input arguments are there only for compatibility purposes (unused)
AUTHOR E. Bertin (IAP)
VERSION 17/09/2008
***/
void profit_printout(int n_par, double* par, int m_dat, double* fvec,
void profit_printout(int n_par, float* par, int m_dat, float* fvec,
void *data, int iflag, int iter, int nfev )
{
checkstruct *check;
......@@ -760,7 +750,7 @@ void profit_printout(int n_par, double* par, int m_dat, double* fvec,
/****** profit_evaluate ******************************************************
PROTO void profit_evaluate(double *par, double *fvec, int m, int n,
PROTO void profit_evaluate(float *par, float *fvec, int m, int n,
void *adata)
PURPOSE Provide a function returning residuals to levmar.
INPUT Pointer to the vector of parameters,
......@@ -773,7 +763,7 @@ NOTES Input arguments are there only for compatibility purposes (unused)
AUTHOR E. Bertin (IAP)
VERSION 18/09/2008
***/
void profit_evaluate(double *par, double *fvec, int m, int n,
void profit_evaluate(float *par, float *fvec, int m, int n,
void *adata)
{
profitstruct *profit;
......@@ -788,8 +778,8 @@ void profit_evaluate(double *par, double *fvec, int m, int n,
/****** profit_residuals ******************************************************
PROTO double *prof_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, double dynparam, double *param, double *resi)
PROTO float *prof_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, float dynparam, float *param, float *resi)
PURPOSE Compute the vector of residuals between the data and the galaxy
profile model.
INPUT Profile-fitting structure,
......@@ -803,13 +793,13 @@ NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 20/03/2009
***/
double *profit_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, double dynparam, double *param, double *resi)
float *profit_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, float dynparam, float *param, float *resi)
{
int p;
memset(profit->modpix, 0,
profit->modnaxisn[0]*profit->modnaxisn[1]*sizeof(double));
profit->modnaxisn[0]*profit->modnaxisn[1]*sizeof(float));
for (p=0; p<profit->nparam; p++)
profit->param[p] = param[p];
/* Simple PSF shortcut */
......@@ -830,8 +820,8 @@ double *profit_residuals(profitstruct *profit, picstruct *field,
/****** profit_compresi ******************************************************
PROTO double *prof_compresi(profitstruct *profit, double dynparam,
double *resi)
PROTO float *prof_compresi(profitstruct *profit, float dynparam,
float *resi)
PURPOSE Compute the vector of residuals between the data and the galaxy
profile model.
INPUT Profile-fitting structure,
......@@ -840,12 +830,12 @@ INPUT Profile-fitting structure,
OUTPUT Vector of residuals.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 15/04/2009
VERSION 07/09/2009
***/
double *profit_compresi(profitstruct *profit, double dynparam, double *resi)
float *profit_compresi(profitstruct *profit, float dynparam, float *resi)
{
double *resit,
error, x1c,x2,rmin;
double error;
float *resit;
PIXTYPE *objpix, *objweight, *lmodpix,
val,val2,wval, invsig;
int npix, i;
......@@ -856,9 +846,6 @@ double *profit_compresi(profitstruct *profit, double dynparam, double *resi)
objweight = profit->objweight;
lmodpix = profit->lmodpix;
error = 0.0;
x1c = (double)(profit->objnaxisn[0]/2);
rmin = profit->obj2->hl_radius / 2.0;
x2 = -(double)(profit->objnaxisn[1]/2);
npix = profit->objnaxisn[0]*profit->objnaxisn[1];
if (dynparam > 0.0)
{
......@@ -869,7 +856,7 @@ double *profit_compresi(profitstruct *profit, double dynparam, double *resi)
if ((wval=*(objweight++))>0.0)
{
val2 = (val - *lmodpix)*wval*invsig;
val2 = val2>0.0? LOGF(1.0+val2) : -LOGF(1.0-val2);
val2 = val2>0.0? logf(1.0+val2) : -logf(1.0-val2);
*(resit++) = val2*dynparam;
error += val2*val2;
}
......@@ -896,27 +883,28 @@ double *profit_compresi(profitstruct *profit, double dynparam, double *resi)
/****** profit_resample ******************************************************
PROTO void prof_resample(profitstruct *profit, double *inpix,
PROTO void prof_resample(profitstruct *profit, float *inpix,
PIXTYPE *outpix)
PURPOSE Resample the current full resolution model to image resolution.
INPUT Profile-fitting structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 18/03/2009
VERSION 07/09/2009
***/
void profit_resample(profitstruct *profit, double *inpix, PIXTYPE *outpix,
double factor)
void profit_resample(profitstruct *profit, float *inpix, PIXTYPE *outpix,
float factor)
{
double posin[2], posout[2], dnaxisn[2],
double flux;
float posin[2], posout[2], dnaxisn[2],
*dx,*dy,
xcout,ycout, xcin,ycin, invpixstep, flux;
xcout,ycout, xcin,ycin, invpixstep;
int d,i;
xcout = (double)(profit->objnaxisn[0]/2) + 1.0; /* FITS convention */
xcout = (float)(profit->objnaxisn[0]/2) + 1.0; /* FITS convention */
if ((dx=(profit->paramlist[PARAM_X])))
xcout += *dx;
ycout = (double)(profit->objnaxisn[1]/2) + 1.0; /* FITS convention */
ycout = (float)(profit->objnaxisn[1]/2) + 1.0; /* FITS convention */
if ((dy=(profit->paramlist[PARAM_Y])))
ycout += *dy;
xcin = (profit->modnaxisn[0]/2) + 1.0; /* FITS convention */
......@@ -952,7 +940,7 @@ void profit_resample(profitstruct *profit, double *inpix, PIXTYPE *outpix,
/****** profit_convolve *******************************************************
PROTO void profit_convolve(profitstruct *profit, double *modpix)
PROTO void profit_convolve(profitstruct *profit, float *modpix)
PURPOSE Convolve a model image with the local PSF.
INPUT Pointer to the profit structure,
Pointer to the image raster.
......@@ -961,7 +949,7 @@ NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 15/09/2008
***/
void profit_convolve(profitstruct *profit, double *modpix)
void profit_convolve(profitstruct *profit, float *modpix)
{
if (!profit->psfdft)
profit_makedft(profit);
......@@ -984,8 +972,8 @@ VERSION 22/04/2008
void profit_makedft(profitstruct *profit)
{
psfstruct *psf;
double *mask,*maskt, *ppix;
double dx,dy, r,r2,rmin,rmin2,rmax,rmax2,rsig,invrsig2;
float *mask,*maskt, *ppix;
float dx,dy, r,r2,rmin,rmin2,rmax,rmax2,rsig,invrsig2;
int width,height,npix,offset, psfwidth,psfheight,psfnpix,
cpwidth, cpheight,hcpwidth,hcpheight, i,j,x,y;
......@@ -998,7 +986,7 @@ void profit_makedft(profitstruct *profit)
width = profit->modnaxisn[0];
height = profit->modnaxisn[1];
npix = width*height;
QCALLOC(mask, double, npix);
QCALLOC(mask, float, npix);
cpwidth = (width>psfwidth)?psfwidth:width;
hcpwidth = cpwidth>>1;
cpwidth = hcpwidth<<1;
......@@ -1055,12 +1043,12 @@ void profit_makedft(profitstruct *profit)
dx = 0.0;
for (x=hcpwidth; x--; dx+=1.0, maskt++)
if ((r2=dx*dx+dy*dy)>rmin2)
*maskt *= (r2>rmax2)?0.0:exp((2*rmin*sqrt(r2)-r2-rmin2)*invrsig2);
*maskt *= (r2>rmax2)?0.0:expf((2*rmin*sqrtf(r2)-r2-rmin2)*invrsig2);
dx = -hcpwidth;
maskt += offset;
for (x=hcpwidth; x--; dx+=1.0, maskt++)
if ((r2=dx*dx+dy*dy)>rmin2)
*maskt *= (r2>rmax2)?0.0:exp((2*rmin*sqrt(r2)-r2-rmin2)*invrsig2);
*maskt *= (r2>rmax2)?0.0:expf((2*rmin*sqrtf(r2)-r2-rmin2)*invrsig2);
}
dy = -hcpheight;
maskt += width*(height-cpheight);
......@@ -1069,12 +1057,12 @@ void profit_makedft(profitstruct *profit)
dx = 0.0;
for (x=hcpwidth; x--; dx+=1.0, maskt++)
if ((r2=dx*dx+dy*dy)>rmin2)
*maskt *= (r2>rmax2)?0.0:exp((2*rmin*sqrt(r2)-r2-rmin2)*invrsig2);
*maskt *= (r2>rmax2)?0.0:expf((2*rmin*sqrtf(r2)-r2-rmin2)*invrsig2);
dx = -hcpwidth;
maskt += offset;
for (x=hcpwidth; x--; dx+=1.0, maskt++)
if ((r2=dx*dx+dy*dy)>rmin2)
*maskt *= (r2>rmax2)?0.0:exp((2*rmin*sqrt(r2)-r2-rmin2)*invrsig2);
*maskt *= (r2>rmax2)?0.0:expf((2*rmin*sqrtf(r2)-r2-rmin2)*invrsig2);
}
/* Finally move to Fourier space */
......@@ -1101,7 +1089,7 @@ VERSION 18/09/2008
int profit_copyobjpix(profitstruct *profit, picstruct *field,
picstruct *wfield)
{
double dx2, dy2, dr2, rad2;
float dx2, dy2, dr2, rad2;
PIXTYPE *pixin,*pixout, *wpixin,*wpixout,
backnoise2, invgain, satlevel, wthresh, pix, wpix;
int i,x,y, xmin,xmax,ymin,ymax, w,h,w2,dw, npix, off, gainflag,
......@@ -1222,7 +1210,7 @@ int profit_copyobjpix(profitstruct *profit, picstruct *field,
/****** profit_spiralindex ****************************************************
PROTO double profit_spiralindex(profitstruct *profit)
PROTO float profit_spiralindex(profitstruct *profit)
PURPOSE Compute the spiral index of a galaxy image (positive for arms
extending counter-clockwise and negative for arms extending CW, 0 for
no spiral pattern).
......@@ -1232,11 +1220,11 @@ NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 18/09/2008
***/
double profit_spiralindex(profitstruct *profit)
float profit_spiralindex(profitstruct *profit)
{
objstruct *obj;
obj2struct *obj2;
double *dx,*dy, *fdx,*fdy, *gdx,*gdy, *gdxt,*gdyt, *pix,
float *dx,*dy, *fdx,*fdy, *gdx,*gdy, *gdxt,*gdyt, *pix,
fwhm, invtwosigma2, hw,hh, ohw,ohh, x,y,xstart, tx,ty,txstart,
gx,gy, r2, spirindex, invsig, val, sep;
PIXTYPE *fpix;
......@@ -1253,13 +1241,13 @@ double profit_spiralindex(profitstruct *profit)
sep = 2.0;
invtwosigma2 = -(2.35*2.35/(2.0*fwhm*fwhm));
hw = (double)(profit->objnaxisn[0]/2);
hw = (float)(profit->objnaxisn[0]/2);
ohw = profit->objnaxisn[0] - hw;
hh = (double)(profit->objnaxisn[1]/2);
hh = (float)(profit->objnaxisn[1]/2);
ohh = profit->objnaxisn[1] - hh;
txstart = -hw;
ty = -hh;
QMALLOC(dx, double, npix);
QMALLOC(dx, float, npix);
pix = dx;
for (j=profit->objnaxisn[1]; j--; ty+=1.0)
{
......@@ -1272,7 +1260,7 @@ double profit_spiralindex(profitstruct *profit)
- exp(invtwosigma2*((x-sep)*(x-sep)+y*y));
}
}
QMALLOC(dy, double, npix);
QMALLOC(dy, float, npix);
pix = dy;
ty = -hh;
for (j=profit->objnaxisn[1]; j--; ty+=1.0)
......@@ -1287,7 +1275,7 @@ double profit_spiralindex(profitstruct *profit)
}
}
QMALLOC(gdx, double, npix);
QMALLOC(gdx, float, npix);
gdxt = gdx;
fpix = profit->objpix;
invsig = npix/profit->sigma;
......@@ -1297,7 +1285,7 @@ double profit_spiralindex(profitstruct *profit)
*(gdxt++) = (val>0.0? log(1.0+val) : -log(1.0-val));
}
gdy = NULL; /* to avoid gcc -Wall warnings */
QMEMCPY(gdx, gdy, double, npix);
QMEMCPY(gdx, gdy, float, npix);
fdx = fft_rtf(dx, profit->objnaxisn);
fft_conv(gdx, fdx, profit->objnaxisn);
fdy = fft_rtf(dy, profit->objnaxisn);
......@@ -1341,21 +1329,21 @@ INPUT Profile-fitting structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 29/06/2009
VERSION 07/09/2009
***/
void profit_moments(profitstruct *profit)
{
objstruct *obj;
obj2struct *obj2;
double *pix,
hw,hh, x,y, xstart, val,
mx,my, sum, mx2,my2,mxy, den, r2max;
double mx,my, sum, mx2,my2,mxy, den;
float *pix,
hw,hh, x,y, xstart, val, r2max;
int ix,iy;
obj = profit->obj;
obj2 = profit->obj2;
hw = (double)(profit->modnaxisn[0]/2);
hh = (double)(profit->modnaxisn[1]/2);
hw = (float)(profit->modnaxisn[0]/2);
hh = (float)(profit->modnaxisn[1]/2);
r2max = hw<hh? hw*hw : hh*hh;
xstart = -hw;
y = -hh;
......@@ -1407,7 +1395,7 @@ void profit_moments(profitstruct *profit)
/****** profit_addparam *******************************************************
PROTO void profit_addparam(profitstruct *profit, paramenum paramindex,
double **param)
float **param)
PURPOSE Add a profile parameter to the list of fitted items.
INPUT Pointer to the profit structure,
Parameter index,
......@@ -1418,7 +1406,7 @@ AUTHOR E. Bertin (IAP)
VERSION 29/03/2007
***/
void profit_addparam(profitstruct *profit, paramenum paramindex,
double **param)
float **param)
{
/* Check whether the parameter has already be registered */
if (profit->paramlist[paramindex])
......@@ -1449,7 +1437,7 @@ void profit_resetparam(profitstruct *profit, paramenum paramtype)
{
objstruct *obj;
obj2struct *obj2;
double param, parammin,parammax;
float param, parammin,parammax;
obj = profit->obj;
obj2 = profit->obj2;
......@@ -1647,7 +1635,7 @@ void profit_resetparams(profitstruct *profit)
/****** profit_setparam ****************************************************
PROTO void profit_setparam(profitstruct *profit, paramenum paramtype,
double param, double parammin, double parammax)
float param, float parammin, float parammax)
PURPOSE Set the actual, lower and upper boundary values of a profile parameter.
INPUT Pointer to the profit structure,
Parameter index,
......@@ -1659,9 +1647,9 @@ AUTHOR E. Bertin (IAP)
VERSION 15/03/2009
***/
int profit_setparam(profitstruct *profit, paramenum paramtype,
double param, double parammin, double parammax)
float param, float parammin, float parammax)
{
double *paramptr;
float *paramptr;
int index;
/* Check whether the parameter has already be registered */
......@@ -1679,15 +1667,15 @@ int profit_setparam(profitstruct *profit, paramenum paramtype,
/****** profit_boundtounbound *************************************************
PROTO void profit_boundtounbound(profitstruct *profit, double *param)
PROTO void profit_boundtounbound(profitstruct *profit, float *param)
PURPOSE Convert parameters from bounded to unbounded space.
INPUT Pointer to the profit structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 25/05/2007
VERSION 07/09/2009
***/
void profit_boundtounbound(profitstruct *profit, double *param)
void profit_boundtounbound(profitstruct *profit, float *param)
{
double num,den;
int p;
......@@ -1697,7 +1685,7 @@ void profit_boundtounbound(profitstruct *profit, double *param)
{
num = param[p] - profit->parammin[p];
den = profit->parammax[p] - param[p];
param[p] = num>1e-100? (den>1e-100? log(num/den): 200.0) : -200.0;
param[p] = num>1e-50? (den>1e-50? log(num/den): 50.0) : -50.0;
}
return;
......@@ -1706,22 +1694,22 @@ void profit_boundtounbound(profitstruct *profit, double *param)
/****** profit_unboundtobound *************************************************
PROTO void profit_unboundtobound(profitstruct *profit, double *param)
PROTO void profit_unboundtobound(profitstruct *profit, float *param)
PURPOSE Convert parameters from unbounded to bounded space.
INPUT Pointer to the profit structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 18/05/2007
VERSION 18/05/2009
***/
void profit_unboundtobound(profitstruct *profit, double *param)
void profit_unboundtobound(profitstruct *profit, float *param)
{
int p;
for (p=0; p<profit->nparam; p++)
if (profit->parammin[p]!=profit->parammax[p])
param[p] = (profit->parammax[p] - profit->parammin[p])
/ (1.0 + exp(-(param[p]>200.0? 200.0 : param[p])))
/ (1.0 + exp(-(param[p]>50.0? 50.0 : param[p])))
+ profit->parammin[p];
return;
......@@ -1735,12 +1723,13 @@ INPUT Pointer to the profit structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 30/04/2008
VERSION 07/09/2009
***/
void profit_covarunboundtobound(profitstruct *profit)
{
double *covar, *dxdy,*x,*xmin,*xmax,
dxmin, dxmax;
double *dxdy,
dxmin,dxmax;
float *covar, *x,*xmin,*xmax;
int p,p1,p2, nparam;
nparam = profit->nparam;
......@@ -1762,7 +1751,7 @@ void profit_covarunboundtobound(profitstruct *profit)
covar = profit->covar;
for (p2=0; p2<nparam; p2++)
for (p1=0; p1<nparam; p1++)
*(covar++) *= dxdy[p1]*dxdy[p2];
*(covar++) *= (float)(dxdy[p1]*dxdy[p2]);
free(dxdy);
......@@ -1783,7 +1772,7 @@ VERSION 22/04/2008
profstruct *prof_init(profitstruct *profit, proftypenum profcode)
{
profstruct *prof;
double *pix,
float *pix,
rmax2, re2, dy2,r2, scale, zero, k,n, hinvn;
int width,height, ixc,iyc, ix,iy, nsub,
d,s;
......@@ -1904,7 +1893,7 @@ profstruct *prof_init(profitstruct *profit, proftypenum profcode)
width = prof->naxisn[0] = PROFIT_PROFRES;
height = prof->naxisn[1] = PROFIT_PROFRES;
nsub = prof->naxisn[2] = PROFIT_PROFSRES;
QCALLOC(prof->pix, double, width*height*nsub);
QCALLOC(prof->pix, float, width*height*nsub);
ixc = width/2;
iyc = height/2;
rmax2 = (ixc - 1.0)*(ixc - 1.0);
......@@ -1954,7 +1943,7 @@ profstruct *prof_init(profitstruct *profit, proftypenum profcode)
(prof->kernelwidth[d] = interp_kernwidth[prof->interptype[d]]);
}
prof->kernelnlines /= prof->kernelwidth[0];
QMALLOC(prof->kernelbuf, double, prof->kernelnlines);
QMALLOC(prof->kernelbuf, float, prof->kernelnlines);
}
return prof;
......@@ -1991,16 +1980,15 @@ INPUT Profile structure,
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 07/08/2009
VERSION 07/09/2009
***/
void prof_add(profstruct *prof, profitstruct *profit)
{
double posin[PROFIT_MAXEXTRA], posout[2], dnaxisn[2],
*pixout,
flux,fluxfac, scaling;
float *pixin,
amp,ctheta,stheta,cd11,cd12,cd21,cd22, dcd11,dcd21, dx1,dx2,
x1,x10,x2, x1cin,x2cin, x1cout,x2cout, xscale,yscale, saspect,
double xscale, yscale, saspect, ctheta,stheta, flux, scaling;
float posin[PROFIT_MAXEXTRA], posout[2], dnaxisn[2],
*pixin, *pixout,
fluxfac, amp,cd11,cd12,cd21,cd22, dcd11,dcd21, dx1,dx2,
x1,x10,x2, x1cin,x2cin, x1cout,x2cout,
x1in,x2in, odx, ostep,
n,k, hinvn, x1t,x2t, ca,sa, u,umin,
armamp,arm2amp, armrdphidr, armrdphidrvar, posang,
......@@ -2033,17 +2021,17 @@ void prof_add(profstruct *prof, profitstruct *profit)
0.0 : fabs(scaling / (*prof->scale*prof->typscale));
yscale = (*prof->scale*saspect == 0.0)?
0.0 : fabs(scaling / (*prof->scale*prof->typscale*saspect));
cd11 = xscale*ctheta;
cd12 = xscale*stheta;
cd21 = -yscale*stheta;
cd22 = yscale*ctheta;
cd11 = (float)(xscale*ctheta);
cd12 = (float)(xscale*stheta);
cd21 = (float)(-yscale*stheta);
cd22 = (float)(yscale*ctheta);
}
dx1 = 0.0; /* Shifting operations have been moved to profit_resample() */
dx2 = 0.0; /* Shifting operations have been moved to profit_resample() */
x1cout = (double)(profit->modnaxisn[0]/2);
x2cout = (double)(profit->modnaxisn[1]/2);
x1cout = (float)(profit->modnaxisn[0]/2);
x2cout = (float)(profit->modnaxisn[1]/2);
switch(prof->code)
{
......@@ -2064,7 +2052,7 @@ void prof_add(profstruct *prof, profitstruct *profit)
x1in = cd12*x2 + cd11*x1;
x2in = cd22*x2 + cd21*x1;
ra = x1in*x1in+x2in*x2in;
val = expf(k*PROFIT_POWF(ra,hinvn));
val = expf(k*expf(logf(ra)*hinvn));
noversamp = (int)(val*PROFIT_OVERSAMP+0.1);
if (noversamp < 2)
*(pixin++) = val;
......@@ -2325,20 +2313,20 @@ width = 3.0;
if (posin[d] < 0.99999)
{
if (prof->extracycleflag[e])
posin[d] += (double)prof->naxisn[d];
posin[d] += (float)prof->naxisn[d];
else
posin[d] = 1.0;
}
else if (posin[d] > (double)prof->naxisn[d])
else if (posin[d] > (float)prof->naxisn[d])
{
if (prof->extracycleflag[e])
posin[d] = (prof->extracycleflag[e])?
fmod(posin[d], (double)prof->naxisn[d])
: (double)prof->naxisn[d];
fmod(posin[d], (float)prof->naxisn[d])
: (float)prof->naxisn[d];
}
}
x1cin = (double)(prof->naxisn[0]/2);
x2cin = (double)(prof->naxisn[1]/2);
x1cin = (float)(prof->naxisn[0]/2);
x2cin = (float)(prof->naxisn[1]/2);
pixin = profit->pmodpix;
for (i=npix; i--;)
{
......@@ -2385,7 +2373,7 @@ width = 3.0;
pixin = profit->pmodpix;
for (i=npix; i--; pixin++)
if (*pixin >= thresh)
flux += *pixin;
flux += (double)*pixin;
else
*pixin = 0.0;
......@@ -2402,7 +2390,7 @@ width = 3.0;
/****** prof_interpolate ******************************************************
PROTO double prof_interpolate(profstruct *prof, double *posin)
PROTO float prof_interpolate(profstruct *prof, float *posin)
PURPOSE Interpolate a multidimensional model profile at a given position.
INPUT Profile structure,
input position vector.
......@@ -2411,9 +2399,9 @@ NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 10/12/2006
***/
static double prof_interpolate(profstruct *prof, double *posin)
static float prof_interpolate(profstruct *prof, float *posin)
{
double dpos[2+PROFIT_MAXEXTRA],
float dpos[2+PROFIT_MAXEXTRA],
kernel_vector[INTERP_MAXKERNELWIDTH],
*kvector, *pixin,*pixout,
val;
......@@ -2496,7 +2484,7 @@ static double prof_interpolate(profstruct *prof, double *posin)
/****** interpolate_pix ******************************************************
PROTO void interpolate_pix(double *posin, double *pix, int naxisn,
PROTO void interpolate_pix(float *posin, float *pix, int naxisn,
interpenum interptype)
PURPOSE Interpolate a model profile at a given position.
INPUT Profile structure,
......@@ -2508,10 +2496,10 @@ NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 07/12/2006
***/
static double interpolate_pix(double *posin, double *pix, int *naxisn,
static float interpolate_pix(float *posin, float *pix, int *naxisn,
interpenum interptype)
{
double buffer[INTERP_MAXKERNELWIDTH],
float buffer[INTERP_MAXKERNELWIDTH],
kernel[INTERP_MAXKERNELWIDTH], dpos[2],
*kvector, *pixin, *pixout,
val;
......@@ -2567,7 +2555,7 @@ static double interpolate_pix(double *posin, double *pix, int *naxisn,
/****** make_kernel **********************************************************
PROTO void make_kernel(double pos, double *kernel, interpenum interptype)
PROTO void make_kernel(float pos, float *kernel, interpenum interptype)
PURPOSE Conpute interpolation-kernel data
INPUT Position,
Pointer to the output kernel data,
......@@ -2575,11 +2563,11 @@ INPUT Position,
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 28/04/2009
VERSION 07/09/2009
***/
void make_kernel(double pos, double *kernel, interpenum interptype)
void make_kernel(float pos, float *kernel, interpenum interptype)
{
double x, val, sinx1,sinx2,sinx3,cosx1;
float x, val, sinx1,sinx2,sinx3,cosx1;
if (interptype == INTERP_NEARESTNEIGHBOUR)
*kernel = 1;
......@@ -2601,10 +2589,10 @@ void make_kernel(double pos, double *kernel, interpenum interptype)
{
x = -PI/2.0*(pos+1.0);
#ifdef HAVE_SINCOS
sincos(x, &sinx1, &cosx1);
sincosf(x, &sinx1, &cosx1);
#else
sinx1 = sin(x);
cosx1 = cos(x);
sinx1 = sinf(x);
cosx1 = cosf(x);
#endif
val = (*(kernel++) = sinx1/(x*x));
x += PI/2.0;
......@@ -2635,10 +2623,10 @@ void make_kernel(double pos, double *kernel, interpenum interptype)
{
x = -PI/3.0*(pos+2.0);
#ifdef HAVE_SINCOS
sincos(x, &sinx1, &cosx1);
sincosf(x, &sinx1, &cosx1);
#else
sinx1 = sin(x);
cosx1 = cos(x);
sinx1 = sinf(x);
cosx1 = cosf(x);
#endif
val = (*(kernel++) = sinx1/(x*x));
x += PI/3.0;
......@@ -2679,10 +2667,10 @@ void make_kernel(double pos, double *kernel, interpenum interptype)
{
x = -PI/4.0*(pos+3.0);
#ifdef HAVE_SINCOS
sincos(x, &sinx1, &cosx1);
sincosf(x, &sinx1, &cosx1);
#else
sinx1 = sin(x);
cosx1 = cos(x);
sinx1 = sinf(x);
cosx1 = cosf(x);
#endif
val = (*(kernel++) = sinx1/(x*x));
x += PI/4.0;
......
......@@ -9,7 +9,7 @@
*
* Contents: Include file for profit.c.
*
* Last modify: 20/03/2009
* Last modify: 07/09/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -70,32 +70,32 @@ typedef enum {PARAM_BACK, PARAM_X, PARAM_Y,
typedef struct
{
proftypenum code; /* Model code */
double *pix; /* Full pixmap of the model */
float *pix; /* Full pixmap of the model */
int naxis; /* Number of pixmap dimensions */
int naxisn[3]; /* Pixmap size for each axis */
double typscale; /* Typical scale in prof pixels */
double fluxfac; /* Flux normalisation factor */
float typscale; /* Typical scale in prof pixels */
float fluxfac; /* Flux normalisation factor */
/* Generic presentation parameters */
double *flux; /* Integrated flux */
double *x[2]; /* Coordinate vector */
double *scale; /* Scaling vector */
double *aspect; /* Aspect ratio */
double *posangle; /* Position angle (CCW/NAXIS1)*/
double *featfrac; /* Feature flux fraction */
double *featscale; /* Feature relative scalelength */
double *featstart; /* Feature relative starting radius */
double *featposang; /* Feature position angle */
double *featpitch; /* Feature pitch */
double *featpitchvar; /* Feature pitch variation */
double *featwidth; /* Feature width */
double *feataspect; /* Feature aspect ratio */
double *extra[PROFIT_MAXEXTRA];/* Parameters along extra-dimension */
double extrazero[PROFIT_MAXEXTRA]; /* Zero-point along extra-dim. */
double extrascale[PROFIT_MAXEXTRA]; /* Scaling along extra-dim. */
float *flux; /* Integrated flux */
float *x[2]; /* Coordinate vector */
float *scale; /* Scaling vector */
float *aspect; /* Aspect ratio */
float *posangle; /* Position angle (CCW/NAXIS1)*/
float *featfrac; /* Feature flux fraction */
float *featscale; /* Feature relative scalelength */
float *featstart; /* Feature relative starting radius */
float *featposang; /* Feature position angle */
float *featpitch; /* Feature pitch */
float *featpitchvar; /* Feature pitch variation */
float *featwidth; /* Feature width */
float *feataspect; /* Feature aspect ratio */
float *extra[PROFIT_MAXEXTRA];/* Parameters along extra-dimension */
float extrazero[PROFIT_MAXEXTRA]; /* Zero-point along extra-dim. */
float extrascale[PROFIT_MAXEXTRA]; /* Scaling along extra-dim. */
int extracycleflag[PROFIT_MAXEXTRA]; /* !=0 for cycling dim. */
interpenum interptype[2+PROFIT_MAXEXTRA]; /* Interpolation type */
int kernelwidth[2+PROFIT_MAXEXTRA]; /* Kernel size */
double *kernelbuf; /* Kernel buffer */
float *kernelbuf; /* Kernel buffer */
int kernelnlines; /* Number of interp kernel lines */
} profstruct;
......@@ -104,22 +104,22 @@ typedef struct
objstruct *obj; /* Current object */
obj2struct *obj2; /* Current object */
int nparam; /* Number of parameters to be fitted */
double *paramlist[PARAM_NPARAM]; /* flat parameter list */
float *paramlist[PARAM_NPARAM]; /* flat parameter list */
int paramindex[PARAM_NPARAM];/* Vector of parameter indices */
double param[PARAM_NPARAM]; /* Vector of parameters to be fitted */
double paraminit[PARAM_NPARAM];/* Parameter initial guesses */
double parammin[PARAM_NPARAM]; /* Parameter lower limits */
double parammax[PARAM_NPARAM]; /* Parameter upper limits */
double *covar; /* Covariance matrix */
double paramerr[PARAM_NPARAM]; /* Std deviations of parameters */
float param[PARAM_NPARAM]; /* Vector of parameters to be fitted */
float paraminit[PARAM_NPARAM];/* Parameter initial guesses */
float parammin[PARAM_NPARAM]; /* Parameter lower limits */
float parammax[PARAM_NPARAM]; /* Parameter upper limits */
float *covar; /* Covariance matrix */
float paramerr[PARAM_NPARAM]; /* Std deviations of parameters */
int niter; /* Number of iterations */
profstruct **prof; /* Array of pointers to profiles */
int nprof; /* Number of profiles to consider */
struct psf *psf; /* PSF */
double pixstep; /* Model/PSF sampling step */
double *psfdft; /* Compressed Fourier Transform of the PSF */
double *psfpix; /* Full res. pixmap of the PSF */
double *modpix; /* Full res. pixmap of the complete model */
float pixstep; /* Model/PSF sampling step */
float *psfdft; /* Compressed Fourier Transform of the PSF */
float *psfpix; /* Full res. pixmap of the PSF */
float *modpix; /* Full res. pixmap of the complete model */
float *pmodpix; /* Full res. pixmap of the partial model */
int modnaxisn[3]; /* Dimensions along each axis */
PIXTYPE *lmodpix; /* Low resolution pixmap of the model */
......@@ -127,12 +127,12 @@ typedef struct
PIXTYPE *objweight; /* Copy of object weight-map */
int objnaxisn[2]; /* Dimensions along each axis */
int ix, iy; /* Integer coordinates of object pixmap */
double *resi; /* Vector of residuals */
float *resi; /* Vector of residuals */
int nresi; /* Number of residual elements */
double chi2; /* Std error per residual element */
double sigma; /* Standard deviation of the pixel values */
double flux; /* Total flux in final convolved model */
double spirindex; /* Spiral index (>0 for CCW) */
float chi2; /* Std error per residual element */
float sigma; /* Standard deviation of the pixel values */
float flux; /* Total flux in final convolved model */
float spirindex; /* Spiral index (>0 for CCW) */
} profitstruct;
/*----------------------------- Global variables ----------------------------*/
......@@ -142,41 +142,41 @@ profitstruct *profit_init(struct psf *psf);
profstruct *prof_init(profitstruct *profit, proftypenum profcode);
double *profit_compresi(profitstruct *profit, double dynparam,
double *resi),
float *profit_compresi(profitstruct *profit, float dynparam,
float *resi),
*profit_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, double dynparam,
double *param, double *resi),
picstruct *wfield, float dynparam,
float *param, float *resi),
profit_spiralindex(profitstruct *profit);
int profit_copyobjpix(profitstruct *profit, picstruct *field,
picstruct *wfield),
profit_minimize(profitstruct *profit, int niter),
profit_setparam(profitstruct *profit, paramenum paramtype,
double param, double parammin, double parammax);
float param, float parammin, float parammax);
void prof_add(profstruct *prof, profitstruct *profit),
prof_end(profstruct *prof),
profit_addparam(profitstruct *profit, paramenum paramindex,
double **param),
profit_boundtounbound(profitstruct *profit, double *param),
float **param),
profit_boundtounbound(profitstruct *profit, float *param),
profit_fit(profitstruct *profit,
picstruct *field, picstruct *wfield,
objstruct *obj, obj2struct *obj2),
profit_convolve(profitstruct *profit, double *modpix),
profit_convolve(profitstruct *profit, float *modpix),
profit_covarunboundtobound(profitstruct *profit),
profit_end(profitstruct *profit),
profit_evaluate(double *par, double *fvec, int m, int n,
profit_evaluate(float *par, float *fvec, int m, int n,
void *adata),
profit_makedft(profitstruct *profit),
profit_moments(profitstruct *profit),
profit_printout(int n_par, double* par, int m_dat, double* fvec,
profit_printout(int n_par, float* par, int m_dat, float* fvec,
void *data, int iflag, int iter, int nfev ),
profit_psf(profitstruct *profit),
profit_resample(profitstruct *profit, double *inpix,
PIXTYPE *outpix, double factor),
profit_resample(profitstruct *profit, float *inpix,
PIXTYPE *outpix, float factor),
profit_resetparam(profitstruct *profit, paramenum paramtype),
profit_resetparams(profitstruct *profit),
profit_unboundtobound(profitstruct *profit, double *param);
profit_unboundtobound(profitstruct *profit, float *param);
#endif
......@@ -1020,8 +1020,8 @@ Build the local PSF (function of "context").
void psf_build(psfstruct *psf)
{
static double pos[POLY_MAXDIM];
double *pl, *basis, fac;
float *ppc;
double *basis, fac;
float *ppc, *pl;
int i,n,p, ndim, npix;
npix = psf->masksize[0]*psf->masksize[1];
......
......@@ -68,7 +68,7 @@ typedef struct psf
int *masksize; /* PSF mask dimensions */
int masknpix; /* Total number of involved PSF pixels */
float *maskcomp; /* Complete pix. data (PSF components) */
double *maskloc; /* Local PSF */
float *maskloc; /* Local PSF */
double **context; /* Contexts */
t_type *contexttyp; /* Context types */
char **contextname; /* Array of context key-names */
......
......@@ -72,6 +72,9 @@ CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
......@@ -49,6 +49,9 @@ DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
ATLAS_CFLAGS = @ATLAS_CFLAGS@
ATLAS_ERROR = @ATLAS_ERROR@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment