Commit 5f63711a authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Added VOTABLE "version" attribute to XML output.

Reverted minimization algorithm back to double precision (while keeping single precision for data and parameters in "bounded" space).
Added specific handling of "Jacobian calls" in model-fitting.
Sped up the resampling process in model-fitting.
Tuned up minimization algorithm in model-fitting.
Added shortcuts to the computation of the local PSF model. 
Fixed triggering issues with some model-fitting parameters (thanks to S.Serrano).
Removed CLASS_STAR_MODEL and DISK_PATTERN* measurement parameters.
Added automatic tracking of the PSF FWHM from the local PSF model if SEEING_FWHM is 0 for CLASS_STAR.
Fixed excessive WIN parameter computation time on large ring-shaped objects.
Fixed model-fitting issue with null half-light radii (thanks to S.Desai and B.Armstrong).
Fixed aperture display value error in FITS-LDAC catalogue header.
Removed redundant update_tab() calls in FITS library.
Fixed comment copy issue for slashes within strings in FITS library (thanks to F.Schuller).
Added check of PSF values; SExtractor will now exit in error in the case where all PSF components sum up to 0.
Replaced computation of model second moments and ellipticities with analytical estimates.
Improved the accuracy of peak and average model surface brightness estimates.
Fixed some compiler warnings.
Pushed version number to 2.11.7.
parent 523e3274
#! /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.0. # Generated by GNU Autoconf 2.63 for sextractor 2.11.7.
# #
# 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.11.0' PACKAGE_VERSION='2.11.7'
PACKAGE_STRING='sextractor 2.11.0' PACKAGE_STRING='sextractor 2.11.7'
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 ...@@ -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.0 to adapt to many kinds of systems. \`configure' configures sextractor 2.11.7 to adapt to many kinds of systems.
   
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
   
...@@ -1575,7 +1575,7 @@ fi ...@@ -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.0:";; short | recursive ) echo "Configuration of sextractor 2.11.7:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
   
...@@ -1706,7 +1706,7 @@ fi ...@@ -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.0 sextractor configure 2.11.7
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 ...@@ -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.0, which was It was created by sextractor $as_me 2.11.7, 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 ...@@ -2423,7 +2423,7 @@ fi
   
# Define the identity of the package. # Define the identity of the package.
PACKAGE='sextractor' PACKAGE='sextractor'
VERSION='2.11.0' VERSION='2.11.7'
   
   
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -28535,7 +28535,7 @@ exec 6>&1 ...@@ -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.0, which was This file was extended by sextractor $as_me 2.11.7, 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>." ...@@ -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.0 sextractor config.status 2.11.7
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'`\\"
   
......
# configure.in for SExtractor # configure.in for SExtractor
# (C) E.Bertin 2002-2009 # (C) E.Bertin 2002-2010
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# First, disable the annoying config.cache # First, disable the annoying config.cache
define([AC_CACHE_LOAD],) 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.0, [bertin@iap.fr]) AC_INIT(sextractor, 2.11.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" "February 2010" "SWarp 2.11.0" "User Commands" .TH SEXTRACTOR "1" "July 2010" "SWarp 2.11.7" "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
......
...@@ -395,6 +395,11 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield, ...@@ -395,6 +395,11 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
analtime1; analtime1;
int i,j, ix,iy,selecflag, newnumber,nsub; int i,j, ix,iy,selecflag, newnumber,nsub;
if (prefs.psf_flag || prefs.prof_flag)
thepsf->build_flag = 0; /* Reset PSF building flag */
if (prefs.dpsf_flag)
ppsf->build_flag = 0; /* Reset PSF building flag */
if (FLAG(obj2.analtime)) if (FLAG(obj2.analtime))
analtime1 = counter_seconds(); analtime1 = counter_seconds();
else else
...@@ -589,7 +594,8 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield, ...@@ -589,7 +594,8 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
{ {
double fac2, input[10], output, fwhm; double fac2, input[10], output, fwhm;
fwhm = prefs.seeing_fwhm; fwhm = (prefs.seeing_fwhm==0.0)? psf_fwhm(thepsf)*field->pixscale
: prefs.seeing_fwhm;
fac2 = fwhm/field->pixscale; fac2 = fwhm/field->pixscale;
fac2 *= fac2; fac2 *= fac2;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: functions for output of catalog data. * Contents: functions for output of catalog data.
* *
* Last modify: 07/10/2009 * Last modify: 08/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -193,6 +193,9 @@ void updateparamflags() ...@@ -193,6 +193,9 @@ void updateparamflags()
| FLAG(obj2.poserraw_prof); | FLAG(obj2.poserraw_prof);
FLAG(obj2.poserrcxx_prof) |= FLAG(obj2.poserrcyy_prof) FLAG(obj2.poserrcxx_prof) |= FLAG(obj2.poserrcyy_prof)
| FLAG(obj2.poserrcxy_prof); | FLAG(obj2.poserrcxy_prof);
FLAG(obj2.poserrmx2_prof) |= FLAG(obj2.poserrmy2_prof)
| FLAG(obj2.poserrmxy_prof)
| FLAG(obj2.poserrmx2w_prof);
FLAG(obj2.alpha1950_prof) |= FLAG(obj2.delta1950_prof) FLAG(obj2.alpha1950_prof) |= FLAG(obj2.delta1950_prof)
| FLAG(obj2.poserrtheta1950_prof); | FLAG(obj2.poserrtheta1950_prof);
FLAG(obj2.alpha2000_prof) |= FLAG(obj2.delta2000_prof) FLAG(obj2.alpha2000_prof) |= FLAG(obj2.delta2000_prof)
...@@ -208,6 +211,7 @@ void updateparamflags() ...@@ -208,6 +211,7 @@ void updateparamflags()
| FLAG(obj2.xf_prof) | FLAG(obj2.xf_prof)
| FLAG(obj2.poserra_prof) | FLAG(obj2.poserra_prof)
| FLAG(obj2.poserrcxx_prof) | FLAG(obj2.poserrcxx_prof)
| FLAG(obj2.poserrmx2_prof)
| FLAG(obj2.prof_concentration) | FLAG(obj2.prof_concentration)
| FLAG(obj2.prof_class_star); | FLAG(obj2.prof_class_star);
...@@ -336,12 +340,10 @@ void updateparamflags() ...@@ -336,12 +340,10 @@ void updateparamflags()
| FLAG(obj2.prof_e1) | FLAG(obj2.prof_e1)
| 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.mumax_prof) |= FLAG(obj2.mueff_prof) | FLAG(obj2.mumean_prof);/*!*/
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);
FLAG(obj2.peak_prof) |= FLAG(obj2.mumax_prof) FLAG(obj2.peak_prof) |= FLAG(obj2.mumax_prof);
| FLAG(obj2.fluxeff_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)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: handling of "check-images". * Contents: handling of "check-images".
* *
* Last modify: 17/09/2008 * Last modify: 23/03/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -236,13 +236,17 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -236,13 +236,17 @@ void reinitcheck(picstruct *field, checkstruct *check)
case CHECK_OBJECTS: case CHECK_OBJECTS:
case CHECK_APERTURES: case CHECK_APERTURES:
case CHECK_SUBPSFPROTOS:
case CHECK_PSFPROTOS: case CHECK_PSFPROTOS:
case CHECK_SUBPCPROTOS: case CHECK_SUBPSFPROTOS:
case CHECK_PCPROTOS: case CHECK_PCPROTOS:
case CHECK_SUBPCPROTOS:
case CHECK_PCOPROTOS: case CHECK_PCOPROTOS:
case CHECK_SUBPROFILES:
case CHECK_PROFILES: case CHECK_PROFILES:
case CHECK_SUBPROFILES:
case CHECK_SPHEROIDS:
case CHECK_SUBSPHEROIDS:
case CHECK_DISKS:
case CHECK_SUBDISKS:
case CHECK_PATTERNS: case CHECK_PATTERNS:
ival = -32; ival = -32;
fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG); fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
...@@ -349,6 +353,20 @@ void reinitcheck(picstruct *field, checkstruct *check) ...@@ -349,6 +353,20 @@ void reinitcheck(picstruct *field, checkstruct *check)
free(check->fitshead); free(check->fitshead);
break; break;
case CHECK_OTHER:
ival = -32;
fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
fitswrite(check->fitshead, "NAXIS1 ", &check->width, H_INT, T_LONG);
fitswrite(check->fitshead, "NAXIS2 ", &check->height, H_INT, T_LONG);
check->npix = check->width*check->height;
QMALLOC(ptrf, PIXTYPE, check->npix);
check->pix = (void *)ptrf;
for (i=check->npix; i--;)
*(ptrf++) = -10.0;
QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
free(check->fitshead);
break;
default: default:
error(EXIT_FAILURE, "*Internal Error* in ", "reinitcheck()!"); error(EXIT_FAILURE, "*Internal Error* in ", "reinitcheck()!");
} }
...@@ -366,7 +384,8 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w) ...@@ -366,7 +384,8 @@ 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_SUBPROFILES || check->type == CHECK_SUBSPHEROIDS
|| check->type == CHECK_SUBDISKS)
{ {
memcpy((PIXTYPE *)check->pix + w*(check->y++), data, w*sizeof(PIXTYPE)); memcpy((PIXTYPE *)check->pix + w*(check->y++), data, w*sizeof(PIXTYPE));
return; return;
...@@ -422,15 +441,21 @@ void reendcheck(picstruct *field, checkstruct *check) ...@@ -422,15 +441,21 @@ void reendcheck(picstruct *field, checkstruct *check)
case CHECK_OBJECTS: case CHECK_OBJECTS:
case CHECK_APERTURES: case CHECK_APERTURES:
case CHECK_SUBPSFPROTOS:
case CHECK_PSFPROTOS: case CHECK_PSFPROTOS:
case CHECK_SUBPCPROTOS: case CHECK_SUBPSFPROTOS:
case CHECK_PCPROTOS: case CHECK_PCPROTOS:
case CHECK_SUBPCPROTOS:
case CHECK_PCOPROTOS: case CHECK_PCOPROTOS:
case CHECK_SUBPROFILES:
case CHECK_PROFILES: case CHECK_PROFILES:
case CHECK_SUBPROFILES:
case CHECK_SPHEROIDS:
case CHECK_SUBSPHEROIDS:
case CHECK_DISKS:
case CHECK_SUBDISKS:
case CHECK_ASSOC: case CHECK_ASSOC:
case CHECK_PATTERNS: case CHECK_PATTERNS:
case CHECK_MAPSOM:
case CHECK_OTHER:
if (bswapflag) if (bswapflag)
swapbytes(check->pix, sizeof(PIXTYPE), (int)check->npix); swapbytes(check->pix, sizeof(PIXTYPE), (int)check->npix);
QFWRITE(check->pix,check->npix*sizeof(PIXTYPE), QFWRITE(check->pix,check->npix*sizeof(PIXTYPE),
...@@ -461,15 +486,6 @@ void reendcheck(picstruct *field, checkstruct *check) ...@@ -461,15 +486,6 @@ void reendcheck(picstruct *field, checkstruct *check)
break; break;
} }
case CHECK_MAPSOM:
if (bswapflag)
swapbytes(check->pix, sizeof(PIXTYPE), (int)check->npix);
QFWRITE(check->pix,check->npix*sizeof(PIXTYPE),
check->file,check->filename);
free(check->pix);
padsize = (FBSIZE -((check->npix*sizeof(USHORT))%FBSIZE)) % FBSIZE;
break;
default: default:
error(EXIT_FAILURE, "*Internal Error* in ", "endcheck()!"); error(EXIT_FAILURE, "*Internal Error* in ", "endcheck()!");
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: functions for handling FITS keywords. * Contents: functions for handling FITS keywords.
* *
* Last modify: 02/11/2009 * Last modify: 02/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -181,7 +181,7 @@ OUTPUT RETURN_OK if something was found, RETURN_ERROR otherwise. ...@@ -181,7 +181,7 @@ OUTPUT RETURN_OK if something was found, RETURN_ERROR otherwise.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP), AUTHOR E. Bertin (IAP),
E.R. Deul - Handling of NaN E.R. Deul - Handling of NaN
VERSION 18/05/2009 VERSION 02/07/2010
***/ ***/
int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype, int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
t_type *ttype, char *comment) t_type *ttype, char *comment)
...@@ -274,7 +274,7 @@ int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype, ...@@ -274,7 +274,7 @@ int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
for (fptr = fitsline + (i=j); i<80; i++) for (fptr = fitsline + (i=j); i<80; i++)
{ {
if (*fptr == (char)'\'') if (*fptr == (char)'\'')
toggle^=toggle; toggle ^= 1;
if (*(fptr++) == (char)'/' && !toggle) if (*(fptr++) == (char)'/' && !toggle)
{ {
while (++i<80 && *fptr<=' ') while (++i<80 && *fptr<=' ')
......
...@@ -75,7 +75,7 @@ INPUT pointer to the catalog structure, ...@@ -75,7 +75,7 @@ INPUT pointer to the catalog structure,
OUTPUT -. OUTPUT -.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP & Leiden observatory) AUTHOR E. Bertin (IAP & Leiden observatory)
VERSION 09/09/2003 VERSION 02/11/2009
***/ ***/
void save_tab(catstruct *cat, tabstruct *tab) void save_tab(catstruct *cat, tabstruct *tab)
...@@ -90,8 +90,6 @@ void save_tab(catstruct *cat, tabstruct *tab) ...@@ -90,8 +90,6 @@ void save_tab(catstruct *cat, tabstruct *tab)
char *buf, *inbuf, *outbuf, *fptr,*ptr; char *buf, *inbuf, *outbuf, *fptr,*ptr;
int esize; int esize;
/* Make the table parameters reflect its content*/
update_tab(tab);
/* The header itself*/ /* The header itself*/
tabflag = save_head(cat, tab)==RETURN_OK?1:0; tabflag = save_head(cat, tab)==RETURN_OK?1:0;
/* Allocate memory for the output buffer */ /* Allocate memory for the output buffer */
...@@ -265,7 +263,7 @@ INPUT catalog structure, ...@@ -265,7 +263,7 @@ INPUT catalog structure,
OUTPUT -. OUTPUT -.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP & Leiden observatory) AUTHOR E. Bertin (IAP & Leiden observatory)
VERSION 26/09/2004 VERSION 02/11/2009
***/ ***/
void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf) void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf)
...@@ -273,8 +271,6 @@ void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf) ...@@ -273,8 +271,6 @@ void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf)
keystruct *key; keystruct *key;
int k; int k;
/* Make the table parameters reflect its content*/
update_tab(tab);
/* The header itself */ /* The header itself */
if (save_head(cat, tab) != RETURN_OK) if (save_head(cat, tab) != RETURN_OK)
error(EXIT_FAILURE, "*Error*: Not a binary table: ", tab->extname); error(EXIT_FAILURE, "*Error*: Not a binary table: ", tab->extname);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Make growth curves. * Contents: Make growth curves.
* *
* Last modify: 19/12/2007 * Last modify: 02/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -336,6 +336,8 @@ void makeavergrowth(picstruct *field, picstruct *wfield, objstruct *obj) ...@@ -336,6 +336,8 @@ void makeavergrowth(picstruct *field, picstruct *wfield, objstruct *obj)
i + (tv - *(growtht-1))/dg i + (tv - *(growtht-1))/dg
: i) : i)
: (*growth !=0.0 ?tv/(*growth) : 0.0)); : (*growth !=0.0 ?tv/(*growth) : 0.0));
if (obj2->flux_radius[j] > rlim)
obj2->flux_radius[j] = rlim;
} }
} }
...@@ -346,10 +348,14 @@ void makeavergrowth(picstruct *field, picstruct *wfield, objstruct *obj) ...@@ -346,10 +348,14 @@ void makeavergrowth(picstruct *field, picstruct *wfield, objstruct *obj)
tv = 0.5*obj2->flux_auto; tv = 0.5*obj2->flux_auto;
growtht = growth-1; growtht = growth-1;
for (i=0; i<n && *(++growtht)<tv; i++); for (i=0; i<n && *(++growtht)<tv; i++);
obj2->hl_radius = step*(i? ((dg=*growtht - *(growtht-1)) != 0.0 ? obj2->hl_radius = fabs(step*(i? ((dg=*growtht - *(growtht-1)) != 0.0 ?
i + (tv - *(growtht-1))/dg i + (tv - *(growtht-1))/dg
: i) : i)
: (*growth !=0.0 ?tv/(*growth) : 0.0)); : (*growth !=0.0 ?tv/(*growth) : 0.0)));
if (obj2->hl_radius > rlim)
obj2->hl_radius = rlim;
if (obj2->hl_radius < GROWTH_MINHLRAD)
obj2->hl_radius = GROWTH_MINHLRAD;
} }
return; return;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Include file for growth.c. * Contents: Include file for growth.c.
* *
* Last modify: 04/05/98 * Last modify: 02/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#define GROWTH_NSTEP 64 /* number of growth curve samples */ #define GROWTH_NSTEP 64 /* number of growth curve samples */
#define GROWTH_OVERSAMP 5 /* pixel oversampling in each dimension */ #define GROWTH_OVERSAMP 5 /* pixel oversampling in each dimension */
#define GROWTH_NSIG 3*MARGIN_SCALE /* MAG_AUTO analysis range (number */ #define GROWTH_NSIG 3*MARGIN_SCALE /* MAG_AUTO analysis range (nsigmas) */
/* of sigma) */ #define GROWTH_MINHLRAD 0.5 /* Minimum internal half-light radius (pixels)*/
/* NOTES: /* NOTES:
One must have: GROWTH_SAMP >= 1 One must have: GROWTH_SAMP >= 1
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: parameter list for catalog data. * Contents: parameter list for catalog data.
* *
* Last modify: 14/12/2009 * Last modify: 18/05/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -702,7 +702,7 @@ keystruct objkey[] = { ...@@ -702,7 +702,7 @@ keystruct objkey[] = {
&outobj2.win_polarw, H_FLOAT, T_FLOAT, "%7.5f", "", &outobj2.win_polarw, H_FLOAT, T_FLOAT, "%7.5f", "",
"src.ellipticity", ""}, "src.ellipticity", ""},
{"CLASS_STAR", "S/G classifier output", {"CLASS_STAR", "S/G classifier output",
&outobj2.sprob, H_FLOAT, T_FLOAT, "%5.2f", "", &outobj2.sprob, H_FLOAT, T_FLOAT, "%6.3f", "",
"src.class.starGalaxy", ""}, "src.class.starGalaxy", ""},
{"VIGNET", "Pixel data around detection", {"VIGNET", "Pixel data around detection",
&outobj2.vignet, H_FLOAT, T_FLOAT, "%12.7g", "count", &outobj2.vignet, H_FLOAT, T_FLOAT, "%12.7g", "count",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Model-fitting parameter list for catalog data. * Contents: Model-fitting parameter list for catalog data.
* *
* Last modify: 01/12/2009 * Last modify: 25/05/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -272,10 +272,11 @@ ...@@ -272,10 +272,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", ""},
/*
{"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", "",
"src.class.starGalaxy", ""}, "src.class.starGalaxy", ""},
*/
{"FLUX_BACKOFFSET", "Background offset from fitting", {"FLUX_BACKOFFSET", "Background offset from fitting",
&outobj2.prof_offset_flux, H_FLOAT, T_FLOAT, "%12.7g", "count", &outobj2.prof_offset_flux, H_FLOAT, T_FLOAT, "%12.7g", "count",
"instr.skyLevel;arith.diff;stat.fit.param", "ct"}, "instr.skyLevel;arith.diff;stat.fit.param", "ct"},
...@@ -446,6 +447,7 @@ ...@@ -446,6 +447,7 @@
{"DISK_THETA_B1950", "Disk position angle (east of north, B1950)", {"DISK_THETA_B1950", "Disk position angle (east of north, B1950)",
&outobj2.prof_disk_theta1950, H_FLOAT, T_FLOAT, "%+7.3f", "deg", &outobj2.prof_disk_theta1950, H_FLOAT, T_FLOAT, "%+7.3f", "deg",
"pos.posAng;src.morph;stat.fit.param", "deg"}, "pos.posAng;src.morph;stat.fit.param", "deg"},
/*
{"DISK_PATTERN_VECTOR", "Disk pattern fitted coefficients", {"DISK_PATTERN_VECTOR", "Disk pattern fitted coefficients",
&outobj2.prof_disk_patternvector, H_FLOAT, T_FLOAT, "%12.4g", "", &outobj2.prof_disk_patternvector, H_FLOAT, T_FLOAT, "%12.4g", "",
"stat.fit.param;src.morph.param", "", 1, "stat.fit.param;src.morph.param", "", 1,
...@@ -461,7 +463,7 @@ ...@@ -461,7 +463,7 @@
{"DISK_PATTERN_SPIRAL", "Disk pattern spiral index", {"DISK_PATTERN_SPIRAL", "Disk pattern spiral index",
&outobj2.prof_disk_patternspiral, H_FLOAT, T_FLOAT, "%12.4g", "", &outobj2.prof_disk_patternspiral, H_FLOAT, T_FLOAT, "%12.4g", "",
"stat.fit.param;src.morph.param", ""}, "stat.fit.param;src.morph.param", ""},
/*
{"FLUX_BAR", "Bar total flux from fitting", {"FLUX_BAR", "Bar total flux from fitting",
&outobj2.prof_bar_flux, H_FLOAT, T_FLOAT, "%12.g", "count", &outobj2.prof_bar_flux, H_FLOAT, T_FLOAT, "%12.g", "count",
"phot.count;stat.fit.param", "ct"}, "phot.count;stat.fit.param", "ct"},
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Keywords for the configuration file. * Contents: Keywords for the configuration file.
* *
* Last modify: 05/02/2010 * Last modify: 18/05/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -69,9 +69,10 @@ ...@@ -69,9 +69,10 @@
"BACKGROUND", "BACKGROUND_RMS", "MINIBACKGROUND", "BACKGROUND", "BACKGROUND_RMS", "MINIBACKGROUND",
"MINIBACK_RMS", "-BACKGROUND", "MINIBACK_RMS", "-BACKGROUND",
"FILTERED", "OBJECTS", "APERTURES", "SEGMENTATION", "ASSOC", "FILTERED", "OBJECTS", "APERTURES", "SEGMENTATION", "ASSOC",
"-OBJECTS", "-PSFS", "PSFS", "-OBJECTS", "PSFS", "-PSFS",
"-PC_CONVPROTOS", "PC_CONVPROTOS", "PC_PROTOS", "PC_CONVPROTOS", "-PC_CONVPROTOS", "PC_PROTOS",
"MAP_SOM", "-MODELS", "MODELS", "PATTERNS", ""}, "MAP_SOM", "MODELS", "-MODELS", "SPHEROIDS", "-SPHEROIDS",
"DISKS", "-DISKS", "PATTERNS", "OTHER", ""},
0, 17, &prefs.ncheck_type}, 0, 17, &prefs.ncheck_type},
{"CLEAN", P_BOOL, &prefs.clean_flag}, {"CLEAN", P_BOOL, &prefs.clean_flag},
{"CLEAN_PARAM", P_FLOAT, &prefs.clean_param, 0,0, 0.1,10.0}, {"CLEAN_PARAM", P_FLOAT, &prefs.clean_param, 0,0, 0.1,10.0},
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
{"PSF_NMAX", P_INT, &prefs.psf_npsfmax, 1, PSF_NPSFMAX}, {"PSF_NMAX", P_INT, &prefs.psf_npsfmax, 1, PSF_NPSFMAX},
{"SATUR_KEY", P_STRING, prefs.satur_key}, {"SATUR_KEY", P_STRING, prefs.satur_key},
{"SATUR_LEVEL", P_FLOAT, &prefs.satur_level, 0,0, -1e+30, 1e+30}, {"SATUR_LEVEL", P_FLOAT, &prefs.satur_level, 0,0, -1e+30, 1e+30},
{"SEEING_FWHM", P_FLOAT, &prefs.seeing_fwhm, 0,0, 1e-10, 1e+10}, {"SEEING_FWHM", P_FLOAT, &prefs.seeing_fwhm, 0,0, 0.0, 1e+10},
{"SOM_NAME", P_STRING, prefs.som_name}, {"SOM_NAME", P_STRING, prefs.som_name},
{"STARNNW_NAME", P_STRING, prefs.nnw_name}, {"STARNNW_NAME", P_STRING, prefs.nnw_name},
{"THRESH_TYPE", P_KEYLIST, prefs.thresh_type, 0,0, 0.0,0.0, {"THRESH_TYPE", P_KEYLIST, prefs.thresh_type, 0,0, 0.0,0.0,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Functions to handle the configuration file. * Contents: Functions to handle the configuration file.
* *
* Last modify: 11/09/2009 * Last modify: 08/03/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -588,13 +588,21 @@ void useprefs() ...@@ -588,13 +588,21 @@ void useprefs()
prefs.pc_flag = 1; prefs.pc_flag = 1;
} }
/*-------------------------- Profile-fitting -------------------------------*/ /*----------------------------- Model-fitting -------------------------------*/
if (prefs.check_flag) if (prefs.check_flag)
for (i=0; i<prefs.ncheck_type; i++) for (i=0; i<prefs.ncheck_type; i++)
if (prefs.check_type[i] == CHECK_SUBPROFILES if (prefs.check_type[i] == CHECK_PROFILES
|| prefs.check_type[i] == CHECK_PROFILES) || prefs.check_type[i] == CHECK_SUBPROFILES
|| prefs.check_type[i] == CHECK_SPHEROIDS
|| prefs.check_type[i] == CHECK_SUBSPHEROIDS
|| prefs.check_type[i] == CHECK_DISKS
|| prefs.check_type[i] == CHECK_SUBDISKS)
prefs.prof_flag = 1; prefs.prof_flag = 1;
/*--------------------------- Adaptive class-star ---------------------------*/
if (prefs.seeing_fwhm == 0)
prefs.psf_flag = 1;
/*-------------------------- Pattern-fitting -------------------------------*/ /*-------------------------- Pattern-fitting -------------------------------*/
/* Profile-fitting is possible only if a PSF file is loaded */ /* Profile-fitting is possible only if a PSF file is loaded */
if (prefs.check_flag) if (prefs.check_flag)
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Include file for profit.c. * Contents: Include file for profit.c.
* *
* Last modify: 09/10/2009 * Last modify: 08/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
/*----------------------------- Internal constants --------------------------*/ /*----------------------------- Internal constants --------------------------*/
#define PARAM_ALLPARAMS (-1) /* All parameters */
#define PROFIT_MAXITER 1000 /* Max. nb of iterations in profile fitting */ #define PROFIT_MAXITER 1000 /* Max. nb of iterations in profile fitting */
#define PROFIT_MAXPROF 8 /* Max. nb of profile components */ #define PROFIT_MAXPROF 8 /* Max. nb of profile components */
#define PROFIT_OVERSAMP 5 /* Max. profile oversamp. factor on each axis */ #define PROFIT_OVERSAMP 5 /* Max. profile oversamp. factor on each axis */
#define PROFIT_HIDEFRES 201 /* Resolution of the high def. model raster */ #define PROFIT_HIDEFRES 201 /* Hi. def. model resol. (must be <MAXMODSIZE)*/
#define PROFIT_REFFFAC 6.0 /* Factor in r_eff for measurement radius*/ #define PROFIT_REFFFAC 3.0 /* Factor in r_eff for measurement radius*/
#define PROFIT_DYNPARAM 10.0 /* Dynamic compression param. in sigma units */ #define PROFIT_DYNPARAM 10.0 /* Dynamic compression param. in sigma units */
#define PROFIT_MAXMODSIZE 512 /* Maximum size allowed for the model raster */ #define PROFIT_MAXMODSIZE 512 /* Maximum size allowed for the model raster */
#define PROFIT_MAXOBJSIZE 512 /* Maximum size allowed for the object raster */ #define PROFIT_MAXOBJSIZE 512 /* Maximum size allowed for the object raster */
...@@ -79,9 +80,11 @@ typedef struct ...@@ -79,9 +80,11 @@ typedef struct
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 */
int npix; /* Total number of prof pixels */
float typscale; /* Typical scale in prof pixels */ float typscale; /* Typical scale in prof pixels */
float fluxfac; /* Flux normalisation factor */ float fluxfac; /* Flux normalisation factor */
float lostfluxfrac; /* Lost flux fraction */ float lostfluxfrac; /* Lost flux fraction */
float m0,mx2,my2,mxy; /* 2nd order moments */
/* Generic presentation parameters */ /* Generic presentation parameters */
float *flux; /* Integrated flux */ float *flux; /* Integrated flux */
float *x[2]; /* Coordinate vector */ float *x[2]; /* Coordinate vector */
...@@ -113,12 +116,16 @@ typedef struct ...@@ -113,12 +116,16 @@ typedef struct
int nparam; /* Number of parameters to be fitted */ int nparam; /* Number of parameters to be fitted */
float *paramlist[PARAM_NPARAM]; /* flat parameter list */ float *paramlist[PARAM_NPARAM]; /* flat parameter list */
int paramindex[PARAM_NPARAM];/* Vector of parameter indices */ int paramindex[PARAM_NPARAM];/* Vector of parameter indices */
int paramrevindex[PARAM_NPARAM];/* Vector of reversed indices */
int freeparam_flag[PARAM_NPARAM]; /* Free parameter flag */
int nfreeparam; /* Number of free parameters */
float param[PARAM_NPARAM]; /* Vector of parameters to be fitted */ float param[PARAM_NPARAM]; /* Vector of parameters to be fitted */
float paraminit[PARAM_NPARAM];/* Parameter initial guesses */ float paraminit[PARAM_NPARAM];/* Parameter initial guesses */
float parammin[PARAM_NPARAM]; /* Parameter lower limits */ float parammin[PARAM_NPARAM]; /* Parameter lower limits */
float parammax[PARAM_NPARAM]; /* Parameter upper limits */ float parammax[PARAM_NPARAM]; /* Parameter upper limits */
float *covar; /* Covariance matrix */
float paramerr[PARAM_NPARAM]; /* Std deviations of parameters */ float paramerr[PARAM_NPARAM]; /* Std deviations of parameters */
float *covar; /* Covariance matrix */
int iter; /* Iteration counter */
int niter; /* Number of iterations */ int niter; /* Number of iterations */
profstruct **prof; /* Array of pointers to profiles */ profstruct **prof; /* Array of pointers to profiles */
int nprof; /* Number of profiles to consider */ int nprof; /* Number of profiles to consider */
...@@ -126,15 +133,20 @@ typedef struct ...@@ -126,15 +133,20 @@ typedef struct
float pixstep; /* Model/PSF sampling step */ float pixstep; /* Model/PSF sampling step */
float fluxfac; /* Model flux scaling factor */ float fluxfac; /* Model flux scaling factor */
float subsamp; /* Subsampling factor */ float subsamp; /* Subsampling factor */
int oversamp; /* Oversampling factor */
float *psfdft; /* Compressed Fourier Transform of the PSF */ float *psfdft; /* Compressed Fourier Transform of the PSF */
float *psfpix; /* Full res. pixmap of the PSF */ float *psfpix; /* Full res. pixmap of the PSF */
float *modpix; /* Full res. pixmap of the complete model */ float *modpix; /* Full res. pixmap of the complete model */
float *pmodpix; /* Full res. pixmap of the partial model */ float *modpix2; /* 2nd full res. pixmap of the complete model */
float *cmodpix; /* Full res. pixmap of the convolved model */
int modnaxisn[3]; /* Dimensions along each axis */ int modnaxisn[3]; /* Dimensions along each axis */
int nmodpix; /* Total number of model pixels */
PIXTYPE *lmodpix; /* Low resolution pixmap of the model */ PIXTYPE *lmodpix; /* Low resolution pixmap of the model */
PIXTYPE *lmodpix2; /* 2nd low resolution pixmap of the model */
PIXTYPE *objpix; /* Copy of object pixmap */ PIXTYPE *objpix; /* Copy of object pixmap */
PIXTYPE *objweight; /* Copy of object weight-map */ PIXTYPE *objweight; /* Copy of object weight-map */
int objnaxisn[2]; /* Dimensions along each axis */ int objnaxisn[2]; /* Dimensions along each axis */
int nobjpix; /* Total number of "final" pixels */
int ix, iy; /* Integer coordinates of object pixmap */ int ix, iy; /* Integer coordinates of object pixmap */
float *resi; /* Vector of residuals */ float *resi; /* Vector of residuals */
int nresi; /* Number of residual elements */ int nresi; /* Number of residual elements */
...@@ -142,6 +154,8 @@ typedef struct ...@@ -142,6 +154,8 @@ typedef struct
float sigma; /* Standard deviation of the pixel values */ float sigma; /* Standard deviation of the pixel values */
float flux; /* Total flux in final convolved model */ float flux; /* Total flux in final convolved model */
float spirindex; /* Spiral index (>0 for CCW) */ float spirindex; /* Spiral index (>0 for CCW) */
/* Buffers */
double dparam[PARAM_NPARAM];
} profitstruct; } profitstruct;
/*----------------------------- Global variables ----------------------------*/ /*----------------------------- Global variables ----------------------------*/
...@@ -156,39 +170,43 @@ float *profit_compresi(profitstruct *profit, float dynparam, ...@@ -156,39 +170,43 @@ float *profit_compresi(profitstruct *profit, float dynparam,
*profit_residuals(profitstruct *profit, picstruct *field, *profit_residuals(profitstruct *profit, picstruct *field,
picstruct *wfield, float dynparam, picstruct *wfield, float dynparam,
float *param, float *resi), float *param, float *resi),
prof_add(profstruct *prof, profitstruct *profit), prof_add(profitstruct *profit, profstruct *prof,
int extfluxfac_flag),
profit_minradius(profitstruct *profit, float refffac), profit_minradius(profitstruct *profit, float refffac),
profit_spiralindex(profitstruct *profit); profit_spiralindex(profitstruct *profit);
int profit_copyobjpix(profitstruct *profit, picstruct *field, int profit_copyobjpix(profitstruct *profit, picstruct *field,
picstruct *wfield), picstruct *wfield),
profit_minimize(profitstruct *profit, int niter), profit_minimize(profitstruct *profit, int niter),
profit_resample(profitstruct *profit, float *inpix,
PIXTYPE *outpix, float factor),
profit_setparam(profitstruct *profit, paramenum paramtype, profit_setparam(profitstruct *profit, paramenum paramtype,
float param, float parammin, float parammax); float param, float parammin, float parammax);
void prof_end(profstruct *prof), void prof_end(profstruct *prof),
prof_moments(profitstruct *profit, profstruct *prof),
profit_addparam(profitstruct *profit, paramenum paramindex, profit_addparam(profitstruct *profit, paramenum paramindex,
float **param), float **param),
profit_boundtounbound(profitstruct *profit, float *param), profit_boundtounbound(profitstruct *profit,
float *param, double *dparam, int index),
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_convolve(profitstruct *profit, float *modpix), profit_convolve(profitstruct *profit, float *modpix),
profit_covarunboundtobound(profitstruct *profit), profit_covarunboundtobound(profitstruct *profit,
double *dparam, float *param),
profit_end(profitstruct *profit), profit_end(profitstruct *profit),
profit_evaluate(float *par, float *fvec, int m, int n, profit_evaluate(double *par, double *fvec, int m, int n,
void *adata), void *adata),
profit_makedft(profitstruct *profit), profit_makedft(profitstruct *profit),
profit_moments(profitstruct *profit, obj2struct *obj2), profit_moments(profitstruct *profit, obj2struct *obj2),
profit_printout(int n_par, float* par, int m_dat, float* fvec, profit_printout(int n_par, float* par, int m_dat, float* fvec,
void *data, int iflag, int iter, int nfev ), void *data, int iflag, int iter, int nfev ),
profit_psf(profitstruct *profit), profit_psf(profitstruct *profit),
profit_resample(profitstruct *profit, float *inpix,
PIXTYPE *outpix, float factor),
profit_resetparam(profitstruct *profit, paramenum paramtype), profit_resetparam(profitstruct *profit, paramenum paramtype),
profit_resetparams(profitstruct *profit), profit_resetparams(profitstruct *profit),
profit_surface(profitstruct *profit, obj2struct *obj2, profit_surface(profitstruct *profit, obj2struct *obj2),
double lostfluxfrac), profit_unboundtobound(profitstruct *profit,
profit_unboundtobound(profitstruct *profit, float *param); double *dparam, float *param, int index);
#endif #endif
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* Contents: Fit the PSF to a detection. * Contents: Fit the PSF to a detection.
* *
* Last modify: 14/12/2009 * Last modify: 07/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -255,7 +255,8 @@ psfstruct *psf_load(char *filename) ...@@ -255,7 +255,8 @@ psfstruct *psf_load(char *filename)
psf->fwhm = 3.0; psf->fwhm = 3.0;
/* PSF oversampling: defaulted to 1 */ /* PSF oversampling: defaulted to 1 */
if (fitsread(head, "PSF_SAMP", &psf->pixstep,H_FLOAT,T_FLOAT) != RETURN_OK) if (fitsread(head, "PSF_SAMP", &psf->pixstep,H_FLOAT,T_FLOAT) != RETURN_OK
|| psf->pixstep <= 0.0)
psf->pixstep = 1.0; psf->pixstep = 1.0;
/* Load the PSF mask data */ /* Load the PSF mask data */
...@@ -1016,6 +1017,9 @@ void psf_build(psfstruct *psf) ...@@ -1016,6 +1017,9 @@ void psf_build(psfstruct *psf)
float *ppc, *pl; float *ppc, *pl;
int i,n,p, ndim, npix; int i,n,p, ndim, npix;
if (psf->build_flag)
return;
npix = psf->masksize[0]*psf->masksize[1]; npix = psf->masksize[0]*psf->masksize[1];
/* Reset the Local PSF mask */ /* Reset the Local PSF mask */
...@@ -1042,10 +1046,42 @@ void psf_build(psfstruct *psf) ...@@ -1042,10 +1046,42 @@ void psf_build(psfstruct *psf)
*(pl++) += fac**(ppc++); *(pl++) += fac**(ppc++);
} }
psf->build_flag = 1;
return; return;
} }
/******************************** psf_fwhm **********************************/
/*
Return the local PSF FWHM.
*/
double psf_fwhm(psfstruct *psf)
{
float *pl,
val, max;
int n,p, npix;
if (!psf->build_flag)
psf_build(psf);
npix = psf->masksize[0]*psf->masksize[1];
max = -BIG;
pl = psf->maskloc;
for (p=npix; p--;)
if ((val=*(pl++)) > max)
max = val;
pl = psf->maskloc;
max /= 2.0;
n = 0;
for (p=npix; p--;)
if (*(pl++) >= max)
n++;
return 2.0*sqrt(n/PI)*psf->pixstep;
}
/*****************************compute_gradient*********************************/ /*****************************compute_gradient*********************************/
double *compute_gradient(float *weight,int width, int height, double *compute_gradient(float *weight,int width, int height,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* Contents: Include file for psffit.c. * Contents: Include file for psffit.c.
* *
* Last modify: 14/12/2009 * Last modify: 18/05/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -78,6 +78,7 @@ typedef struct psf ...@@ -78,6 +78,7 @@ typedef struct psf
pcstruct *pc; /* PC components */ pcstruct *pc; /* PC components */
double fwhm; /* Typical PSF FWHM */ double fwhm; /* Typical PSF FWHM */
float pixstep; /* PSF sampling step */ float pixstep; /* PSF sampling step */
int build_flag; /* Set if the current PSF has been computed */
} psfstruct; } psfstruct;
typedef struct typedef struct
...@@ -113,7 +114,8 @@ extern double *compute_gradient (float *weight,int width, int height, ...@@ -113,7 +114,8 @@ extern double *compute_gradient (float *weight,int width, int height,
float *masks, float *maskx, float *masky, float *masks, float *maskx, float *masky,
double *mat), double *mat),
*compute_gradient_phot(float *weight,int width, int height, *compute_gradient_phot(float *weight,int width, int height,
float *masks, double *pm); float *masks, double *pm),
psf_fwhm(psfstruct *psf);
extern psfstruct *psf_load(char *filename); extern psfstruct *psf_load(char *filename);
...@@ -129,3 +131,4 @@ extern void pc_end(pcstruct *pc), ...@@ -129,3 +131,4 @@ extern void pc_end(pcstruct *pc),
psf_readcontext(psfstruct *psf, picstruct *field); psf_readcontext(psfstruct *psf, picstruct *field);
extern pcstruct *pc_load(catstruct *cat); extern pcstruct *pc_load(catstruct *cat);
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: functions for input of image data. * Contents: functions for input of image data.
* *
* Last modify: 29/09/2009 * Last modify: 08/03/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -113,6 +113,10 @@ void *loadstrip(picstruct *field, picstruct *wfield) ...@@ -113,6 +113,10 @@ void *loadstrip(picstruct *field, picstruct *wfield)
writecheck(check, data, w); writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBPROFILES])) if ((check = prefs.check[CHECK_SUBPROFILES]))
writecheck(check, data, w); writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBSPHEROIDS]))
writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBDISKS]))
writecheck(check, data, w);
} }
if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS])) if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS]))
{ {
...@@ -182,6 +186,10 @@ void *loadstrip(picstruct *field, picstruct *wfield) ...@@ -182,6 +186,10 @@ void *loadstrip(picstruct *field, picstruct *wfield)
writecheck(check, data, w); writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBPROFILES])) if ((check = prefs.check[CHECK_SUBPROFILES]))
writecheck(check, data, w); writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBSPHEROIDS]))
writecheck(check, data, w);
if ((check = prefs.check[CHECK_SUBDISKS]))
writecheck(check, data, w);
} }
if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS])) if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS]))
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: header (FITS format #1) and templates for catalog data. * Contents: header (FITS format #1) and templates for catalog data.
* *
* Last modify: 19/12/2007 * Last modify: 02/07/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -95,8 +95,8 @@ keystruct headkey1[] = { ...@@ -95,8 +95,8 @@ keystruct headkey1[] = {
&prefs.clean_param, H_FLOAT, T_DOUBLE, "%8f"}, &prefs.clean_param, H_FLOAT, T_DOUBLE, "%8f"},
{"SEXCLNST", "CLEANING OBJECT-STACK", {"SEXCLNST", "CLEANING OBJECT-STACK",
&prefs.deblend_nthresh, H_INT, T_LONG, "%6d"}, &prefs.deblend_nthresh, H_INT, T_LONG, "%6d"},
{"SEXAPERD", "APERTURE DIAMETER (PIXELS)", {"SEXAPERD", "1ST APERTURE DIAMETER (PIXELS)",
&prefs.apert[0], H_INT, T_LONG, "%7.1f"}, &prefs.apert[0], H_FLOAT, T_DOUBLE, "%8.2f"},
{"SEXAPEK1", "KRON PARAMETER", {"SEXAPEK1", "KRON PARAMETER",
&prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"}, &prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"},
{"SEXAPEK2", "KRON ANALYSIS RADIUS", {"SEXAPEK2", "KRON ANALYSIS RADIUS",
......
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