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

Add More SRF Checks #23

Merged
merged 2 commits into from
Feb 25, 2025
Merged

Add More SRF Checks #23

merged 2 commits into from
Feb 25, 2025

Conversation

lispandfound
Copy link
Contributor

@lispandfound lispandfound commented Feb 25, 2025

After the discovery of Cesear's SRF bug, I thought it prudent to introduce more SRF checks to catch future bugs like this before they reach EMOD3D. Here are the additional quick checks I've added:

  1. Check that there are no NaN values in the SRF.
  2. Check that -90 <= lat <= 90 and -180 <= lon <= 180 for all points in the srf.
  3. Check that the original SRF geometry can be extracted.

The last check invokes the .planes property to which constructs source modelling Plane objects. The Plane constructor checks that source modelling does apply here. This means SRFs meeting the above three criteria, but specifying a group of points that do not form a plane will be rejected.

Additionally, I have fixed the SRF magnitude check. This check ensures that the magnitude in the SRF matches the magnitude in the realisation file. This was broken because I wasn't calculating SRF magnitude correctly due to a simple mistake. I have corrected this mistake, and testing the ~100 alpine realisation SRFs generated for Brendon a few weeks ago I now get passes for all of them.

@lispandfound lispandfound merged commit 6984575 into pegasus Feb 25, 2025
6 checks passed
@lispandfound
Copy link
Contributor Author

Bypassed merge rules because they appeared not to work.

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.

3 participants