Action #755
Feature #754: Allow fitting of elliptical morphology shapes
Implement GModelSpatialElliptical base class
Status: | Closed | Start date: | 02/16/2013 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | Estimated time: | 0.00 hour | |
Target version: | 1.0.0 | |||
Duration: |
Description
The abstract base class of elliptical models should be GModelSpatialElliptical
. It derives from the GModelSpatial
.
Here is a proposal for the interface of the GModelSpatialElliptical
class:
class GModelSpatialElliptical : public GModelSpatial {
public:
// Constructors and destructors
GModelSpatialElliptical(void);
GModelSpatialElliptical(const GModelSpatialElliptical& model);
explicit GModelSpatialElliptical(const GXmlElement& xml);
virtual ~GModelSpatialElliptical(void);
// Operators
virtual GModelSpatialElliptical& operator=(const GModelSpatialElliptical& model);
// Pure virtual methods
virtual void clear(void) = 0;
virtual GModelSpatialElliptical* clone(void) const = 0;
virtual std::string type(void) const = 0;
virtual double eval(const double& theta, const double& posangle) const = 0;
virtual double eval_gradients(const double& theta, const double& posangle) const = 0;
virtual GSkyDir mc(GRan& ran) const = 0;
virtual double theta_max(void) const = 0;
virtual std::string print(void) const = 0;
// Implemented virtual base class methods
virtual double eval(const GSkyDir& srcDir) const;
virtual double eval_gradients(const GSkyDir& srcDir) const;
virtual void read(const GXmlElement& xml);
virtual void write(GXmlElement& xml) const;
// Other methods
double ra(void) const { return m_ra.real_value(); }
double dec(void) const { return m_dec.real_value(); }
double posangle(void) const { return m_posangle.real_value(); }
GSkyDir dir(void) const;
void dir(const GSkyDir& dir);
void posangle(const double& posangle) { m_posangle.real_value(posangle); }
protected:
// Protected methods
void init_members(void);
void copy_members(const GModelSpatialElliptical& model);
void free_members(void);
// Proteced members
GModelPar m_ra; //!< Right Ascension (deg)
GModelPar m_dec; //!< Declination (deg)
GModelPar m_posangle; //!< Position angle from North, counterclockwise (deg)
};
The base class stores the model centre and the position angle. The position angle is specified in celestial coordinates (Right Ascension, Declination), and is counted counterclockwise from North (usual convention).
There are variants of the eval
and eval_gradients
method that take an offset angle and a position angle as arguments.
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen almost 12 years ago
- Target version set to HESS sprint #1
#2 Updated by Mayer Michael almost 12 years ago
Looks great. Only posang sounds a bit odd, may posangle or pos_angle would be more meaningful?
#3 Updated by Knödlseder Jürgen almost 12 years ago
- Subject changed from Implement GModelElliptical base class to Implement GModelSpatialElliptical base class
- Description updated (diff)
#4 Updated by Knödlseder Jürgen almost 12 years ago
Michael Mayer wrote:
Looks great. Only posang sounds a bit odd, may posangle or pos_angle would be more meaningful?
Agree. Changed to posangle
.
#5 Updated by Knödlseder Jürgen almost 12 years ago
- Status changed from New to In Progress
- Assigned To set to Knödlseder Jürgen
Start implementation.
#6 Updated by Knödlseder Jürgen almost 12 years ago
- File GModelSpatial.jpg added
- Description updated (diff)
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
- Remaining (hours) set to 0.0
An initial version of GModelSpatialElliptical
has been implemented following the lines indicated above.
The new inheritance diagram of GModelSpatial
is shown below:
#7 Updated by Knödlseder Jürgen over 11 years ago
- Target version changed from HESS sprint #1 to 00-08-00
#8 Updated by Knödlseder Jürgen almost 11 years ago
- Status changed from Feedback to Closed
- Estimated time set to 0.00
#9 Updated by Knödlseder Jürgen almost 11 years ago
- Target version deleted (
00-08-00)
#10 Updated by Knödlseder Jürgen over 10 years ago
- Target version set to 1.0.0