diff --git a/src/analyse.c b/src/analyse.c index 271ce2dbc776994be05b94c2af76713387f56175..9e73e244afefb4750323c916c063c3218c9cde0b 100644 --- a/src/analyse.c +++ b/src/analyse.c @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with SExtractor. If not, see . * -* Last modified: 02/11/2011 +* Last modified: 12/09/2013 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -830,6 +830,9 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield, } } + /* Clean (zero) all measurements */ + zerocat(); + return; } diff --git a/src/back.c b/src/back.c index ebe3471014857bfa3ec539840725e3cb1e443db6..f3a7d28fdfe99ddb9f3afc903d6f8ba78a1a93c3 100644 --- a/src/back.c +++ b/src/back.c @@ -253,7 +253,6 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) { QFSEEK(wfield->file, wfcurpos2, SEEK_SET, wfield->filename); wtab->currentElement = (wfcurpos2 == 0) ? 1 : wfcurpos2; // CFITSIO - wbm = wbackmesh; for (m=nx; m--; wbm++) if (wbm->mean <= -BIG) @@ -266,14 +265,10 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) { if (bufsize2>size) bufsize2 = size; - read_body(field->tab, buf, bufsize2); - if (wfield) { - - read_body(wfield->tab, wbuf, bufsize2); - + read_body(wfield->tab, wbuf, bufsize2); weight_to_var(wfield, wbuf, bufsize2); } backhisto(backmesh, wbackmesh, buf, wbuf, bufsize2, nx, w, bw, @@ -313,11 +308,9 @@ void makeback(picstruct *field, picstruct *wfield, int wscale_flag) /* Go back to the original position */ QFSEEK(field->file, fcurpos, SEEK_SET, field->filename); field->tab->currentElement = fcurpos; // CFITSIO - if (wfield) { QFSEEK(wfield->file, wfcurpos, SEEK_SET, wfield->filename); wfield->tab->currentElement = (wfcurpos == 0) ? 1 : wfcurpos; // CFITSIO - } /* Median-filter and check suitability of the background map */ diff --git a/src/catout.c b/src/catout.c index ed169c9657f37cfde5c4ad5e629a7c99f7b41876..d03e71c2eab7614ede31a77a4f8745eff92b4412 100644 --- a/src/catout.c +++ b/src/catout.c @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with SExtractor. If not, see . * -* Last modified: 05/07/2013 +* Last modified: 12/09/2013 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -933,6 +933,8 @@ void reinitcat(picstruct *field) init_writeobj(fitscat, objtab, &buf); } + zerocat(); + return; } @@ -1101,3 +1103,21 @@ void reendcat() } +/********************************** zerocat **********************************/ +/* +Reset to 0 all measurements in the current catalog. +*/ +void zerocat(void) + { + keystruct *key; + int i; + + key = objtab->key; + for (i=objtab->nkey; i--; key=key->nextkey) + memset(key->ptr, 0, key->nbytes); + + return; + } + + + diff --git a/src/field.c b/src/field.c index 60fe2caadaed850de34e94cbd8bbbf777b7eac0e..117a5a1993c7f1b45b1e1cac1e81ddfbcf2a7718 100644 --- a/src/field.c +++ b/src/field.c @@ -87,6 +87,7 @@ picstruct *newfield(char *filename, int flags, int ext) } if (!nok) error(EXIT_FAILURE, "Not a valid FITS image in ",filename); + field->tab = tab; if (ntab<0) error(EXIT_FAILURE, "Not enough valid FITS image extensions in ",filename); diff --git a/src/fits/fitsbody.c b/src/fits/fitsbody.c index 3aabd206ba76eabba4f89f0c1880824d102c9c89..66c55d8fa74a4d32cfd61602cdca7be563be8469 100644 --- a/src/fits/fitsbody.c +++ b/src/fits/fitsbody.c @@ -389,7 +389,6 @@ void read_body(tabstruct *tab, PIXTYPE *ptr, size_t size) } else QFREAD(bufdata, spoonful*tab->bytepix, cat->file, cat->filename); - switch(tab->bitpix) { case BP_BYTE: @@ -665,8 +664,6 @@ void read_body(tabstruct *tab, PIXTYPE *ptr, size_t size) default: error(EXIT_FAILURE,"*Internal Error*: unknown compression mode in ", "read_body()"); - - } //printf("SSSS %f %f %f %f %f\n", bufdata[0], bufdata[10], bufdata[100], bufdata[1000], bufdata[spoonful-1]); @@ -977,7 +974,6 @@ void write_body(tabstruct *tab, PIXTYPE *ptr, size_t size) for (i=spoonful; i--;) *(bufdata++) = (*(ptr++)-bz)/bs; - // CFITSIO - only perform byte-swap if we are NOT writing a tile-compressed format using cfitsio if (0 && tab->infptr == NULL) // TODO if (bswapflag) diff --git a/src/fits/fitscat.h b/src/fits/fitscat.h index d79ff38477b49a39b9d56dc579bb4a2013e30ca9..6b4d4af6fdf65f69149029e4867560b802c5283d 100644 --- a/src/fits/fitscat.h +++ b/src/fits/fitscat.h @@ -23,7 +23,7 @@ * along with AstrOmatic software. * If not, see . * -f* Last modified: 29/08/2012 +* Last modified: 29/08/2012 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/globals.h b/src/globals.h index cc98d66909e4cb6805fcef087732a879e7265e57..f6ded6f011ee84b36f58cbf0b6efd11346edbe57 100644 --- a/src/globals.h +++ b/src/globals.h @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with SExtractor. If not, see . * -* Last modified: 11/10/2010 +* Last modified: 12/09/2013 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -85,7 +85,8 @@ extern void alloccatparams(void), useprefs(void), writecat(int, objliststruct *), write_error(char *msg1, char *msg2), - write_vo_fields(FILE *file); + write_vo_fields(FILE *file), + zerocat(void); extern double counter_seconds(void); diff --git a/src/makeit.c b/src/makeit.c index c43e9987bcdeeda0dafc7cc9d5a7a944b8cca1e6..339ea17b04bf5670937887204fad44064799977c 100644 --- a/src/makeit.c +++ b/src/makeit.c @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with SExtractor. If not, see . * -* Last modified: 13/02/2013 +* Last modified: 17/08/2013 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -57,7 +57,11 @@ static int selectext(char *filename); time_t thetimet, thetimet2; +#ifdef USE_MODEL extern profitstruct *theprofit,*thedprofit, *thepprofit,*theqprofit; +#else +profitstruct *theprofit,*thedprofit, *thepprofit,*theqprofit; +#endif extern char profname[][32]; double dtime; @@ -479,6 +483,7 @@ if (!imatab->isTileCompressed) thepsf = psf_load(prefs.psf_name[0], nok); } +#ifdef USE_MODEL if (prefs.prof_flag) { /*------ Create profiles at full resolution */ @@ -502,6 +507,7 @@ if (!imatab->isTileCompressed) theqprofit = profit_init(thepsf, MODEL_EXPONENTIAL); } } +#endif } /*-- Initialize PSF contexts and workspace */ diff --git a/src/readimage.c b/src/readimage.c index 6f34aa4615083a9a9266e76435defde7c98226af..76dc670222c396f7aeb644eddc6896618e48766e 100644 --- a/src/readimage.c +++ b/src/readimage.c @@ -294,7 +294,6 @@ void readimagehead(picstruct *field) QFSEEK(field->file, tab->bodypos, SEEK_SET, field->filename); - return; #undef FITSREADS