source: trunk/src/duchamp.cc @ 167

Last change on this file since 167 was 164, checked in by Matthew Whiting, 18 years ago

A series of changes, prompted by the need to update the subsections parsing
to make it compliant with the new multi-dimensional FITS formalism.
Specifically:

  • FitsIO/subsection.cc
    • New file. Main task the Param::verifySubsection() function. Makes sure the subsection has correct format and number of axes.

Also removes any steps in the subsection string.

  • Another simple function, Param::setOffsets, to set the offset values if necessary.
  • FitsIO/dataIO.cc
    • Call to Param::setOffsets after array is read in.
  • mainDuchamp.cc
    • Added a call to Param::verifySubsection() before the cube is opened.
  • param.hh
    • New prototypes and definition of offsets array in Param class.
  • param.cc
    • Removed parseSubsection
  • Cubes/cubes.hh:
    • A simpler way of doing the Cube::getCube() function. No call to parseSubsection
  • Cubes/getImage.cc:
    • An error message if opening the FITS file fails due to bad subsection.
    • Fixed a bug for the reporting of the FITS file size.
  • duchamp.cc
    • Added a bell to the duchampError function.
File size: 729 bytes
Line 
1#include <iostream>
2#include <iomanip>
3#include <string>
4#include <duchamp.hh>
5
6void duchampWarning(std::string subroutine, std::string warning)
7{
8  std::string preamble = "WARNING <" + subroutine + "> : ";
9  std::cerr << preamble;
10  for(int i=0;i<warning.size();i++){
11    std::cerr << warning[i];
12    if((i!=warning.size()-1)&&(warning[i]=='\n'))
13      std::cerr << std::setw(preamble.size()) <<": ";
14  }
15}
16
17void duchampError(std::string subroutine, std::string error)
18{
19  std::string preamble = "\aERROR <" + subroutine + "> : ";
20  std::cerr << preamble;
21  for(int i=0;i<error.size();i++){
22    std::cerr << error[i];
23    if((i!=error.size()-1)&&(error[i]=='\n'))
24      std::cerr << std::setw(preamble.size()-1) <<": ";
25  }
26}
27
Note: See TracBrowser for help on using the repository browser.