-
Notifications
You must be signed in to change notification settings - Fork 153
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
Need a 'What is above me now' view #3
Comments
The satcruncher webworker has the framework for az, el, and range calculations from a lat long. You could modify the satcruncher to have a binary "inview" variable and then change the colorscheme to highlight things that are "inview". |
Hi @jensenbox - were you able to solve this? I need this view as well. I looked at @thkruz suggestion, but I cannot see how I would write that in the satcruncher unfortunately. |
Let me be more detailed on my earlier response: Below the declaration for satPos, add the following and adjust to your needs: Below Add the following code: That will allow you to calculate AER for each satellite relative to your lat/long. From there you could add an if statement along the lines of:
NOTE: You will need to create a new array both in sat.js and sat-cruncher.js to pass back and forth. Then you would need to create a new if statement in color-scheme.js to change the object's color. Let me know if you hit any more road blocks. I forked this project at https://github.com/thkruz/keeptrack.space/ and have the code for this included if you need a reference point (copying and pasting it will almost surely fail). There is simply no way around these changes for what you are asking for. If you don't want to/can't then it might be best to look for another library to do the calculations on-demand instead of in the webworker. Best of luck. PS. Geolocation requires https in most modern browsers. |
Thank you @thkruz ! This worked like a charm, just one question then: how would I access the satellites id or type from here? if (elevation >= 0 && rangeSat < 2000) { thank you so much! |
@louiselessel you can add
to satcruncher around line 19 (put the function towards the bottom if you want).. Now you can use the SCC_NUM property to filter inside satcruncher AND it will get passed back to satSet so that you can use it inside the main program too. Something like
It is probably more optimal to push "i" or satCache[i].SCC_NUM instead of the whole satCache[i] object since the satCache exists in satSet.js as well with the same id and SCC_NUM properties. The postMessage call can be resource intensive on slower machines. I pad 0s and use strings for consistency sake when dealing with other external databases that may or may not call 00005 instead of 5. |
Thank you @thkruz. |
Use the geolocation of the browser to assist - either by IP or just the standard HTML5 sensor.
The text was updated successfully, but these errors were encountered: