Action #931

Feature #46: Add XPSEC support module

Implement GPha class

Added by Knödlseder Jürgen over 11 years ago. Updated about 11 years ago.

Status:ClosedStart date:06/23/2013
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-Estimated time:0.00 hour
Target version:HESS sprint #1
Duration:

Description

This class stores a counts spectrum. Reading from a PHA file and writing into a PHA file should be supported. A spectrum can be filled using the fill() method. The spectrum also tracks underflows and overflows.

class GPha : public GBase {

public:
    // Constructors and destructors
    GPha(void);
    explicit GPha(const GEbounds& ebds);
    GPha(const GPha& spec);
    virtual ~GPha(void);

    // Operators
    GPha& operator=(const GPha& spec);
    double&          operator[](const int& index);
    const double&    operator[](const int& index) const;

    // Implemented pure virtual methods
    void             clear(void);
    GPha* clone(void) const;
    int              size(void) const;
    void             fill(const GEnergy& energy, const double& value = 1.0);
    void             load(const std::string& filename);
    void             save(const std::string& filename) const;
    std::string      print(const GChatter& chatter = NORMAL) const;

protected:
    // Protected methods
    void         init_members(void);
    void         copy_members(const GPha& spec);
    void         free_members(void);

    // Protected members
    GEbounds            m_ebounds;    //!< Energy boundaries
    std::vector<double> m_counts;     //!< Counts data
    double              m_underflow;  //!< Number of underflowing events
    double              m_overflow;   //!< Number of overflowing events
};


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 11 years ago

  • Description updated (diff)

#2 Updated by Knödlseder Jürgen over 11 years ago

  • Assigned To set to Knödlseder Jürgen

#3 Updated by Knödlseder Jürgen over 11 years ago

  • Status changed from New to In Progress

#4 Updated by Knödlseder Jürgen over 11 years ago

  • % Done changed from 0 to 30

Implement an initial version of the GPha class.

#5 Updated by Knödlseder Jürgen over 11 years ago

  • % Done changed from 30 to 80

#6 Updated by Knödlseder Jürgen over 11 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 80 to 100
  • Remaining (hours) set to 0.0

The Python interface and a Python unit test has been implemented.

#7 Updated by Knödlseder Jürgen about 11 years ago

  • Status changed from Feedback to Closed
  • Estimated time set to 0.00

Also available in: Atom PDF