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

Fixed FLUX_HYBRID and MAG_HYBRID centering issues.

Added 2nd order moments measurements of the convolved model.
Fixed issues introduced in a recent updates with check-images.
Implemented new algorithms for SPREAD_MODEL and SPREADERR_MODEL (no optimization yet and the scaling is still variable however).
Added experimental SNR_WIN measurement parameter.
Fixed crash with empty ASSOC lists.
Pushed version number to 2.13.6.
parent 1b0fb5bd
#! /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.13.2. # Generated by GNU Autoconf 2.63 for sextractor 2.13.6.
# #
# 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.13.2' PACKAGE_VERSION='2.13.6'
PACKAGE_STRING='sextractor 2.13.2' PACKAGE_STRING='sextractor 2.13.6'
PACKAGE_BUGREPORT='bertin@iap.fr' PACKAGE_BUGREPORT='bertin@iap.fr'
   
ac_unique_file="src/makeit.c" ac_unique_file="src/makeit.c"
...@@ -1508,7 +1508,7 @@ if test "$ac_init_help" = "long"; then ...@@ -1508,7 +1508,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.13.2 to adapt to many kinds of systems. \`configure' configures sextractor 2.13.6 to adapt to many kinds of systems.
   
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
   
...@@ -1578,7 +1578,7 @@ fi ...@@ -1578,7 +1578,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.13.2:";; short | recursive ) echo "Configuration of sextractor 2.13.6:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
   
...@@ -1711,7 +1711,7 @@ fi ...@@ -1711,7 +1711,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.13.2 sextractor configure 2.13.6
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,
...@@ -1725,7 +1725,7 @@ cat >config.log <<_ACEOF ...@@ -1725,7 +1725,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.13.2, which was It was created by sextractor $as_me 2.13.6, which was
generated by GNU Autoconf 2.63. Invocation command line was generated by GNU Autoconf 2.63. Invocation command line was
   
$ $0 $@ $ $0 $@
...@@ -2428,7 +2428,7 @@ fi ...@@ -2428,7 +2428,7 @@ fi
   
# Define the identity of the package. # Define the identity of the package.
PACKAGE='sextractor' PACKAGE='sextractor'
VERSION='2.13.2' VERSION='2.13.6'
   
   
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -28593,7 +28593,7 @@ exec 6>&1 ...@@ -28593,7 +28593,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.13.2, which was This file was extended by sextractor $as_me 2.13.6, 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
...@@ -28656,7 +28656,7 @@ Report bugs to <bug-autoconf@gnu.org>." ...@@ -28656,7 +28656,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.13.2 sextractor config.status 2.13.6
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'`\\"
   
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with SExtractor. If not, see <http://www.gnu.org/licenses/>. # along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
# #
# Last modified: 24/01/2011 # Last modified: 03/05/2011
# #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -31,7 +31,7 @@ define([AC_CACHE_LOAD],) ...@@ -31,7 +31,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.13.2, [bertin@iap.fr]) AC_INIT(sextractor, 2.13.6, [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)
......
.TH SEXTRACTOR "1" "March 2011" "SExtractor 2.13.2" "User Commands" .TH SEXTRACTOR "1" "May 2011" "SExtractor 2.13.6" "User Commands"
.SH NAME .SH NAME
sex \- extract a source catalogue from an astronomical FITS image sex \- extract a source catalogue from an astronomical FITS image
.SH SYNOPSIS .SH SYNOPSIS
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 12/01/2011 * Last modified: 04/05/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -109,7 +109,7 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs) ...@@ -109,7 +109,7 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs)
if (!(file = fopen(filename, "r"))) if (!(file = fopen(filename, "r")))
return NULL; return NULL;
assoc = NULL; /* To avoid gcc -Wall warnings */ QCALLOC(assoc, assocstruct, 1);
list = NULL; /* To avoid gcc -Wall warnings */ list = NULL; /* To avoid gcc -Wall warnings */
data = NULL; /* To avoid gcc -Wall warnings */ data = NULL; /* To avoid gcc -Wall warnings */
ispoon = ncol = ndata = nlist = size = spoonsize = xindex = yindex ispoon = ncol = ndata = nlist = size = spoonsize = xindex = yindex
...@@ -170,8 +170,7 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs) ...@@ -170,8 +170,7 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs)
nlist = ndata+3; nlist = ndata+3;
/*---- Allocate memory for the ASSOC struct and the filtered list */ /*---- Allocate memory for the filtered list */
QMALLOC(assoc, assocstruct, 1);
ispoon = ASSOC_BUFINC/(nlist*sizeof(double)); ispoon = ASSOC_BUFINC/(nlist*sizeof(double));
spoonsize = ispoon*nlist; spoonsize = ispoon*nlist;
QMALLOC(assoc->list, double, size = spoonsize); QMALLOC(assoc->list, double, size = spoonsize);
...@@ -210,11 +209,15 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs) ...@@ -210,11 +209,15 @@ assocstruct *load_assoc(char *filename, wcsstruct *wcs)
fclose(file); fclose(file);
free(data); free(data);
QREALLOC(assoc->list, double, i*nlist);
assoc->nobj = i; assoc->nobj = i;
assoc->radius = prefs.assoc_radius; if (i>0)
assoc->ndata = ndata; {
assoc->ncol = nlist; QREALLOC(assoc->list, double, i*nlist);
assoc->radius = prefs.assoc_radius;
assoc->ndata = ndata;
assoc->ncol = nlist;
}
return assoc; return assoc;
} }
...@@ -236,6 +239,9 @@ void init_assoc(picstruct *field) ...@@ -236,6 +239,9 @@ void init_assoc(picstruct *field)
error(EXIT_FAILURE, "*Error*: Assoc-list file not found: ", error(EXIT_FAILURE, "*Error*: Assoc-list file not found: ",
prefs.assoc_name); prefs.assoc_name);
if (assoc->nobj==0)
warning(prefs.assoc_name, " ASSOC input-list is empty");
/* Sort the assoc-list by y coordinates, and build the hash table */ /* Sort the assoc-list by y coordinates, and build the hash table */
sort_assoc(field, assoc); sort_assoc(field, assoc);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1993-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 11/10/2010 * Last modified: 23/03/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -60,7 +60,7 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) ...@@ -60,7 +60,7 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag)
w,bw, bh, nx,ny,nb, w,bw, bh, nx,ny,nb,
lflag, nr; lflag, nr;
float *ratio,*ratiop, *weight, *sigma, float *ratio,*ratiop, *weight, *sigma,
sratio; sratio, sigfac;
/* If the weight-map is not an external one, no stats are needed for it */ /* If the weight-map is not an external one, no stats are needed for it */
if (wfield && wfield->flags&(INTERP_FIELD|BACKRMS_FIELD)) if (wfield && wfield->flags&(INTERP_FIELD|BACKRMS_FIELD))
...@@ -294,7 +294,7 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) ...@@ -294,7 +294,7 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag)
filterback(wfield); filterback(wfield);
/* Compute normalization for variance- or weight-maps*/ /* Compute normalization for variance- or weight-maps*/
if (wfield && wscale_flag && wfield->flags&(VAR_FIELD|WEIGHT_FIELD)) if (wfield && wfield->flags&(VAR_FIELD|WEIGHT_FIELD))
{ {
nr = 0; nr = 0;
QMALLOC(ratio, float, wfield->nback); QMALLOC(ratio, float, wfield->nback);
...@@ -308,18 +308,27 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) ...@@ -308,18 +308,27 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag)
*(ratiop++) = sratio; *(ratiop++) = sratio;
nr++; nr++;
} }
wfield->sigfac = fqmedian(ratio, nr); sigfac = fqmedian(ratio, nr);
for (i=0; i<nr && ratio[i]<=0.0; i++); for (i=0; i<nr && ratio[i]<=0.0; i++);
if (i<nr) if (i<nr)
wfield->sigfac = fqmedian(ratio+i, nr-i); sigfac = fqmedian(ratio+i, nr-i);
else else
{ {
warning("Null or negative global weighting factor:","defaulted to 1"); warning("Null or negative global weighting factor:","defaulted to 1");
wfield->sigfac = 1.0; sigfac = 1.0;
} }
free(ratio); free(ratio);
if (wscale_flag)
wfield->sigfac = sigfac;
else
{
wfield->sigfac = 1.0;
field->backsig /= sigfac;
}
} }
/* Compute 2nd derivatives along the y-direction */ /* Compute 2nd derivatives along the y-direction */
NFPRINTF(OUTPUT, "Computing background d-map"); NFPRINTF(OUTPUT, "Computing background d-map");
free(field->dback); free(field->dback);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1993-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 19/10/2010 * Last modified: 12/04/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -189,6 +189,17 @@ void updateparamflags() ...@@ -189,6 +189,17 @@ void updateparamflags()
FLAG(obj2.prof_disk_scale) |= prefs.pattern_flag; FLAG(obj2.prof_disk_scale) |= prefs.pattern_flag;
FLAG(obj2.prof_concentration) |= FLAG(obj2.prof_concentrationerr); FLAG(obj2.prof_concentration) |= FLAG(obj2.prof_concentrationerr);
FLAG(obj2.fluxcorerr_prof) |= FLAG(obj2.magcorerr_prof);
FLAG(obj2.fluxcor_prof) |= FLAG(obj2.magcor_prof)
| FLAG(obj2.fluxcorerr_prof);
FLAG(obj2.fluxerr_prof) |= FLAG(obj2.magerr_prof)
| FLAG(obj2.prof_concentrationerr)
| FLAG(obj2.fluxcorerr_prof);
FLAG(obj2.flux_prof) |= FLAG(obj2.mag_prof)
| FLAG(obj2.fluxerr_prof)
| FLAG(obj2.fluxcor_prof);
FLAG(obj2.poserraw_prof) |= FLAG(obj2.poserrbw_prof); FLAG(obj2.poserraw_prof) |= FLAG(obj2.poserrbw_prof);
FLAG(obj2.poserrcxxw_prof) |= FLAG(obj2.poserrcyyw_prof) FLAG(obj2.poserrcxxw_prof) |= FLAG(obj2.poserrcyyw_prof)
| FLAG(obj2.poserrcxyw_prof); | FLAG(obj2.poserrcxyw_prof);
...@@ -226,17 +237,9 @@ void updateparamflags() ...@@ -226,17 +237,9 @@ void updateparamflags()
| FLAG(obj2.poserrcxx_prof) | FLAG(obj2.poserrcxx_prof)
| FLAG(obj2.poserrmx2_prof) | FLAG(obj2.poserrmx2_prof)
| FLAG(obj2.prof_concentration) | FLAG(obj2.prof_concentration)
| FLAG(obj2.prof_class_star); | FLAG(obj2.prof_class_star)
FLAG(obj2.fluxcorerr_prof) |= FLAG(obj2.magcorerr_prof);
FLAG(obj2.fluxcor_prof) |= FLAG(obj2.magcor_prof)
| FLAG(obj2.fluxcorerr_prof);
FLAG(obj2.fluxerr_prof) |= FLAG(obj2.magerr_prof)
| FLAG(obj2.prof_concentrationerr)
| FLAG(obj2.fluxcorerr_prof);
FLAG(obj2.flux_prof) |= FLAG(obj2.mag_prof)
| FLAG(obj2.fluxerr_prof)
| FLAG(obj2.fluxcor_prof); | FLAG(obj2.fluxcor_prof);
FLAG(obj2.prof_dirac_mag) |= FLAG(obj2.prof_dirac_magerr); FLAG(obj2.prof_dirac_mag) |= FLAG(obj2.prof_dirac_magerr);
FLAG(obj2.prof_spheroid_mag) |= FLAG(obj2.prof_spheroid_magerr); FLAG(obj2.prof_spheroid_mag) |= FLAG(obj2.prof_spheroid_magerr);
FLAG(obj2.prof_spheroid_reff) |= FLAG(obj2.prof_spheroid_refferr); FLAG(obj2.prof_spheroid_reff) |= FLAG(obj2.prof_spheroid_refferr);
...@@ -365,6 +368,10 @@ void updateparamflags() ...@@ -365,6 +368,10 @@ void updateparamflags()
| FLAG(obj2.prof_e1) | FLAG(obj2.prof_pol1) | FLAG(obj2.prof_e1) | FLAG(obj2.prof_pol1)
| FLAG(obj2.prof_a) | FLAG(obj2.prof_cxx) | FLAG(obj2.prof_a) | FLAG(obj2.prof_cxx)
| FLAG(obj2.prof_mx2w); | FLAG(obj2.prof_mx2w);
FLAG(obj2.prof_conva) |= FLAG(obj2.prof_convb) | FLAG(obj2.prof_convtheta);
FLAG(obj2.prof_convcxx) |= FLAG(obj2.prof_convcyy)
/*| FLAG(obj2.fluxcor_prof) */;
FLAG(obj2.prof_convmx2) |= FLAG(obj2.prof_convcxx) | FLAG(obj2.prof_conva);
FLAG(obj2.fluxmean_prof) |= FLAG(obj2.mumean_prof); FLAG(obj2.fluxmean_prof) |= FLAG(obj2.mumean_prof);
FLAG(obj2.fluxeff_prof) |= FLAG(obj2.mueff_prof) FLAG(obj2.fluxeff_prof) |= FLAG(obj2.mueff_prof)
| FLAG(obj2.fluxmean_prof); | FLAG(obj2.fluxmean_prof);
...@@ -471,8 +478,7 @@ void updateparamflags() ...@@ -471,8 +478,7 @@ 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)
...@@ -531,8 +537,9 @@ void updateparamflags() ...@@ -531,8 +537,9 @@ void updateparamflags()
FLAG(obj2.mxw) |= FLAG(obj2.myw) | FLAG(obj2.mx2w) | FLAG(obj2.alphas) FLAG(obj2.mxw) |= FLAG(obj2.myw) | FLAG(obj2.mx2w) | FLAG(obj2.alphas)
| FLAG(obj2.poserr_mx2w); | FLAG(obj2.poserr_mx2w);
FLAG(obj2.mamaposx) |= FLAG(obj2.mamaposy); FLAG(obj2.mamaposx) |= FLAG(obj2.mamaposy);
FLAG(obj2.fluxerr_win) |= FLAG(obj2.snr_win);
FLAG(obj2.flux_win) |= FLAG(obj2.mag_win)|FLAG(obj2.magerr_win) FLAG(obj2.flux_win) |= FLAG(obj2.mag_win)|FLAG(obj2.magerr_win)
| FLAG(obj2.flux_win) | FLAG(obj2.fluxerr_win); | FLAG(obj2.flux_win) | FLAG(obj2.fluxerr_win);
FLAG(obj2.winpos_x) |= FLAG(obj2.winpos_y) FLAG(obj2.winpos_x) |= FLAG(obj2.winpos_y)
| FLAG(obj2.winposerr_mx2) | FLAG(obj2.win_mx2) | FLAG(obj2.winposerr_mx2) | FLAG(obj2.win_mx2)
| FLAG(obj2.winpos_xw) | FLAG(obj2.winpos_xf) | FLAG(obj2.winpos_xw) | FLAG(obj2.winpos_xf)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 11/03/2011 * Last modified: 25/03/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -208,7 +208,6 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -208,7 +208,6 @@ void reinitcheck(picstruct *field, checkstruct *check)
check->y = 0; check->y = 0;
fitshead = tab->headbuf; fitshead = tab->headbuf;
/* Neutralize possible scaling factors */ /* Neutralize possible scaling factors */
tab->bytepix = 4;
tab->bscale = 1.0; tab->bscale = 1.0;
tab->bzero = 0.0; tab->bzero = 0.0;
fitswrite(fitshead, "BSCALE ", &tab->bscale, H_FLOAT, T_DOUBLE); fitswrite(fitshead, "BSCALE ", &tab->bscale, H_FLOAT, T_DOUBLE);
...@@ -227,7 +226,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -227,7 +226,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
case CHECK_BACKGROUND: case CHECK_BACKGROUND:
case CHECK_FILTERED: case CHECK_FILTERED:
case CHECK_SUBTRACTED: case CHECK_SUBTRACTED:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -239,7 +239,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -239,7 +239,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
case CHECK_BACKRMS: case CHECK_BACKRMS:
case CHECK_SUBOBJECTS: case CHECK_SUBOBJECTS:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -266,6 +267,7 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -266,6 +267,7 @@ void reinitcheck(picstruct *field, checkstruct *check)
case CHECK_SUBDISKS: case CHECK_SUBDISKS:
case CHECK_PATTERNS: case CHECK_PATTERNS:
tab->bitpix = -32; tab->bitpix = -32;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -276,7 +278,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -276,7 +278,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
break; break;
case CHECK_SEGMENTATION: case CHECK_SEGMENTATION:
tab->bitpix = 32; tab->bitpix = BP_LONG;
tab->bytepix = 4;
tab->bitsgn = 1; tab->bitsgn = 1;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -285,8 +288,23 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -285,8 +288,23 @@ void reinitcheck(picstruct *field, checkstruct *check)
save_head(cat, cat->tab); save_head(cat, cat->tab);
break; break;
case CHECK_MASK:
case CHECK_SUBMASK:
tab->bitpix = BP_BYTE;
tab->bytepix = 1;
tab->bitsgn = 1;
tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height;
check->npix = field->npix;
save_head(cat, cat->tab);
/*---- Allocate memory */
if (!check->line)
QMALLOC(check->line, FLAGTYPE, check->width);
break;
case CHECK_ASSOC: case CHECK_ASSOC:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -299,7 +317,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -299,7 +317,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
case CHECK_MINIBACKGROUND: case CHECK_MINIBACKGROUND:
case CHECK_MINIBACKRMS: case CHECK_MINIBACKRMS:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->nbackx; tab->naxisn[0] = check->width = field->nbackx;
tab->naxisn[1] = check->height = field->nbacky; tab->naxisn[1] = check->height = field->nbacky;
...@@ -336,7 +355,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -336,7 +355,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
break; break;
case CHECK_MAPSOM: case CHECK_MAPSOM:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->height = field->height;
...@@ -349,10 +369,11 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -349,10 +369,11 @@ void reinitcheck(picstruct *field, checkstruct *check)
break; break;
case CHECK_OTHER: case CHECK_OTHER:
tab->bitpix = -32; tab->bitpix = BP_FLOAT;
tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width; tab->naxisn[0] = check->width = field->width;
tab->naxisn[1] = check->height; tab->naxisn[1] = check->height = field->height;
check->npix = check->width*check->height; check->npix = check->width*check->height;
QCALLOC(check->pix, PIXTYPE, check->npix); QCALLOC(check->pix, PIXTYPE, check->npix);
save_head(cat, cat->tab); save_head(cat, cat->tab);
...@@ -376,7 +397,7 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w) ...@@ -376,7 +397,7 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w)
if (check->type == CHECK_APERTURES || check->type == CHECK_SUBPSFPROTOS if (check->type == CHECK_APERTURES || check->type == CHECK_SUBPSFPROTOS
|| check->type == CHECK_SUBPCPROTOS || check->type == CHECK_PCOPROTOS || check->type == CHECK_SUBPCPROTOS || check->type == CHECK_PCOPROTOS
|| check->type == CHECK_SUBPROFILES || check->type == CHECK_SUBSPHEROIDS || check->type == CHECK_SUBPROFILES || check->type == CHECK_SUBSPHEROIDS
|| check->type == CHECK_SUBDISKS) || check->type == CHECK_SUBDISKS || check->type == CHECK_OTHER)
{ {
memcpy((PIXTYPE *)check->pix + w*(check->y++), data, w*sizeof(PIXTYPE)); memcpy((PIXTYPE *)check->pix + w*(check->y++), data, w*sizeof(PIXTYPE));
return; return;
...@@ -386,13 +407,33 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w) ...@@ -386,13 +407,33 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w)
int i; int i;
PIXTYPE *pixt; PIXTYPE *pixt;
pixt = check->line; pixt = (PIXTYPE *)check->line;
for (i=w; i--; data++) for (i=w; i--; data++)
*(pixt++) = (*data>-BIG)? *data:0.0; *(pixt++) = (*data>-BIG)? *data:0.0;
data = check->line; write_body(check->cat->tab, (PIXTYPE *)check->line, w);
}
else if (check->type == CHECK_MASK)
{
int i;
FLAGTYPE *pixt;
pixt = (FLAGTYPE *)check->line;
for (i=w; i--;)
*(pixt++) = (*(data++)>-BIG)?0:1;
write_ibody(check->cat->tab, (FLAGTYPE *)check->line, w);
} }
else if (check->type == CHECK_SUBMASK)
{
int i;
FLAGTYPE *pixt;
write_body(check->cat->tab, data, w); pixt = (FLAGTYPE *)check->line;
for (i=w; i--;)
*(pixt++) = (*(data++)>-BIG)?1:0;
write_ibody(check->cat->tab, (FLAGTYPE *)check->line, w);
}
else
write_body(check->cat->tab, data, w);
return; return;
} }
...@@ -452,6 +493,19 @@ void reendcheck(picstruct *field, checkstruct *check) ...@@ -452,6 +493,19 @@ void reendcheck(picstruct *field, checkstruct *check)
pad_tab(cat, check->npix*sizeof(FLAGTYPE)); pad_tab(cat, check->npix*sizeof(FLAGTYPE));
break; break;
case CHECK_MASK:
case CHECK_SUBMASK:
{
int y;
for (y=field->ymin; y<field->ymax; y++)
writecheck(check, &PIX(field, 0, y), field->width);
free(check->line);
check->line = NULL;
pad_tab(cat, check->npix*sizeof(unsigned char));
break;
}
case CHECK_SUBOBJECTS: case CHECK_SUBOBJECTS:
{ {
int y; int y;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 02/12/2010 * Last modified: 25/03/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -41,7 +41,7 @@ typedef struct structcheck ...@@ -41,7 +41,7 @@ typedef struct structcheck
size_t npix; /* number of pixels in check-image */ size_t npix; /* number of pixels in check-image */
int y; /* current line in check-image */ int y; /* current line in check-image */
PIXTYPE overlay; /* intensity of the overlayed plots */ PIXTYPE overlay; /* intensity of the overlayed plots */
PIXTYPE *line; /* buffered image line */ void *line; /* buffered image line */
checkenum type; /* CHECKIMAGE_TYPE */ checkenum type; /* CHECKIMAGE_TYPE */
} checkstruct; } checkstruct;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 09/01/2011 * Last modified: 12/04/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -65,10 +65,10 @@ ...@@ -65,10 +65,10 @@
#define OUTPUT stderr /* where all msgs are sent */ #define OUTPUT stderr /* where all msgs are sent */
#define PSF_NPSFMAX 9 /* Max number of fitted PSFs */ #define PSF_NPSFMAX 9 /* Max number of fitted PSFs */
#define DEG (PI/180.0) /* 1 deg in radians */
#ifndef PI #ifndef PI
#define PI 3.1415926535898 /* never met before? */ #define PI 3.1415926535898 /* never met before? */
#endif #endif
#define DEG (PI/180.0) /* 1 deg in radians */
/* NOTES: /* NOTES:
* *
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 09/03/2011 * Last modified: 22/04/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
static int selectext(char *filename); static int selectext(char *filename);
time_t thetimet, thetimet2; time_t thetimet, thetimet2;
extern profitstruct *theprofit; extern profitstruct *theprofit,*thepprofit,*theqprofit;
extern char profname[][32]; extern char profname[][32];
double dtime; double dtime;
...@@ -124,7 +124,15 @@ void makeit() ...@@ -124,7 +124,15 @@ void makeit()
fft_init(prefs.nthreads); fft_init(prefs.nthreads);
/* Create profiles at full resolution */ /* Create profiles at full resolution */
NFPRINTF(OUTPUT, "Preparing profile models"); NFPRINTF(OUTPUT, "Preparing profile models");
theprofit = profit_init(thepsf); theprofit = profit_init(thepsf,
(FLAG(obj2.prof_offset_flux)? MODEL_BACK : MODEL_NONE)
|(FLAG(obj2.prof_dirac_flux)? MODEL_DIRAC : MODEL_NONE)
|(FLAG(obj2.prof_spheroid_flux)?
(FLAG(obj2.prof_spheroid_sersicn)?
MODEL_SERSIC : MODEL_DEVAUCOULEURS) : MODEL_NONE)
|(FLAG(obj2.prof_disk_flux)? MODEL_EXPONENTIAL : MODEL_NONE)
|(FLAG(obj2.prof_bar_flux)? MODEL_BAR : MODEL_NONE)
|(FLAG(obj2.prof_arms_flux)? MODEL_ARMS : MODEL_NONE));
changecatparamarrays("VECTOR_MODEL", &theprofit->nparam, 1); changecatparamarrays("VECTOR_MODEL", &theprofit->nparam, 1);
changecatparamarrays("VECTOR_MODELERR", &theprofit->nparam, 1); changecatparamarrays("VECTOR_MODELERR", &theprofit->nparam, 1);
nparam2[0] = nparam2[1] = theprofit->nparam; nparam2[0] = nparam2[1] = theprofit->nparam;
...@@ -161,9 +169,12 @@ void makeit() ...@@ -161,9 +169,12 @@ void makeit()
{ {
if (i) if (i)
QPRINTF(OUTPUT, "+"); QPRINTF(OUTPUT, "+");
QPRINTF(OUTPUT, "%s", profname[theprofit->prof[i]->code]); QPRINTF(OUTPUT, "%s", theprofit->prof[i]->name);
} }
QPRINTF(OUTPUT, "\n"); QPRINTF(OUTPUT, "\n");
if (FLAG(obj2.prof_concentration)|FLAG(obj2.prof_concentration))
thepprofit = profit_init(thepsf, MODEL_DIRAC);
theqprofit = profit_init(thepsf, MODEL_EXPONENTIAL);
#else #else
error(EXIT_FAILURE, error(EXIT_FAILURE,
"*Error*: model-fitting is not supported in this build.\n", "*Error*: model-fitting is not supported in this build.\n",
...@@ -535,6 +546,11 @@ void makeit() ...@@ -535,6 +546,11 @@ void makeit()
if (prefs.prof_flag) if (prefs.prof_flag)
{ {
profit_end(theprofit); profit_end(theprofit);
if (FLAG(obj2.prof_concentration)|FLAG(obj2.prof_concentration))
{
profit_end(thepprofit);
profit_end(theqprofit);
}
fft_end(); fft_end();
} }
#endif #endif
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 13/03/2011 * Last modified: 03/05/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -127,6 +127,9 @@ keystruct objkey[] = { ...@@ -127,6 +127,9 @@ keystruct objkey[] = {
{"MAGERR_WIN", "RMS error for MAG_WIN", {"MAGERR_WIN", "RMS error for MAG_WIN",
&outobj2.magerr_win, H_FLOAT, T_FLOAT, "%8.4f", "mag", &outobj2.magerr_win, H_FLOAT, T_FLOAT, "%8.4f", "mag",
"stat.stdev;phot.mag", "mag"}, "stat.stdev;phot.mag", "mag"},
{"SNR_WIN", "Gaussian-weighted SNR",
&outobj2.snr_win, H_FLOAT, T_FLOAT, "%10.4g", "",
"stat.snr", ""},
{"FLUX_SOMFIT", "Flux derived from SOM fit", {"FLUX_SOMFIT", "Flux derived from SOM fit",
&outobj2.flux_somfit, H_FLOAT, T_FLOAT, "%12.7g", "count", &outobj2.flux_somfit, H_FLOAT, T_FLOAT, "%12.7g", "count",
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 13/03/2011 * Last modified: 07/04/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -60,16 +60,16 @@ ...@@ -60,16 +60,16 @@
&outobj2.magerr_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"}, "stat.error;phot.mag;stat.fit.param", "mag"},
{"FLUXHYBRID_MODEL", "Hybrid flux from model-fitting", {"FLUX_HYBRID", "Hybrid flux from model-fitting",
&outobj2.fluxcor_prof, H_FLOAT, T_FLOAT, "%12.7g", "count", &outobj2.fluxcor_prof, H_FLOAT, T_FLOAT, "%12.7g", "count",
"phot.count;stat.fit.param", "ct"}, "phot.count;stat.fit.param", "ct"},
{"FLUXHYBRIDERR_MODEL", "RMS error on hybrid flux", {"FLUXERR_HYBRID", "RMS error on hybrid flux",
&outobj2.fluxcorerr_prof, H_FLOAT, T_FLOAT, "%12.7g", "count", &outobj2.fluxcorerr_prof, H_FLOAT, T_FLOAT, "%12.7g", "count",
"stat.error;phot.count;stat.fit.param", "ct"}, "stat.error;phot.count;stat.fit.param", "ct"},
{"MAGHYBRID_MODEL", "Hybrid magnitude from model-fitting", {"MAG_HYBRID", "Hybrid magnitude from model-fitting",
&outobj2.magcor_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag", &outobj2.magcor_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
"phot.mag;stat.fit.param", "mag"}, "phot.mag;stat.fit.param", "mag"},
{"MAGHYBRIDERR_MODEL", "RMS error on hybrid magnitude", {"MAGERR_HYBRID", "RMS error on hybrid magnitude",
&outobj2.magcorerr_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag", &outobj2.magcorerr_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
"stat.error;phot.mag;stat.fit.param", "mag"}, "stat.error;phot.mag;stat.fit.param", "mag"},
...@@ -338,6 +338,11 @@ ...@@ -338,6 +338,11 @@
{"SPREADERR_MODEL", "Spread parameter error from model-fitting", {"SPREADERR_MODEL", "Spread parameter error from model-fitting",
&outobj2.prof_concentrationerr, H_FLOAT, T_FLOAT, "%8.5f", "", &outobj2.prof_concentrationerr, H_FLOAT, T_FLOAT, "%8.5f", "",
"src.morph.param", ""}, "src.morph.param", ""},
{"NOISEAREA_MODEL", "Equivalent noise area of the fitted model",
&outobj2.prof_noisearea, H_FLOAT, T_FLOAT, "%12.2f", "pixel**2",
"phys.area", "pix2"},
/* /*
{"CLASS_STAR_MODEL", "S/G classifier from model-fitting", {"CLASS_STAR_MODEL", "S/G classifier from model-fitting",
&outobj2.prof_class_star, H_FLOAT, T_FLOAT, "%7.4f", "", &outobj2.prof_class_star, H_FLOAT, T_FLOAT, "%7.4f", "",
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 09/03/2011 * Last modified: 25/03/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
{"NONE", "IDENTICAL", {"NONE", "IDENTICAL",
"BACKGROUND", "BACKGROUND_RMS", "MINIBACKGROUND", "BACKGROUND", "BACKGROUND_RMS", "MINIBACKGROUND",
"MINIBACK_RMS", "-BACKGROUND", "MINIBACK_RMS", "-BACKGROUND",
"FILTERED", "OBJECTS", "APERTURES", "SEGMENTATION", "ASSOC", "FILTERED", "OBJECTS", "APERTURES", "SEGMENTATION", "MASK", "-MASK", "ASSOC",
"-OBJECTS", "PSFS", "-PSFS", "-OBJECTS", "PSFS", "-PSFS",
"PC_CONVPROTOS", "-PC_CONVPROTOS", "PC_PROTOS", "MAP_SOM", "PC_CONVPROTOS", "-PC_CONVPROTOS", "PC_PROTOS", "MAP_SOM",
#ifdef USE_MODEL #ifdef USE_MODEL
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 2006-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 2006-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,13 +22,28 @@ ...@@ -22,13 +22,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 24/01/2011 * Last modified: 22/04/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifndef _PROFIT_H_ #ifndef _PROFIT_H_
#define _PROFIT_H_ #define _PROFIT_H_
/*-------------------------------- models -----------------------------------*/
#define MODEL_NONE 0x0000
#define MODEL_BACK 0x0001
#define MODEL_DIRAC 0x0002
#define MODEL_SERSIC 0x0004
#define MODEL_DEVAUCOULEURS 0x0008
#define MODEL_EXPONENTIAL 0x0010
#define MODEL_ARMS 0x0020
#define MODEL_BAR 0x0040
#define MODEL_INRING 0x0080
#define MODEL_OUTRING 0x0100
#define MODEL_TABULATED 0x0200
#define MODEL_NMAX 11
/*-------------------------------- flags ------------------------------------*/ /*-------------------------------- flags ------------------------------------*/
#define PROFLAG_MODSUB 0x0001 #define PROFLAG_MODSUB 0x0001
...@@ -64,11 +79,6 @@ One must have: PROFIT_NITER > 0 ...@@ -64,11 +79,6 @@ One must have: PROFIT_NITER > 0
/*--------------------------------- typedefs --------------------------------*/ /*--------------------------------- typedefs --------------------------------*/
typedef enum {PROF_BACK, PROF_DIRAC, PROF_SERSIC, PROF_DEVAUCOULEURS,
PROF_EXPONENTIAL, PROF_ARMS, PROF_BAR, PROF_INRING,
PROF_OUTRING, PROF_SERSIC_TABEX, PROF_NPROF}
proftypenum; /* Profile code */
typedef enum {INTERP_NEARESTNEIGHBOUR, INTERP_BILINEAR, INTERP_LANCZOS2, typedef enum {INTERP_NEARESTNEIGHBOUR, INTERP_BILINEAR, INTERP_LANCZOS2,
INTERP_LANCZOS3, INTERP_LANCZOS4} interpenum; INTERP_LANCZOS3, INTERP_LANCZOS4} interpenum;
...@@ -90,7 +100,8 @@ typedef enum {PARAM_BACK, ...@@ -90,7 +100,8 @@ typedef enum {PARAM_BACK,
typedef struct typedef struct
{ {
proftypenum code; /* Model code */ unsigned int code; /* Model code */
char *name; /* Model name */
float *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 */
...@@ -174,9 +185,9 @@ typedef struct ...@@ -174,9 +185,9 @@ typedef struct
/*----------------------------- Global variables ----------------------------*/ /*----------------------------- Global variables ----------------------------*/
/*-------------------------------- functions --------------------------------*/ /*-------------------------------- functions --------------------------------*/
profitstruct *profit_init(struct psf *psf); profitstruct *profit_init(struct psf *psf, unsigned int modeltype);
profstruct *prof_init(profitstruct *profit, proftypenum profcode); profstruct *prof_init(profitstruct *profit, unsigned int modeltype);
float *profit_compresi(profitstruct *profit, float dynparam, float *profit_compresi(profitstruct *profit, float dynparam,
float *resi), float *resi),
...@@ -186,6 +197,7 @@ float *profit_compresi(profitstruct *profit, float dynparam, ...@@ -186,6 +197,7 @@ float *profit_compresi(profitstruct *profit, float dynparam,
prof_add(profitstruct *profit, profstruct *prof, prof_add(profitstruct *profit, profstruct *prof,
int extfluxfac_flag), int extfluxfac_flag),
profit_minradius(profitstruct *profit, float refffac), profit_minradius(profitstruct *profit, float refffac),
profit_noisearea(profitstruct *profit),
profit_spiralindex(profitstruct *profit); profit_spiralindex(profitstruct *profit);
int profit_copyobjpix(profitstruct *profit, picstruct *field, int profit_copyobjpix(profitstruct *profit, picstruct *field,
...@@ -206,6 +218,7 @@ void prof_end(profstruct *prof), ...@@ -206,6 +218,7 @@ void prof_end(profstruct *prof),
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_convmoments(profitstruct *profit, obj2struct *obj2),
profit_convolve(profitstruct *profit, float *modpix), profit_convolve(profitstruct *profit, float *modpix),
profit_covarunboundtobound(profitstruct *profit, profit_covarunboundtobound(profitstruct *profit,
double *dparam, float *param), double *dparam, float *param),
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1993-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 11/10/2010 * Last modified: 25/03/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -165,6 +165,12 @@ void *loadstrip(picstruct *field, picstruct *wfield) ...@@ -165,6 +165,12 @@ void *loadstrip(picstruct *field, picstruct *wfield)
if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_SUBOBJECTS])) if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_SUBOBJECTS]))
writecheck(check, data, w); writecheck(check, data, w);
if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_MASK]))
writecheck(check, data, w);
if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_SUBMASK]))
writecheck(check, data, w);
if (flags & BACKRMS_FIELD) if (flags & BACKRMS_FIELD)
backrmsline(field, field->ymax, data); backrmsline(field, field->ymax, data);
else if (flags & INTERP_FIELD) else if (flags & INTERP_FIELD)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1993-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 12/01/2011 * Last modified: 03/05/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -71,8 +71,8 @@ typedef enum {BACK_RELATIVE, BACK_ABSOLUTE} ...@@ -71,8 +71,8 @@ typedef enum {BACK_RELATIVE, BACK_ABSOLUTE}
typedef enum {CHECK_NONE, CHECK_IDENTICAL, CHECK_BACKGROUND, typedef enum {CHECK_NONE, CHECK_IDENTICAL, CHECK_BACKGROUND,
CHECK_BACKRMS, CHECK_MINIBACKGROUND, CHECK_MINIBACKRMS, CHECK_BACKRMS, CHECK_MINIBACKGROUND, CHECK_MINIBACKRMS,
CHECK_SUBTRACTED, CHECK_FILTERED, CHECK_OBJECTS, CHECK_APERTURES, CHECK_SUBTRACTED, CHECK_FILTERED, CHECK_OBJECTS, CHECK_APERTURES,
CHECK_SEGMENTATION, CHECK_ASSOC, CHECK_SUBOBJECTS, CHECK_SEGMENTATION, CHECK_MASK, CHECK_SUBMASK, CHECK_ASSOC,
CHECK_PSFPROTOS, CHECK_SUBPSFPROTOS, CHECK_SUBOBJECTS, CHECK_PSFPROTOS, CHECK_SUBPSFPROTOS,
CHECK_PCPROTOS, CHECK_SUBPCPROTOS, CHECK_PCOPROTOS, CHECK_PCPROTOS, CHECK_SUBPCPROTOS, CHECK_PCOPROTOS,
CHECK_MAPSOM, CHECK_PROFILES, CHECK_SUBPROFILES, CHECK_MAPSOM, CHECK_PROFILES, CHECK_SUBPROFILES,
CHECK_SPHEROIDS, CHECK_SUBSPHEROIDS, CHECK_DISKS, CHECK_SUBDISKS, CHECK_SPHEROIDS, CHECK_SUBSPHEROIDS, CHECK_DISKS, CHECK_SUBDISKS,
...@@ -165,6 +165,7 @@ typedef struct ...@@ -165,6 +165,7 @@ typedef struct
float *magerr_aper; /* APER mag error vector */ float *magerr_aper; /* APER mag error vector */
float flux_win; /* WINdowed flux*/ float flux_win; /* WINdowed flux*/
float fluxerr_win; /* WINdowed flux error */ float fluxerr_win; /* WINdowed flux error */
float snr_win; /* WINdowed SNR */
float mag_win; /* WINdowed magnitude */ float mag_win; /* WINdowed magnitude */
float magerr_win; /* WINdowed magnitude error */ float magerr_win; /* WINdowed magnitude error */
/* ---- astrometric data */ /* ---- astrometric data */
...@@ -371,6 +372,12 @@ typedef struct ...@@ -371,6 +372,12 @@ typedef struct
prof_theta; /* Model-fitting ellip. params*/ prof_theta; /* Model-fitting ellip. params*/
float prof_cxx, prof_cyy, float prof_cxx, prof_cyy,
prof_cxy; /* Model-fitting ellip. params*/ prof_cxy; /* Model-fitting ellip. params*/
double prof_convmx2, prof_convmy2,
prof_convmxy; /* Convolved model moments */
float prof_convcxx, prof_convcyy,
prof_convcxy; /* Conv. model ellipse params */
float prof_conva, prof_convb,
prof_convtheta; /* Conv. model ellipse params */
float prof_pol1, prof_pol2; /* Model-fitting pol. vector*/ float prof_pol1, prof_pol2; /* Model-fitting pol. vector*/
float prof_pol1err, prof_pol2err, float prof_pol1err, prof_pol2err,
prof_pol12corr; /* Model-fitting pol. errors */ prof_pol12corr; /* Model-fitting pol. errors */
...@@ -395,6 +402,7 @@ typedef struct ...@@ -395,6 +402,7 @@ typedef struct
float prof_class_star; /* Mod.-fitting star/gal class*/ float prof_class_star; /* Mod.-fitting star/gal class*/
float prof_concentration; /* Model-fitting concentration*/ float prof_concentration; /* Model-fitting concentration*/
float prof_concentrationerr; /* RMS error */ float prof_concentrationerr; /* RMS error */
float prof_noisearea; /* Equivalent noise area */
float prof_offset_flux; /* Background offset */ float prof_offset_flux; /* Background offset */
float prof_offset_fluxerr; /* RMS error */ float prof_offset_fluxerr; /* RMS error */
float prof_dirac_flux; /* Point source total flux */ float prof_dirac_flux; /* Point source total flux */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: SExtractor * This file part of: SExtractor
* *
* Copyright: (C) 2005-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 2005-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>. * along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 11/10/2010 * Last modified: 03/05/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -50,7 +50,7 @@ INPUT Picture structure pointer, ...@@ -50,7 +50,7 @@ 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 16/07/2010 VERSION 03/05/2011
***/ ***/
void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj) void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
...@@ -79,7 +79,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj) ...@@ -79,7 +79,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
pflag = (prefs.detect_type==PHOTO)? 1:0; pflag = (prefs.detect_type==PHOTO)? 1:0;
corrflag = (prefs.mask_type==MASK_CORRECT); corrflag = (prefs.mask_type==MASK_CORRECT);
gainflag = wfield && prefs.weightgain_flag; gainflag = wfield && prefs.weightgain_flag;
errflag = FLAG(obj2.winposerr_mx2); errflag = FLAG(obj2.winposerr_mx2) | FLAG(obj2.fluxerr_win);
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;
invgain = field->gain>0.0? 1.0/field->gain : 0.0; invgain = field->gain>0.0? 1.0/field->gain : 0.0;
...@@ -262,13 +262,14 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj) ...@@ -262,13 +262,14 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
{ {
obj2->flux_win = tv; obj2->flux_win = tv;
obj2->fluxerr_win = sqrt(esum); obj2->fluxerr_win = sqrt(esum);
obj2->snr_win = esum>(1.0/BIG)? obj2->flux_win / obj2->fluxerr_win: BIG;
} }
temp2=mx2*my2-mxy*mxy; 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) if (obj2->win_flag)
{ {
/*--- Negative values: revert to isophotal estimates */ /*--- Negative values: revert to isophotal estimates */
if (errflag) if (FLAG(obj2.winposerr_mx2))
{ {
obj2->winposerr_mx2 = obj->poserr_mx2; obj2->winposerr_mx2 = obj->poserr_mx2;
obj2->winposerr_my2 = obj->poserr_my2; obj2->winposerr_my2 = obj->poserr_my2;
...@@ -308,7 +309,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj) ...@@ -308,7 +309,7 @@ void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
} }
else else
{ {
if (errflag) if (FLAG(obj2.winposerr_mx2))
{ {
norm = WINPOS_FAC*WINPOS_FAC/(tv*tv); norm = WINPOS_FAC*WINPOS_FAC/(tv*tv);
emx2 *= norm; emx2 *= norm;
......
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