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
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	Command-line parsing.
*
*	Last modify:	29/05/2009
*	Last modify:	21/01/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -132,11 +132,11 @@ setlinebuf(stdout);

  endprefs();
  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;
  dets = (double)thecat.ntotal/tdiff;
  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":"");

  return EXIT_SUCCESS;
+5 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	main program.
*
*	Last modify:	24/09/2009
*	Last modify:	21/01/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -47,6 +47,7 @@ static int selectext(char *filename);
time_t			thetimet, thetimet2;
extern profitstruct	*theprofit;
extern char		profname[][32];
double			dtime;

/******************************** makeit *************************************/
/*
@@ -70,6 +71,7 @@ void makeit()
  error_installfunc(write_error);

/* Processing start date and time */
  dtime = counter_seconds();
  thetimet = time(NULL);
  tm = localtime(&thetimet);
  sprintf(prefs.sdate_start,"%04d-%02d-%02d",
@@ -532,7 +534,7 @@ void makeit()
	tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
  sprintf(prefs.stime_end,"%02d:%02d:%02d",
	tm->tm_hour, tm->tm_min, tm->tm_sec);
  prefs.time_diff = difftime(thetimet2, thetimet);
  prefs.time_diff = counter_seconds() - dtime;

/* Write XML */
  if (prefs.xml_flag)
@@ -620,3 +622,4 @@ void write_error(char *msg1, char *msg2)
  return;
  }

+4 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	Keywords for the configuration file.
*
*	Last modify:	14/12/2009
*	Last modify:	21/01/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -78,6 +78,7 @@
  {"DEBLEND_MINCONT", P_FLOAT, &prefs.deblend_mincont, 0,0, 0.0,1.0},
  {"DEBLEND_NTHRESH", P_INT, &prefs.deblend_nthresh, 1,64},
  {"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,
   {""}, 1, 2, &prefs.ndthresh},
  {"DETECT_TYPE", P_KEY, &prefs.detect_type, 0,0, 0.0,0.0,
@@ -168,7 +169,8 @@ char *default_prefs[] =
"#------------------------------- Extraction ----------------------------------",
" ",
"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)",
"*                                # or ABSOLUTE (in ADUs)",
"DETECT_THRESH    1.5            # <sigmas> or <threshold>,<ZP> in mag.arcsec-2",
+2 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
*
*	Contents:	Keywords for the configuration file.
*
*	Last modify:	14/12/2009
*	Last modify:	21/01/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -53,6 +53,7 @@ typedef struct
/*----- extraction */
  int		dimage_flag;				/* detect. image ? */
  int		ext_minarea;				/* min area in pix. */
  int		ext_maxarea;				/* max area in pix. */
  int		deb_maxarea;				/* max deblend. area */
  int		filter_flag;				/* smoothing on/off */
  char		filter_name[MAXCHAR];			/* mask filename */
+3 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
*	Contents:	functions for extraction of connected pixels from
*			a pixmap.
*
*	Last modify:	01/12/2009
*	Last modify:	21/01/2010
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
@@ -791,6 +791,8 @@ void sortit(picstruct *field, picstruct *dfield, picstruct *wfield,
  for (i=0; i<objlist2->nobj; i++)
    {
    preanalyse(i, objlist2, ANALYSE_FULL|ANALYSE_ROBUST);
    if (prefs.ext_maxarea && objlist2->obj[i].fdnpix > prefs.ext_maxarea)
      continue; 
    analyse(field, dfield, i, objlist2);
    cobj = objlist2->obj + i;
    if (prefs.blank_flag)
Loading