Commit e698f1c9 authored by rhenders's avatar rhenders
Browse files

Merged recent changes from trunk

parent 9abd0048
......@@ -22,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: 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;
}
......@@ -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 */
......
......@@ -22,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: 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;
}
......@@ -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);
......
......@@ -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)
......
......@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
f* Last modified: 29/08/2012
* Last modified: 29/08/2012
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......
......@@ -22,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: 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);
......
......@@ -22,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: 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 */
......
......@@ -294,7 +294,6 @@ void readimagehead(picstruct *field)
QFSEEK(field->file, tab->bodypos, SEEK_SET, field->filename);
return;
#undef FITSREADS
......
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