Commit 7f3c6c33 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Removed multithreading in FFTs (would degrade performance).

Added computation of FLUXERR_MODEL and MAGERR_MODEL.
Fixed a numerical bug in E1MODEL_IMAGE and E2MODEL_IMAGE.
Improved onscreen display.
Pushed version number to 2.8.7
parent ad67010b
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for sextractor 2.8.6.
# Generated by GNU Autoconf 2.61 for sextractor 2.8.7.
#
# Report bugs to <bertin@iap.fr>.
#
......@@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='sextractor'
PACKAGE_TARNAME='sextractor'
PACKAGE_VERSION='2.8.6'
PACKAGE_STRING='sextractor 2.8.6'
PACKAGE_VERSION='2.8.7'
PACKAGE_STRING='sextractor 2.8.7'
PACKAGE_BUGREPORT='bertin@iap.fr'
 
ac_unique_file="src/makeit.c"
......@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sextractor 2.8.6 to adapt to many kinds of systems.
\`configure' configures sextractor 2.8.7 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1475,7 +1475,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sextractor 2.8.6:";;
short | recursive ) echo "Configuration of sextractor 2.8.7:";;
esac
cat <<\_ACEOF
 
......@@ -1599,7 +1599,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sextractor configure 2.8.6
sextractor configure 2.8.7
generated by GNU Autoconf 2.61
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
......@@ -1613,7 +1613,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by sextractor $as_me 2.8.6, which was
It was created by sextractor $as_me 2.8.7, which was
generated by GNU Autoconf 2.61. Invocation command line was
 
$ $0 $@
......@@ -2290,7 +2290,7 @@ fi
 
# Define the identity of the package.
PACKAGE='sextractor'
VERSION='2.8.6'
VERSION='2.8.7'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -22567,6 +22567,8 @@ else
 
fi
 
# Deactivate multithreading for now
use_pthreads="no"
 
# Provide special option for gprof profiling
{ echo "$as_me:$LINENO: checking for gprof profiler mode" >&5
......@@ -27297,7 +27299,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sextractor $as_me 2.8.6, which was
This file was extended by sextractor $as_me 2.8.7, which was
generated by GNU Autoconf 2.61. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -27350,7 +27352,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
sextractor config.status 2.8.6
sextractor config.status 2.8.7
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
......
......@@ -6,7 +6,7 @@ define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)
# This is your standard Bertin source code...
AC_INIT(sextractor, 2.8.6, [bertin@iap.fr])
AC_INIT(sextractor, 2.8.7, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER(config.h)
......@@ -148,6 +148,8 @@ AC_ARG_ENABLE(threads,
fi,
use_pthreads=yes
)
# Deactivate multithreading for now
use_pthreads="no"
# Provide special option for gprof profiling
AC_MSG_CHECKING([for gprof profiler mode])
......
.TH SEXTRACTOR "1" "May 2009" "SWarp 2.8.6" "User Commands"
.TH SEXTRACTOR "1" "May 2009" "SWarp 2.8.7" "User Commands"
.SH NAME
sex \- extract a source catalog from an astronomical FITS image
.SH SYNOPSIS
......
......@@ -9,7 +9,7 @@
*
* Contents: functions for output of catalog data.
*
* Last modify: 18/03/2009
* Last modify: 29/05/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -209,6 +209,7 @@ void updateparamflags()
| FLAG(obj2.prof_concentration)
| FLAG(obj2.prof_class_star);
FLAG(obj2.mag_prof) |= FLAG(obj2.magerr_prof);
FLAG(obj2.magerr_prof) |= FLAG(obj2.fluxerr_prof);
FLAG(obj2.flux_prof) |= FLAG(obj2.mag_prof) | FLAG(obj2.fluxerr_prof);
FLAG(obj2.prof_spheroid_mag) |= FLAG(obj2.prof_spheroid_magerr);
FLAG(obj2.prof_spheroid_reff) |= FLAG(obj2.prof_spheroid_refferr);
......
......@@ -9,7 +9,7 @@
*
* Contents: Routines dealing with double precision FFT.
*
* Last modify: 26/03/2007
* Last modify: 28/05/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -46,17 +46,20 @@ INPUT -.
OUTPUT -.
NOTES Global preferences are used for multhreading.
AUTHOR E. Bertin (IAP)
VERSION 29/11/2006
VERSION 28/05/2009
***/
void fft_init(void)
void fft_init(int nthreads)
{
if (!firsttimeflag)
{
#ifdef USE_THREADS
if (!fftw_init_threads())
error(EXIT_FAILURE, "*Error*: thread initialization failed in ", "FFTW");
fftw_plan_with_nthreads(prefs.nthreads);
QPTHREAD_MUTEX_INIT(&fftmutex, NULL);
if (nthreads > 1)
{
if (!fftw_init_threads())
error(EXIT_FAILURE, "*Error*: thread initialization failed in ", "FFTW");
fftw_plan_with_nthreads(prefs.nthreads);
}
#endif
firsttimeflag = 1;
}
......
......@@ -9,7 +9,7 @@
*
* Contents: Include for fft.c.
*
* Last modify: 29/11/2006
* Last modify: 28/05/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -32,6 +32,6 @@
/*---------------------------------- protos --------------------------------*/
extern void fft_conv(double *data1, double *fdata2, int *size),
fft_end(),
fft_init();
fft_init(int nthreads);
extern double *fft_rtf(double *data, int *size);
......@@ -106,7 +106,7 @@ void makeit()
if (prefs.prof_flag)
{
fft_init();
fft_init(prefs.nthreads);
/* Create profiles at full resolution */
NFPRINTF(OUTPUT, "Preparing profile models");
theprofit = profit_init(thepsf);
......
......@@ -9,7 +9,7 @@
*
* Contents: Model-fitting parameter list for catalog data.
*
* Last modify: 19/05/2009
* Last modify: 27/05/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -40,7 +40,7 @@
&outobj2.mag_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
"phot.mag;stat.fit.param", "mag"},
{"MAGERR_MODEL", "RMS error on model-fitting magnitude",
&outobj2.mag_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
&outobj2.magerr_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
"stat.error;phot.mag;stat.fit.param", "mag"},
{"XMODEL_IMAGE", "X coordinate from model-fitting",
......
......@@ -9,7 +9,7 @@
*
* Contents: Fit an arbitrary profile combination to a detection.
*
* Last modify: 28/04/2009
* Last modify: 29/05/2009
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
......@@ -168,7 +168,7 @@ OUTPUT Pointer to an allocated fit structure (containing details about the
fit).
NOTES It is a modified version of the lm_minimize() of lmfit.
AUTHOR E. Bertin (IAP)
VERSION 15/04/2009
VERSION 29/05/2009
***/
void profit_fit(profitstruct *profit,
picstruct *field, picstruct *wfield,
......@@ -178,10 +178,11 @@ void profit_fit(profitstruct *profit,
patternstruct *pattern;
psfstruct *psf;
checkstruct *check;
double psf_fwhm, a , cp,sp, emx2,emy2,emxy, dchi2;
int i,j,p, nparam, ncomp;
double psf_fwhm, a , cp,sp, emx2,emy2,emxy, dchi2, err;
int i,j,p, nparam, ncomp, nprof;
nparam = profit->nparam;
nprof = profit->nprof;
if (profit->psfdft)
{
QFREE(profit->psfdft);
......@@ -313,6 +314,26 @@ the_gal++;
obj2->prof_niter = profit->niter;
obj2->flux_prof = profit->flux;
if (FLAG(obj2.fluxerr_prof))
{
err = 0.0;
i = j = 0; /* avoid gcc -Wall warning */
if (profit->paramlist[PARAM_DISK_FLUX])
{
i = profit->paramindex[PARAM_DISK_FLUX];
err += profit->covar[i*(nparam+1)];
}
if (profit->paramlist[PARAM_SPHEROID_FLUX])
{
j = profit->paramindex[PARAM_SPHEROID_FLUX];
err += profit->covar[j*(nparam+1)];
}
if (profit->paramlist[PARAM_DISK_FLUX]
&& profit->paramlist[PARAM_SPHEROID_FLUX])
err += profit->covar[i+j*nparam]+profit->covar[j+i*nparam];
obj2->fluxerr_prof = err>0.0? sqrt(err): 0.0;
}
obj2->prof_chi2 = (profit->nresi > profit->nparam)?
profit->chi2 / (profit->nresi - profit->nparam) : 0.0;
......@@ -1320,7 +1341,7 @@ INPUT Profile-fitting structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 18/09/2008
VERSION 27/05/2009
***/
void profit_moments(profitstruct *profit)
{
......@@ -1365,7 +1386,7 @@ void profit_moments(profitstruct *profit)
{
obj2->prof_eps1 = (mx2 - my2) / (mx2+my2);
obj2->prof_eps2 = 2.0*mxy / (mx2 + my2);
den = mx2+my2-mxy*mxy;
den = mx2*my2-mxy*mxy;
if (den>=0.0)
den = mx2+my2+2.0*sqrt(den);
else
......
......@@ -47,7 +47,7 @@ INPUT Measurement field pointer,
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 11/01/2008
VERSION 29/05/2009
***/
void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
int nffield, picstruct *wfield, picstruct *dwfield)
......@@ -65,7 +65,7 @@ void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
char *marker, newmarker, *blankpad, *bpt,*bpt0;
int co, i,j, flag, luflag,pstop, xl,xl2,yl, cn,
nposize, stacksize, w, h, blankh, maxpixnb,
varthreshflag;
varthreshflag, ontotal;
short trunflag;
PIXTYPE thresh, relthresh, cdnewsymbol, cdvar,
*scan,*dscan,*cdscan,*dwscan,*cdwscan,*cdwscanp,
......@@ -548,6 +548,7 @@ void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
if (cfield->stripy==cfield->stripysclim)
{
cleanobj = cleanobjlist->obj+cleanobjlist->nobj-1;
ontotal = 0;
for (i=cleanobjlist->nobj; i--; cleanobj--)
{
if (cleanobj->ycmin <= cfield->ymin)
......@@ -567,6 +568,13 @@ void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
QWARNING(gstr, "may have some unBLANKed neighbours:\n"
" You might want to increase MEMORY_PIXSTACK");
}
if ((prefs.prof_flag && !(thecat.ntotal%10)
&& thecat.ntotal != ontotal)
|| !(thecat.ntotal%400))
NPRINTF(OUTPUT, "\33[1M> Line:%5d "
"Objects: %8d detected / %8d sextracted\n\33[1A",
yl>=h? h:yl+1, thecat.ndetect, thecat.ntotal);
ontotal = thecat.ntotal;
endobject(field, dfield, wfield, cdwfield, i, cleanobjlist);
subcleanobj(i);
cleanobj = cleanobjlist->obj+i; /* realloc in subcleanobj() */
......@@ -574,7 +582,7 @@ void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
}
}
if (!((yl+1)%16))
if ((prefs.prof_flag && !(thecat.ntotal%10)) || !((yl+1)%25))
NPRINTF(OUTPUT, "\33[1M> Line:%5d "
"Objects: %8d detected / %8d sextracted\n\33[1A",
yl+1, thecat.ndetect, thecat.ntotal);
......@@ -604,8 +612,15 @@ void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
}
/* Now that all "detected" pixels have been removed, analyse detections */
ontotal = 0;
for (j=cleanobjlist->nobj; j--;)
{
if ((prefs.prof_flag && !(thecat.ntotal%10) && thecat.ntotal != ontotal)
|| !(thecat.ntotal%400))
NPRINTF(OUTPUT, "\33[1M> Line:%5d "
"Objects: %8d detected / %8d sextracted\n\33[1A",
h, thecat.ndetect, thecat.ntotal);
ontotal = thecat.ntotal;
endobject(field, dfield, wfield, cdwfield, 0, cleanobjlist);
subcleanobj(0);
}
......
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