From 882ad557570b79618dc4b3fe7f0d6ef3bdfc0d57 Mon Sep 17 00:00:00 2001 From: Emmanuel Bertin Date: Mon, 19 Oct 2009 15:10:20 +0000 Subject: [PATCH] Fixed MODELS check-image. Fixed X/YMODEL_WORLD issue. Increased CLEANing margin for model-fitting. --- src/clean.c | 2 +- src/define.h | 3 ++- src/paramprofit.h | 6 +++--- src/profit.c | 6 ++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/clean.c b/src/clean.c index eeca609..4d0dbce 100644 --- a/src/clean.c +++ b/src/clean.c @@ -210,7 +210,7 @@ void addcleanobj(objstruct *objin) hh1 = hh1 > 0.0 ? 1/sqrt(3*hh1) : 0.0; /* ... then from the isophotal limit, which should not be TOO different... */ hh2 = (objin->ymax-objin->ymin+1.0); - margin = (int)((hh1>hh2?hh1:hh2)*MARGIN_SCALE+1.49999); + margin = (int)((hh1>hh2?hh1:hh2)*MARGIN_SCALE+MARGIN_OFFSET+0.49999); objin->ycmax = objin->ymax+margin; /* ... and finally compare with the predefined margin */ if ((y=(int)(objin->my+0.49999)+prefs.cleanmargin)>objin->ycmax) diff --git a/src/define.h b/src/define.h index 25b75f4..5037313 100644 --- a/src/define.h +++ b/src/define.h @@ -9,7 +9,7 @@ * * Contents: global definitions. * -* Last modify: 02/10/2009 +* Last modify: 12/10/2009 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ @@ -36,6 +36,7 @@ #define LESSBIG 1e+25 /* a somewhat smaller number */ #define DATA_BUFSIZE 262144 /* data buffer size */ #define MARGIN_SCALE 2.0 /* Margin / object height */ +#define MARGIN_OFFSET 4.0 /* Margin offset (pixels) */ #define MAXCHAR 512 /* max. number of characters */ #define MAXCHARL 16384 /* max.nb of chars in strlist*/ #define MAXDEBAREA 3 /* max. area for deblending */ diff --git a/src/paramprofit.h b/src/paramprofit.h index 03f2280..cc9a5c9 100644 --- a/src/paramprofit.h +++ b/src/paramprofit.h @@ -9,7 +9,7 @@ * * Contents: Model-fitting parameter list for catalog data. * -* Last modify: 29/09/2009 +* Last modify: 12/10/2009 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ @@ -73,10 +73,10 @@ &outobj2.y_prof, H_FLOAT, T_FLOAT, "%10.3f", "pixel", "pos.cartesian.y;stat.fit.param;instr.det;meta.main", "pix"}, - {"XMODEL_WORLD", "Fitted position along focal-plane x axis", + {"XFOCAL_WORLD", "Fitted position along focal-plane x axis", &outobj2.xf_prof, H_FLOAT, T_DOUBLE, "%18.10e", "", "pos.cartesian.x;stat.fit.param", ""}, - {"YMODEL_WORLD", "Fitted position along focal-plane y axis", + {"YFOCAL_WORLD", "Fitted position along focal-plane y axis", &outobj2.yf_prof, H_FLOAT, T_DOUBLE, "%18.10e", "", "pos.cartesian.y;stat.fit.param", ""}, diff --git a/src/profit.c b/src/profit.c index 43fe51d..0f2db0d 100644 --- a/src/profit.c +++ b/src/profit.c @@ -9,7 +9,7 @@ * * Contents: Fit an arbitrary profile combination to a detection. * -* Last modify: 09/10/2009 +* Last modify: 19/10/2009 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ @@ -173,7 +173,7 @@ OUTPUT Pointer to an allocated fit structure (containing details about the fit). NOTES It is a modified version of the lm_minimize() of lmfit. AUTHOR E. Bertin (IAP) -VERSION 09/10/2009 +VERSION 19/10/2009 ***/ void profit_fit(profitstruct *profit, picstruct *field, picstruct *wfield, @@ -218,9 +218,7 @@ void profit_fit(profitstruct *profit, if (profit->objnaxisn[0]>PROFIT_MAXOBJSIZE) { profit->subsamp = ceil((float)profit->objnaxisn[0]/PROFIT_MAXOBJSIZE); -// profit->fluxfac *= profit->subsamp*profit->subsamp; profit->objnaxisn[1] = (profit->objnaxisn[0] /= (int)profit->subsamp); -// profit->pixstep *= profit->subsamp; obj2->prof_flag |= PROFLAG_OBJSUB; } else -- GitLab