From f998c6bfdb687b3173a5805d25abe50c95014817 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Wed, 20 Mar 2024 19:04:39 +0800 Subject: [PATCH] tweaks --- config.readme | 1 + config/default.sex | 1 + doc/src/conf.py | 8 ++++---- src/back.c | 11 ++++++++--- src/preflist.h | 4 ++++ src/prefs.h | 1 + 6 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 config.readme diff --git a/config.readme b/config.readme new file mode 100644 index 0000000..344f4a3 --- /dev/null +++ b/config.readme @@ -0,0 +1 @@ +./configure --with-atlas-libdir=/line17/zouhu/softwares/ATLAS/MyObj/lib --with-atlas-incdir=/line17/zouhu/softwares/ATLAS/MyObj/include/ diff --git a/config/default.sex b/config/default.sex index bd5abfa..3ade1c9 100644 --- a/config/default.sex +++ b/config/default.sex @@ -67,6 +67,7 @@ BACK_TYPE AUTO # AUTO or MANUAL BACK_VALUE 0.0 # Default background value in MANUAL mode BACK_SIZE 64 # Background mesh: or , BACK_FILTERSIZE 3 # Background filter: or , +FBACK_DIFF 0.15 # Difference tolerence between mode and median. If relative difference < FBACK_DIFF, use mode or else use median filter *Hu Zou @ 202307 #------------------------------ Check Image ---------------------------------- diff --git a/doc/src/conf.py b/doc/src/conf.py index 256ec92..fa7c850 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -67,9 +67,9 @@ author = u'E. Bertin' # built documents. # # The short X.Y version. -version = '2.24.2' +version = '2.25.0' # The full version, including alpha/beta/rc tags. -release = '2.24.2' +release = '2.25.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -81,7 +81,7 @@ language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # -today = 'Fri Dec 29 2017' +today = 'Fri Jul 14 2023' # # Else, today_fmt is used as the format for a strftime call. # @@ -144,7 +144,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. # " v documentation" by default. # -# html_title = u'SExtractor v2.24.2' +# html_title = u'SExtractor v2.25.0' # A shorter title for the navigation bar. Default is the same as html_title. # diff --git a/src/back.c b/src/back.c index a77118b..ccb6317 100644 --- a/src/back.c +++ b/src/back.c @@ -625,7 +625,7 @@ float backguess(backstruct *bkg, float *mean, float *sigma) { LONG *histo, *hilow, *hihigh, *histot; unsigned long lowsum, highsum, sum; - double ftemp, mea, sig, sig1, med, dpix; + double ftemp, mea, sig, sig1, med, dpix, fback; int i, n, lcut,hcut, nlevelsm1, pix; /* Leave here if the mesh is already classified as `bad' */ @@ -674,12 +674,17 @@ float backguess(backstruct *bkg, float *mean, float *sigma) hcut = (ftemp=med+3.0*sig)0.0?ftemp+0.5:ftemp-0.5) : nlevelsm1; } - *mean = fabs(sig)>0.0? (fabs(bkg->sigma/(sig*bkg->qscale)-1) < 0.0 ? + /* *mean = fabs(sig)>0.0? (fabs(bkg->sigma/(sig*bkg->qscale)-1) < 0.0 ? bkg->qzero+mea*bkg->qscale :(fabs((mea-med)/sig)< 0.3 ? bkg->qzero+(2.5*med-1.5*mea)*bkg->qscale :bkg->qzero+med*bkg->qscale)) - :bkg->qzero+mea*bkg->qscale; + :bkg->qzero+mea*bkg->qscale; */ + fback=prefs.fback_diff; + *mean = fabs(sig)>0.0?(fabs((mea-med)/sig)< fback ? + bkg->qzero+(2.5*med-1.5*mea)*bkg->qscale + :bkg->qzero+mea*bkg->qscale) + :bkg->qzero+mea*bkg->qscale; *sigma = sig*bkg->qscale; diff --git a/src/preflist.h b/src/preflist.h index de1f773..0dc341e 100644 --- a/src/preflist.h +++ b/src/preflist.h @@ -61,6 +61,7 @@ {"BACK_FILTERSIZE", P_INTLIST, prefs.backfsize, 1,11, 0.0,0.0, {""}, 1,2, &prefs.nbackfsize}, {"BACK_FILTTHRESH", P_FLOAT, &prefs.backfthresh, 0,0, 0.0,BIG}, + {"FBACK_DIFF", P_FLOAT, &prefs.fback_diff, 0,0, 0.0,BIG}, {"BACKPHOTO_THICK", P_INT, &prefs.pback_size, 1, 256}, {"BACKPHOTO_TYPE", P_KEY, &prefs.pback_type, 0,0, 0.0,0.0, {"GLOBAL","LOCAL",""}}, @@ -263,6 +264,9 @@ char *default_prefs[] = "*BACK_VALUE 0.0 # Default background value in MANUAL mode", "BACK_SIZE 64 # Background mesh: or ,", "BACK_FILTERSIZE 3 # Background filter: or ,", +"FBACK_DIFF 0.15 # Difference tolerence between mode and median", +" # If relative difference < FBACK_DIFF, use mode", +" # or else use median filter *Hu Zou @ 202307", " ", "BACKPHOTO_TYPE GLOBAL # can be GLOBAL or LOCAL", "*BACKPHOTO_THICK 24 # thickness of the background LOCAL annulus", diff --git a/src/prefs.h b/src/prefs.h index a12cb74..961b260 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -138,6 +138,7 @@ typedef struct double backfthresh; /* bkgnd fil. thresh */ enum {GLOBAL, LOCAL} pback_type; /* phot. bkgnd type */ int pback_size; /* rect. ann. width */ + double fback_diff; /* mode and median relative difference threashold (default 15%, if mode and median agrees within this value, use mode or else use median) Hu Zou @ 202307*/ /*----- memory */ int clean_stacksize; /* size of buffer */ int mem_pixstack; /* pixel stack size */ -- GitLab