#- Version # # # 2.2.0 -- MER-2A/ep55a3 -- December 10, 2003 # # Added auxiliary aliases to convert from UTC SCET to PST/ERT and # PDT/ERT -- "scet2pstert.a" and "scet2pdtert.a" # # 2.1.0 -- MER-2A/ep55a3 -- November 6, 2003 # # Added auxiliary aliases displaying SCLK version and complete list # of kernels -- "chronos.sclk.a" and "chronos.kernels.a" # # 2.0.0 -- MER-2A/ep55a3 -- September 18, 2003 # # Added aliases for decimal SCLK -- "sclkd2..." & "...2sclkd.a" # # 1.0.0 -- MER-2A/ep55a3 -- September 3, 2003 # #- Contact Information # # Boris Semenov, 1-818-354-8135, 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 MER. These aliases are for the MER-A rover. # # Majority of the MER-A time conversion aliases have form: # # from2to.a # # where [from] and [to] is any of the following time system/types: # # Acronym Description # --------- -------------------------------------------------- # lsta MER-A Hybrid (approximate) Local Solar Time (LSTA) # 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 # # and [.a] designates for MER-A. For example: # # lsta2scet.a from LSTA to UTC SCET for MER-A # scet2sclk.b from UTC SCET to SCLK for MER-B # # Aliases are also provided for the following "special" conversions: # # scet2ett.a between UTC SCET and UTC Earth Transmit Time (ETT) # ett2scet.a # # scet2et.a between UTC SCET and Ephemeris Time (ET) expressed # et2scet.a as ephemeris seconds past J2000 # # scet2doy.a between UTC SCET in month/day and UTC in DOY formats # doy2scet.a # # sclk2hex.a between SLCK in decimal and hexadecimal # hex2sclk.a representation # # scet2lsun.a computes L-sub-S for given UTC SCET # # scet2lt.a computes one way light time for given UTC SCET # # scet2pst.a computes PST and PDT for given UTC SCET # scet2pdt.a # # scet2pstert.a computes PST/ERT for a given UTC SCET # # scet2pdtert.a computes PDT/ERT for a given UTC SCET # # Two auxiliary aliases are provided to display kernels used by CHRONOS: # # chronos.sclk.a displays original SCLK name # chronos.kernels.a display all kernels used by CHRONOS # # #- Environment # # These variables contain complete path to the normal and HLST # CHRONOS setup files # setenv MERA_HLST_CHRONOS_SETUP "/home/bsemenov/mer/chronos/setups/chronos_hlst.mer2_ep55a3" setenv MERA_LTST_CHRONOS_SETUP "/home/bsemenov/mer/chronos/setups/chronos.mer2_ep55a3" setenv CHRONOS_EXECUTABLE "/naif/toolkit/exe/chronos" # #- Aliases # # From LSTA to all other other time systems. # # To convert from LSTA to other time systems CHRONOS must be run twice # and the LSTA should be pre-parsed to look like SCLK string. # alias lsta2ltst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to lst -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lsta2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lsta2ert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -totype ert -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lsta2sclk.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' # # From all other time systems to LSTA. # # To convert from other time systems to LSTA CHRONOS must be run twice # and the LSTA should be post-parsed to look like 'SOL # HR:MN:SC' string. # alias ltst2lsta.a \ '$CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from lst -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias scet2lsta.a \ '$CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias ert2lsta.a \ '$CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ert -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias sclk2lsta.a \ '$CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -time \!* ` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' # # Between all time systems EXCEPT LSTA. # # These conversions require a single CHRONOS run without pre- or # post-parsing. # # # From LTST to other time systems EXCEPT LSTA. # alias ltst2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from lst -to utc -nolabel -time ' alias ltst2ert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from lst -to utc -totype ert -nolabel -time ' alias ltst2sclk.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from lst -to sclk -nolabel -time ' # # From SCET to other time systems EXCEPT LSTA. # alias scet2ltst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to lst -nolabel -time ' alias scet2ert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -nolabel -time ' alias scet2sclk.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to sclk -nolabel -time ' # # From ERT to other time systems EXCEPT LSTA. # alias ert2ltst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ert -to lst -nolabel -time ' alias ert2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ert -to utc -nolabel -time ' alias ert2sclk.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ert -to sclk -nolabel -time ' # # From SCLK to other time systems EXCEPT LSTA. # alias sclk2ltst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to lst -nolabel -time ' alias sclk2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to utc -nolabel -time ' alias sclk2ert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to utc -totype ert -nolabel -time ' # # Special aliases # alias scet2ett.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -totype ett -nolabel -time ' alias ett2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ett -to utc -nolabel -time ' alias scet2et.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -nolabel -time ' alias et2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -time ' alias scet2doy.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-DOY//HR:MN:SC.\#\#\# ::RND -nolabel -time ' alias doy2scet.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND -nolabel -time ' alias sclk2hex.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to sclk -totype hex -nolabel -time ' alias hex2sclk.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -fromtype hex -to sclk -nolabel -time ' alias scet2lsun.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to lst -totype lsun -nolabel -time ' alias scet2lt.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -totype lt -nolabel -time ' alias scet2pst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdt.a \ '$CHRONOS_EXECUTABLE -setup $MERA_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 LSTA: # # - 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.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to utc -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'"'`' alias sclkd2ert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to utc -totype ert -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'"'`' alias sclkd2sclk.a \ 'echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'" alias sclkd2ltst.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to lst -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'"'`' # # Going from "decimal" SCLK to LSTA: # # - 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 HLST setup to convert to LSTA express as SCLK # - run sed to replace partition, "1/", with "SOL " # - run sed replace first ":" with blank to make output look like # "SOL DDD HR:MN:SC" # alias sclkd2lsta.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -time `echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'"'` | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -batch | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' # # Going all other except LSTA 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.DDD" or "SSSSSSSSS.DDD" # alias scet2sclkd.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" alias ert2sclkd.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -fromtype ert -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" alias sclk2sclkd.a \ 'echo \!* | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" alias ltst2sclkd.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from lst -to sclk -nolabel -time \!* | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" # # Going from LSTA to "decimal" SCLK: # # - run sed to remove SOL marker (twice, for lowercase and uppercase) # - run CHRONOS with HLST setup to convert LSTA in SLCK 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.DDD" or "SSSSSSSSS.DDD" # alias lsta2sclkd.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERA_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch` | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" # # 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.a \ 'chronos -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -time "2003 jan 1 12:00" -trace | grep -v "Actual command line" | grep "\/oss\/mer[ab]\/" | sed '"'"'s/SPK\: //g'"'"' | sed '"'"'s/TEXT\: //g'"'"' | awk '"'"'{print $1}'"'" alias chronos.sclk.a \ 'grep FILE_NAME `chronos -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -time "2003 jan 1 12:00" -trace | egrep "\/sclk\/mer[12]\.tsc|\/sclk\/MER_25._SCLKSCET\......\.tsc"` | awk '"'"'{print $3}'"'" # # Aliases to convert from UTC SCET to PST/ERT and PDT/ERT. # alias scet2pstert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdtert.a \ '$CHRONOS_EXECUTABLE -setup $MERA_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-7 PDT -nolabel -time '