Commit a9446199 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Fixed model-fitting issue with empty images in dual-image mode (thanks to V....

Fixed model-fitting issue with empty images in dual-image mode (thanks to V. de Lapparent for reporting).
Updated LevMar to version 2.5.
Updated URLs in various places.
Pushed version number to 2.12.1.
parent 78801391
function x = modhs76(p)
x(1)=p(1);
x(2)=sqrt(0.5)*p(2);
x(3)=p(3);
x(4)=sqrt(0.5)*p(4);
function x = osborne(p)
n=33;
for i=1:n
t=10*(i-1);
x(i)=p(1) + p(2)*exp(-p(4)*t) + p(3)*exp(-p(5)*t);
end
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>
#include "lm.h" #include "levmar.h"
#include "misc.h" #include "misc.h"
#if !defined(LM_DBL_PREC) && !defined(LM_SNGL_PREC) #if !defined(LM_DBL_PREC) && !defined(LM_SNGL_PREC)
......
...@@ -579,8 +579,8 @@ int rnk; ...@@ -579,8 +579,8 @@ int rnk;
LM_REAL fact; LM_REAL fact;
#ifdef HAVE_LAPACK #ifdef HAVE_LAPACK
rnk=LEVMAR_PSEUDOINVERSE(JtJ, C, m); rnk=LEVMAR_PSEUDOINVERSE(JtJ, C, m);
if(!rnk) return 0; if(!rnk) return 0;
#else #else
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma message("LAPACK not available, LU will be used for matrix inversion when computing the covariance; this might be unstable at times") #pragma message("LAPACK not available, LU will be used for matrix inversion when computing the covariance; this might be unstable at times")
...@@ -592,10 +592,9 @@ LM_REAL fact; ...@@ -592,10 +592,9 @@ LM_REAL fact;
// rnk=LEVMAR_LUINVERSE(JtJ, C, m); // rnk=LEVMAR_LUINVERSE(JtJ, C, m);
rnk = SVDINV(JtJ, C, m); rnk = SVDINV(JtJ, C, m);
if (!rnk) if (!rnk) return 0;
return 0;
// rnk=m; /* assume full rank */ // rnk=m; /* assume full rank */
#endif /* HAVE_LAPACK */ #endif /* HAVE_LAPACK */
...@@ -689,12 +688,6 @@ register int i; ...@@ -689,12 +688,6 @@ register int i;
#ifdef HAVE_LAPACK #ifdef HAVE_LAPACK
/* compute the Cholesky decomposition of C in W, s.t. C=W^t W and W is upper triangular */
int LEVMAR_CHOLESKY(LM_REAL *C, LM_REAL *W, int m)
{
register int i, j;
int info;
/* compute the Cholesky decomposition of C in W, s.t. C=W^t W and W is upper triangular */ /* compute the Cholesky decomposition of C in W, s.t. C=W^t W and W is upper triangular */
int LEVMAR_CHOLESKY(LM_REAL *C, LM_REAL *W, int m) int LEVMAR_CHOLESKY(LM_REAL *C, LM_REAL *W, int m)
{ {
...@@ -711,13 +704,13 @@ int info; ...@@ -711,13 +704,13 @@ int info;
POTF2("U", (int *)&m, W, (int *)&m, (int *)&info); POTF2("U", (int *)&m, W, (int *)&m, (int *)&info);
/* error treatment */ /* error treatment */
if(info!=0){ if(info!=0){
if(info<0){ if(info<0){
fprintf(stderr, "LAPACK error: illegal value for argument %d of dpotf2 in %s\n", -info, LCAT(LEVMAR_CHOLESKY, "()")); fprintf(stderr, "LAPACK error: illegal value for argument %d of dpotf2 in %s\n", -info, LCAT(LEVMAR_CHOLESKY, "()"));
} }
else{ else{
fprintf(stderr, "LAPACK error: the leading minor of order %d is not positive definite,\n%s()\n", info, fprintf(stderr, "LAPACK error: the leading minor of order %d is not positive definite,\n%s()\n", info,
RCAT("and the Cholesky factorization could not be completed in ", LEVMAR_CHOLESKY)); RCAT("and the Cholesky factorization could not be completed in ", LEVMAR_CHOLESKY));
} }
return LM_ERROR; return LM_ERROR;
} }
...@@ -783,12 +776,12 @@ register LM_REAL sum0=0.0, sum1=0.0, sum2=0.0, sum3=0.0; ...@@ -783,12 +776,12 @@ register LM_REAL sum0=0.0, sum1=0.0, sum2=0.0, sum3=0.0;
switch(n - i){ switch(n - i){
case 7 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 7 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i;
case 6 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 6 : e[i]=x[i]-y[i]; sum1+=e[i]*e[i]; ++i;
case 5 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 5 : e[i]=x[i]-y[i]; sum2+=e[i]*e[i]; ++i;
case 4 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 4 : e[i]=x[i]-y[i]; sum3+=e[i]*e[i]; ++i;
case 3 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 3 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i;
case 2 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 2 : e[i]=x[i]-y[i]; sum1+=e[i]*e[i]; ++i;
case 1 : e[i]=x[i]-y[i]; sum0+=e[i]*e[i]; ++i; case 1 : e[i]=x[i]-y[i]; sum2+=e[i]*e[i]; //++i;
} }
} }
} }
...@@ -818,12 +811,12 @@ register LM_REAL sum0=0.0, sum1=0.0, sum2=0.0, sum3=0.0; ...@@ -818,12 +811,12 @@ register LM_REAL sum0=0.0, sum1=0.0, sum2=0.0, sum3=0.0;
switch(n - i){ switch(n - i){
case 7 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 7 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i;
case 6 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 6 : e[i]=-y[i]; sum1+=e[i]*e[i]; ++i;
case 5 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 5 : e[i]=-y[i]; sum2+=e[i]*e[i]; ++i;
case 4 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 4 : e[i]=-y[i]; sum3+=e[i]*e[i]; ++i;
case 3 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 3 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i;
case 2 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 2 : e[i]=-y[i]; sum1+=e[i]*e[i]; ++i;
case 1 : e[i]=-y[i]; sum0+=e[i]*e[i]; ++i; case 1 : e[i]=-y[i]; sum2+=e[i]*e[i]; //++i;
} }
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Fit an arbitrary profile combination to a detection. * Contents: Fit an arbitrary profile combination to a detection.
* *
* Last modify: 19/08/2010 * Last modify: 26/08/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "globals.h" #include "globals.h"
#include "prefs.h" #include "prefs.h"
#include "fits/fitscat.h" #include "fits/fitscat.h"
#include "levmar/lm.h" #include "levmar/levmar.h"
#include "fft.h" #include "fft.h"
#include "fitswcs.h" #include "fitswcs.h"
#include "check.h" #include "check.h"
...@@ -199,14 +199,13 @@ OUTPUT Pointer to an allocated fit structure (containing details about the ...@@ -199,14 +199,13 @@ 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 08/03/2010 VERSION 26/08/2010
***/ ***/
void profit_fit(profitstruct *profit, void profit_fit(profitstruct *profit,
picstruct *field, picstruct *wfield, picstruct *field, picstruct *wfield,
objstruct *obj, obj2struct *obj2) objstruct *obj, obj2struct *obj2)
{ {
profitstruct pprofit; profitstruct pprofit;
profitstruct hdprofit;
patternstruct *pattern; patternstruct *pattern;
psfstruct *psf; psfstruct *psf;
checkstruct *check; checkstruct *check;
...@@ -2450,7 +2449,7 @@ INPUT Pointer to the profit structure, ...@@ -2450,7 +2449,7 @@ INPUT Pointer to the profit structure,
OUTPUT -. OUTPUT -.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP) AUTHOR E. Bertin (IAP)
VERSION 02/07/2010 VERSION 26/08/2010
***/ ***/
void profit_resetparam(profitstruct *profit, paramenum paramtype) void profit_resetparam(profitstruct *profit, paramenum paramtype)
{ {
...@@ -2631,6 +2630,8 @@ void profit_resetparam(profitstruct *profit, paramenum paramtype) ...@@ -2631,6 +2630,8 @@ void profit_resetparam(profitstruct *profit, paramenum paramtype)
if (parammin!=parammax && (param<=parammin || param>=parammax)) if (parammin!=parammax && (param<=parammin || param>=parammax))
param = (parammin+parammax)/2.0; param = (parammin+parammax)/2.0;
else if (parammin==0.0 && parammax==0.0)
parammax = 1.0;
profit_setparam(profit, paramtype, param, parammin, parammax); profit_setparam(profit, paramtype, param, parammin, parammax);
return; return;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<xsl:variable name="time" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Time']/@value"/> <xsl:variable name="time" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Time']/@value"/>
<HTML> <HTML>
<HEAD> <HEAD>
<link rel="shortcut icon" type="image/x-icon" href="http://astromatic.iap.fr/xsl/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="http://astromatic.net/xsl/favicon.ico" />
<script type="text/javascript" src="http://astromatic.iap.fr/xsl/sorttable.js"/> <script type="text/javascript" src="http://astromatic.net/xsl/sorttable.js"/>
<style type="text/css"> <style type="text/css">
p { p {
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
body { body {
margin: 10px; margin: 10px;
background-color: #e0e0e0; background-color: #e0e0e0;
background-image: url("http://astromatic.iap.fr/xsl/body_bg.jpg"); background-image: url("http://astromatic.net/xsl/body_bg.jpg");
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: top; background-position: top;
min-width:662px; min-width:662px;
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
#header { #header {
padding: 5px; padding: 5px;
min-width: 662px; min-width: 662px;
background-image: url("http://astromatic.iap.fr/xsl/astromaticleft.png"); background-image: url("http://astromatic.net/xsl/astromaticleft.png");
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: left top; background-position: left top;
text-align: left; text-align: left;
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<div id="header"> <div id="header">
<a href="/"><img style="vertical-align: middle; border:0px" src="http://astromatic.iap.fr/xsl/astromatic.png" title="Astromatic home" alt="Astromatic.net" /></a> Processing summary <a href="/"><img style="vertical-align: middle; border:0px" src="http://astromatic.net/xsl/astromatic.png" title="Astromatic home" alt="Astromatic.net" /></a> Processing summary
</div> </div>
<xsl:call-template name="VOTable"/> <xsl:call-template name="VOTable"/>
</BODY> </BODY>
......
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