mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:00:05 +00:00 
			
		
		
		
	Use more precise latitude/longitude of radar when determining distance and azimuth
This commit is contained in:
		
							parent
							
								
									a2f2181f1b
								
							
						
					
					
						commit
						20191dce07
					
				
					 1 changed files with 15 additions and 11 deletions
				
			
		|  | @ -512,18 +512,22 @@ Level3RadialView::GetBinLevel(const common::Coordinate& coordinate) const | ||||||
|       return std::nullopt; |       return std::nullopt; | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |    auto         radarProductManager = radar_product_manager(); | ||||||
|  |    auto         radarSite           = radarProductManager->radar_site(); | ||||||
|  |    const double radarLatitude       = radarSite->latitude(); | ||||||
|  |    const double radarLongitude      = radarSite->longitude(); | ||||||
|  | 
 | ||||||
|    // Determine distance and azimuth of coordinate relative to radar location
 |    // Determine distance and azimuth of coordinate relative to radar location
 | ||||||
|    double s12;  // Distance (meters)
 |    double s12;  // Distance (meters)
 | ||||||
|    double azi1; // Azimuth (degrees)
 |    double azi1; // Azimuth (degrees)
 | ||||||
|    double azi2; // Unused
 |    double azi2; // Unused
 | ||||||
|    util::GeographicLib::DefaultGeodesic().Inverse( |    util::GeographicLib::DefaultGeodesic().Inverse(radarLatitude, | ||||||
|       descriptionBlock->latitude_of_radar(), |                                                   radarLongitude, | ||||||
|       descriptionBlock->longitude_of_radar(), |                                                   coordinate.latitude_, | ||||||
|       coordinate.latitude_, |                                                   coordinate.longitude_, | ||||||
|       coordinate.longitude_, |                                                   s12, | ||||||
|       s12, |                                                   azi1, | ||||||
|       azi1, |                                                   azi2); | ||||||
|       azi2); |  | ||||||
| 
 | 
 | ||||||
|    if (std::isnan(azi1)) |    if (std::isnan(azi1)) | ||||||
|    { |    { | ||||||
|  | @ -553,11 +557,11 @@ Level3RadialView::GetBinLevel(const common::Coordinate& coordinate) const | ||||||
|    // Find Radial
 |    // Find Radial
 | ||||||
|    const std::uint16_t numRadials = radialData->number_of_radials(); |    const std::uint16_t numRadials = radialData->number_of_radials(); | ||||||
|    std::uint16_t       radial     = numRadials; |    std::uint16_t       radial     = numRadials; | ||||||
|    float               nextAngle  = radialData->start_angle(0); |    double              nextAngle  = radialData->start_angle(0); | ||||||
|    for (std::uint16_t i = 0; i < numRadials; ++i) |    for (std::uint16_t i = 0; i < numRadials; ++i) | ||||||
|    { |    { | ||||||
|       float startAngle = nextAngle; |       double startAngle = nextAngle; | ||||||
|       nextAngle        = radialData->start_angle((i + 1) % numRadials); |       nextAngle         = radialData->start_angle((i + 1) % numRadials); | ||||||
| 
 | 
 | ||||||
|       if (startAngle < nextAngle) |       if (startAngle < nextAngle) | ||||||
|       { |       { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat