| Line 5... |
Line 5... |
*
|
*
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
*
|
*
|
* 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
|
*
|
*
|
* SExtractor is free software: you can redistribute it and/or modify
|
* SExtractor is free software: you can redistribute it and/or modify
|
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
| Line 20... |
Line 20... |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
* 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
|
*
|
*
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
#include "config.h"
|
#include "config.h"
|
| Line 58... |
Line 58... |
size,meshsize;
|
size,meshsize;
|
int i,j,k,m,n, step, nlines,
|
int i,j,k,m,n, step, nlines,
|
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))
|
wfield= NULL;
|
wfield= NULL;
|
|
|
| Line 292... |
Line 292... |
filterback(field);
|
filterback(field);
|
if (wfield)
|
if (wfield)
|
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);
|
ratiop = ratio;
|
ratiop = ratio;
|
weight = wfield->back;
|
weight = wfield->back;
|
| Line 306... |
Line 306... |
&& (sratio = *sigma/sqrt(sratio)) > 0.0)
|
&& (sratio = *sigma/sqrt(sratio)) > 0.0)
|
{
|
{
|
*(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);
|
field->dback = makebackspline(field, field->back);
|
field->dback = makebackspline(field, field->back);
|
NFPRINTF(OUTPUT, "Computing background-noise d-map");
|
NFPRINTF(OUTPUT, "Computing background-noise d-map");
|