source: trunk/src/duchamp.hh @ 474

Last change on this file since 474 was 474, checked in by MatthewWhiting, 16 years ago

Rename Rrose to Selavy and starting to fix up the reading of options

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