[Gpredict-svn] SF.net SVN: gpredict:[436] trunk/data/satdata
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2009-09-26 10:00:31
|
Revision: 436 http://gpredict.svn.sourceforge.net/gpredict/?rev=436&view=rev Author: csete Date: 2009-09-26 10:00:22 +0000 (Sat, 26 Sep 2009) Log Message: ----------- Moved script into own folder. Added Paths: ----------- trunk/data/satdata/scripts/ trunk/data/satdata/scripts/convert.py Removed Paths: ------------- trunk/data/satdata/convert.py Deleted: trunk/data/satdata/convert.py =================================================================== --- trunk/data/satdata/convert.py 2009-09-25 13:08:05 UTC (rev 435) +++ trunk/data/satdata/convert.py 2009-09-26 10:00:22 UTC (rev 436) @@ -1,68 +0,0 @@ -#!/usr/bin/python -# -# This script was used to convert Celestrak TLE files into individual .sat and .cat files -# -import os -import string - - -# For each input file -for file in os.listdir("./in/"): - - print file - - # open TLE file for reading - tlefile = open('./in/'+file, 'r') - - # create category file - category = "./out/"+file.partition(".")[0]+".cat" - catfile = open(category, 'w') - - while 1: - # read three lines at a time; strip trailing whitespaces - line1 = tlefile.readline().strip() - if not line1: break - line2 = tlefile.readline().strip() - line3 = tlefile.readline().strip() - - # catalog number; strip leading zeroes - catnum = line2[2:7].lstrip('0') - print " ... "+catnum - - # add satellite to category - catfile.write(catnum+'\n') - - # satellite file - satfile = open('./tmp/'+catnum+'.sat','w') - - satfile.write('VERSION=1.1\n') - satfile.write('NAME='+line1+'\n') - satfile.write('NICKNAME='+line1+'\n') - satfile.write('TLE1='+line2+'\n') - satfile.write('TLE2='+line3+'\n') - - satfile.close() - - # close TLE and CAT files - tlefile.close() - catfile.close() - -# now package the .sat files into one .dat file -datfile = open('./out/satellites.dat', 'w') -for file in os.listdir("./tmp/"): - - # open .sat file - satfile = open("./tmp/"+file, "r") - - # Create fake config group of catnum - catnum = file.partition(".")[0] - datfile.write("\n["+catnum+"]\n") - - # read lines from satfile and write them to datfile - text = satfile.readlines() - datfile.writelines(text) - - satfile.close(); - -datfile.close() - Copied: trunk/data/satdata/scripts/convert.py (from rev 435, trunk/data/satdata/convert.py) =================================================================== --- trunk/data/satdata/scripts/convert.py (rev 0) +++ trunk/data/satdata/scripts/convert.py 2009-09-26 10:00:22 UTC (rev 436) @@ -0,0 +1,68 @@ +#!/usr/bin/python +# +# This script was used to convert Celestrak TLE files into individual .sat and .cat files +# +import os +import string + + +# For each input file +for file in os.listdir("./in/"): + + print file + + # open TLE file for reading + tlefile = open('./in/'+file, 'r') + + # create category file + category = "./out/"+file.partition(".")[0]+".cat" + catfile = open(category, 'w') + + while 1: + # read three lines at a time; strip trailing whitespaces + line1 = tlefile.readline().strip() + if not line1: break + line2 = tlefile.readline().strip() + line3 = tlefile.readline().strip() + + # catalog number; strip leading zeroes + catnum = line2[2:7].lstrip('0') + print " ... "+catnum + + # add satellite to category + catfile.write(catnum+'\n') + + # satellite file + satfile = open('./tmp/'+catnum+'.sat','w') + + satfile.write('VERSION=1.1\n') + satfile.write('NAME='+line1+'\n') + satfile.write('NICKNAME='+line1+'\n') + satfile.write('TLE1='+line2+'\n') + satfile.write('TLE2='+line3+'\n') + + satfile.close() + + # close TLE and CAT files + tlefile.close() + catfile.close() + +# now package the .sat files into one .dat file +datfile = open('./out/satellites.dat', 'w') +for file in os.listdir("./tmp/"): + + # open .sat file + satfile = open("./tmp/"+file, "r") + + # Create fake config group of catnum + catnum = file.partition(".")[0] + datfile.write("\n["+catnum+"]\n") + + # read lines from satfile and write them to datfile + text = satfile.readlines() + datfile.writelines(text) + + satfile.close(); + +datfile.close() + Property changes on: trunk/data/satdata/scripts/convert.py ___________________________________________________________________ Added: svn:executable + * Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |