Re: message from space track regarding bulk tle file

From: Mark Robinson (mark@zl2tod.net)
Date: Sat Aug 25 2012 - 13:12:51 UTC

  • Next message: alberto rango: "4641 SATOBS 24 AUG 2012."

    On 25/08/12 01:50, Jonathan McDowell wrote:
    >
    > I've been sending feedback to their beta team. It's not trivial but I now
    > have set up a daily job to download TLEs.
    > First I get a cookies.txt file per their instructions:
    > curl -c cookies.txt -b cookies.txt -k https://beta.space-track.org/ajaxauth/login -d 'identity=Jonathan_Mcdowell&password=blahblah'
    > Then I find the latest TLE file serial number:
    > curl -D latest.log -o latest.raw --cookie cookies.txt --insecure  "https://beta.space-track.org/basicspacedata/query/class/tle/format/csv/limit/1/predicates/FILE/orderby/FILE%20desc" >>&st.log
    > tail -1 latest.raw | cut -d\" -f2 > latest.new
    >
    > My code then reads the 'latest.new' file and finds the number 1339667 as the latest file
    > number. I've saved yesterday's value which was 1339652. So then I build the following query
    > (I wrote a c program to do it but python would probably be more sensible):
    > curl -D st.err -o newdata_2012_237.txt --cookie cookies.txt --insecure https://beta.space-track.org/basicspacedata/query/class/tle/format/tle/FILE/1339653--1339667 >>& tleget.log
    >
    > <snip>
    >
    > Good luck everyone...
    >     Jonathan
    
    Thanks for this Jonathan,
    
    Here's a script only version hacked up to get the updates since the last run, 
    or the last 1000 TLEs if it has not been run before:
    
    > #!/bin/bash
    > curl -c cookies.txt -b cookies.txt -k https://beta.space-track.org/ajaxauth/login -d 'identity=us&password=them'
    >
    > curl -D latest.log -o latest.raw --cookie cookies.txt --insecure  "https://beta.space-track.org/basicspacedata/query/class/tle/format/csv/limit/1/predicates/FILE/orderby/FILE%20desc" >> st.log
    > latestnew=$(tail -1 latest.raw | cut -d\" -f2 )
    > echo "latest.new: $latestnew"
    >
    > if [ -e latest.prev ] ; then
    >   latestprev=$(cat latest.prev)
    > else
    >   latestprev=$(($latestnew - 1000))
    > fi
    > echo "latest.prev: $latestprev"
    >
    > yeardoy=$(date +%Y_%j)
    >
    > if [[ $latestprev != $latestnew ]]; then
    >   curl -D st.err -o newdata_$yeardoy.txt --cookie cookies.txt --insecure https://beta.space-track.org/basicspacedata/query/class/tle/format/tle/FILE/$latestprev--$latestnew >> tleget.log
    >   echo $latestnew > latest.prev
    > fi
    
    Needs an error test before writing latest.prev, and limits on maximum number of 
    records to fetch per your code.
    
    And no, I haven't read any of the docs.
    
    Cheers
    Mark
    
    
    
    _______________________________________________
    Seesat-l mailing list
    http://mailman.satobs.org/mailman/listinfo/seesat-l
    



    This archive was generated by hypermail 2b29 : Sat Aug 25 2012 - 13:13:55 UTC