Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
msc
sextractor
Commits
0ca2f8a5
Commit
0ca2f8a5
authored
Jan 21, 2010
by
Emmanuel Bertin
Browse files
Added the DETECT_MAXAREA (advanced) configuration keyword (as suggested by V.Terron).
Improved processing time display.
parent
4d8f6615
Changes
6
Show whitespace changes
Inline
Side-by-side
src/main.c
View file @
0ca2f8a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
* Contents: Command-line parsing.
* Contents: Command-line parsing.
*
*
* Last modify: 2
9
/0
5
/200
9
* Last modify: 2
1
/0
1
/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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
.
0
01
;
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 %.
0
f s: %.1f line%s/s , %.1f detection%s/s)
\n
"
,
"> All done (in %.
1
f 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
;
...
...
src/makeit.c
View file @
0ca2f8a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
* Contents: main program.
* Contents: main program.
*
*
* Last modify: 2
4
/0
9
/200
9
* Last modify: 2
1
/0
1
/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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
,
the
time
t
)
;
prefs
.
time_diff
=
counter_seconds
()
-
d
time
;
/* 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
;
}
}
src/preflist.h
View file @
0ca2f8a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
* Contents: Keywords for the configuration file.
* Contents: Keywords for the configuration file.
*
*
* Last modify:
14/12
/200
9
* Last modify:
21/01
/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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"
,
...
...
src/prefs.h
View file @
0ca2f8a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
* Contents: Keywords for the configuration file.
* Contents: Keywords for the configuration file.
*
*
* Last modify:
14/12
/200
9
* Last modify:
21/01
/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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 */
...
...
src/scan.c
View file @
0ca2f8a5
...
@@ -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:
0
1/1
2
/200
9
* Last modify:
2
1/
0
1/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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
)
...
...
src/xml.c
View file @
0ca2f8a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
* Contents: XML logging.
* Contents: XML logging.
*
*
* Last modify:
14/12
/200
9
* Last modify:
21/01
/20
1
0
*
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
*/
...
@@ -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
/200
9
VERSION
21/01
/20
1
0
***/
***/
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"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment