#ifndef SUNSENSORREGION_H_ #define SUNSENSORREGION_H_ // //----------------------------------------------------------------------- /// @copyright /// (c) Copyright 2007 by GATS, Inc., /// 11864 Canon Blvd, Suite 101, Newport News VA 23606 /// /// All Rights Reserved. No part of this software or publication may be /// reproduced, stored in a retrieval system, or transmitted, in any form /// or by any means, electronic, mechanical, photocopying, recording, or /// otherwise without the prior written permission of GATS, Inc. /// //----------------------------------------------------------------------- /// /// @file SunSensorRegion.h /// /// @author John Burton /// /// @date Mon Oct 29 11:46:10 2007 /// //----------------------------------------------------------------------- // //----------------------------------------------------------------------- // Include Files: //----------------------------------------------------------------------- // #include "EventVar.h" // //----------------------------------------------------------------------- // Constants, Defines, Macros and Type Definitions: //----------------------------------------------------------------------- // enum ROI_Type { NO_ROI, // Region of Interest not set X_ROI, // Region of Interest for X (top/bottom) Solar Edges Y_ROI, // Region of Interest for Y (left/right) Solar Edges C_ROI, // Region of Interest for Center Sums }; // //----------------------------------------------------------------------- // Global Variables: //----------------------------------------------------------------------- // // //----------------------------------------------------------------------- // Class Definition: //----------------------------------------------------------------------- // class SunSensorRegion { // //----------------------------------------------------------------------- // Private Members: //----------------------------------------------------------------------- // private: int XLow_; int XHigh_; int XInc_; int XLen_; int YLow_; int YHigh_; int YInc_; int YLen_; double XCenter_; double YCenter_; ROI_Type Type_; // EventVar *sums_; EventVar *sums_; EventVar *ave_; EventVar *locs_; double edge_; void calcROI(double ctr, int len, int inc_2, int &lo, int &hi, int &inc); void correctXSums(EventVar &rel_resp); void correctYSums(EventVar &rel_resp); void correctCntrSums(EventVar &rel_resp); double correctXEdge(double threshold); double correctYEdge(double threshold); // //----------------------------------------------------------------------- // Protected Members: //----------------------------------------------------------------------- // protected: // //----------------------------------------------------------------------- // Public Members: //----------------------------------------------------------------------- // public: SunSensorRegion(); SunSensorRegion(double x, double y, ROI_Type type); SunSensorRegion(double x, double y, EventVar Sums, ROI_Type type); virtual ~SunSensorRegion(); void initRegion(double x, double y, ROI_Type type); void initRegion(double x, double y, EventVar Sums, ROI_Type type); void setROI(double x, double y, ROI_Type type); std::vector getXLimits(); std::vector getYLimits(); EventVar getXLocs(); EventVar getYLocs(); std::vector getXLocations(); std::vector getYLocations(); std::vector getSumsRows(); std::vector getSumsColumns(); int getXLength() { return XLen_; }; int getYLength() { return YLen_; }; int getXCenter() { return (int)round(XCenter_); }; int getYCenter() { return (int)round(YCenter_); }; double d_getXCenter() { return XCenter_; }; double d_getYCenter() { return YCenter_; }; ROI_Type getROIType() { return Type_; }; void correctIntensities(EventVar &Int, EventVar &Cnt); void correctIntegration(double factor); void correctSums(EventVar &rel_resp); void correctEdge(double threshold); EventVar getAveIntensity() { return *ave_; }; EventVar getSums() { return *sums_; }; EventVar getLocs() { return *locs_; }; double getEdge() { return edge_; }; }; // end class SunSensorRegion #endif