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 to 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 passing time. However, this passing time varies over time, so this method is not that accurate, and it is dependent on the geographical positions.
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 check this stream of geographical positions and times, and discover which belongs to each passing?
I'm working with Python and SQLite.
Aucun commentaire:
Enregistrer un commentaire