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 for FindSpan #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cecomp64
Copy link

@cecomp64 cecomp64 commented Mar 5, 2023

FindSpan would fail when the first altitude was less than the target altitude. Fix by starting the loop at altitude index 1 instead of 0.

FindSpan would fail when the first altitude was less than the target
altitude.  Fix by starting the loop at altitude index 1 instead of 0.
@tcpalmer
Copy link
Owner

tcpalmer commented Mar 6, 2023

Hey - do you have a testcase that can reproduce the problem? Thanks -

@cecomp64
Copy link
Author

cecomp64 commented Mar 6, 2023

Yeah, I think if you select M 31 as the target, let the coordinates populate, set the date to 3/5/2023, and the number of days to 7, and click on the button for the daily report, you should see the exception in the log, and no output on the plug-in page. (sorry if the terminology is inaccurate, I’m not at my computer right now)

I believe I also tried the date 12/15/2022 with the same M 31 target and got the same results. Oh, and latitude and longitude were somewhere in the northern hemisphere. I’ll have to check what it was exactly this evening. I just got the coordinates from the ASCOM telescope simulator.

@tcpalmer
Copy link
Owner

tcpalmer commented Mar 6, 2023 via email

@cecomp64
Copy link
Author

cecomp64 commented Mar 7, 2023

Here's some more details:

lat: 51.079
long: -0.294
elevation: 487.0
(no custom horizon)

Here's the text of the exception:

2023-03-06T16:23:51.2604|ERROR|TargetPlanning.cs|ShowDailyDetails|381|daily details exception: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')    at System.Collections.Generic.List`1.get_Item(Int32 index)
   at TargetPlanning.NINAPlugin.Astrometry.Altitudes.FindSpan(Double targetAltitude, Boolean descending)
   at TargetPlanning.NINAPlugin.Astrometry.NighttimeCircumstances.DetectAltitudeEvent(Altitudes altitudes, Double targetAltitude, Boolean descending)
   at TargetPlanning.NINAPlugin.Astrometry.NighttimeCircumstances.Calculate()
   at TargetPlanning.NINAPlugin.Astrometry.NighttimeCircumstances..ctor(ObserverInfo observerInfo, DateTime onDate, Int32 twilightInclude)
   at TargetPlanning.NINAPlugin.Astrometry.PlanGenerator.GetNighttimeCircumstances(DateTime startDate, Int32 planDays, ObserverInfo observerInfo, Int32 twilightInclude, CancellationToken token)
   at TargetPlanning.NINAPlugin.Astrometry.PlanGenerator.Generate(CancellationToken token)
   at TargetPlanning.NINAPlugin.TargetPlanningPlugin.<ShowDailyDetails>b__93_0()

Attached is a screenshot of my other TargetPlanning settings:

TargetPlanningParameters

Click 'Daily Details' to reproduce. This was on NINA 3.0.0.1015-nightly

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