Commit 5ae55cd0 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Moved software to trunk

parent 3b348a94
/*
ldactoasc.h
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* Part of: LDACtoASC
*
* Author: E.BERTIN (IAP)
*
* Contents: global definitions.
*
* Last modify: 04/06/2007
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/* Check if we are using a configure script here */
#ifndef HAVE_CONFIG_H
#define VERSION "1.x"
#define DATE "2007-06-04"
#define THREADS_NMAX 16 /* max. number of threads */
#endif
/*------------------------ what, who, when and where ------------------------*/
#define BANNER "LDACtoASC"
#ifdef USE_THREADS
#define MYVERSION VERSION "-MP"
#else
#define MYVERSION VERSION
#endif
#define COPYRIGHT "Emmanuel BERTIN <bertin@iap.fr>"
#define WEBSITE "http://terapix.iap.fr/soft/sextractor/"
#define INSTITUTE "TERAPIX team at IAP http://terapix.iap.fr"
/*----------------------------- Physical constants --------------------------*/
#ifndef PI
#define PI 3.1415926535898
#endif
/*----------------------------- Internal constants --------------------------*/
#define BIG 1e+30 /* a huge number */
#define TINY (1.0/BIG) /* a small number */
#define OUTPUT stdout /* where all msgs are sent */
#define MAXCHAR 512 /* max. number of characters */
#define MAXFILE 32768 /* max number of input files */
/*------------ Set defines according to machine's specificities -------------*/
#if 0
#define NO_ENVVAR
#endif
/*--------------------- in case of missing constants ------------------------*/
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE -1
#endif
/*---------------------------- return messages ------------------------------*/
#define RETURN_OK 0
#define RETURN_ERROR (-1)
#define RETURN_FATAL_ERROR (-2)
/*------------------------------- Other Macros ------------------------------*/
#define DEXP(x) exp(2.30258509299*(x)) /* 10^x */
#define QFREAD(ptr, size, afile, fname) \
if (fread(ptr, (size_t)(size), (size_t)1, afile)!=1) \
error(EXIT_FAILURE, "*Error* while reading ", fname)
#define QFWRITE(ptr, size, afile, fname) \
if (fwrite(ptr, (size_t)(size), (size_t)1, afile)!=1) \
error(EXIT_FAILURE, "*Error* while writing ", fname)
#define QFSEEK(afile, offset, pos, fname) \
if (fseek(afile, (offset), pos)) \
error(EXIT_FAILURE,"*Error*: file positioning failed in ", \
fname)
#define QFTELL(pos, afile, fname) \
if ((pos=ftell(afile))==-1) \
error(EXIT_FAILURE,"*Error*: file position unknown in ", \
fname)
#define QCALLOC(ptr, typ, nel) \
{if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
error(EXIT_FAILURE, "Not enough memory for ", \
#ptr " (" #nel " elements) !");;}
#define QMALLOC(ptr, typ, nel) \
{if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
error(EXIT_FAILURE, "Not enough memory for ", \
#ptr " (" #nel " elements) !");;}
#define QREALLOC(ptr, typ, nel) \
{if (!(ptr = (typ *)realloc(ptr, (size_t)(nel)*sizeof(typ)))) \
error(EXIT_FAILURE, "Not enough memory for ", \
#ptr " (" #nel " elements) !");;}
#define QMEMCPY(ptrin, ptrout, typ, nel) \
{if (ptrin) \
{if (!(ptrout = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
error(EXIT_FAILURE, "Not enough memory for ", \
#ptrout " (" #nel " elements) !"); \
memcpy(ptrout, ptrin, (size_t)(nel)*sizeof(typ));};;}
#define QPOPEN(file, cmdline, flag) \
{if (!(file=popen(cmdline, flag))) \
error(EXIT_FAILURE, "*Error*: cannot execute ", cmdline);;}
#define RINT(x) (int)(floor(x+0.5))
#define NPRINTF if (prefs.verbose_type == NORM) fprintf
#define NFPRINTF(w,x) {if (prefs.verbose_type == NORM) \
fprintf(w, "\33[1M> %s\n\33[1A",x);}
#define FPRINTF if (prefs.verbose_type == FULL) fprintf
#define QPRINTF if (prefs.verbose_type != QUIET) fprintf
#define QIPRINTF(w,x) {if (prefs.verbose_type == NORM) \
fprintf(w, "\33[7m%s\33[0m\n", x); \
else if (prefs.verbose_type == LOG) \
fprintf(w, "%s\n", x);}
#define QBPRINTF(w,x) {if (prefs.verbose_type == NORM) \
fprintf(w, "\33[01;31m%s\33[0m\n", x); \
else if (prefs.verbose_type == LOG) \
fprintf(w, "%s\n", x);}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Command-line parsing. * Contents: Command-line parsing.
* *
* Last modify: 10/04/2007 * Last modify: 07/07/2006
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -120,7 +120,6 @@ int main(int argc, char *argv[]) ...@@ -120,7 +120,6 @@ int main(int argc, char *argv[])
makeit(); makeit();
endprefs();
NFPRINTF(OUTPUT, ""); NFPRINTF(OUTPUT, "");
NPRINTF(OUTPUT, "> All done (in %.0f s)\n", prefs.time_diff); NPRINTF(OUTPUT, "> All done (in %.0f s)\n", prefs.time_diff);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: main program. * Contents: main program.
* *
* Last modify: 31/07/2007 * Last modify: 14/07/2006
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -56,7 +56,6 @@ void makeit() ...@@ -56,7 +56,6 @@ void makeit()
static time_t thetime1, thetime2; static time_t thetime1, thetime2;
struct tm *tm; struct tm *tm;
int i, nok, ntab, next; int i, nok, ntab, next;
void *gptr, *sptr;
/* Install error logging */ /* Install error logging */
error_installfunc(write_error); error_installfunc(write_error);
...@@ -160,6 +159,7 @@ void makeit() ...@@ -160,6 +159,7 @@ void makeit()
" CHECK_IMAGE_TYPE"); " CHECK_IMAGE_TYPE");
prefs.check[c] = initcheck(prefs.check_name[i], prefs.check_type[i], prefs.check[c] = initcheck(prefs.check_name[i], prefs.check_type[i],
next); next);
free(prefs.check_name[i]);
} }
} }
...@@ -193,7 +193,7 @@ void makeit() ...@@ -193,7 +193,7 @@ void makeit()
dfield = newfield(prefs.image_name[0], DETECT_FIELD, nok); dfield = newfield(prefs.image_name[0], DETECT_FIELD, nok);
field = newfield(prefs.image_name[1], MEASURE_FIELD, nok); field = newfield(prefs.image_name[1], MEASURE_FIELD, nok);
if ((field->width!=dfield->width) || (field->height!=dfield->height)) if ((field->width!=dfield->width) || (field->height!=dfield->height))
error(EXIT_FAILURE, "*Error*: Frames have different sizes",""); error(EXIT_FAILURE, "*Error*: Frames have different sizes","");
/*---- Prepare interpolation */ /*---- Prepare interpolation */
if (prefs.dweight_flag && prefs.interp_type[0] == INTERP_ALL) if (prefs.dweight_flag && prefs.interp_type[0] == INTERP_ALL)
init_interpolate(dfield, -1, -1); init_interpolate(dfield, -1, -1);
...@@ -209,14 +209,6 @@ void makeit() ...@@ -209,14 +209,6 @@ void makeit()
init_interpolate(field, -1, -1); /* 0.0 or anything else */ init_interpolate(field, -1, -1); /* 0.0 or anything else */
} }
/*---- Prepare photometry Measurements: gain and saturation definition */
if (fitsread(field->fitshead, prefs.gain_key, &gptr, H_FLOAT, T_DOUBLE)
==RETURN_OK)
prefs.gain = *(double *)&gptr;
if (fitsread(field->fitshead, prefs.satur_key, &sptr, H_FLOAT, T_DOUBLE)
==RETURN_OK)
prefs.satur_level = *(double *)&sptr;
/*-- Init the WEIGHT-images */ /*-- Init the WEIGHT-images */
if (prefs.dweight_flag || prefs.weight_flag) if (prefs.dweight_flag || prefs.weight_flag)
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Keywords for the configuration file. * Contents: Keywords for the configuration file.
* *
* Last modify: 31/07/2007 * Last modify: 14/07/2006
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
{"FLAG_TYPE", P_KEYLIST, prefs.flag_type, 0,0, 0.0,0.0, {"FLAG_TYPE", P_KEYLIST, prefs.flag_type, 0,0, 0.0,0.0,
{"OR","AND","MIN", "MAX", "MOST",""}, 0, MAXFLAG, &idummy}, {"OR","AND","MIN", "MAX", "MOST",""}, 0, MAXFLAG, &idummy},
{"GAIN", P_FLOAT, &prefs.gain, 0,0, 0.0, 1e+30}, {"GAIN", P_FLOAT, &prefs.gain, 0,0, 0.0, 1e+30},
{"GAIN_KEY", P_STRING, prefs.gain_key},
{"INTERP_MAXXLAG", P_INTLIST, prefs.interp_xtimeout, 1,1000000, 0.0,0.0, {"INTERP_MAXXLAG", P_INTLIST, prefs.interp_xtimeout, 1,1000000, 0.0,0.0,
{""}, 1, 2, &prefs.ninterp_xtimeout}, {""}, 1, 2, &prefs.ninterp_xtimeout},
{"INTERP_MAXYLAG", P_INTLIST, prefs.interp_ytimeout, 1,1000000, 0.0,0.0, {"INTERP_MAXYLAG", P_INTLIST, prefs.interp_ytimeout, 1,1000000, 0.0,0.0,
...@@ -124,7 +123,6 @@ ...@@ -124,7 +123,6 @@
{"PSFDISPLAY_TYPE", P_KEY, &prefs.psfdisplay_type, 0,0, 0.0,0.0, {"PSFDISPLAY_TYPE", P_KEY, &prefs.psfdisplay_type, 0,0, 0.0,0.0,
{"SPLIT","VECTOR",""}}, {"SPLIT","VECTOR",""}},
{"SATUR_LEVEL", P_FLOAT, &prefs.satur_level, 0,0, -1e+30, 1e+30}, {"SATUR_LEVEL", P_FLOAT, &prefs.satur_level, 0,0, -1e+30, 1e+30},
{"SATUR_KEY", P_STRING, prefs.satur_key},
{"SEEING_FWHM", P_FLOAT, &prefs.seeing_fwhm, 0,0, 1e-10, 1e+10}, {"SEEING_FWHM", P_FLOAT, &prefs.seeing_fwhm, 0,0, 1e-10, 1e+10},
{"SOM_NAME", P_STRING, prefs.som_name}, {"SOM_NAME", P_STRING, prefs.som_name},
{"STARNNW_NAME", P_STRING, prefs.nnw_name}, {"STARNNW_NAME", P_STRING, prefs.nnw_name},
...@@ -212,12 +210,9 @@ char *default_prefs[] = ...@@ -212,12 +210,9 @@ char *default_prefs[] =
" ", " ",
"SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation", "SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation",
" ", " ",
"SATUR_KEY SATURATE # keyword for saturation level (in ADUs)",
" ",
"MAG_ZEROPOINT 0.0 # magnitude zero-point", "MAG_ZEROPOINT 0.0 # magnitude zero-point",
"MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans)", "MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans)",
"GAIN 0.0 # detector gain in e-/ADU", "GAIN 0.0 # detector gain in e-/ADU",
"GAIN_KEY GAIN # keyword for detector gain in e-/ADU",
"PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info)", "PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info)",
" ", " ",
"#------------------------- Star/Galaxy Separation ----------------------------", "#------------------------- Star/Galaxy Separation ----------------------------",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Functions to handle the configuration file. * Contents: Functions to handle the configuration file.
* *
* Last modify: 10/04/2007 * Last modify: 12/01/2006
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -598,23 +598,3 @@ void useprefs() ...@@ -598,23 +598,3 @@ void useprefs()
} }
/********************************* endprefs *********************************/
/*
Mostly free memory allocate for static arrays.
*/
void endprefs(void)
{
int i;
for (i=0; i<prefs.nfimage_name; i++)
free(prefs.fimage_name[i]);
for (i=0; i<prefs.nwimage_name; i++)
free(prefs.wimage_name[i]);
for (i=0; i<prefs.npsf_name; i++)
free(prefs.psf_name[i]);
for (i=0; i<prefs.ncheck_name; i++)
free(prefs.check_name[i]);
return;
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* Contents: Keywords for the configuration file. * Contents: Keywords for the configuration file.
* *
* Last modify: 31/07/2007 * Last modify: 13/07/2006
* *
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/ */
...@@ -52,7 +52,6 @@ typedef struct ...@@ -52,7 +52,6 @@ typedef struct
int deblend_nthresh; /* threshold number */ int deblend_nthresh; /* threshold number */
double deblend_mincont; /* minimum contrast */ double deblend_mincont; /* minimum contrast */
double satur_level; /* saturation level */ double satur_level; /* saturation level */
char satur_key[8]; /* saturation keyword */
enum {CCD, PHOTO} detect_type; /* detection type */ enum {CCD, PHOTO} detect_type; /* detection type */
/*----- Flagging */ /*----- Flagging */
char *(fimage_name[MAXFLAG]); /* flagmap filenames */ char *(fimage_name[MAXFLAG]); /* flagmap filenames */
...@@ -92,8 +91,6 @@ typedef struct ...@@ -92,8 +91,6 @@ typedef struct
double mag_zeropoint; /* magnitude offsets */ double mag_zeropoint; /* magnitude offsets */
double mag_gamma; /* for emulsions */ double mag_gamma; /* for emulsions */
double gain; /* only for CCD */ double gain; /* only for CCD */
char gain_key[8]; /* gain keyword
only for CCD */
/*----- S/G separation */ /*----- S/G separation */
double pixel_scale; /* in arcsec */ double pixel_scale; /* in arcsec */
double seeing_fwhm; /* in arcsec */ double seeing_fwhm; /* in arcsec */
...@@ -215,7 +212,6 @@ typedef struct ...@@ -215,7 +212,6 @@ typedef struct
extern int cistrcmp(char *cs, char *ct, int mode); extern int cistrcmp(char *cs, char *ct, int mode);
extern void dumpprefs(int state), extern void dumpprefs(int state),
endprefs(void),
readprefs(char *filename,char **argkey,char **argval,int narg), readprefs(char *filename,char **argkey,char **argval,int narg),
useprefs(void); useprefs(void);
#endif #endif
# Makefile.in generated by automake 1.9.4 from Makefile.am. # Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc. # 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
@SET_MAKE@ @SET_MAKE@
SOURCES = $(libwcs_c_a_SOURCES)
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
...@@ -39,10 +37,7 @@ POST_UNINSTALL = : ...@@ -39,10 +37,7 @@ POST_UNINSTALL = :
subdir = src/wcs subdir = src/wcs
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acx_urbi_resolve_dir.m4 \ am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
$(top_srcdir)/acx_prog_cc_optim.m4 \
$(top_srcdir)/acx_prog_cc_optim.m4 \
$(top_srcdir)/acx_urbi_resolve_dir.m4 \
$(top_srcdir)/configure.ac $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
...@@ -168,9 +163,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) ...@@ -168,9 +163,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/wcs/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/wcs/Makefile'; \
cd $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/wcs/Makefile $(AUTOMAKE) --gnu src/wcs/Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
......
...@@ -358,9 +358,9 @@ int write_xml_meta(FILE *file, char *error) ...@@ -358,9 +358,9 @@ int write_xml_meta(FILE *file, char *error)
fprintf(file, " <TR>\n" fprintf(file, " <TR>\n"
" <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>" " <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>"
"<TD>%d</TD><TD>%d</TD>\n" "<TD>%d</TD><TD>%d</TD>\n"
" <TD>%s,%s</TD><TD>%g %g</TD>\n" " <TD>%s,%s</TD>\n"
" <TD>%g %g</TD><TD>%g %g</TD><TD>%g %g</TD>" " <TD>%g %g</TD><TD>%g %g</TD><TD>%g %g</TD>"
"<TD>%g %g</TD><TD>%f %f</TD>\n" "<TD>%g %g</TD><TD>%g %g</TD>\n"
" </TR>\n", " </TR>\n",
xmlstack[n].currext, xmlstack[n].currext,
xmlstack[n].ext_date, xmlstack[n].ext_date,
...@@ -373,14 +373,13 @@ int write_xml_meta(FILE *file, char *error) ...@@ -373,14 +373,13 @@ int write_xml_meta(FILE *file, char *error)
xmlstack[n].backsig[0], xmlstack[n].backsig[1], xmlstack[n].backsig[0], xmlstack[n].backsig[1],
xmlstack[n].sigfac[0], xmlstack[n].sigfac[1], xmlstack[n].sigfac[0], xmlstack[n].sigfac[1],
xmlstack[n].thresh[0], xmlstack[n].thresh[1], xmlstack[n].thresh[0], xmlstack[n].thresh[1],
xmlstack[n].pixscale[0], xmlstack[n].pixscale[1], xmlstack[n].pixscale[0], xmlstack[n].pixscale[1]);
xmlstack[n].epoch[0], xmlstack[n].epoch[1]);
else else
fprintf(file, " <TR>\n" fprintf(file, " <TR>\n"
" <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>" " <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>"
"<TD>%d</TD><TD>%d</TD>\n" "<TD>%d</TD><TD>%d</TD>\n"
" <TD>%s</TD><TD>%g</TD>\n" " <TD>%s</TD>\n"
" <TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%f</TD>\n" " <TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%g</TD>\n"
" </TR>\n", " </TR>\n",
xmlstack[n].currext, xmlstack[n].currext,
xmlstack[n].ext_date, xmlstack[n].ext_date,
...@@ -393,8 +392,7 @@ int write_xml_meta(FILE *file, char *error) ...@@ -393,8 +392,7 @@ int write_xml_meta(FILE *file, char *error)
xmlstack[n].backsig[0], xmlstack[n].backsig[0],
xmlstack[n].sigfac[0], xmlstack[n].sigfac[0],
xmlstack[n].thresh[0], xmlstack[n].thresh[0],
xmlstack[n].pixscale[0], xmlstack[n].pixscale[0]);
xmlstack[n].epoch[0]);
fprintf(file, " </TABLEDATA></DATA>\n"); fprintf(file, " </TABLEDATA></DATA>\n");
fprintf(file, " </TABLE>\n"); fprintf(file, " </TABLE>\n");
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY deg "&#176;">
<!ENTITY amin "&#180;">
<!ENTITY asec "&#168;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- *********************** Global XSL template ************************** -->
<xsl:template match="/">
<xsl:variable name="date" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Date']/@value"/>
<xsl:variable name="time" select="/VOTABLE/RESOURCE/RESOURCE[@name='MetaData']/PARAM[@name='Time']/@value"/>
<html>
<!-- HTML head -->
<head>
<!-- javascript -->
<!-- <script type="text/javascript" language="javascript"> -->
<script src="http://terapix.iap.fr/cplt/xsl/sorttable.js"/>
<style type="text/css">
p.sansserif {font-family: sans-serif}
body {background-color: white}
mono {font-family: monospace}
elen {font-family: monospace; font-size: 100%; font-weight: bold; color: green }
elep {font-family: monospace; font-size: 100%; font-weight: bold; color: red }
el {font-family: monospace; font-size: 100%; color: black}
a {text-decoration: none}
table.sortable a.sortheader
{
background-color:#FFEECC;
color: black;
font-weight: bold;
font-size: 80%;
text-decoration: none;
display: button;
}
table.sortable span.sortarrow
{
color: black;
font-weight: bold;
text-decoration: none;
}
table.sortable a.sortheader.sub
{
vertical-align: sub;
}
</style>
<title>
Processing summary on <xsl:value-of select="$date"/> at <xsl:value-of select="$time"/>
</title>
</head>
<!-- HTML body -->
<BODY>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TR>
<TD ALIGN="LEFT">
<TABLE BORDER="0">
<TR>
<TD ALIGN="CENTER">
<IMG SRC="http://terapix.iap.fr/cplt/xsl/terapixLogo.png" ALT="Terapix"/>
</TD>
<TD ALIGN="CENTER">
<IMG SRC="http://terapix.iap.fr/cplt/xsl/terapixTitle.png" ALT="Logo"/>
</TD>
<TD ALIGN="CENTER">
<FONT color="#669933">
<B> Processing summary</B>
</FONT>
</TD>
<TD ALIGN="CENTER">
<IMG SRC="http://terapix.iap.fr/cplt/xsl/terapixPicture.gif" ALT="Terapix banner"/>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER="0" WIDTH="100%" BGCOLOR="#000000">
<TR>
<TH BGCOLOR="#000000" ALIGN="LEFT"><FONT SIZE="-1" COLOR="#FFFFFF"> Home > Tools > Data reduction</FONT></TH>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<xsl:call-template name="VOTable"/>
</BODY>
</html>
</xsl:template>
<!-- **************** Generic XSL template for VOTables ****************** -->
<xsl:template name="VOTable">
<xsl:for-each select="/VOTABLE">
<xsl:call-template name="Resource"/>
</xsl:for-each>
</xsl:template>
<!-- *************** Generic XSL template for Resources ****************** -->
<xsl:template name="Resource">
<xsl:for-each select="RESOURCE">
<xsl:choose>
<xsl:when test="@ID='SExtractor'">
<xsl:call-template name="sextractor"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- ******************* XSL template for SExtractor ********************* -->
<xsl:template name="sextractor">
<xsl:for-each select="RESOURCE[@ID='MetaData']">
<xsl:call-template name="RunInfo"/>
<xsl:for-each select="/VOTABLE/RESOURCE[@ID='SExtractor']/TABLE[@ID='Source_List']">
<xsl:call-template name="sources"/>
</xsl:for-each>
<xsl:for-each select="TABLE[@ID='Extension_Data']">
<xsl:call-template name="extdata"/>
</xsl:for-each>
<xsl:for-each select="RESOURCE[@ID='Config']">
<xsl:call-template name="Config"/>
</xsl:for-each>
<xsl:for-each select="TABLE[@ID='Warnings']">
<xsl:call-template name="Warnings"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<!-- ************* Generic XSL RunInfo template for MetaData ************* -->
<xsl:template name="RunInfo">
<p>
<!-- Software name, version, date, time and number of threads -->
<a>
<xsl:attribute name="href">
<xsl:value-of select="PARAM[@name='Soft_URL']/@value"/>
</xsl:attribute>
<b>
<xsl:value-of select="PARAM[@name='Software']/@value"/>&nbsp;<xsl:value-of select="PARAM[@name='Version']/@value"/>
</b>
</a>
started on
<b><xsl:value-of select="PARAM[@name='Date']/@value"/></b>
at
<b><xsl:value-of select="PARAM[@name='Time']/@value"/></b>
with
<b><xsl:value-of select="PARAM[@name='NThreads']/@value"/></b>
thread<xsl:if test="PARAM[@name='NThreads']/@value &gt; 1">s</xsl:if>
<!-- Run time -->
<xsl:variable name="duration" select="PARAM[@name='Duration']/@value"/>
(run time:
<b>
<xsl:choose>
<xsl:when test="$duration &gt; 3600.0">
<xsl:value-of
select='concat(string(floor($duration div 3600)),
" h ", format-number(floor(($duration div 60) mod 60.0), "00"),
" min")'/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$duration &gt; 60.0">
<xsl:value-of
select='concat(format-number(floor($duration div 60),"##"),
" min ", format-number(floor($duration mod 60.0), "00")," s")'/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select='concat(string($duration), " s")'/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</b>)
<br />
by user <b><xsl:value-of select="PARAM[@name='User']/@value"/></b>
from <b><xsl:value-of select="PARAM[@name='Host']/@value"/></b>
in <b><mono><xsl:value-of select="PARAM[@name='Path']/@value"/></mono></b>
</p>
<p>
<b style="color: red"><xsl:if test="PARAM[@name='Error_Msg']/@value &gt; 0">
An Error occured!!! </xsl:if>
<xsl:value-of select="PARAM[@name='Error_Msg']/@value"/></b>
</p>
<p>
<sans-serif><i>click to expand or hide tables</i></sans-serif>
</p>
</xsl:template>
<!-- ******************** XSL template for Source List ******************** -->
<xsl:template name="sources">
<xsl:choose>
<xsl:when test="DATA/TABLEDATA">
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: sans-serif; font-weight: bold;" onclick="showhideTable('sources')">
Source List
</BUTTON>
<TABLE id="sources" class="sortable" style="display: none">
<TR>
<xsl:for-each select="FIELD">
<TH BGCOLOR="#FFEECC" align="center"><xsl:attribute name="title"><xsl:value-of select="DESCRIPTION"/></xsl:attribute>
<xsl:value-of select="@name"/>
<xsl:text disable-output-escaping="yes">&#13;&#10;
</xsl:text>
<xsl:value-of select="@unit"/>
</TH>
</xsl:for-each>
</TR>
<xsl:for-each select="DATA/TABLEDATA">
<xsl:for-each select="TR">
<tr>
<xsl:for-each select="TD">
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="self::TD"/></el>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:for-each>
</TABLE>
</p>
</xsl:when>
<xsl:otherwise>
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: sans-serif; font-weight: bold;" onclick="showhideTable('catparam')">
Parameter List
</BUTTON>
<TABLE id="catparam" class="sortable" style="display: none">
<TR>
<TH BGCOLOR="#FFEECC" align="center">Parameter Name</TH>
<TH BGCOLOR="#FFEECC" align="center">Description</TH>
</TR>
<xsl:for-each select="FIELD">
<tr>
<td align="left" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="@name"/></el>
</td>
<td align="left" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="DESCRIPTION"/></el>
</td>
</tr>
</xsl:for-each>
</TABLE>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ******************* XSL template for Extension Data ****************** -->
<xsl:template name="extdata">
<xsl:variable name="extension" select="count(FIELD[@name='Extension']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="date" select="count(FIELD[@name='Date']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="time" select="count(FIELD[@name='Time']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="duration" select="count(FIELD[@name='Duration']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="ndet" select="count(FIELD[@name='NDetect']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="nsex" select="count(FIELD[@name='NSextracted']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="imid" select="count(FIELD[@name='Image_Ident']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="backmean" select="count(FIELD[@name='Background_Mean']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="backsig" select="count(FIELD[@name='Background_StDev']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="thresh" select="count(FIELD[@name='Threshold']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="wscale" select="count(FIELD[@name='Weight_Scaling']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="pixscale" select="count(FIELD[@name='Pixel_Scale']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="epoch" select="count(FIELD[@name='Epoch']/preceding-sibling::FIELD)+1"/>
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: sans-serif; font-weight: bold;" onclick="showhideTable('extdata')">
Summary Table on Output Catalog
</BUTTON>
<TABLE class="sortable" id="extdata" BORDER="2" style="display: none">
<TR>
<TH BGCOLOR="#FFEECC">Extension</TH>
<TH BGCOLOR="#FFEECC">Date</TH>
<TH BGCOLOR="#FFEECC">Time</TH>
<TH BGCOLOR="#FFEECC">Duration</TH>
<TH BGCOLOR="#FFEECC">Detected Source Number</TH>
<TH BGCOLOR="#FFEECC">Sextracted Source Number</TH>
<TH BGCOLOR="#FFEECC">Image ID</TH>
<TH BGCOLOR="#FFEECC">Mean Background</TH>
<TH BGCOLOR="#FFEECC">Sigma Background</TH>
<TH BGCOLOR="#FFEECC">Detection Threshold</TH>
<TH BGCOLOR="#FFEECC">Weight Scaling</TH>
<TH BGCOLOR="#FFEECC">Pixel Scale</TH>
<TH BGCOLOR="#FFEECC">Epoch</TH>
</TR>
<xsl:for-each select="DATA/TABLEDATA">
<xsl:for-each select="TR">
<tr>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$extension]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$date]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$time]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$duration]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$ndet]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$nsex]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$imid]"/></el>
</td>
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="format-number(TD[$backmean],'#####0.00')"/></el>
</td>
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="format-number(TD[$backsig],'###0.000')"/></el>
</td>
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="format-number(TD[$thresh],'#####0.00')"/></el>
</td>
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="format-number(TD[$wscale],'#####0.00')"/></el>
</td>
<td align="right" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="format-number(TD[$pixscale],'#0.000')"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$epoch]"/></el>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</TABLE>
</p>
</xsl:template>
<!-- ******************** XSL template for Config File ******************** -->
<xsl:template name="Config">
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: sans-serif; font-weight: bold;" onclick="showhideTable('config')">
Configuration File: <xsl:value-of select="PARAM[@name='Prefs_Name']/@value"/>
</BUTTON>
<TABLE id="config" class="sortable" style="display: none">
<TR>
<TH BGCOLOR="#FFEECC">Config Parameter</TH>
<TH BGCOLOR="#FFEECC">Value</TH>
</TR>
<xsl:for-each select="PARAM[position()>2]">
<tr BGCOLOR="#EEEEEE">
<td><el><xsl:value-of select="@name"/></el></td>
<td><el><xsl:value-of select="@value"/></el></td>
</tr>
</xsl:for-each>
</TABLE>
</p>
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: monospace; font-weight: bold: font-size: 80%;" onclick="showhideTable('commandline')">
Command Line
</BUTTON>
<TABLE id="commandline" style="display: none">
<TR>
<TD BGCOLOR="#FFEECC" style="font-size: 80%;"><el>Command Line: <xsl:value-of select="PARAM[@name='Command_Line']/@value"/></el></TD>
</TR>
</TABLE>
</p>
</xsl:template>
<!-- ********************** XSL template for Warnings ********************** -->
<xsl:template name="Warnings">
<xsl:variable name="date" select="count(FIELD[@name='Date']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="time" select="count(FIELD[@name='Time']/preceding-sibling::FIELD)+1"/>
<xsl:variable name="msg" select="count(FIELD[@name='Msg']/preceding-sibling::FIELD)+1"/>
<p>
<BUTTON type="button" style="background:#CCEECC; font-family: monospace; font-weight: bold: font-size: 80%;" onclick="showhideTable('warnings')">
Warnings (limited to the last 100)
</BUTTON>
<TABLE id="warnings" style="display: none">
<TR style="font-size: 80%;">
<TH BGCOLOR="#FFEECC">Date</TH>
<TH BGCOLOR="#FFEECC">Time</TH>
<TH BGCOLOR="#FFEECC">Message</TH>
</TR>
<xsl:for-each select="DATA/TABLEDATA">
<xsl:for-each select="TR">
<tr>
<td BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$date]"/></el>
</td>
<td BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$time]"/></el>
</td>
<td align="center" BGCOLOR="#EEEEEE">
<el><xsl:value-of select="TD[$msg]"/></el>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</TABLE>
</p>
</xsl:template>
<xsl:template name="Rest">
</xsl:template>
</xsl:stylesheet>
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