FACT++  1.0
bool FitsFile::OpenFile ( const string &  filename,
bool  allow_open = false 
)

Definition at line 94 of file FitsFile.cc.

References Error().

Referenced by AddColumn().

95 {
96  if (fFile || fTable)
97  {
98  Error("FitsFile::OpenFile - File already open.");
99  return false;
100  }
101  // fFileName = fileName;
102  if (!allow_open && access(filename.c_str(), F_OK)==0)
103  {
104  Error("File '"+filename+"' already existing.");
105  return false;
106  }
107  //create the FITS object
108  try
109  {
110  fFile = new CCfits::FITS(filename, CCfits::RWmode::Write);
111  }
112  catch (CCfits::FitsException e)
113  {
114  Error("CCfits::FITS failed for '"+filename+"': "+e.message());
115  return false;
116  }
117  /*
118  "SIMPLE = T / file does conform to FITS standard "
119  "BITPIX = 8 / number of bits per data pixel "
120  "NAXIS = 0 / number of data axes "
121  "EXTEND = T / FITS dataset may contain extensions "
122  "COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy"
123  "COMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H "
124  "END ";
125  */
126 
127  fIsOwner = true;
128 
129  return true;
130 }
CCfits::Table * fTable
The pointer to the CCfits FITS file.
Definition: FitsFile.h:19
CCfits::FITS * fFile
Definition: FitsFile.h:18
int Error(const std::string &str)
Definition: MessageImp.h:49
bool fIsOwner
Definition: FitsFile.h:24

+ Here is the call graph for this function:

+ Here is the caller graph for this function: