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

Smoothing crashes on particular days; 'Newton Curve Issue' #295

Open
hjabbot opened this issue Sep 23, 2024 · 0 comments
Open

Smoothing crashes on particular days; 'Newton Curve Issue' #295

hjabbot opened this issue Sep 23, 2024 · 0 comments
Labels
Bug It might be considered a bug...

Comments

@hjabbot
Copy link
Collaborator

hjabbot commented Sep 23, 2024

Describe the bug
PolarRoute crashes with particular datasets, probably something to do with current vectors exceeding possible vessel speeds since it pops up most with gliders, however attached is a crash experiences using the SDA as the vehicle. In the cases I was testing when I stumbled on this, I was aggregating 3 days of data for each day of a month. 2 runs failed, and they did not have overlapping days. Other runs around the failing days were ok, so this problem isn't to do with a single day's dataset, but rather the values after aggregating; probably a combination of high SIC and high currents.

In doing these tests, it dawned on me that we should be saving outputs for successfully navigated routes. All but one of the calculated routes were successful, but because one crashed, nothing was saved out.

This bug appears both on main and on 0.6.x

To Reproduce
I have provided the set of configs that fails below. Crashes during smoothing.

Screenshots & Files
2024-01-06_amsr_failing_case.zip

Traceback (most recent call last):
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/venv_dev/bin/optimise_routes", line 8, in <module>
    sys.exit(optimise_routes_cli())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/utils.py", line 238, in wrapper
    res = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/cli.py", line 202, in optimise_routes_cli
    smoothed_routes = rp.compute_smoothed_routes()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/utils.py", line 238, in wrapper
    res = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/route_planner/route_planner.py", line 700, in compute_smoothed_routes
    sf.forward()
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/route_planner/crossing_smoothing.py", line 1334, in forward
    midpoint_prime = self.newton_smooth(ap.start, ap.end, ap.case, firstpoint, midpoint, lastpoint)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/route_planner/crossing_smoothing.py", line 674, in newton_smooth
    midpoint = self._long_case(start, end, case, firstpoint, midpoint, lastpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/route_planner/crossing_smoothing.py", line 481, in _long_case
    y           = newton_optimisation_long(_F, y0, x, a, Y, u1, v1, u2, v2, speed_s, speed_e, Rd, λ_s, φ_r)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/habbot/Documents/Work/BAS/repos/sdadt/PolarRoute/polar_route/route_planner/crossing_smoothing.py", line 381, in newton_optimisation_long
    raise Exception('Newton Curve Issue - Longitude Case')
Exception: Newton Curve Issue - Longitude Case

@hjabbot hjabbot added the Bug It might be considered a bug... label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be considered a bug...
Projects
None yet
Development

No branches or pull requests

1 participant