I've god some satellite data which essentially is the geographical position of a satellite that circles the earth at a given time. This is data saved with a latitude, longitude and unixtime in a SQLite DB. This is retrieved as following:
latitudes = [] #Long list of latitudes
longitudes = [] #Long list of longitudes
unixtimes = [] #Long list of corresponding unixtimes
So, I'm interested to distinguish the latitude/longitude recordings for each time the satellite is over a fairly large geographical area (for each passing). However I'm unsure on how I would do this.
Now I've manually, by visual inspection of the plots of the position, found the first 'occurrence' of the satellite in that area, then I have found the next occurrence in the same way. The passing time is then the difference between each of those events. However, this passing time varies over time, so this method is not that accurate over time. An other problem is that it is dependent on the geographical positions, If I want the time of the first passing, and the passing time for any other geographical position I have to manually inspect once again. I've included my code. Note that the seq
function is simply a function I've retrieved from SO that gives me the ability to iterate over non-integer increments.
def seq(start, end, step):
assert(step != 0)
sample_count = abs(end - start) / step
return itertools.islice(itertools.count(start, step), sample_count)
gridsize = 5 #Unit: degrees
upperleftlong = #Upper corner of geographical area
upperleftlat = #Upper corner of geographical area
lowerrightlong = #Lower corner of geographical area
lowerrightlat = #Lower corner of geographical area
passrate = 5500 #Time between passings in seconds
start = 1498902400 #Time of first passing
end = 1498905700 #Approximately passing length
numberofpassings = 600 #Number of passings that should be checked for
for p in range(0,numberofpassings+1):
start = 1398903400+passrate*p
end = 1398905400+passrate*p
for i in seq(lowerrightlat, upperleftlat+gridsize, gridsize):
for j in seq(upperleftlong, lowerrightlong+gridsize, gridsize):
positions = getPositionsFromDB(j,i,start,end,gridsize,databasepath, con)
So, does anyone have a clever way to signify passing rate, passing time and discover which geographical positions that belongs to each passing?
I'm working with Python and SQLite.