source: tags/release-1.1/src/duchamp.hh @ 1391

Last change on this file since 1391 was 299, checked in by Matthew Whiting, 17 years ago

Adding distribution text at the start of each file...

File size: 7.0 KB
Line 
1// -----------------------------------------------------------------------
2// duchamp.hh: Definitions for use with Duchamp
3// -----------------------------------------------------------------------
4// Copyright (C) 2006, Matthew Whiting, ATNF
5//
6// This program is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 2 of the License, or (at your
9// option) any later version.
10//
11// Duchamp is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14// for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with Duchamp; if not, write to the Free Software Foundation,
18// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
19//
20// Correspondence concerning Duchamp may be directed to:
21//    Internet email: Matthew.Whiting [at] atnf.csiro.au
22//    Postal address: Dr. Matthew Whiting
23//                    Australia Telescope National Facility, CSIRO
24//                    PO Box 76
25//                    Epping NSW 1710
26//                    AUSTRALIA
27// -----------------------------------------------------------------------
28#ifndef DUCHAMP_HH
29#define DUCHAMP_HH
30
31#include <iostream>
32#include <string>
33
34#undef PACKAGE_BUGREPORT
35#undef PACKAGE_NAME
36#undef PACKAGE_STRING
37#undef PACKAGE_TARNAME
38#undef PACKAGE_VERSION
39#include "config.h"
40
41/** how to convey whether a function has worked */
42enum OUTCOME {SUCCESS=0, FAILURE};
43
44/** Usage message for command line help. */
45const std::string ERR_USAGE_MSG =
46"Usage: Duchamp [OPTION] [FILE]\n\
47Duchamp is an object finder for spectral-line FITS cubes.\n\
48\n\
49  -p FILE      Read in parameters from FILE, including FITS image location.\n\
50  -f FILE      Use default parameters with imageFile=FILE\n\
51  -x           Do not use X-windows PGPLOT output\n\
52               (equivalent to setting flagXOutput=false -- overrides the parameter file)\n\n\
53  -v           Return version number and exit\n\
54  -h           Display this help information and exit\n";
55
56/** Shorter Usage message for command line help. */
57const std::string ERR_USAGE_MSG_SHORT="Usage: Duchamp -p [parameter file]\n";
58
59/** The program name. (Duchamp) */
60const std::string PROGNAME = PACKAGE_NAME;
61
62/** The program version */
63const std::string VERSION = PACKAGE_VERSION;
64
65// Specialised functions to report warnings and errors -- in duchamp.cc
66/** Print a warning message to the stderr */
67void duchampWarning(std::string subroutine, std::string warning);
68/** Print an error message to the stderr and sound the bell */
69void duchampError(std::string subroutine, std::string error);
70
71
72/** The spectral type that we want the wcsprm structs to be in. */
73const char duchampVelocityType[9] = "VELO-F2V";
74/** The spectral type that we want the wcsprm structs to be in when no
75    velocity info is present. */
76const char duchampFrequencyType[9] = "FREQ    ";
77
78/** Descriptions of the various spectral axis types */
79enum TYPEDESC {FREQUENCY=0,VELOCITY,WAVELENGTH};
80/** Human-readable descriptions of the various spectral axis types */
81const std::string duchampSpectralDescription[3]=
82  {"Frequency", "Velocity", "Wavelength"};
83
84// The following are the FITS Header Keywords corresponding to the
85// parameters related to the atrous reconstruction.
86/** FITS header keyword for min atrous scale*/
87const std::string keyword_scaleMin     = "DU_MINSC";
88/** FITS header keyword for S/N used in atrous reconstruction*/
89const std::string keyword_snrRecon     = "DU_ATCUT";
90/** FITS header keyword for number of dimensions used in atrous
91    reconstruction*/
92const std::string keyword_reconDim     = "DU_ATDIM";
93/** FITS header keyword for the code number of the filter used in
94    atrous reconstruction*/
95const std::string keyword_filterCode   = "DU_FILTR";
96/** FITS header keyword: does this file hold the reconstructed array
97    or the residual?*/
98const std::string keyword_ReconResid   = "DU_RECON";
99/** FITS header keyword: type of smoothing done. */
100const std::string keyword_smoothtype   = "DU_SMTYP";
101/** FITS header keyword for the gaussian kernel major axis FWHM*/
102const std::string keyword_kernmaj      = "DU_KMAJ";
103/** FITS header keyword for the gaussian kernel minor axis FWHM*/
104const std::string keyword_kernmin      = "DU_KMIN";
105/** FITS header keyword for the gaussian kernel position angle*/
106const std::string keyword_kernpa       = "DU_KPA";
107/** FITS header keyword for the Hanning filter width*/
108const std::string keyword_hanningwidth = "DU_WHANN";
109/** FITS header keyword for the image subsection used*/
110const std::string keyword_subsection   = "DU_IMSUB";
111
112// And these are the comments corresponding to the relevant keywords
113/** FITS header comment for DU_MINSC keyword*/
114const std::string comment_scaleMin     = "Duchamp parameter scaleMin";
115/** FITS header comment for DU_ATCUT keyword*/
116const std::string comment_snrRecon     = "Duchamp parameter snrRecon";
117/** FITS header comment for DU_ATDIM keyword*/
118const std::string comment_reconDim     = "Duchamp parameter reconDim";
119/** FITS header comment for DU_FILTR keyword*/
120const std::string comment_filterCode   = "Duchamp parameter filterCode";
121/** FITS header comment for DU_RECON keyword*/
122const std::string comment_ReconResid   = "Is this the reconstruction or residual?";
123/** FITS header comment for DU_SMTYP keyword*/
124const std::string comment_smoothtype   = "Type of smoothing done";
125/** FITS header comment for DU_KMAJ  keyword*/
126const std::string comment_kernmaj      = "Duchamp parameter kernMaj";
127/** FITS header comment for DU_KMIN  keyword*/
128const std::string comment_kernmin      = "Duchamp parameter kernMin";
129/** FITS header comment for DU_KPA   keyword*/
130const std::string comment_kernpa       = "Duchamp parameter kernPA";
131/** FITS header comment for DU_WHANN keyword*/
132const std::string comment_hanningwidth = "Duchamp parameter hanningWidth";
133/** FITS header comment for DU_IMSUB keyword*/
134const std::string comment_subsection   = "Subsection of the original image";
135
136// Descriptive Headers: for the reconstruction case
137const std::string header_reconHistory1 =
138"Reconstructed with a trous wavelet technique";
139const std::string header_reconHistory2 =
140"Reconstruction by Duchamp v." + VERSION;
141const std::string header_reconHistory_input =
142"Original (input) image used by Duchamp follows";
143const std::string header_reconSubsection_comment  =
144"A subsection of the original was reconstructed by Duchamp";
145const std::string header_atrous_comment  =
146"The following are the Duchamp parameters used in reconstruction";
147
148// Descriptive Headers: for the Smoothing case
149const std::string header_smoothHistory =
150"Smoothed by Duchamp v." + VERSION;
151const std::string header_smoothHistory_input =
152"Original (input) image used by Duchamp follows";
153const std::string header_smoothSubsection_comment  =
154"A subsection of the original was smoothed by Duchamp";
155const std::string header_smoothSpatial = "Spatial, gaussian kernel";
156const std::string header_smoothSpectral= "Spectral, hanning filter";
157#endif
158
Note: See TracBrowser for help on using the repository browser.