mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:50:05 +00:00 
			
		
		
		
	Start angle should properly reflect the edge of the bin instead of the middle
This commit is contained in:
		
							parent
							
								
									fe76cd67d0
								
							
						
					
					
						commit
						bb0419aa3e
					
				
					 3 changed files with 31 additions and 61 deletions
				
			
		|  | @ -440,7 +440,7 @@ void RadarProductManager::Initialize() | ||||||
|          const uint16_t radial = |          const uint16_t radial = | ||||||
|             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.5 degree radial
 | ||||||
|          const float  range  = (gate + 1) * gateSize; |          const float  range  = (gate + 1) * gateSize; | ||||||
|          const size_t offset = radialGate * 2; |          const size_t offset = radialGate * 2; | ||||||
| 
 | 
 | ||||||
|  | @ -477,7 +477,7 @@ void RadarProductManager::Initialize() | ||||||
|          const uint16_t radial = |          const uint16_t radial = | ||||||
|             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; // 1 degree radial
 | ||||||
|          const float  range  = (gate + 1) * gateSize; |          const float  range  = (gate + 1) * gateSize; | ||||||
|          const size_t offset = radialGate * 2; |          const size_t offset = radialGate * 2; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -738,51 +738,38 @@ void Level2ProductViewImpl::ComputeCoordinates( | ||||||
|    auto radials = boost::irange<std::uint32_t>(0u, numRadials); |    auto radials = boost::irange<std::uint32_t>(0u, numRadials); | ||||||
|    auto gates   = boost::irange<std::uint32_t>(0u, numRangeBins); |    auto gates   = boost::irange<std::uint32_t>(0u, numRangeBins); | ||||||
| 
 | 
 | ||||||
|    std::for_each( |    std::for_each(std::execution::par_unseq, | ||||||
|       std::execution::par_unseq, |                  radials.begin(), | ||||||
|       radials.begin(), |                  radials.end(), | ||||||
|       radials.end(), |                  [&](std::uint32_t radial) | ||||||
|       [&](std::uint32_t radial) |                  { | ||||||
|       { |                     const float angle = (*radarData)[radial]->azimuth_angle(); | ||||||
|          // Angles are ordered clockwise, delta should be positive. Only correct
 |  | ||||||
|          // less than -90 degrees, this should cover any "overlap" scenarios.
 |  | ||||||
|          float deltaAngle = |  | ||||||
|             (radial == 0) ? (*radarData)[0]->azimuth_angle() - |  | ||||||
|                                (*radarData)[numRadials - 1]->azimuth_angle() : |  | ||||||
|                             (*radarData)[radial]->azimuth_angle() - |  | ||||||
|                                (*radarData)[radial - 1]->azimuth_angle(); |  | ||||||
|          while (deltaAngle < -90.0f) |  | ||||||
|          { |  | ||||||
|             deltaAngle += 360.0f; |  | ||||||
|          } |  | ||||||
| 
 | 
 | ||||||
|          const float angle = |                     std::for_each(std::execution::par_unseq, | ||||||
|             (*radarData)[radial]->azimuth_angle() - (deltaAngle * 0.5f); |                                   gates.begin(), | ||||||
|  |                                   gates.end(), | ||||||
|  |                                   [&](std::uint32_t gate) | ||||||
|  |                                   { | ||||||
|  |                                      const std::uint32_t radialGate = | ||||||
|  |                                         radial * common::MAX_DATA_MOMENT_GATES + | ||||||
|  |                                         gate; | ||||||
|  |                                      const float range = (gate + 1) * gateSize; | ||||||
|  |                                      const std::size_t offset = radialGate * 2; | ||||||
| 
 | 
 | ||||||
|          std::for_each(std::execution::par_unseq, |                                      double latitude; | ||||||
|                        gates.begin(), |                                      double longitude; | ||||||
|                        gates.end(), |  | ||||||
|                        [&](std::uint32_t gate) |  | ||||||
|                        { |  | ||||||
|                           const std::uint32_t radialGate = |  | ||||||
|                              radial * common::MAX_DATA_MOMENT_GATES + gate; |  | ||||||
|                           const float       range  = (gate + 1) * gateSize; |  | ||||||
|                           const std::size_t offset = radialGate * 2; |  | ||||||
| 
 | 
 | ||||||
|                           double latitude; |                                      geodesic.Direct(radarLatitude, | ||||||
|                           double longitude; |                                                      radarLongitude, | ||||||
|  |                                                      angle, | ||||||
|  |                                                      range, | ||||||
|  |                                                      latitude, | ||||||
|  |                                                      longitude); | ||||||
| 
 | 
 | ||||||
|                           geodesic.Direct(radarLatitude, |                                      coordinates_[offset]     = latitude; | ||||||
|                                           radarLongitude, |                                      coordinates_[offset + 1] = longitude; | ||||||
|                                           angle, |                                   }); | ||||||
|                                           range, |                  }); | ||||||
|                                           latitude, |  | ||||||
|                                           longitude); |  | ||||||
| 
 |  | ||||||
|                           coordinates_[offset]     = latitude; |  | ||||||
|                           coordinates_[offset + 1] = longitude; |  | ||||||
|                        }); |  | ||||||
|       }); |  | ||||||
|    timer.stop(); |    timer.stop(); | ||||||
|    logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws")); |    logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws")); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -454,24 +454,7 @@ void Level3RadialViewImpl::ComputeCoordinates( | ||||||
|                  radials.end(), |                  radials.end(), | ||||||
|                  [&](std::uint32_t radial) |                  [&](std::uint32_t radial) | ||||||
|                  { |                  { | ||||||
|                     float deltaAngle; |                     const float angle = radialData->start_angle(radial); | ||||||
|                     if (radial == 0) |  | ||||||
|                     { |  | ||||||
|                        // Angles are ordered clockwise, delta should be positive
 |  | ||||||
|                        deltaAngle = radialData->start_angle(0) - |  | ||||||
|                                     radialData->start_angle(numRadials - 1); |  | ||||||
|                        while (deltaAngle < 0.0f) |  | ||||||
|                        { |  | ||||||
|                           deltaAngle += 360.0f; |  | ||||||
|                        } |  | ||||||
|                     } |  | ||||||
|                     else |  | ||||||
|                     { |  | ||||||
|                        deltaAngle = radialData->delta_angle(radial); |  | ||||||
|                     } |  | ||||||
| 
 |  | ||||||
|                     const float angle = |  | ||||||
|                        radialData->start_angle(radial) - (deltaAngle * 0.5f); |  | ||||||
| 
 | 
 | ||||||
|                     std::for_each(std::execution::par_unseq, |                     std::for_each(std::execution::par_unseq, | ||||||
|                                   gates.begin(), |                                   gates.begin(), | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat