#- Version # # 6.0.0 -- MSL/ops120808_v1 -- August 8, 2012 # # Changed to use ops120808_v1 setups (actual site, 2012-08-08 solution; # landing time 2012-08-06T05:17:57 UTC). # # 5.0.0 -- MSL/gc120806_v3 -- June 14, 2012 # # Changed to use gc120806_v3 setups (Gale Crater, final site, revA; # landing time 2012-08-06T05:17:55 UTC). # # 4.0.0 -- MSL/gc120806_v2 -- June 7, 2012 # # Changed to use gc120806_v2 setups (Gale Crater, final site; landing # time 2012-08-06T05:17:45 UTC). # # 3.1.0 -- MSL/gc120806_v1 -- January 17, 2012 # # Modified sclk2sclkd to work with input SCLKs without partition. # # 3.0.1 -- MSL/gc120806_v1 -- November 30, 2010 # # Changed to use gc120806_v1 setups (Gale Crater; landing time # 2012-08-06T05:17:29 UTC). # # 3.0.0 -- MSL/CS0N45E120806 -- November 8, 2010 # # Updated to load "_v3" CS0N45E120806 setups listing the new # baseline on-board clock SCLK kernel (ver. 00007, different from # ver. 00002 by ~0.001 sec). # # Extended precision of SCET, ERT, ETT, ERT/PDT, and ERT/PST outputs # to microseconds to avoid truncation in conversions from SCLK and # LMST. # # 2.0.0 -- MSL/CS0N45E120806 -- July 22, 2010 # # Updated to work with LMST in "Sol-nnnnnMhh:mm:ss.sssss" format # # 1.0.0 -- MSL/CS0N45E120806 -- February 10, 2010 # # Initial version; based on PHX aliases. # # #- Contact Information # # Boris Semenov, 1-818-354-8136, Boris.Semenov@jpl.nasa.gov # #- Abstract # # This file contains UNIX c- or tc-shell aliases providing short cuts # for the common time conversions supported by SPICE's CHRONOS # utility, applicable to MSL. # # Majority of the MSL time conversion aliases have form: # # from2to # # where [from] and [to] is any of the following time system/types: # # Acronym Description # --------- -------------------------------------------------- # lmst Local Mean Solar Time (LMST) # ltst Local True Solar Time (LTST) # scet UTC Spacecraft Event Time (UTC SCET) # ert UTC Earth Receive Time (UTC ERT) # sclk Spacecraft on-board Clock (SCLK), byte-based # sclkd Spacecraft on-board Clock (SCLK), decimal # # For example: # # lmst2scet from LMST to UTC SCET for MSL # scet2sclk from UTC SCET to SCLK for MSL # # Aliases are also provided for the following "special" conversions: # # scet2ett between UTC SCET and UTC Earth Transmit Time (ETT) # ett2scet # # scet2et between UTC SCET and Ephemeris Time (ET) expressed # et2scet as ephemeris seconds past J2000 # # scet2doy between UTC SCET in month/day and UTC in DOY formats # doy2scet # # sclk2hex between SLCK in decimal and hexadecimal # hex2sclk representation # # scet2lsun computes L-sub-S for given UTC SCET # # scet2lt computes one way light time for given UTC SCET # # scet2pst computes PST and PDT for given UTC SCET # scet2pdt # # scet2pstert computes PST/ERT for a given UTC SCET # # scet2pdtert computes PDT/ERT for a given UTC SCET # # Two auxiliary aliases are provided to display kernels used by CHRONOS: # # chronos.sclk displays original SCLK name # chronos.kernels display all kernels used by CHRONOS # # #- Environment # # These variables contain complete path to the normal and LMST # CHRONOS setup files # setenv MSL_LMST_CHRONOS_SETUP "/ftp/pub/naif/MSL/misc/chronos/setups/chronos_lmst.msl_ops120808_v1" setenv MSL_LTST_CHRONOS_SETUP "/ftp/pub/naif/MSL/misc/chronos/setups/chronos.msl_ops120808_v1" setenv CHRONOS_EXECUTABLE "/naif/toolkit/exe/chronos" # #- Aliases # # From LMST to all other other time systems. # # To convert from LMST to other time systems CHRONOS must be run twice # and the LMST should be pre-parsed to look like SCLK string with # fields separated by spaces with right field forced into count of # 10 microsecs. # alias lmst2ltst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to lst -nolabel -time `echo \!* | sed "s/SOL/ /ig" | sed "s/m/ /ig" | sed "s/\-/ /g" | sed "s/\:/ /g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%s %s %s %s %05.0f\n",$1,$2,$3,$4,$5*100000)}'"'"' | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -batch`' alias lmst2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time `echo \!* | sed "s/SOL/ /ig" | sed "s/m/ /ig" | sed "s/\-/ /g" | sed "s/\:/ /g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%s %s %s %s %05.0f\n",$1,$2,$3,$4,$5*100000)}'"'"' | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -batch`' alias lmst2ert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -totype ert -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time `echo \!* | sed "s/SOL/ /ig" | sed "s/m/ /ig" | sed "s/\-/ /g" | sed "s/\:/ /g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%s %s %s %s %05.0f\n",$1,$2,$3,$4,$5*100000)}'"'"' | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -batch`' alias lmst2sclk \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /ig" | sed "s/m/ /ig" | sed "s/\-/ /g" | sed "s/\:/ /g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%s %s %s %s %05.0f\n",$1,$2,$3,$4,$5*100000)}'"'"' | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -batch`' # # From all other time systems to LMST. # # To convert from other time systems to LMST CHRONOS must be run twice # and the LMST should be post-parsed to look like 'Sol-nnnnnMhh:mm:ss.sssss' # string. # alias ltst2lmst \ '$CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from lst -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time \!*` | sed "s/1\///g" | sed "s/\:/ /g" | awk '"'"'{printf ("Sol-%sM%s:%s:%s.%s\n",$1,$2,$3,$4,$5)}'"'" alias scet2lmst \ '$CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time \!*` | sed "s/1\///g" | sed "s/\:/ /g" | awk '"'"'{printf ("Sol-%sM%s:%s:%s.%s\n",$1,$2,$3,$4,$5)}'"'" alias ert2lmst \ '$CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ert -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time \!*` | sed "s/1\///g" | sed "s/\:/ /g" | awk '"'"'{printf ("Sol-%sM%s:%s:%s.%s\n",$1,$2,$3,$4,$5)}'"'" alias sclk2lmst \ '$CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time \!* ` | sed "s/1\///g" | sed "s/\:/ /g" | awk '"'"'{printf ("Sol-%sM%s:%s:%s.%s\n",$1,$2,$3,$4,$5)}'"'" # # Between all time systems EXCEPT LMST. # # These conversions require a single CHRONOS run without pre- or # post-parsing. # # # From LTST to other time systems EXCEPT LMST. # alias ltst2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from lst -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias ltst2ert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from lst -to utc -totype ert -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias ltst2sclk \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from lst -to sclk -nolabel -time ' # # From SCET to other time systems EXCEPT LMST. # alias scet2ltst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to lst -nolabel -time ' alias scet2ert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias scet2sclk \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to sclk -nolabel -time ' # # From ERT to other time systems EXCEPT LMST. # alias ert2ltst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ert -to lst -nolabel -time ' alias ert2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ert -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias ert2sclk \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ert -to sclk -nolabel -time ' # # From SCLK to other time systems EXCEPT LMST. # alias sclk2ltst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to lst -nolabel -time ' alias sclk2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias sclk2ert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to utc -totype ert -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' # # Special aliases # alias scet2ett \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -totype ett -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias ett2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ett -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias scet2et \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time ' alias et2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time ' alias scet2doy \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-DOY//HR:MN:SC.\#\#\#\#\#\# ::RND -nolabel -time ' alias doy2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -nolabel -time ' alias sclk2hex \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to sclk -totype hex -nolabel -time ' alias hex2sclk \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -fromtype hex -to sclk -nolabel -time ' alias scet2lsun \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to lst -totype lsun -nolabel -time ' alias scet2lt \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -totype lt -nolabel -time ' alias scet2pst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdt \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND ::UTC-7 PDT -nolabel -time ' # # Going from "decimal" SCLK to all other except LMST: # # - expects input like "N/SSSSSSSSS.DDDD..." or "SSSSSSSSS.DDDD..." # - run sed to remove partition (if present) # - run sed to replace "." with " 0." # - run awk to convert integer and decimal second to "normal" SCLK # - run CHRONOS with LTST setup to convert to output time system # alias sclkd2scet \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to utc -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%05.0f\n",$1,$2*65536)}'"'"'`' alias sclkd2ert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to utc -totype ert -nolabel -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%05.0f\n",$1,$2*65536)}'"'"'`' alias sclkd2sclk \ 'echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%05.0f\n",$1,$2*65536)}'"'" alias sclkd2ltst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to lst -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%05.0f\n",$1,$2*65536)}'"'"'`' # # Going from "decimal" SCLK to LMST: # # - run sed to remove partition (if present) # - run sed to replace "." with " 0." # - run awk to convert integer and decimal second to "normal" SCLK # - run CHRONOS with LTST setup to convert to ET seconds # - run CHRONOS with LMST setup to convert to LMST express as SCLK # - run sed to replace partition, "1/", and separators, ":" with " " # - run awk to format output as "Sol-nnnnnMhh:mm:ss.sssss" # alias sclkd2lmst \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%05.0f\n",$1,$2*65536)}'"'"'` | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -batch | sed "s/1\///g" | sed "s/\:/ /g" | awk '"'"'{printf ("Sol-%sM%s:%s:%s.%s\n",$1,$2,$3,$4,$5)}'"'" # # Going all other except LMST to "decimal" SCLK: # # - run CHRONOS with LTST setup to convert from input time to SCLK # - run sed to replace partition separator, "/", with " " # - run sed to replace field separator, ".", with " " # - run awk to convert three tokens of "normal" SCLK to integer and # decimal SCLK # - output looks like "N/SSSSSSSSS.DDDDDD" or "SSSSSSSSS.DDDDDD" # alias scet2sclkd \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\-/ /g" | awk '"'"'{printf ("%010d.%06.0f\n",$2,$3/65536*1000000)}'"'" alias ert2sclkd \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -fromtype ert -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\-/ /g" | awk '"'"'{printf ("%010d.%06.0f\n",$2,$3/65536*1000000)}'"'" alias sclk2sclkd \ 'echo \!* | sed "s/[0-9]\///g" | sed "s/\-/ /g" | sed "s/\./ /g" | sed "s/\:/ /g" | awk '"'"'{printf ("%010d.%06.0f\n",$1,$2/65536*1000000)}'"'" alias ltst2sclkd \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from lst -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\-/ /g" | awk '"'"'{printf ("%010d.%06.0f\n",$2,$3/65536*1000000)}'"'" # # Going from LMST to "decimal" SCLK: # # - run sed to replace all LMST SOL markers with blanks and force # right field into count of 10 microsecs # - run CHRONOS with LMST setup to convert LMST in SCLK form to ET seconds # - run CHRONOS with LTST setup to convert ET to "normal" SCLK # - run sed to replace partition separator, "/", with " " # - run sed to replace field separator, ".", with " " # - run awk to convert three tokens of "normal" SCLK to integer and # decimal SCLK # - output looks like "N/SSSSSSSSS.DDDDDD" or "SSSSSSSSS.DDDDDD" # alias lmst2sclkd \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /ig" | sed "s/m/ /ig" | sed "s/\-/ /g" | sed "s/\:/ /g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%s %s %s %s %05.0f\n",$1,$2,$3,$4,$5*100000)}'"'"' | $CHRONOS_EXECUTABLE -setup $MSL_LMST_CHRONOS_SETUP -from sclk -to et -totype seconds -format nnnnnnnnnn.nnnnnn -nolabel -batch` | sed "s/\// /g" | sed "s/\-/ /g" | awk '"'"'{printf ("%010d.%06.0f\n",$2,$3/65536*1000000)}'"'" # # Two auxiliary aliases are provided to display kernels used by CHRONOS. # In 'chronos.kernels' the output of CHRONOS run with -trace option is # post-formatted to be a file list, one per line. In 'chronos.sclk' the # original SCLK name is pulled out of the comments of the SCLK file, the # name of which is extracted from CHRONOS/-trace output. # alias chronos.kernels \ 'chronos -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -time "2003 jan 1 12:00" -trace | grep -v "Actual command line" | egrep -i "\/kernels\/|\/kernels\/" | sed '"'"'s/SPK\: //g'"'"' | sed '"'"'s/TEXT\: //g'"'"' | awk '"'"'{print $1}'"'" alias chronos.sclk \ 'grep FILE_NAME `chronos -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -time "2003 jan 1 12:00" -trace | egrep "\/sclk\/msl\.tsc|\/MSL_76_SCLKSCET\......\.tsc"` | grep -v ";" | awk '"'"'{print $3}'"'" # # Aliases to convert from UTC SCET to PST/ERT and PDT/ERT. # alias scet2pstert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdtert \ '$CHRONOS_EXECUTABLE -setup $MSL_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\#\#\#\# ::RND ::UTC-7 PDT -nolabel -time '