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