Closed JaniniRami closed 3 years ago
It sounds like there's a problem in your code that is causing an infinite loop. Double check the stop condition and make sure it is indeed exiting. I'm using a similar looping strategy with own library and it works fine and is very fast.
One second intervals will get you a pretty nice ground track, except at extreme polar latitudes on Mercator projection maps, which have more map distortion and need <1s intervals for a slightly smoother-looking line at those latitudes.
I regularly do the whole catalog on a one second loop, so I agree with @davidcalhoun that your issue is that it isn't exiting. If you post your current code then I'd be happy to take a look.
I'd recommend interpolating between 250 or 500 millisecond measurements if you really want that level of detail - but as was said, you probably don't need that except in really specific cases. What are you trying to accomplish?
I felt that my function for predicting the position for every second in the day is wrong so I didn't include it in the issue, but ill include it now as you asked to see it, I hope I can get some feedback of what is the proper way to do it.
@thkruz I am trying to get a list of lat/lon for the ISS throughout the day to plot them on a map creating a ground track look alike map.
Two things that jump out (I can do some more testing when I get home):
Comment out the console.log and try again. You should instead do something like this:
Put this outside the loop.
var positionArray = [];
And this at the bottom
positionArray.push(position);
}
console.log(positionArray)
Second, lesser thing, is that having the var statements INSIDE the loop is going to cause new objects to be created every time. I would declare all your variables at the top ie:
var positionAndVelocity, positionEci, ... etc
and the just change the values inside the loop so that it reuses those objects over and over.
@thkruz I am trying to get a list of lat/lon for the ISS throughout the day to plot them on a map creating a ground track look alike map.
Then @davidcalhoun is definitely correct that you do not need millisecond intervals. Try 500 milliseconds and see if you like the results. A more complete solution would change i to increment by 1000 unless the current latitude > 80 || < -80 and then increment by 250.
Thank you so much, removing the vars and declaring them outside the function made it work, Also thanks for the advice I will try to use milliseconds instead of seconds and see how they compare in accuracy!
Hey, I was trying to generate a list containing the lat/lon of the ISS in every second (preferably millisecond) of the day, I tried to do this and ended up crashing my browser, is there any efficient way to do so without crashing my browser?