[Gpredict-svn] SF.net SVN: gpredict:[394] trunk/data/satdata/convert.py
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2009-08-07 23:10:44
|
Revision: 394 http://gpredict.svn.sourceforge.net/gpredict/?rev=394&view=rev Author: csete Date: 2009-08-07 23:10:32 +0000 (Fri, 07 Aug 2009) Log Message: ----------- Updated. Modified Paths: -------------- trunk/data/satdata/convert.py Modified: trunk/data/satdata/convert.py =================================================================== --- trunk/data/satdata/convert.py 2009-08-06 23:55:45 UTC (rev 393) +++ trunk/data/satdata/convert.py 2009-08-07 23:10:32 UTC (rev 394) @@ -33,8 +33,8 @@ catfile.write(catnum+'\n') # satellite file - satfile = open('./out/'+catnum+'.sat','w') - satfile.write('[Satellite]\n') + satfile = open('./tmp/'+catnum+'.sat','w') + satfile.write('VERSION=1.1\n') satfile.write('NAME='+line1+'\n') satfile.write('NICKNAME='+line1+'\n') @@ -47,3 +47,22 @@ 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() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |