source: trunk/src/Cubes/WriteArray.hh @ 1120

Last change on this file since 1120 was 1120, checked in by MatthewWhiting, 12 years ago

Ticket #170, #105 - The bulk of the work allowing this to happen. Have implemented different classes for each of the output types, including the baselines (which required new parameters etc.) Not yet implemented in mainDuchamp, so needs testing.

File size: 989 bytes
Line 
1#ifndef DUCHAMP_WRITE_ARRAY_HH_
2#define DUCHAMP_WRITE_ARRAY_HH_
3
4#include <duchamp/duchamp.hh>
5#include <duchamp/Cubes/cubes.hh>
6#include <fitsio.h>
7
8namespace duchamp {
9
10  class WriteArray
11  {
12  public:
13    WriteArray();
14    WriteArray(Cube *cube);
15    WriteArray(Cube *cube, int bitpix);
16    WriteArray(const WriteArray& other);
17    WriteArray& operator= (const WriteArray& other);
18    virtual ~WriteArray(){};
19
20    void setCube(Cube *cube){itsCube=cube;};
21    void setBitpix(int bitpix){itsBitpix = bitpix;};
22    void setFilename(std::string filename){itsFilename=filename;};
23    void setFITSptr(fitsfile *fptr){itsFptr=fptr;};
24    void set2D(bool b){itsFlag2D=b;};
25
26    OUTCOME openFile();
27    OUTCOME writeBasicHeader();
28    virtual OUTCOME writeHeader() = 0;
29    virtual OUTCOME writeData() = 0;
30    OUTCOME closeFile();
31
32    OUTCOME write();
33
34  protected:
35    Cube *itsCube;
36    std::string itsFilename;
37    fitsfile *itsFptr;
38    int itsBitpix;
39    bool itsFlag2D;
40  };
41
42}
43
44#endif
Note: See TracBrowser for help on using the repository browser.