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 Original line Diff line number Diff line
#! /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.11.7.
# Generated by GNU Autoconf 2.63 for sextractor 2.11.8.
#
#
# Report bugs to <bertin@iap.fr>.
# Report bugs to <bertin@iap.fr>.
#
#
@@ -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.11.7'
PACKAGE_VERSION='2.11.8'
PACKAGE_STRING='sextractor 2.11.7'
PACKAGE_STRING='sextractor 2.11.8'
PACKAGE_BUGREPORT='bertin@iap.fr'
PACKAGE_BUGREPORT='bertin@iap.fr'
ac_unique_file="src/makeit.c"
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.
  # 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.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]...
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1575,7 +1575,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.11.7:";;
     short | recursive ) echo "Configuration of sextractor 2.11.8:";;
   esac
   esac
  cat <<\_ACEOF
  cat <<\_ACEOF
@@ -1706,7 +1706,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.11.7
sextractor configure 2.11.8
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,
@@ -1720,7 +1720,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.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
generated by GNU Autoconf 2.63.  Invocation command line was
  $ $0 $@
  $ $0 $@
@@ -2423,7 +2423,7 @@ fi
# Define the identity of the package.
# Define the identity of the package.
 PACKAGE='sextractor'
 PACKAGE='sextractor'
 VERSION='2.11.7'
 VERSION='2.11.8'
cat >>confdefs.h <<_ACEOF
cat >>confdefs.h <<_ACEOF
@@ -28535,7 +28535,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.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
generated by GNU Autoconf 2.63.  Invocation command line was
  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_FILES    = $CONFIG_FILES
@@ -28598,7 +28598,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.11.7
sextractor config.status 2.11.8
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'`\\"
+1 −1
Original line number Original line Diff line number Diff line
@@ -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.11.7, [bertin@iap.fr])
AC_INIT(sextractor, 2.11.8, [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)
+1 −1
Original line number Original line 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
.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
+3 −2
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
*
*
*	Contents:	functions for output of catalog data.
*	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_mx2) |= FLAG(obj2.winposerr_my2)
			| FLAG(obj2.winposerr_mxy)
			| FLAG(obj2.winposerr_mxy)
			| FLAG(obj2.winposerr_a) | FLAG(obj2.winposerr_cxx)
			| 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.winpos_alpha1950) |= FLAG(obj2.winpos_delta1950)
			| FLAG(obj2.win_theta1950)
			| FLAG(obj2.win_theta1950)
+26 −27
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@
*
*
*	Contents:	Compute windowed barycenter
*	Contents:	Compute windowed barycenter
*
*
*	Last modify:	19/12/2007
*	Last modify:	16/07/2010
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
@@ -38,16 +38,16 @@ INPUT Picture structure pointer,
OUTPUT  -.
OUTPUT  -.
NOTES   obj->posx and obj->posy are taken as initial centroid guesses.
NOTES   obj->posx and obj->posy are taken as initial centroid guesses.
AUTHOR  E. Bertin (IAP)
AUTHOR  E. Bertin (IAP)
VERSION 19/12/2007
VERSION 16/07/2010
 ***/
 ***/
void	compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
void	compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)


  {
  {
   float		r2, raper,raper2, rintlim,rintlim2,rextlim2,
   float		r2,invtwosig2, raper,raper2, rintlim,rintlim2,rextlim2,
			dx,dx1,dy,dy2, sig, pdbkg,
			dx,dx1,dy,dy2, sig, invngamma, pdbkg,
                        offsetx,offsety,scalex,scaley,scale2, ngamma, locarea;
                        offsetx,offsety,scalex,scaley,scale2, locarea;
   double               tv, tv2, pix, var, backnoise2, gain, locpix,
   double               tv, norm, pix, var, backnoise2, invgain, locpix,
			dxpos,dypos, twosig2, err,err2, emx2,emy2,emxy,
			dxpos,dypos, err,err2, emx2,emy2,emxy,
			esum, temp,temp2, mx2, my2,mxy,pmx2, theta, mx,my,
			esum, temp,temp2, mx2, my2,mxy,pmx2, theta, mx,my,
			mx2ph, my2ph;
			mx2ph, my2ph;
   int                  i,x,y, x2,y2, xmin,xmax,ymin,ymax, sx,sy, w,h,
   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);
  errflag = FLAG(obj2.winposerr_mx2);
  momentflag = FLAG(obj2.win_mx2) | FLAG(obj2.winposerr_mx2);
  momentflag = FLAG(obj2.win_mx2) | FLAG(obj2.winposerr_mx2);
  var = backnoise2 = field->backsig*field->backsig;
  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 */
  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 */
/* Integration radius */
  raper = WINPOS_NSIG*sig;
  raper = WINPOS_NSIG*sig;
@@ -80,12 +80,12 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
/* For photographic data */
/* For photographic data */
  if (pflag)
  if (pflag)
    {
    {
    ngamma = field->ngamma;
    invngamma = 1.0/field->ngamma;
    pdbkg = exp(obj->dbkg/ngamma);
    pdbkg = expf(obj->dbkg*invngamma);
    }
    }
  else
  else
    {
    {
    ngamma = 0.0;
    invngamma = 0.0;
    pdbkg = 0.0;
    pdbkg = 0.0;
    }
    }
  raper2 = raper*raper;
  raper2 = raper*raper;
@@ -165,7 +165,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
            }
            }
          else
          else
            locarea = 1.0;
            locarea = 1.0;
          locarea *= exp(-r2/twosig2);
          locarea *= expf(-r2*invtwosig2);
/*-------- Here begin tests for pixel and/or weight overflows. Things are a */
/*-------- 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 */
/*-------- bit intricated to have it running as fast as possible in the most */
/*-------- common cases */
/*-------- common cases */
@@ -191,7 +191,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
              }
              }
            }
            }
          if (pflag)
          if (pflag)
            pix=exp(pix/ngamma);
            pix = expf(pix*invngamma);
          dx = x - mx;
          dx = x - mx;
          dy = y - my;
          dy = y - my;
          locpix = locarea*pix;
          locpix = locarea*pix;
@@ -202,13 +202,13 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
            {
            {
            err = var;
            err = var;
            if (pflag)
            if (pflag)
              err *= locpix*pix/(ngamma*ngamma);
              err *= locpix*pix*invngamma*invngamma;
            else if (gain>0.0 && pix>0.0)
            else if (invgain>0.0 && pix>0.0)
              {
              {
              if (gainflag)
              if (gainflag)
                err += pix/gain*var/backnoise2;
                err += pix*invgain*var/backnoise2;
              else
              else
                err += pix/gain;
                err += pix*invgain;
              }
              }
            err2 = locarea*locarea*err;
            err2 = locarea*locarea*err;
            esum += err2;
            esum += err2;
@@ -228,8 +228,8 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)


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