#- Version # # 2.2.0 -- MER-1B/TM20B3 -- December 10, 2003 # # Added auxiliary aliases to convert from UTC SCET to PST/ERT and # PDT/ERT -- "scet2pstert.b" and "scet2pdtert.b" # # 2.1.0 -- MER-1B/TM20B3 -- November 6, 2003 # # Added auxiliary aliases displaying SCLK version and complete list # of kernels -- "chronos.sclk.b" and "chronos.kernels.b" # # 2.0.0 -- MER-1B/TM20B3 -- September 18, 2003 # # Added aliases for decimal SCLK -- "sclkd2..." & "...2sclkd.b" # # 1.0.0 -- MER-1B/TM20B3 -- 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-B rover. # # Majority of the MER-B time conversion aliases have form: # # from2to.b # # where [from] and [to] is any of the following time system/types: # # Acronym Description # --------- -------------------------------------------------- # lstb MER-B Hybrid (approximate) Local Solar Time (LSTB) # 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 [.b] designates for MER-B. For example: # # lstb2scet.b from LSTB to UTC SCET for MER-B # scet2sclk.b from UTC SCET to SCLK for MER-B # # Aliases are also provided for the following "special" conversions: # # scet2ett.b between UTC SCET and UTC Earth Transmit Time (ETT) # ett2scet.b # # scet2et.b between UTC SCET and Ephemeris Time (ET) expressed # et2scet.b as ephemeris seconds past J2000 # # scet2doy.b between UTC SCET in month/day and UTC in DOY formats # doy2scet.b # # sclk2hex.b between SLCK in decimal and hexadecimal # hex2sclk.b representation # # scet2lsun.b computes L-sub-S for given UTC SCET # # scet2lt.b computes one way light time for given UTC SCET # # scet2pst.b computes PST and PDT for given UTC SCET # scet2pdt.b # # scet2pstert.b computes PST/ERT for a given UTC SCET # # scet2pdtert.b computes PDT/ERT for a given UTC SCET # # Two auxiliary aliases are provided to display kernels used by CHRONOS: # # chronos.sclk.b displays original SCLK name # chronos.kernels.b display all kernels used by CHRONOS # # #- Environment # # These variables contain complete path to the normal and HLST # CHRONOS setup files # setenv MERB_HLST_CHRONOS_SETUP "/home/bsemenov/mer/chronos/setups/chronos_hlst.mer1_tm20b3" setenv MERB_LTST_CHRONOS_SETUP "/home/bsemenov/mer/chronos/setups/chronos.mer1_tm20b3" setenv CHRONOS_EXECUTABLE "/naif/toolkit/exe/chronos" # #- Aliases # # From LSTB to all other other time systems. # # To convert from LSTB to other time systems CHRONOS must be run twice # and the LSTB should be pre-parsed to look like SCLK string. # alias lstb2ltst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from et -fromtype seconds -to lst -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lstb2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lstb2ert.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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 $MERB_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' alias lstb2sclk.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from sclk -to et -totype seconds -nolabel -batch`' # # From all other time systems to LSTB. # # To convert from other time systems to LSTB CHRONOS must be run twice # and the LSTB should be post-parsed to look like 'SOL # HR:MN:SC' string. # alias ltst2lstb.b \ '$CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from lst -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias scet2lstb.b \ '$CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias ert2lstb.b \ '$CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -fromtype ert -to et -totype seconds -nolabel -time \!*` | sed "s/1\/\0\{1,5\}/SOL /g" | sed "s/\:/ /"' alias sclk2lstb.b \ '$CHRONOS_EXECUTABLE -setup $MERB_HLST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `$CHRONOS_EXECUTABLE -setup $MERB_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 LSTB. # # These conversions require a single CHRONOS run without pre- or # post-parsing. # # # From LTST to other time systems EXCEPT LSTB. # alias ltst2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from lst -to utc -nolabel -time ' alias ltst2ert.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from lst -to utc -totype ert -nolabel -time ' alias ltst2sclk.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from lst -to sclk -nolabel -time ' # # From SCET to other time systems EXCEPT LSTB. # alias scet2ltst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to lst -nolabel -time ' alias scet2ert.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -nolabel -time ' alias scet2sclk.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to sclk -nolabel -time ' # # From ERT to other time systems EXCEPT LSTB. # alias ert2ltst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -fromtype ert -to lst -nolabel -time ' alias ert2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -fromtype ert -to utc -nolabel -time ' alias ert2sclk.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -fromtype ert -to sclk -nolabel -time ' # # From SCLK to other time systems EXCEPT LSTB. # alias sclk2ltst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from sclk -to lst -nolabel -time ' alias sclk2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from sclk -to utc -nolabel -time ' alias sclk2ert.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from sclk -to utc -totype ert -nolabel -time ' # # Special aliases # alias scet2ett.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -totype ett -nolabel -time ' alias ett2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -fromtype ett -to utc -nolabel -time ' alias scet2et.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to et -totype seconds -nolabel -time ' alias et2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from et -fromtype seconds -to utc -nolabel -time ' alias scet2doy.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-DOY//HR:MN:SC.\#\#\# ::RND -nolabel -time ' alias doy2scet.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND -nolabel -time ' alias sclk2hex.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from sclk -to sclk -totype hex -nolabel -time ' alias hex2sclk.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from sclk -fromtype hex -to sclk -nolabel -time ' alias scet2lsun.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to lst -totype lsun -nolabel -time ' alias scet2lt.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -totype lt -nolabel -time ' alias scet2pst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdt.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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 LSTB: # # - 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.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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.b \ 'echo \!* | sed "s/[0-9]\///g" | sed "s/\./ 0\./g" | awk '"'"'{printf ("%010d:%03.0f\n",$1,$2*256)}'"'" alias sclkd2ltst.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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 LSTB: # # - 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 LSTB 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 sclkd2lstb.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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 $MERB_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 LSTB 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.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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.b \ 'echo \!* | sed "s/\// /g" | sed "s/\./ /g" | awk '"'"'{printf ("%010d.%03.0f\n",$2,$3/256*1000)}'"'" alias ltst2sclkd.b \ '$CHRONOS_EXECUTABLE -setup $MERB_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 LSTB to "decimal" SCLK: # # - run sed to remove SOL marker (twice, for lowercase and uppercase) # - run CHRONOS with HLST setup to convert LSTB 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 lstb2sclkd.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from et -fromtype seconds -to sclk -nolabel -time `echo \!* | sed "s/SOL/ /g" | sed "s/sol/ /g" | $CHRONOS_EXECUTABLE -setup $MERB_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.b \ 'chronos -setup $MERB_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.b \ 'grep FILE_NAME `chronos -setup $MERB_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.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-8 PST -nolabel -time ' alias scet2pdtert.b \ '$CHRONOS_EXECUTABLE -setup $MERB_LTST_CHRONOS_SETUP -from utc -to utc -totype ert -format YYYY-MM-DD HR:MN:SC.\#\#\# ::RND ::UTC-7 PDT -nolabel -time '