Commit 8810cda9 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Added FLUXHYBRID_,MAG_HYBRID

parent 48d60ffa
......@@ -7,11 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1998-2010 IAP/CNRS/UPMC
* (C) 1997 ESO
* (C) 1995,1996 Sterrewacht Leiden
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1995-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,11 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1998-2010 IAP/CNRS/UPMC
* (C) 1997 ESO
* (C) 1995,1996 Sterrewacht Leiden
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1995-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,11 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1993,1998-2010 IAP/CNRS/UPMC
* (C) 1994,1997 ESO
* (C) 1995,1996 Sterrewacht Leiden
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......@@ -26,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 11/10/2010
* Last modified: 19/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -101,7 +97,7 @@ int copyimage(picstruct *field, PIXTYPE *dest, int w,int h, int ix,int iy)
/********************************* addimage **********************************/
/*
Add a PSF to a part of the image (with a multiplicative factor).
Outside boundaries are taken into account.
outside boundaries are taken into account.
*/
void addimage(picstruct *field, float *psf,
int w,int h, int ix,int iy, float amplitude)
......@@ -667,3 +663,101 @@ int vignet_resample(float *pix1, int w1, int h1,
}
/********************************* addtobig *********************************/
/*
Add an image to another (with a multiplicative factor).
outside boundaries are taken into account.
*/
void addtobig(float *pixsmall, int wsmall,int hsmall,
float *pixbig, int wbig, int hbig,
int ix,int iy, float amplitude)
{
int x,y, xmin,xmax,ymin,ymax, w2,dwbig,dwsmall;
/* Don't go further if out of frame!! */
if (ix<0 || ix>=wbig || iy<0 || iy>=hbig)
return;
/* Set the image boundaries */
w2 = wsmall;
ymin = iy-hsmall/2;
ymax = ymin + hsmall;
if (ymin<0)
{
pixsmall -= ymin*wsmall;
ymin = 0;
}
if (ymax>hbig)
ymax = hbig;
xmin = ix-wsmall/2;
xmax = xmin + wsmall;
if (xmax>wbig)
xmax = wbig;
if (xmin<0)
{
pixsmall -= xmin;
xmin = 0;
}
/* Copy the right pixels to the destination */
w2 = xmax - xmin;
dwsmall = wsmall - w2;
dwbig = wbig - w2;
pixbig += ymin*wbig + xmin;
for (y=ymax-ymin; y--; pixsmall += dwsmall, pixbig += dwbig)
for (x=w2; x--;)
*(pixbig++) += amplitude**(pixsmall++);
return;
}
/******************************** addfrombig *********************************/
/*
Copy a small part of an image.
*/
void addfrombig(float *pixbig, int wbig,int hbig,
float *pixsmall, int wsmall, int hsmall,
int ix,int iy, float amplitude)
{
int x,y, xmin,xmax,ymin,ymax, w2,dwbig,dwsmall;
/* Don't go further if out of frame!! */
if (ix<0 || ix>=wbig || iy<0 || iy>=hbig)
return;
/* Set the image boundaries */
ymin = iy-hsmall/2;
ymax = ymin + hsmall;
if (ymin<0)
{
pixsmall -= ymin*wsmall;
ymin = 0;
}
if (ymax>hbig)
ymax = hbig;
xmin = ix-wsmall/2;
xmax = xmin + wsmall;
if (xmax>wbig)
xmax = wbig;
if (xmin<0)
{
pixsmall -= xmin;
xmin = 0;
}
/* Copy the right pixels to the destination */
w2 = xmax - xmin;
dwsmall = wsmall - w2;
dwbig = wbig - w2;
pixbig += ymin*wbig + xmin;
for (y=ymax-ymin; y--; pixsmall += dwsmall, pixbig += dwbig)
for (x=w2; x--;)
*(pixsmall++) += amplitude**(pixbig++);
return;
}
......@@ -7,11 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1993,1998-2010 IAP/CNRS/UPMC
* (C) 1994,1997 ESO
* (C) 1995,1996 Sterrewacht Leiden
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......@@ -26,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 11/10/2010
* Last modified: 19/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -48,6 +44,12 @@
/*------------------------------- functions ---------------------------------*/
extern void addimage(picstruct *field, float *psf,
int w,int h, int ix,int iy, float amplitude),
addfrombig(float *pixbig, int wbig,int hbig,
float *pixsmall, int wsmall, int hsmall,
int ix,int iy, float amplitude),
addtobig(float *pixsmall, int wsmall,int hsmall,
float *pixbig, int wbig, int hbig,
int ix,int iy, float amplitude),
addimage_center(picstruct *field, float *psf,
int w,int h, float x, float y, float amplitude),
blankimage(picstruct *, PIXTYPE *, int,int, int,int, PIXTYPE),
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1998-2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1998-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1998-2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1998-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,11 +7,7 @@
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 1993,1998-2010 IAP/CNRS/UPMC
* (C) 1994,1997 ESO
* (C) 1995,1996 Sterrewacht Leiden
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 1993-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......@@ -27,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 09/10/2010
* Last modified: 10/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -45,7 +41,7 @@ typedef struct
P_BOOLLIST, P_KEYLIST, P_STRINGLIST} type;
void *ptr; /* Pointer to the keyword value */
int imin, imax; /* Range for int's */
double dmin, dmax; /* Range for doubles */
double dmin, dmax; /* Range for floats */
char keylist[32][32]; /* List of keywords */
int nlistmin; /* Minimum number of list members */
int nlistmax; /* Maximum number of list members */
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 2007-2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
......@@ -7,9 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 2007-2010 IAP/CNRS/UPMC
*
* Author: Emmanuel Bertin (IAP)
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
*
* License: GNU General Public License
*
......
/*
* Axb.c
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/////////////////////////////////////////////////////////////////////////////////
//
// Solution of linear systems involved in the Levenberg - Marquardt
......
/*
* Axb_core.c
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/////////////////////////////////////////////////////////////////////////////////
//
// Solution of linear systems involved in the Levenberg - Marquardt
......
# Makefile.am for the levmar Levenberg-Marquardt fitting library
# Copyright (C) 2007-2010 Emmanuel Bertin.
# levmar code by Manolis Lourakis <lourakis@ics.forth.gr>
# http://www.ics.forth.gr/~lourakis/levmar/
#
# Makefile.am
#
# LevMar Makefile.am. Process this file with automake to generate a Makefile
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#
# This file part of: AstrOmatic software
#
# Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
## (C) 2004 Manolis Lourakis (original LevMar)
#
# Licenses: GNU General Public License
#
# AstrOmatic software is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# AstrOmatic software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstrOmatic software.
# If not, see <http://www.gnu.org/licenses/>.
#
# Last modified: 10/10/2010
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
noinst_LIBRARIES = liblevmar.a
liblevmar_a_SOURCES = Axb.c lmbc.c lm.c lmblec.c lmbleic.c lmlec.c misc.c \
compiler.h levmar.h misc.h
......
......@@ -14,6 +14,35 @@
@SET_MAKE@
#
# Makefile.am
#
# LevMar Makefile.am. Process this file with automake to generate a Makefile
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#
# This file part of: AstrOmatic software
#
# Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
#
# Licenses: GNU General Public License
#
# AstrOmatic software is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# AstrOmatic software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstrOmatic software.
# If not, see <http://www.gnu.org/licenses/>.
#
# Last modified: 10/10/2010
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
......@@ -194,11 +223,6 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Makefile.am for the levmar Levenberg-Marquardt fitting library
# Copyright (C) 2007-2010 Emmanuel Bertin.
# levmar code by Manolis Lourakis <lourakis@ics.forth.gr>
# http://www.ics.forth.gr/~lourakis/levmar/
noinst_LIBRARIES = liblevmar.a
liblevmar_a_SOURCES = Axb.c lmbc.c lm.c lmblec.c lmbleic.c lmlec.c misc.c \
compiler.h levmar.h misc.h
......
/*
* compiler.h
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/////////////////////////////////////////////////////////////////////////////////
//
// Levenberg - Marquardt non-linear minimization algorithm
......
/*
* levmar.h
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*
////////////////////////////////////////////////////////////////////////////////////
//
......
/*
* lm.c
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/////////////////////////////////////////////////////////////////////////////////
//
// Levenberg - Marquardt non-linear minimization algorithm
......
/*
* lm.h
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*
////////////////////////////////////////////////////////////////////////////////////
//
......
/*
* lm_core.c
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* This file part of: AstrOmatic software
*
* Copyright: (C) 2007-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
* (C) 2004 Manolis Lourakis (original version)
*
* Licenses: GNU General Public License
*
* AstrOmatic software is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* AstrOmatic software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/10/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/////////////////////////////////////////////////////////////////////////////////
//
// Levenberg - Marquardt non-linear minimization algorithm
......
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