mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 09:30:05 +00:00 
			
		
		
		
	TDWR range updates
This commit is contained in:
		
							parent
							
								
									732a7e233c
								
							
						
					
					
						commit
						41b491314b
					
				
					 6 changed files with 35 additions and 19 deletions
				
			
		|  | @ -104,13 +104,20 @@ RadarProductManager::coordinates(common::RadialSize radialSize) const | ||||||
| { | { | ||||||
|    switch (radialSize) |    switch (radialSize) | ||||||
|    { |    { | ||||||
|    case common::RadialSize::_0_5Degree: return p->coordinates0_5Degree_; |    case common::RadialSize::_0_5Degree: | ||||||
|    case common::RadialSize::_1Degree: return p->coordinates1Degree_; |       return p->coordinates0_5Degree_; | ||||||
|  |    case common::RadialSize::_1Degree: | ||||||
|  |       return p->coordinates1Degree_; | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    throw std::exception("Invalid radial size"); |    throw std::exception("Invalid radial size"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | float RadarProductManager::gate_size() const | ||||||
|  | { | ||||||
|  |    return (p->radarSite_->type() == "tdwr") ? 150.0f : 250.0f; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| std::shared_ptr<config::RadarSite> RadarProductManager::radar_site() const | std::shared_ptr<config::RadarSite> RadarProductManager::radar_site() const | ||||||
| { | { | ||||||
|    return p->radarSite_; |    return p->radarSite_; | ||||||
|  | @ -133,6 +140,8 @@ void RadarProductManager::Initialize() | ||||||
|    const QMapbox::Coordinate radar(p->radarSite_->latitude(), |    const QMapbox::Coordinate radar(p->radarSite_->latitude(), | ||||||
|                                    p->radarSite_->longitude()); |                                    p->radarSite_->longitude()); | ||||||
| 
 | 
 | ||||||
|  |    const float gateSize = gate_size(); | ||||||
|  | 
 | ||||||
|    // Calculate half degree azimuth coordinates
 |    // Calculate half degree azimuth coordinates
 | ||||||
|    timer.start(); |    timer.start(); | ||||||
|    std::vector<float>& coordinates0_5Degree = p->coordinates0_5Degree_; |    std::vector<float>& coordinates0_5Degree = p->coordinates0_5Degree_; | ||||||
|  | @ -154,7 +163,7 @@ void RadarProductManager::Initialize() | ||||||
|             static_cast<uint16_t>(radialGate / common::MAX_DATA_MOMENT_GATES); |             static_cast<uint16_t>(radialGate / common::MAX_DATA_MOMENT_GATES); | ||||||
| 
 | 
 | ||||||
|          const float  angle  = radial * 0.5f - 0.25f; // 0.5 degree radial
 |          const float  angle  = radial * 0.5f - 0.25f; // 0.5 degree radial
 | ||||||
|          const float  range  = (gate + 1) * 250.0f;   // 0.25km gate size
 |          const float  range  = (gate + 1) * gateSize; | ||||||
|          const size_t offset = radialGate * 2; |          const size_t offset = radialGate * 2; | ||||||
| 
 | 
 | ||||||
|          double latitude; |          double latitude; | ||||||
|  | @ -192,7 +201,7 @@ void RadarProductManager::Initialize() | ||||||
|             static_cast<uint16_t>(radialGate / common::MAX_DATA_MOMENT_GATES); |             static_cast<uint16_t>(radialGate / common::MAX_DATA_MOMENT_GATES); | ||||||
| 
 | 
 | ||||||
|          const float  angle  = radial * 1.0f - 0.5f; // 1 degree radial
 |          const float  angle  = radial * 1.0f - 0.5f; // 1 degree radial
 | ||||||
|          const float  range  = (gate + 1) * 250.0f;  // 0.25km gate size
 |          const float  range  = (gate + 1) * gateSize; | ||||||
|          const size_t offset = radialGate * 2; |          const size_t offset = radialGate * 2; | ||||||
| 
 | 
 | ||||||
|          double latitude; |          double latitude; | ||||||
|  |  | ||||||
|  | @ -30,6 +30,7 @@ public: | ||||||
|    ~RadarProductManager(); |    ~RadarProductManager(); | ||||||
| 
 | 
 | ||||||
|    const std::vector<float>& coordinates(common::RadialSize radialSize) const; |    const std::vector<float>& coordinates(common::RadialSize radialSize) const; | ||||||
|  |    float                     gate_size() const; | ||||||
|    std::shared_ptr<config::RadarSite> radar_site() const; |    std::shared_ptr<config::RadarSite> radar_site() const; | ||||||
| 
 | 
 | ||||||
|    void Initialize(); |    void Initialize(); | ||||||
|  |  | ||||||
|  | @ -60,7 +60,10 @@ public: | ||||||
|        colorTable_ {}, |        colorTable_ {}, | ||||||
|        colorTableLut_ {}, |        colorTableLut_ {}, | ||||||
|        colorTableMin_ {2}, |        colorTableMin_ {2}, | ||||||
|        colorTableMax_ {254} |        colorTableMax_ {254}, | ||||||
|  |        savedColorTable_ {nullptr}, | ||||||
|  |        savedScale_ {0.0f}, | ||||||
|  |        savedOffset_ {0.0f} | ||||||
|    { |    { | ||||||
|       auto it = blockTypes_.find(product); |       auto it = blockTypes_.find(product); | ||||||
| 
 | 
 | ||||||
|  | @ -471,10 +474,14 @@ void Level2ProductView::ComputeSweep() | ||||||
|       const uint16_t dataMomentIntervalH = dataMomentInterval / 2; |       const uint16_t dataMomentIntervalH = dataMomentInterval / 2; | ||||||
| 
 | 
 | ||||||
|       // Compute gate size (number of base 250m gates per bin)
 |       // Compute gate size (number of base 250m gates per bin)
 | ||||||
|       const uint16_t gateSize = std::max<uint16_t>(1, dataMomentInterval / 250); |       const uint16_t gateSizeMeters = | ||||||
|  |          static_cast<uint16_t>(p->radarProductManager_->gate_size()); | ||||||
|  |       const uint16_t gateSize = | ||||||
|  |          std::max<uint16_t>(1, dataMomentInterval / gateSizeMeters); | ||||||
| 
 | 
 | ||||||
|       // Compute gate range [startGate, endGate)
 |       // Compute gate range [startGate, endGate)
 | ||||||
|       const uint16_t startGate = (dataMomentRange - dataMomentIntervalH) / 250; |       const uint16_t startGate = | ||||||
|  |          (dataMomentRange - dataMomentIntervalH) / gateSizeMeters; | ||||||
|       const uint16_t numberOfDataMomentGates = |       const uint16_t numberOfDataMomentGates = | ||||||
|          std::min<uint16_t>(momentData->number_of_data_moment_gates(), |          std::min<uint16_t>(momentData->number_of_data_moment_gates(), | ||||||
|                             static_cast<uint16_t>(gates)); |                             static_cast<uint16_t>(gates)); | ||||||
|  |  | ||||||
|  | @ -40,7 +40,10 @@ public: | ||||||
|        colorTable_ {}, |        colorTable_ {}, | ||||||
|        colorTableLut_ {}, |        colorTableLut_ {}, | ||||||
|        colorTableMin_ {2}, |        colorTableMin_ {2}, | ||||||
|        colorTableMax_ {254} |        colorTableMax_ {254}, | ||||||
|  |        savedColorTable_ {nullptr}, | ||||||
|  |        savedScale_ {0.0f}, | ||||||
|  |        savedOffset_ {0.0f} | ||||||
|    { |    { | ||||||
|    } |    } | ||||||
|    ~Level3RadialViewImpl() = default; |    ~Level3RadialViewImpl() = default; | ||||||
|  | @ -48,7 +51,6 @@ public: | ||||||
|    std::string                                   product_; |    std::string                                   product_; | ||||||
|    std::shared_ptr<manager::RadarProductManager> radarProductManager_; |    std::shared_ptr<manager::RadarProductManager> radarProductManager_; | ||||||
| 
 | 
 | ||||||
|    float                                 selectedElevation_; |  | ||||||
|    std::chrono::system_clock::time_point selectedTime_; |    std::chrono::system_clock::time_point selectedTime_; | ||||||
| 
 | 
 | ||||||
|    std::shared_ptr<wsr88d::rpg::GraphicProductMessage> graphicMessage_; |    std::shared_ptr<wsr88d::rpg::GraphicProductMessage> graphicMessage_; | ||||||
|  | @ -168,11 +170,6 @@ void Level3RadialView::LoadColorTable( | ||||||
|    UpdateColorTable(); |    UpdateColorTable(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Level3RadialView::SelectElevation(float elevation) |  | ||||||
| { |  | ||||||
|    p->selectedElevation_ = elevation; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void Level3RadialView::SelectTime(std::chrono::system_clock::time_point time) | void Level3RadialView::SelectTime(std::chrono::system_clock::time_point time) | ||||||
| { | { | ||||||
|    p->selectedTime_ = time; |    p->selectedTime_ = time; | ||||||
|  | @ -435,8 +432,11 @@ void Level3RadialView::ComputeSweep() | ||||||
|       const uint16_t dataMomentIntervalH = dataMomentInterval / 2; |       const uint16_t dataMomentIntervalH = dataMomentInterval / 2; | ||||||
|       const uint16_t dataMomentRange     = dataMomentIntervalH; |       const uint16_t dataMomentRange     = dataMomentIntervalH; | ||||||
| 
 | 
 | ||||||
|       // Compute gate size (number of base 250m gates per bin)
 |       // Compute gate size (number of base gates per bin)
 | ||||||
|       const uint16_t gateSize = std::max<uint16_t>(1, dataMomentInterval / 250); |       const uint16_t gateSize = std::max<uint16_t>( | ||||||
|  |          1, | ||||||
|  |          dataMomentInterval / | ||||||
|  |             static_cast<uint16_t>(p->radarProductManager_->gate_size())); | ||||||
| 
 | 
 | ||||||
|       // Compute gate range [startGate, endGate)
 |       // Compute gate range [startGate, endGate)
 | ||||||
|       const uint16_t startGate = 0; |       const uint16_t startGate = 0; | ||||||
|  |  | ||||||
|  | @ -37,7 +37,6 @@ public: | ||||||
|    const std::vector<float>&             vertices() const override; |    const std::vector<float>&             vertices() const override; | ||||||
| 
 | 
 | ||||||
|    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; |    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; | ||||||
|    void SelectElevation(float elevation) override; |  | ||||||
|    void SelectTime(std::chrono::system_clock::time_point time) override; |    void SelectTime(std::chrono::system_clock::time_point time) override; | ||||||
|    void Update() override; |    void Update() override; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -35,8 +35,8 @@ static const std::unordered_map<int16_t, uint16_t> rangeMap_ { | ||||||
|    {151, 230}, {153, 460}, {154, 300}, {155, 300}, {159, 300}, {161, 300}, |    {151, 230}, {153, 460}, {154, 300}, {155, 300}, {159, 300}, {161, 300}, | ||||||
|    {163, 300}, {165, 300}, {166, 230}, {167, 300}, {168, 300}, {169, 230}, |    {163, 300}, {165, 300}, {166, 230}, {167, 300}, {168, 300}, {169, 230}, | ||||||
|    {170, 230}, {171, 230}, {172, 230}, {173, 230}, {174, 230}, {175, 230}, |    {170, 230}, {171, 230}, {172, 230}, {173, 230}, {174, 230}, {175, 230}, | ||||||
|    {176, 230}, {177, 230}, {178, 300}, {179, 300}, {180, 90},  {181, 90}, |    {176, 230}, {177, 230}, {178, 300}, {179, 300}, {180, 89},  {181, 89}, | ||||||
|    {182, 90},  {184, 90},  {186, 415}, {193, 460}, {195, 460}, {196, 50}}; |    {182, 89},  {184, 89},  {186, 412}, {193, 460}, {195, 460}, {196, 50}}; | ||||||
| 
 | 
 | ||||||
| static const std::unordered_map<int16_t, uint16_t> xResolutionMap_ { | static const std::unordered_map<int16_t, uint16_t> xResolutionMap_ { | ||||||
|    {19, 1000},  {20, 2000},  {27, 1000},  {30, 1000},  {31, 2000},  {32, 1000}, |    {19, 1000},  {20, 2000},  {27, 1000},  {30, 1000},  {31, 2000},  {32, 1000}, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat