src/radiance/AnnualIlluminanceMap.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef RADIANCE_ANNUALILLUMINANCEMAP_HPP | ||
| 7 | #define RADIANCE_ANNUALILLUMINANCEMAP_HPP | ||
| 8 | |||
| 9 | #include "RadianceAPI.hpp" | ||
| 10 | |||
| 11 | #include "../utilities/data/Vector.hpp" | ||
| 12 | #include "../utilities/data/Matrix.hpp" | ||
| 13 | #include "../utilities/time/DateTime.hpp" | ||
| 14 | #include "../utilities/core/Logger.hpp" | ||
| 15 | #include "../utilities/core/Path.hpp" | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | namespace radiance { | ||
| 19 | |||
| 20 | /** AnnualIlluminanceMap represents illuminance map for an entire year. | ||
| 21 | * We assume that the output files is from SPOT, with length in meters and illuminance | ||
| 22 | * values in footcandles. All illuminance values are converted to lux. | ||
| 23 | */ | ||
| 24 | class RADIANCE_API AnnualIlluminanceMap | ||
| 25 | { | ||
| 26 | private: | ||
| 27 | // map of DateTime to Matrix (illuminance map) | ||
| 28 | using DateTimeIlluminanceMap = std::map<openstudio::DateTime, openstudio::Matrix>; | ||
| 29 | |||
| 30 | public: | ||
| 31 | /// default constructor | ||
| 32 | AnnualIlluminanceMap(); | ||
| 33 | |||
| 34 | /// constructor with path | ||
| 35 | AnnualIlluminanceMap(const openstudio::path& path); | ||
| 36 | |||
| 37 | /// virtual destructor | ||
| 38 | 15 | virtual ~AnnualIlluminanceMap() = default; | |
| 39 | |||
| 40 | /// get the dates and times for which illuminance maps are available | ||
| 41 | openstudio::DateTimeVector dateTimes() const { | ||
| 42 | return m_dateTimes; | ||
| 43 | } | ||
| 44 | //openstudio::DateTime::ConstVec dateTimes() const {return openstudio::DateTime::ConstVec(m_dateTimes.begin(), m_dateTimes.end());} | ||
| 45 | |||
| 46 | /// get the x points corresponding to illuminance matrix columns in meters | ||
| 47 | openstudio::Vector xVector() const { | ||
| 48 | return m_xVector; | ||
| 49 | } | ||
| 50 | |||
| 51 | /// get the y points corresponding to illuminance matrix rows in meters | ||
| 52 | openstudio::Vector yVector() const { | ||
| 53 | return m_yVector; | ||
| 54 | } | ||
| 55 | |||
| 56 | /// get the illuminance map in lux corresponding to date and time | ||
| 57 | openstudio::Matrix illuminanceMap(const openstudio::DateTime& dateTime) const; | ||
| 58 | |||
| 59 | private: | ||
| 60 | − | REGISTER_LOGGER("radiance.AnnualIlluminanceMap"); | |
| 61 | |||
| 62 | void init(const openstudio::path& path); | ||
| 63 | |||
| 64 | openstudio::DateTimeVector m_dateTimes; | ||
| 65 | openstudio::Vector m_xVector; | ||
| 66 | openstudio::Vector m_yVector; | ||
| 67 | openstudio::Matrix m_nullIlluminanceMap; // used when there is no data | ||
| 68 | DateTimeIlluminanceMap m_dateTimeIlluminanceMap; | ||
| 69 | }; | ||
| 70 | |||
| 71 | } // namespace radiance | ||
| 72 | } // namespace openstudio | ||
| 73 | |||
| 74 | #endif //RADIANCE_ANNUALILLUMINANCEMAP_HPP | ||
| 75 |