Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix negative radar elevations being reported as large possitive elevations #387

Merged

Conversation

AdenKoperczak
Copy link
Contributor

Properly report negative level II elevations.

Fix was based on this note from ICD FOR RDA/RPG - Build RDA 23.0/RPG 23.0 (PDF) section 3.2.4.3.

NOTE: Elevation angles greater than 90 degrees will be interpreted as a negative angle and the actual elevation angle will be computed as the angle value minus 360 degrees.

I moved the conversion logic from Ar2vFile::GetElevationScan to Ar2vFileImpl::IndexFile. This mainly causes the negative elevations to be sorted before the positive ones, rather than at the end. It may take more memory to store the elevations as floats rather than uint16_t's, but there are only a few elevation records and I believe only a few Ar2vFile objects should exist at any time. (It also decreases the number of conversions that happen, but I do not believe that is a huge deal.) I could convert the angle to a int16_t in Ar2vFileImpl::IndexFile, then to a float in Ar2vFile::GetElevationScan, but I thought that would not be worth the complexity.

@dpaulat dpaulat merged commit db6ff3e into dpaulat:develop Mar 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants