PointingDirectionProjector.h

Go to the documentation of this file.
00001 #ifndef _SYNTHESYS_POINTING_DIRECTION_PROJECTOR_H_
00002 #define _SYNTHESYS_POINTING_DIRECTION_PROJECTOR_H_
00003 
00004 #include <casacore/casa/Arrays/Matrix.h>
00005 #include <casacore/casa/Arrays/Vector.h>
00006 #include <casacore/casa/Logging/LogIO.h>
00007 
00008 namespace casa {
00009 // Partially projection code from ASAP GenericEdgeDetector
00010 class Projector {
00011 public:
00012   Projector();
00013   virtual ~Projector() {
00014   }
00015   void setDirection(const casacore::Matrix<casacore::Double> &dir);
00016   void setReferenceCoordinate(casacore::Double const lat, casacore::Double const lon);
00017   void setReferencePixel(casacore::Double const refx, casacore::Double const refy);
00018   void unsetReferenceCoordinate();
00019   void unsetReferencePixel();
00020   casacore::Bool isReferenceCoordinateSet() const {return user_defined_center_;}
00021   casacore::Bool isReferencePixelSet() const {return user_defined_pcenter_;}
00022   void getUserDefinedReferenceCoordinate(casacore::Double &lat, casacore::Double &lon) {
00023     lat = cenx_user_;
00024     lon = ceny_user_;
00025   }
00026   void getUserDefinedReferencePixel(casacore::Double &refx, casacore::Double &refy) {
00027     refx = pcenx_user_;
00028     refy = pceny_user_;
00029   }
00030   virtual const casacore::Matrix<casacore::Double>& project() = 0;
00031 protected:
00032   // From asap/src/MathUtils
00033   void rotateRA(casacore::Vector<casacore::Double> &v);
00034   // Input data
00035   casacore::Matrix<casacore::Double> dir_;
00036 
00037   // logging
00038   casa::LogIO os_;
00039 
00040 private:
00041   // private attributes
00042   casacore::Double cenx_user_;
00043   casacore::Double ceny_user_;
00044   casacore::Bool user_defined_center_;
00045   casacore::Double pcenx_user_;
00046   casacore::Double pceny_user_;
00047   casacore::Bool user_defined_pcenter_;
00048 };
00049 
00050 class OrthographicProjector: public Projector {
00051 public:
00052   OrthographicProjector(casacore::Float pixel_scale = 0.5);
00053   virtual ~OrthographicProjector();
00054   const casacore::Matrix<casacore::Double>& project();
00055   const casacore::Vector<casacore::Double>& p_center() const {
00056     return p_center_;
00057   }
00058   const casacore::Vector<casacore::Double>& p_size() const {
00059     return p_size_;
00060   }
00061   casacore::Double pixel_size() const {
00062     return dy_;
00063   }
00064 
00065 private:
00066   void scale_and_center();
00067   // options
00068   casacore::Float pixel_scale_;
00069   // pixel info
00070   casacore::Double cenx_;
00071   casacore::Double ceny_;
00072   casacore::Double pcenx_;
00073   casacore::Double pceny_;
00074   casacore::uInt nx_;
00075   casacore::uInt ny_;
00076   casacore::Double dx_;
00077   casacore::Double dy_;
00078 
00079   // storage for projection
00080   casacore::Matrix<casacore::Double> pdir_;
00081 
00082   // projection parameters computed from input directions
00083   casacore::Vector<casacore::Double> p_center_;
00084   casacore::Vector<casacore::Double> p_size_;
00085 };
00086 
00087 } // end of namespace casa
00088 
00089 #endif /* _SYNTHESYS_POINTING_DIRECTION_PROJECTOR_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1