Commit 145c0f5c authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new cal prog

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2301
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 450f1694
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.1 2007-06-12 14:05:18 tforb Exp $
#
# Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
#
# calibration programs
#
# REVISIONS and CHANGES
# 12/06/2007 V1.0 Thomas Forbriger
#
# ============================================================================
#
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
PGPLOTLIB=-lf2cpgplot52 -lX11 -L/usr/X11/lib
CC=gcc
CFLAGS=-O2
F2CFLAGS=-f -u
FLAGS=
CXXFLAGS=-fhonor-std -Wall $(FLAGS)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
.f.o:
f2c $(F2CFLAGS) $<
gcc $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
@rm $(<:.f=.c)
all:
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o *.xxx.* *.ps *~
flist: $(wildcard *.f *.inc Makefile *.cc)
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
dccal: \
%: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lfourier -ldrfftw -ldfftw -lm \
-lsffxx -ldatreadxx -llinearxx \
-ltsxx -ltfxx -lsffxx -lgsexx -ltime++ -laff \
-llapack -lblas -lcseife -lsffxx -lg2c -lm\
-L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
newprog $@
#----------------------------------------------------------------------
%.psp: %.ps; gv $<; /bin/rm -fv $<
%.pdf: %.ps; ps2pdf $<
%.rw.ps: %.ps; gs -sDEVICE=pswrite -dNOPAUSE -dBATCH -sOutputFile=$@ $<
%.fix.ps: %.ps; fixps $< > $@
%.2up.ps: %.ps; psnup -r -l -2 -Pa4 -pa4 $< > $@
%.rs.ps: %.ps; psresize -Pa4 -pa5 $< > $@
%.pngp: %.png; xv $<; /bin/rm -fv $<
# ----- END OF Makefile -----
/*! \file dccal.cc
* \brief DC calibration
*
* ----------------------------------------------------------------------------
*
* $Id: dccal.cc,v 1.1 2007-06-12 14:05:18 tforb Exp $
* \author Thomas Forbriger
* \date 12/06/2007
*
* DC calibration
*
* Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 12/06/2007 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define DCCAL_VERSION \
"DCCAL V1.0 DC calibration"
#define DCCAL_CVSID \
"$Id: dccal.cc,v 1.1 2007-06-12 14:05:18 tforb Exp $"
#include <string>
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
// command line options and arguments
struct Options {
bool verbose;
bool writeresfile, writelogfile;
std::string resfilename, logfilename, infilename, tabfilename;
}; // struct Options
/*======================================================================*/
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
DCCAL_VERSION "\n"
"usage: dccal [-v] [-r resfile] [-l logfile]" "\n"
" infile tabfile" "\n"
" or: dccal --help|-h" "\n"
};
// define full help text
char help_text[]=
{
DCCAL_CVSID "\n"
"\n"
"infile SFF data file" "\n"
"tabfile ASCII table that defines calibration input" "\n"
"-v be verbose" "\n"
"-r resfile write residuals to resfile" "\n"
"-l logfile write results to logfile" "\n"
"\n"
"definition of table file entries:" "\n"
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
// 2: residual file
{"r",arg_yes,"-"},
// 3: log file
{"l",arg_yes,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// read command line
Options opt;
opt.verbose=cmdline.optset(1);
opt.writeresfile=cmdline.optset(2);
opt.resfilename=cmdline.string_arg(2);
opt.writelogfile=cmdline.optset(3);
opt.logfilename=cmdline.string_arg(3);
TFXX_assert(cmdline.extra(), "missing input file");
opt.infilename=cmdline.next();
TFXX_assert(cmdline.extra(), "missing table file");
opt.tabfilename=cmdline.next();
}
/* ----- END OF dccal.cc ----- */
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