source: trunk/src/duchamp.hh @ 349

Last change on this file since 349 was 321, checked in by MatthewWhiting, 17 years ago
  • Solved most of the problem from ticket #12, where the integrated flux was being calculated differently on different machines. Now casting the spatial size of a detection to a double.
  • Solved ticket #13 as well, to allow compilation when PGPLOT is not available. Included moving cpgIsPS() to mycpgplot.cc.
File size: 8.1 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#include <Utils/mycpgplot.hh>
34
35#undef PACKAGE_BUGREPORT
36#undef PACKAGE_NAME
37#undef PACKAGE_STRING
38#undef PACKAGE_TARNAME
39#undef PACKAGE_VERSION
40#undef HAVE_PGPLOT
41#include "config.h"
42
43/** how to convey whether a function has worked */
44enum OUTCOME {SUCCESS=0, FAILURE};
45
46/** Usage message for command line help. */
47const std::string ERR_USAGE_MSG =
48"Usage: Duchamp [OPTION] [FILE]\n\
49Duchamp is an object finder for spectral-line FITS cubes.\n\
50\n\
51  -p FILE      Read in parameters from FILE, including FITS image location.\n\
52  -f FILE      Use default parameters with imageFile=FILE\n\
53  -x           Do not use X-windows PGPLOT output\n\
54               (equivalent to setting flagXOutput=false -- overrides the parameter file)\n\n\
55  -v           Return version number and exit\n\
56  -h           Display this help information and exit\n";
57
58/** Shorter Usage message for command line help. */
59const std::string ERR_USAGE_MSG_SHORT="Usage: Duchamp -p [parameter file]\n";
60
61/** The program name. (Duchamp) */
62const std::string PROGNAME = PACKAGE_NAME;
63
64/** The program version */
65const std::string VERSION = PACKAGE_VERSION;
66
67// Specialised functions to report warnings and errors -- in duchamp.cc
68/** Print a warning message to the stderr */
69void duchampWarning(std::string subroutine, std::string warning);
70/** Print an error message to the stderr and sound the bell */
71void duchampError(std::string subroutine, std::string error);
72
73
74/** The spectral type that we want the wcsprm structs to be in. */
75const char duchampVelocityType[9] = "VELO-F2V";
76/** The spectral type that we want the wcsprm structs to be in when no
77    velocity info is present. */
78const char duchampFrequencyType[9] = "FREQ    ";
79
80/** Descriptions of the various spectral axis types */
81enum TYPEDESC {FREQUENCY=0,VELOCITY,WAVELENGTH};
82/** Human-readable descriptions of the various spectral axis types */
83const std::string duchampSpectralDescription[3]=
84  {"Frequency", "Velocity", "Wavelength"};
85
86// Colours used in graphical output
87/** The colour for the Blank edges */
88const int DUCHAMP_BLANK_EDGE_COLOUR = mycpgplot::MAGENTA;
89/** The colour for the edge of the cube */
90const int DUCHAMP_CUBE_EDGE_COLOUR = mycpgplot::YELLOW;
91/** The colour for the reconstructed spectra */
92const int DUCHAMP_RECON_SPECTRA_COLOUR = mycpgplot::RED;
93/** The colour for the baseline spectra */
94const int DUCHAMP_BASELINE_SPECTRA_COLOUR = mycpgplot::YELLOW;
95/** The colour for the object outline */
96const int DUCHAMP_OBJECT_OUTLINE_COLOUR = mycpgplot::BLUE;
97/** The colour for the Milky-way region spectral boundaries */
98const int DUCHAMP_MILKY_WAY_COLOUR = mycpgplot::DARKGREEN;
99/** The colour for the tick marks in the image cutouts */
100const int DUCHAMP_TICKMARK_COLOUR = mycpgplot::RED;
101/** The colour for the text identifying objects on the maps */
102const int DUCHAMP_ID_TEXT_COLOUR = mycpgplot::RED;
103/** The colour for the WCS axes on the maps */
104const int DUCHAMP_WCS_AXIS_COLOUR = mycpgplot::WCSGREEN;
105
106// The following are the FITS Header Keywords corresponding to the
107// parameters related to the atrous reconstruction.
108/** FITS header keyword for min atrous scale*/
109const std::string keyword_scaleMin     = "DU_MINSC";
110/** FITS header keyword for S/N used in atrous reconstruction*/
111const std::string keyword_snrRecon     = "DU_ATCUT";
112/** FITS header keyword for number of dimensions used in atrous
113    reconstruction*/
114const std::string keyword_reconDim     = "DU_ATDIM";
115/** FITS header keyword for the code number of the filter used in
116    atrous reconstruction*/
117const std::string keyword_filterCode   = "DU_FILTR";
118/** FITS header keyword: does this file hold the reconstructed array
119    or the residual?*/
120const std::string keyword_ReconResid   = "DU_RECON";
121/** FITS header keyword: type of smoothing done. */
122const std::string keyword_smoothtype   = "DU_SMTYP";
123/** FITS header keyword for the gaussian kernel major axis FWHM*/
124const std::string keyword_kernmaj      = "DU_KMAJ";
125/** FITS header keyword for the gaussian kernel minor axis FWHM*/
126const std::string keyword_kernmin      = "DU_KMIN";
127/** FITS header keyword for the gaussian kernel position angle*/
128const std::string keyword_kernpa       = "DU_KPA";
129/** FITS header keyword for the Hanning filter width*/
130const std::string keyword_hanningwidth = "DU_WHANN";
131/** FITS header keyword for the image subsection used*/
132const std::string keyword_subsection   = "DU_IMSUB";
133
134// And these are the comments corresponding to the relevant keywords
135/** FITS header comment for DU_MINSC keyword*/
136const std::string comment_scaleMin     = "Duchamp parameter scaleMin";
137/** FITS header comment for DU_ATCUT keyword*/
138const std::string comment_snrRecon     = "Duchamp parameter snrRecon";
139/** FITS header comment for DU_ATDIM keyword*/
140const std::string comment_reconDim     = "Duchamp parameter reconDim";
141/** FITS header comment for DU_FILTR keyword*/
142const std::string comment_filterCode   = "Duchamp parameter filterCode";
143/** FITS header comment for DU_RECON keyword*/
144const std::string comment_ReconResid   = "Is this the reconstruction or residual?";
145/** FITS header comment for DU_SMTYP keyword*/
146const std::string comment_smoothtype   = "Type of smoothing done";
147/** FITS header comment for DU_KMAJ  keyword*/
148const std::string comment_kernmaj      = "Duchamp parameter kernMaj";
149/** FITS header comment for DU_KMIN  keyword*/
150const std::string comment_kernmin      = "Duchamp parameter kernMin";
151/** FITS header comment for DU_KPA   keyword*/
152const std::string comment_kernpa       = "Duchamp parameter kernPA";
153/** FITS header comment for DU_WHANN keyword*/
154const std::string comment_hanningwidth = "Duchamp parameter hanningWidth";
155/** FITS header comment for DU_IMSUB keyword*/
156const std::string comment_subsection   = "Subsection of the original image";
157
158// Descriptive Headers: for the reconstruction case
159const std::string header_reconHistory1 =
160"Reconstructed with a trous wavelet technique";
161const std::string header_reconHistory2 =
162"Reconstruction by Duchamp v." + VERSION;
163const std::string header_reconHistory_input =
164"Original (input) image used by Duchamp follows";
165const std::string header_reconSubsection_comment  =
166"A subsection of the original was reconstructed by Duchamp";
167const std::string header_atrous_comment  =
168"The following are the Duchamp parameters used in reconstruction";
169
170// Descriptive Headers: for the Smoothing case
171const std::string header_smoothHistory =
172"Smoothed by Duchamp v." + VERSION;
173const std::string header_smoothHistory_input =
174"Original (input) image used by Duchamp follows";
175const std::string header_smoothSubsection_comment  =
176"A subsection of the original was smoothed by Duchamp";
177const std::string header_smoothSpatial = "Spatial, gaussian kernel";
178const std::string header_smoothSpectral= "Spectral, hanning filter";
179#endif
180
Note: See TracBrowser for help on using the repository browser.