Commit 3d8b32ff authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Fixed scaling issue with surface brightness measurements on galaxy models...

Fixed scaling issue with surface brightness measurements on galaxy models (thanks to V. de Lapparent).
Optimized the setup of astrometric polynoms.
Removed confusing FITS header keywords from non-MEF check-images.
Pushed version number to 2.14.7.
parent 17b88c46
#! /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.68 for sextractor 2.14.5. # Generated by GNU Autoconf 2.68 for sextractor 2.14.7.
# #
# Report bugs to <bertin@iap.fr>. # Report bugs to <bertin@iap.fr>.
# #
...@@ -714,8 +714,8 @@ MAKEFLAGS= ...@@ -714,8 +714,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='sextractor' PACKAGE_NAME='sextractor'
PACKAGE_TARNAME='sextractor' PACKAGE_TARNAME='sextractor'
PACKAGE_VERSION='2.14.5' PACKAGE_VERSION='2.14.7'
PACKAGE_STRING='sextractor 2.14.5' PACKAGE_STRING='sextractor 2.14.7'
PACKAGE_BUGREPORT='bertin@iap.fr' PACKAGE_BUGREPORT='bertin@iap.fr'
PACKAGE_URL='' PACKAGE_URL=''
   
...@@ -1465,7 +1465,7 @@ if test "$ac_init_help" = "long"; then ...@@ -1465,7 +1465,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.14.5 to adapt to many kinds of systems. \`configure' configures sextractor 2.14.7 to adapt to many kinds of systems.
   
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
   
...@@ -1535,7 +1535,7 @@ fi ...@@ -1535,7 +1535,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.14.5:";; short | recursive ) echo "Configuration of sextractor 2.14.7:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
   
...@@ -1668,7 +1668,7 @@ fi ...@@ -1668,7 +1668,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.14.5 sextractor configure 2.14.7
generated by GNU Autoconf 2.68 generated by GNU Autoconf 2.68
   
Copyright (C) 2010 Free Software Foundation, Inc. Copyright (C) 2010 Free Software Foundation, Inc.
...@@ -2296,7 +2296,7 @@ cat >config.log <<_ACEOF ...@@ -2296,7 +2296,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.14.5, which was It was created by sextractor $as_me 2.14.7, which was
generated by GNU Autoconf 2.68. Invocation command line was generated by GNU Autoconf 2.68. Invocation command line was
   
$ $0 $@ $ $0 $@
...@@ -2972,7 +2972,7 @@ fi ...@@ -2972,7 +2972,7 @@ fi
   
# Define the identity of the package. # Define the identity of the package.
PACKAGE='sextractor' PACKAGE='sextractor'
VERSION='2.14.5' VERSION='2.14.7'
   
   
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -23325,7 +23325,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ...@@ -23325,7 +23325,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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.14.5, which was This file was extended by sextractor $as_me 2.14.7, which was
generated by GNU Autoconf 2.68. Invocation command line was generated by GNU Autoconf 2.68. Invocation command line was
   
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
...@@ -23391,7 +23391,7 @@ _ACEOF ...@@ -23391,7 +23391,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
sextractor config.status 2.14.5 sextractor config.status 2.14.7
configured by $0, generated by GNU Autoconf 2.68, configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
   
......
...@@ -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: 22/08/2011 # Last modified: 06/09/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.14.5, [bertin@iap.fr]) AC_INIT(sextractor, 2.14.7, [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" "August 2011" "SExtractor 2.14.5" "User Commands" .TH SEXTRACTOR "1" "September 2011" "SExtractor 2.14.7" "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: 19/05/2011 * Last modified: 06/09/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -373,9 +373,9 @@ void updateparamflags() ...@@ -373,9 +373,9 @@ void updateparamflags()
/*| FLAG(obj2.fluxcor_prof) */; /*| FLAG(obj2.fluxcor_prof) */;
FLAG(obj2.prof_convmx2) |= FLAG(obj2.prof_convcxx) | FLAG(obj2.prof_conva); 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.fluxmean_prof);
FLAG(obj2.peak_prof) |= FLAG(obj2.mumax_prof); FLAG(obj2.peak_prof) |= FLAG(obj2.mumax_prof);
FLAG(obj2.fluxeff_prof) |= FLAG(obj2.mueff_prof)
| FLAG(obj2.fluxmean_prof) | FLAG(obj2.peak_prof);
FLAG(obj2.prof_arms_flux) |= FLAG(obj2.prof_arms_fluxerr) FLAG(obj2.prof_arms_flux) |= FLAG(obj2.prof_arms_fluxerr)
| FLAG(obj2.prof_arms_mag) | FLAG(obj2.prof_arms_mag)
......
...@@ -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: 25/03/2011 * Last modified: 06/09/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -372,8 +372,8 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -372,8 +372,8 @@ void reinitcheck(picstruct *field, checkstruct *check)
tab->bitpix = BP_FLOAT; tab->bitpix = BP_FLOAT;
tab->bytepix = 4; tab->bytepix = 4;
tab->bitsgn = 0; tab->bitsgn = 0;
tab->naxisn[0] = check->width = field->width; tab->naxisn[0] = check->width;
tab->naxisn[1] = check->height = field->height; tab->naxisn[1] = check->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);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: AstrOmatic FITS/LDAC library * This file part of: AstrOmatic FITS/LDAC library
* *
* Copyright: (C) 1995-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1995-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* along with AstrOmatic software. * along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 10/11/2010 * Last modified: 30/08/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -480,7 +480,7 @@ INPUT Table structure. ...@@ -480,7 +480,7 @@ INPUT Table structure.
OUTPUT RETURN_OK if tab header was already primary, or RETURN_ERROR otherwise. OUTPUT RETURN_OK if tab header was already primary, or RETURN_ERROR otherwise.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP & Leiden observatory) C. Marmo (IAP) AUTHOR E. Bertin (IAP & Leiden observatory) C. Marmo (IAP)
VERSION 11/06/2007 VERSION 30/08/2011
***/ ***/
int prim_head(tabstruct *tab) int prim_head(tabstruct *tab)
...@@ -489,12 +489,13 @@ int prim_head(tabstruct *tab) ...@@ -489,12 +489,13 @@ int prim_head(tabstruct *tab)
return RETURN_ERROR; return RETURN_ERROR;
if (!strncmp(tab->headbuf, "XTENSION",8)) if (!strncmp(tab->headbuf, "XTENSION",8))
{ {
strncpy(tab->headbuf, "SIMPLE = T " strncpy(tab->headbuf, "SIMPLE = T "
"/ This is a FITS file ", 80); "/ This is a FITS file ", 80);
/* fitsverify 4.13 (CFITSIO V3.002) return an error
if PCOUNT and GCOUNT are in a primary header (23/05/2007)*/
removekeywordfrom_head(tab, "PCOUNT"); removekeywordfrom_head(tab, "PCOUNT");
removekeywordfrom_head(tab, "GCOUNT"); removekeywordfrom_head(tab, "GCOUNT");
removekeywordfrom_head(tab, "TFIELDS");
removekeywordfrom_head(tab, "EXTNAME");
*tab->extname = '\0';
return RETURN_ERROR; return RETURN_ERROR;
} }
...@@ -670,8 +671,8 @@ PURPOSE Return the size of a binary-table field from its ``TFORM''. ...@@ -670,8 +671,8 @@ PURPOSE Return the size of a binary-table field from its ``TFORM''.
INPUT TFORM string (see the FITS documentation). INPUT TFORM string (see the FITS documentation).
OUTPUT size in bytes, or RETURN_ERROR if the TFORM is unknown. OUTPUT size in bytes, or RETURN_ERROR if the TFORM is unknown.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP) AUTHOR E. Bertin (IAP & Leiden observatory)
VERSION 10/11/2010 VERSION 28/10/2009
***/ ***/
int tsizeof(char *str) int tsizeof(char *str)
...@@ -679,8 +680,8 @@ int tsizeof(char *str) ...@@ -679,8 +680,8 @@ int tsizeof(char *str)
int n; int n;
char *str2; char *str2;
n = strtol(str, &str2, 10); str2 = str;
if (str2==str) if (!(n = strtol(str, &str2, 10)))
n = 1; n = 1;
switch ((int)*str2) switch ((int)*str2)
......
...@@ -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: 25/07/2011 * Last modified: 06/09/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -166,7 +166,7 @@ OUTPUT Pointer to an allocated fit structure (containing details about the ...@@ -166,7 +166,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 31/05/2011 VERSION 06/09/2011
***/ ***/
void profit_fit(profitstruct *profit, void profit_fit(profitstruct *profit,
picstruct *field, picstruct *wfield, picstruct *field, picstruct *wfield,
...@@ -537,7 +537,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER); ...@@ -537,7 +537,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER);
} }
/* Do measurements on the rasterised model (surface brightnesses) */ /* Do measurements on the rasterised model (surface brightnesses) */
if (FLAG(obj2.peak_prof)) if (FLAG(obj2.fluxeff_prof))
profit_surface(profit, obj2); profit_surface(profit, obj2);
/* Background offset */ /* Background offset */
...@@ -595,7 +595,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER); ...@@ -595,7 +595,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER);
+ 131.0/(1148175*n*n*n); /* Ciotti & Bertin 1999 */ + 131.0/(1148175*n*n*n); /* Ciotti & Bertin 1999 */
cn = n * prof_gamma(2.0*n) * pow(bn, -2.0*n); cn = n * prof_gamma(2.0*n) * pow(bn, -2.0*n);
obj2->prof_spheroid_peak = obj2->prof_spheroid_reff>0.0? obj2->prof_spheroid_peak = obj2->prof_spheroid_reff>0.0?
obj2->prof_spheroid_flux * profit->pixstep*profit->pixstep obj2->prof_spheroid_flux
/ (2.0 * PI * cn / (2.0 * PI * cn
* obj2->prof_spheroid_reff*obj2->prof_spheroid_reff * obj2->prof_spheroid_reff*obj2->prof_spheroid_reff
* obj2->prof_spheroid_aspect) * obj2->prof_spheroid_aspect)
...@@ -645,7 +645,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER); ...@@ -645,7 +645,7 @@ profit->niter = profit_minimize(profit, PROFIT_MAXITER);
if (FLAG(obj2.prof_disk_peak)) if (FLAG(obj2.prof_disk_peak))
{ {
obj2->prof_disk_peak = obj2->prof_disk_scale>0.0? obj2->prof_disk_peak = obj2->prof_disk_scale>0.0?
obj2->prof_disk_flux * profit->pixstep*profit->pixstep obj2->prof_disk_flux
/ (2.0 * PI * obj2->prof_disk_scale*obj2->prof_disk_scale / (2.0 * PI * obj2->prof_disk_scale*obj2->prof_disk_scale
* obj2->prof_disk_aspect) * obj2->prof_disk_aspect)
: 0.0; : 0.0;
...@@ -2643,7 +2643,7 @@ INPUT Pointer to the profile-fitting structure, ...@@ -2643,7 +2643,7 @@ INPUT Pointer to the profile-fitting structure,
OUTPUT -. OUTPUT -.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP) AUTHOR E. Bertin (IAP)
VERSION 24/01/2011 VERSION 06/09/2011
***/ ***/
void profit_surface(profitstruct *profit, obj2struct *obj2) void profit_surface(profitstruct *profit, obj2struct *obj2)
{ {
...@@ -2667,7 +2667,7 @@ void profit_surface(profitstruct *profit, obj2struct *obj2) ...@@ -2667,7 +2667,7 @@ void profit_surface(profitstruct *profit, obj2struct *obj2)
scalefac = (float)hdprofit.modnaxisn[0] / (float)profit->modnaxisn[0] scalefac = (float)hdprofit.modnaxisn[0] / (float)profit->modnaxisn[0]
/ imsizefac; / imsizefac;
hdprofit.pixstep = profit->pixstep / scalefac; hdprofit.pixstep = profit->pixstep / scalefac;
hdprofit.fluxfac = scalefac*scalefac; hdprofit.fluxfac = 1.0/(hdprofit.pixstep*hdprofit.pixstep);
QCALLOC(hdprofit.modpix, float,npix*sizeof(float)); QCALLOC(hdprofit.modpix, float,npix*sizeof(float));
for (p=0; p<profit->nparam; p++) for (p=0; p<profit->nparam; p++)
...@@ -2680,56 +2680,18 @@ void profit_surface(profitstruct *profit, obj2struct *obj2) ...@@ -2680,56 +2680,18 @@ void profit_surface(profitstruct *profit, obj2struct *obj2)
lost += flux*profit->prof[p]->lostfluxfrac; lost += flux*profit->prof[p]->lostfluxfrac;
} }
lostfluxfrac = sum > 0.0? lost / sum : 0.0; lostfluxfrac = sum > 0.0? lost / sum : 0.0;
/* /*
char filename[256]; char filename[256];
checkstruct *check;
sprintf(filename, "raster_%02d.fits", the_gal); sprintf(filename, "raster_%02d.fits", the_gal);
check=initcheck(filename, CHECK_OTHER, 0); check=initcheck(filename, CHECK_OTHER, 0);
check->width = hdprofit.modnaxisn[0]; check->width = hdprofit.modnaxisn[0];
check->height = hdprofit.modnaxisn[1]; check->height = hdprofit.modnaxisn[1];
reinitcheck(the_field, check); reinitcheck(the_field, check);
memcpy(check->pix,hdprofit.modpix,check->npix*sizeof(float)); memcpy(check->pix,hdprofit.modpix,check->npix*sizeof(float));
int r,t;
double ratio,ratio0,ang,ang0, x,x0,y,y0;
list = profit->paramlist;
index = profit->paramindex;
for (p=0; p<nparam; p++)
param[p] = profit->paraminit[p];
ratio0 = profit->paraminit[index[PARAM_SPHEROID_ASPECT]];
ang0 = profit->paraminit[index[PARAM_SPHEROID_POSANG]];
x0 = profit->paraminit[index[PARAM_X]];
y0 = profit->paraminit[index[PARAM_Y]];
for (r=0;r<check->height;r++)
for (t=0; t<check->width;t++)
{
//x = (r-10.0)/100.0 + x0;
//y = (t-10.0)/100.0 + y0;
ratio = ratio0*exp((r-10.0)/400.0);
ang = ang0+(t-10.0)/3.0;
for (i=0; i<PARAM_NPARAM; i++)
{
//if (list[i] && i==PARAM_X)
//param[index[i]] = x;
//if (list[i] && i==PARAM_Y)
//param[index[i]] = y;
if (list[i] && i==PARAM_SPHEROID_ASPECT)
param[index[i]] = ratio;
if (list[i] && i==PARAM_SPHEROID_POSANG)
param[index[i]] = ang;
//if (list[i] && i==PARAM_SPHEROID_REFF)
//param[index[i]] = profit->paraminit[index[i]]*sqrt(ratio0/ratio);
}
profit_residuals(profit,field,wfield, PROFIT_DYNPARAM, param,profit->resi);
*((float *)check->pix + t + r*check->width) = profit->chi2;
}
reendcheck(the_field, check); reendcheck(the_field, check);
endcheck(check); endcheck(check);
*/ */
if (FLAG(obj2.fluxeff_prof)) if (FLAG(obj2.fluxeff_prof))
{ {
/*-- Sort model pixel values */ /*-- Sort model pixel values */
...@@ -2775,7 +2737,7 @@ endcheck(check); ...@@ -2775,7 +2737,7 @@ endcheck(check);
free(spix); free(spix);
} }
/* Compute model peak (overwrites oversampled model!!) */ /* Compute model peak */
if (FLAG(obj2.peak_prof)) if (FLAG(obj2.peak_prof))
{ {
/*-- Find position of maximum pixel in current hi-def raster */ /*-- Find position of maximum pixel in current hi-def raster */
...@@ -2789,11 +2751,6 @@ endcheck(check); ...@@ -2789,11 +2751,6 @@ endcheck(check);
imax = i; imax = i;
} }
imax = npix-1 - imax; imax = npix-1 - imax;
/*-- Recompute hi-def model raster without oversampling */
/*-- and with the same flux correction factor */
memset(hdprofit.modpix,0, npix*sizeof(float));
for (p=0; p<profit->nprof; p++)
prof_add(&hdprofit, profit->prof[p], 1);
obj2->peak_prof = hdprofit.modpix[imax]; obj2->peak_prof = hdprofit.modpix[imax];
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* This file part of: AstrOmatic WCS library * This file part of: AstrOmatic WCS library
* *
* Copyright: (C) 1998-2010 Emmanuel Bertin -- IAP/CNRS/UPMC * Copyright: (C) 1998-2011 Emmanuel Bertin -- IAP/CNRS/UPMC
* *
* License: GNU General Public License * License: GNU General Public License
* *
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* along with AstrOmatic software. * along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
* *
* Last modified: 26/10/2010 * Last modified: 30/08/2011
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...@@ -72,7 +72,7 @@ INPUT 1D array containing the group for each parameter, ...@@ -72,7 +72,7 @@ INPUT 1D array containing the group for each parameter,
OUTPUT polystruct pointer. OUTPUT polystruct pointer.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP) AUTHOR E. Bertin (IAP)
VERSION 08/03/2003 VERSION 30/08/2011
***/ ***/
polystruct *poly_init(int *group, int ndim, int *degree, int ngroup) polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
{ {
...@@ -81,7 +81,7 @@ polystruct *poly_init(int *group, int ndim, int *degree, int ngroup) ...@@ -81,7 +81,7 @@ polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
char str[512]; char str[512];
int nd[POLY_MAXDIM]; int nd[POLY_MAXDIM];
int *groupt, int *groupt,
d,g,n,num,den; d,g,n, num,den, dmax;
QCALLOC(poly, polystruct, 1); QCALLOC(poly, polystruct, 1);
if ((poly->ndim=ndim) > POLY_MAXDIM) if ((poly->ndim=ndim) > POLY_MAXDIM)
...@@ -117,15 +117,17 @@ polystruct *poly_init(int *group, int ndim, int *degree, int ngroup) ...@@ -117,15 +117,17 @@ polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
poly->ncoeff = 1; poly->ncoeff = 1;
for (g=0; g<ngroup; g++) for (g=0; g<ngroup; g++)
{ {
if ((d=poly->degree[g]=*(degree++))>POLY_MAXDEGREE) if ((dmax=poly->degree[g]=*(degree++))>POLY_MAXDEGREE)
{ {
sprintf(str, "The degree of the polynom (%d) exceeds the maximum\n" sprintf(str, "The degree of the polynom (%d) exceeds the maximum\n"
"allowed one (%d)", poly->degree[g], POLY_MAXDEGREE); "allowed one (%d)", poly->degree[g], POLY_MAXDEGREE);
qerror("*Error*: ", str); qerror("*Error*: ", str);
} }
/*-- There are (n+d)!/(n!d!) coeffs per group, that is Prod_(i<=d) (n+i)/i */ /*-- There are (n+d)!/(n!d!) coeffs per group = Prod_(i<=d)(n+i)/Prod_(i<=d)i */
for (num=den=1, n=nd[g]; d; num*=(n+d), den*=d--); n = nd[g];
d = dmax>n? n: dmax;
for (num=den=1; d; num*=(n+dmax--), den*=d--);
poly->ncoeff *= num/den; poly->ncoeff *= num/den;
} }
......
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