Giter VIP home page Giter VIP logo

Comments (4)

thkruz avatar thkruz commented on June 26, 2024

// Or you can use a JavaScript Date
var positionAndVelocity = satellite.propagate(satrec, new Date());

Create a Date variable passTime = new Date(year, month, day, hours, minutes, seconds, milliseconds);
Then use var positionAndVelocity = satellite.propagate(satrec, passTime); instead.

As for changing your location...

// Set the Observer at 122.03 West by 36.96 North, in RADIANS
var observerGd = {
longitude: satellite.degreesToRadians(-122.0308),
latitude: satellite.degreesToRadians(36.9613422),
height: 0.370
};

Just change those values to the location you want to use.

It's that simple! Let me know if you need anything clarified or have more questions.

from satellite-js.

pkrasicki avatar pkrasicki commented on June 26, 2024

Thanks, but in my case I don't know the date. I need to know when the satellite will be passing nearby my location. I want to know when I will be able to observe it from my position :).

Something like this site: https://spotthestation.nasa.gov/sightings/view.cfm?country=France&region=None&city=Paris. It gives you a list of dates when ISS will be visible from a given city.

from satellite-js.

thkruz avatar thkruz commented on June 26, 2024

This is done through iteration. I don't have a code editor available and probably have a glaring error, but conceptually:

// Set Start Time
passTime = new Date(year, month, day, hours, minutes, seconds, milliseconds);
// Loop at 30 second intervals for 1 day
for (timeAdjust = 0; timeAdjust < 2880; timeAdjust++) {
    passTime = passTime + (timeAdjust * 30) // Add 30 seconds this loop
    positionAndVelocity = satellite.propagate(satrec, passTime);
     ...
     if (elevation > 10) {
           // Do stuff for visible passes like adding it to a table
      }
}

There are things you can do to reduce the time this loop takes, like skipping ahead in time after an object leaves field of view, but there is no way around guess-and-check.

from satellite-js.

pkrasicki avatar pkrasicki commented on June 26, 2024

Thank you! That's what I needed.

from satellite-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.