Commit 0ca2f8a5 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Added the DETECT_MAXAREA (advanced) configuration keyword (as suggested by V.Terron).

Improved processing time display.
parent 4d8f6615
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Command-line parsing. * Contents: Command-line parsing.
* *
* Last modify: 29/05/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -132,11 +132,11 @@ setlinebuf(stdout); ...@@ -132,11 +132,11 @@ setlinebuf(stdout);
endprefs(); endprefs();
NFPRINTF(OUTPUT, ""); NFPRINTF(OUTPUT, "");
tdiff = prefs.time_diff>0.0? prefs.time_diff : 1.0; tdiff = prefs.time_diff>0.0? prefs.time_diff : 0.001;
lines = (double)thefield1.height/tdiff; lines = (double)thefield1.height/tdiff;
dets = (double)thecat.ntotal/tdiff; dets = (double)thecat.ntotal/tdiff;
NPRINTF(OUTPUT, NPRINTF(OUTPUT,
"> All done (in %.0f s: %.1f line%s/s , %.1f detection%s/s)\n", "> All done (in %.1f s: %.1f line%s/s , %.1f detection%s/s)\n",
prefs.time_diff, lines, lines>1.0? "s":"", dets, dets>1.0? "s":""); prefs.time_diff, lines, lines>1.0? "s":"", dets, dets>1.0? "s":"");
return EXIT_SUCCESS; return EXIT_SUCCESS;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: main program. * Contents: main program.
* *
* Last modify: 24/09/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -47,6 +47,7 @@ static int selectext(char *filename); ...@@ -47,6 +47,7 @@ static int selectext(char *filename);
time_t thetimet, thetimet2; time_t thetimet, thetimet2;
extern profitstruct *theprofit; extern profitstruct *theprofit;
extern char profname[][32]; extern char profname[][32];
double dtime;
/******************************** makeit *************************************/ /******************************** makeit *************************************/
/* /*
...@@ -70,6 +71,7 @@ void makeit() ...@@ -70,6 +71,7 @@ void makeit()
error_installfunc(write_error); error_installfunc(write_error);
/* Processing start date and time */ /* Processing start date and time */
dtime = counter_seconds();
thetimet = time(NULL); thetimet = time(NULL);
tm = localtime(&thetimet); tm = localtime(&thetimet);
sprintf(prefs.sdate_start,"%04d-%02d-%02d", sprintf(prefs.sdate_start,"%04d-%02d-%02d",
...@@ -532,7 +534,7 @@ void makeit() ...@@ -532,7 +534,7 @@ void makeit()
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday); tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
sprintf(prefs.stime_end,"%02d:%02d:%02d", sprintf(prefs.stime_end,"%02d:%02d:%02d",
tm->tm_hour, tm->tm_min, tm->tm_sec); tm->tm_hour, tm->tm_min, tm->tm_sec);
prefs.time_diff = difftime(thetimet2, thetimet); prefs.time_diff = counter_seconds() - dtime;
/* Write XML */ /* Write XML */
if (prefs.xml_flag) if (prefs.xml_flag)
...@@ -620,3 +622,4 @@ void write_error(char *msg1, char *msg2) ...@@ -620,3 +622,4 @@ void write_error(char *msg1, char *msg2)
return; return;
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Keywords for the configuration file. * Contents: Keywords for the configuration file.
* *
* Last modify: 14/12/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
{"DEBLEND_MINCONT", P_FLOAT, &prefs.deblend_mincont, 0,0, 0.0,1.0}, {"DEBLEND_MINCONT", P_FLOAT, &prefs.deblend_mincont, 0,0, 0.0,1.0},
{"DEBLEND_NTHRESH", P_INT, &prefs.deblend_nthresh, 1,64}, {"DEBLEND_NTHRESH", P_INT, &prefs.deblend_nthresh, 1,64},
{"DETECT_MINAREA", P_INT, &prefs.ext_minarea, 1,1000000}, {"DETECT_MINAREA", P_INT, &prefs.ext_minarea, 1,1000000},
{"DETECT_MAXAREA", P_INT, &prefs.ext_maxarea, 0,1000000000},
{"DETECT_THRESH", P_FLOATLIST, prefs.dthresh, 0,0, -BIG, BIG, {"DETECT_THRESH", P_FLOATLIST, prefs.dthresh, 0,0, -BIG, BIG,
{""}, 1, 2, &prefs.ndthresh}, {""}, 1, 2, &prefs.ndthresh},
{"DETECT_TYPE", P_KEY, &prefs.detect_type, 0,0, 0.0,0.0, {"DETECT_TYPE", P_KEY, &prefs.detect_type, 0,0, 0.0,0.0,
...@@ -168,7 +169,8 @@ char *default_prefs[] = ...@@ -168,7 +169,8 @@ char *default_prefs[] =
"#------------------------------- Extraction ----------------------------------", "#------------------------------- Extraction ----------------------------------",
" ", " ",
"DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)", "DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)",
"DETECT_MINAREA 5 # minimum number of pixels above threshold", "DETECT_MINAREA 5 # min. # of pixels above threshold",
"*DETECT_MAXAREA 0 # max. # of pixels above threshold (0=unlimited)",
"*THRESH_TYPE RELATIVE # threshold type: RELATIVE (in sigmas)", "*THRESH_TYPE RELATIVE # threshold type: RELATIVE (in sigmas)",
"* # or ABSOLUTE (in ADUs)", "* # or ABSOLUTE (in ADUs)",
"DETECT_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2", "DETECT_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Keywords for the configuration file. * Contents: Keywords for the configuration file.
* *
* Last modify: 14/12/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -53,6 +53,7 @@ typedef struct ...@@ -53,6 +53,7 @@ typedef struct
/*----- extraction */ /*----- extraction */
int dimage_flag; /* detect. image ? */ int dimage_flag; /* detect. image ? */
int ext_minarea; /* min area in pix. */ int ext_minarea; /* min area in pix. */
int ext_maxarea; /* max area in pix. */
int deb_maxarea; /* max deblend. area */ int deb_maxarea; /* max deblend. area */
int filter_flag; /* smoothing on/off */ int filter_flag; /* smoothing on/off */
char filter_name[MAXCHAR]; /* mask filename */ char filter_name[MAXCHAR]; /* mask filename */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Contents: functions for extraction of connected pixels from * Contents: functions for extraction of connected pixels from
* a pixmap. * a pixmap.
* *
* Last modify: 01/12/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -791,6 +791,8 @@ void sortit(picstruct *field, picstruct *dfield, picstruct *wfield, ...@@ -791,6 +791,8 @@ void sortit(picstruct *field, picstruct *dfield, picstruct *wfield,
for (i=0; i<objlist2->nobj; i++) for (i=0; i<objlist2->nobj; i++)
{ {
preanalyse(i, objlist2, ANALYSE_FULL|ANALYSE_ROBUST); preanalyse(i, objlist2, ANALYSE_FULL|ANALYSE_ROBUST);
if (prefs.ext_maxarea && objlist2->obj[i].fdnpix > prefs.ext_maxarea)
continue;
analyse(field, dfield, i, objlist2); analyse(field, dfield, i, objlist2);
cobj = objlist2->obj + i; cobj = objlist2->obj + i;
if (prefs.blank_flag) if (prefs.blank_flag)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: XML logging. * Contents: XML logging.
* *
* Last modify: 14/12/2009 * Last modify: 21/01/2010
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -217,7 +217,7 @@ INPUT Pointer to the output file (or stream), ...@@ -217,7 +217,7 @@ INPUT Pointer to the output file (or stream),
OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise. OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP) AUTHOR E. Bertin (IAP)
VERSION 14/12/2009 VERSION 21/01/2010
***/ ***/
int write_xml_meta(FILE *file, char *error) int write_xml_meta(FILE *file, char *error)
{ {
...@@ -468,9 +468,13 @@ int write_xml_meta(FILE *file, char *error) ...@@ -468,9 +468,13 @@ int write_xml_meta(FILE *file, char *error)
key[findkeys("DETECT_TYPE", keylist, key[findkeys("DETECT_TYPE", keylist,
FIND_STRICT)].keylist[prefs.detect_type]); FIND_STRICT)].keylist[prefs.detect_type]);
fprintf(file, " <PARAM name=\"Detect_MinArea\" datatype=\"int\"" fprintf(file, " <PARAM name=\"Detect_MinArea\" datatype=\"int\""
" ucd=\"phys.area;obs.param\" value=\"%d\" unit=\"pix2\"/>\n", " ucd=\"phys.area;stat.min;obs.param;\" value=\"%d\" unit=\"pix2\"/>\n",
prefs.ext_minarea); prefs.ext_minarea);
fprintf(file, " <PARAM name=\"Detect_MaxArea\" datatype=\"int\""
" ucd=\"phys.area;stat.max;obs.param\" value=\"%d\" unit=\"pix2\"/>\n",
prefs.ext_maxarea);
fprintf(file, fprintf(file,
" <PARAM name=\"Thresh_Type\" datatype=\"char\" arraysize=\"*\"" " <PARAM name=\"Thresh_Type\" datatype=\"char\" arraysize=\"*\""
" ucd=\"meta.code;instr.sensitivity;obs.param\" value=\"%s", " ucd=\"meta.code;instr.sensitivity;obs.param\" value=\"%s",
......
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