Commit eaabc69f authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Fixed WINdowed position error estimates that were underestimated by a factor 2...

Fixed WINdowed position error estimates that were underestimated by a factor 2 (thanks to G.Bernstein).
Fixed FLUXERR_WIN triggering issue.
Optimized WIN parameter computations.
Pushed version number to 2.11.8.
parent 5f63711a
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for sextractor 2.11.7.
# Generated by GNU Autoconf 2.63 for sextractor 2.11.8.
#
# Report bugs to <bertin@iap.fr>.
#
@@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='sextractor'
PACKAGE_TARNAME='sextractor'
PACKAGE_VERSION='2.11.7'
PACKAGE_STRING='sextractor 2.11.7'
PACKAGE_VERSION='2.11.8'
PACKAGE_STRING='sextractor 2.11.8'
PACKAGE_BUGREPORT='bertin@iap.fr'
ac_unique_file="src/makeit.c"
@@ -1505,7 +1505,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.11.7 to adapt to many kinds of systems.
\`configure' configures sextractor 2.11.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1575,7 +1575,7 @@ fi
if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of sextractor 2.11.7:";;
     short | recursive ) echo "Configuration of sextractor 2.11.8:";;
   esac
  cat <<\_ACEOF
@@ -1706,7 +1706,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
sextractor configure 2.11.7
sextractor configure 2.11.8
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1720,7 +1720,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.11.7, which was
It was created by sextractor $as_me 2.11.8, which was
generated by GNU Autoconf 2.63.  Invocation command line was
  $ $0 $@
@@ -2423,7 +2423,7 @@ fi
# Define the identity of the package.
 PACKAGE='sextractor'
 VERSION='2.11.7'
 VERSION='2.11.8'
cat >>confdefs.h <<_ACEOF
@@ -28535,7 +28535,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.11.7, which was
This file was extended by sextractor $as_me 2.11.8, which was
generated by GNU Autoconf 2.63.  Invocation command line was
  CONFIG_FILES    = $CONFIG_FILES
@@ -28598,7 +28598,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
sextractor config.status 2.11.7
sextractor config.status 2.11.8
configured by $0, generated by GNU Autoconf 2.63,
  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)

# This is your standard Bertin source code...
AC_INIT(sextractor, 2.11.7, [bertin@iap.fr])
AC_INIT(sextractor, 2.11.8, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER(config.h)
+1 −1
Original line number Diff line number Diff line
.TH SEXTRACTOR "1" "July 2010" "SWarp 2.11.7" "User Commands"
.TH SEXTRACTOR "1" "July 2010" "SWarp 2.11.8" "User Commands"
.SH NAME
sex \- extract a source catalog from an astronomical FITS image
.SH SYNOPSIS
+3 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	functions for output of catalog data.
*
*	Last modify:	08/07/2010
*	Last modify:	12/07/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -439,7 +439,8 @@ void updateparamflags()
  FLAG(obj2.winposerr_mx2) |= FLAG(obj2.winposerr_my2)
			| FLAG(obj2.winposerr_mxy)
			| FLAG(obj2.winposerr_a) | FLAG(obj2.winposerr_cxx)
			| FLAG(obj2.winposerr_mx2w);
			| FLAG(obj2.winposerr_mx2w)
			| FLAG(obj2.fluxerr_win) | FLAG(obj2.magerr_win);

  FLAG(obj2.winpos_alpha1950) |= FLAG(obj2.winpos_delta1950)
			| FLAG(obj2.win_theta1950)
+26 −27
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	Compute windowed barycenter
*
*	Last modify:	19/12/2007
*	Last modify:	16/07/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -38,16 +38,16 @@ INPUT Picture structure pointer,
OUTPUT  -.
NOTES   obj->posx and obj->posy are taken as initial centroid guesses.
AUTHOR  E. Bertin (IAP)
VERSION 19/12/2007
VERSION 16/07/2010
 ***/
void	compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)

  {
   float		r2, raper,raper2, rintlim,rintlim2,rextlim2,
			dx,dx1,dy,dy2, sig, pdbkg,
                        offsetx,offsety,scalex,scaley,scale2, ngamma, locarea;
   double               tv, tv2, pix, var, backnoise2, gain, locpix,
			dxpos,dypos, twosig2, err,err2, emx2,emy2,emxy,
   float		r2,invtwosig2, raper,raper2, rintlim,rintlim2,rextlim2,
			dx,dx1,dy,dy2, sig, invngamma, pdbkg,
                        offsetx,offsety,scalex,scaley,scale2, locarea;
   double               tv, norm, pix, var, backnoise2, invgain, locpix,
			dxpos,dypos, err,err2, emx2,emy2,emxy,
			esum, temp,temp2, mx2, my2,mxy,pmx2, theta, mx,my,
			mx2ph, my2ph;
   int                  i,x,y, x2,y2, xmin,xmax,ymin,ymax, sx,sy, w,h,
@@ -70,9 +70,9 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
  errflag = FLAG(obj2.winposerr_mx2);
  momentflag = FLAG(obj2.win_mx2) | FLAG(obj2.winposerr_mx2);
  var = backnoise2 = field->backsig*field->backsig;
  gain = field->gain;
  invgain = field->gain>0.0? 1.0/field->gain : 0.0;
  sig = obj2->hl_radius*2.0/2.35; /* From half-FWHM to sigma */
  twosig2 = 2.0*sig*sig;
  invtwosig2 = 1.0/(2.0*sig*sig);

/* Integration radius */
  raper = WINPOS_NSIG*sig;
@@ -80,12 +80,12 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
/* For photographic data */
  if (pflag)
    {
    ngamma = field->ngamma;
    pdbkg = exp(obj->dbkg/ngamma);
    invngamma = 1.0/field->ngamma;
    pdbkg = expf(obj->dbkg*invngamma);
    }
  else
    {
    ngamma = 0.0;
    invngamma = 0.0;
    pdbkg = 0.0;
    }
  raper2 = raper*raper;
@@ -165,7 +165,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
            }
          else
            locarea = 1.0;
          locarea *= exp(-r2/twosig2);
          locarea *= expf(-r2*invtwosig2);
/*-------- Here begin tests for pixel and/or weight overflows. Things are a */
/*-------- bit intricated to have it running as fast as possible in the most */
/*-------- common cases */
@@ -191,7 +191,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
              }
            }
          if (pflag)
            pix=exp(pix/ngamma);
            pix = expf(pix*invngamma);
          dx = x - mx;
          dy = y - my;
          locpix = locarea*pix;
@@ -202,13 +202,13 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
            {
            err = var;
            if (pflag)
              err *= locpix*pix/(ngamma*ngamma);
            else if (gain>0.0 && pix>0.0)
              err *= locpix*pix*invngamma*invngamma;
            else if (invgain>0.0 && pix>0.0)
              {
              if (gainflag)
                err += pix/gain*var/backnoise2;
                err += pix*invgain*var/backnoise2;
              else
                err += pix/gain;
                err += pix*invgain;
              }
            err2 = locarea*locarea*err;
            esum += err2;
@@ -228,8 +228,8 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)

    if (tv>0.0)
      {
      mx += (dxpos /= tv)*WINPOS_GRADFAC;
      my += (dypos /= tv)*WINPOS_GRADFAC;
      mx += (dxpos /= tv)*WINPOS_FAC;
      my += (dypos /= tv)*WINPOS_FAC;
      }
    else
      break;
@@ -252,8 +252,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
    obj2->fluxerr_win = sqrt(esum);
    }
  temp2=mx2*my2-mxy*mxy;
  obj2->win_flag = (tv <= 0.0)*4 + (mx2 < 0.0 || my2 < 0.0)*2
	+ (temp2<0.0);
  obj2->win_flag = (tv <= 0.0)*4 + (mx2 < 0.0 || my2 < 0.0)*2 + (temp2<0.0);
  if (obj2->win_flag)
    {
/*--- Negative values: revert to isophotal estimates */
@@ -299,12 +298,12 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
    {
    if (errflag)
      {
      tv2 = tv*tv;
      emx2 /= tv2;
      emy2 /= tv2;
      emxy /= tv2;
      norm = WINPOS_FAC*WINPOS_FAC/(tv*tv);
      emx2 *= norm;
      emy2 *= norm;
      emxy *= norm;
/*-- Handle fully correlated profiles (which cause a singularity...) */
      esum *= 0.08333/tv2;
      esum *= 0.08333*norm;
      if (obj->singuflag && (emx2*emy2-emxy*emxy) < esum*esum)
        {
        emx2 += esum;
Loading