; REBYTE
;---------------------------------------------------------------
;! service program to transform byte order of full data sets
;# INFORMATION GENERAL
;-----------------------------------------------------------------------
;;  Copyright (C) 2007
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
REBYTE    LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
REBYTE:   Stand-alone program to reverse byte order of data area
----------------------------------------------------------------
REBYTE
Type: Stand-alone service program

Use:  REBYTE is designed to copy a full data area transforming the
      byte and word orders of every file it encounters in a manner
      appropriate to that file type.  Solaris and MAC PPC computers
      have one byte order, while Intel computers under Linux and MAC
      OS/X have the opposite byte order.  REBYTE allows you to
      transform a full data area generated with one byte order to a
      new data area having the opposite byte order.

      Directions:
      (1) Install AIPS on your new computer, amking a small data area
          temporarily to hold a message file for user 1.
      (2) Copy a full data area from your old computer of opposite
          byte order to a temporary area on the new computer.
      (3) Transform the data in this area to another data area (not
          that of step 1 above) using REBYTE outside AIPS:
               RUN REBYTE
               1  100               (give range of user numbers)
               /home/data/temp_1    (input data area)
               /home/data/HOST_1    (output data area)
      (4) Hints: The output data areas can be the data areas intended
          for long-term use on the new computer.  Transform the data
          from the old disk #1 to the new disk #1 - that disk holds
          message, TPUT/TGET, and SAVE/GET files as well as regular
          data files.  Transform the other old disks to the new system
          in any order you choose.  DO NOT transform two old disk
          areas into one new one unless there is absolutely no overlap
          in user numbers.

      Warnings: There are three places where REBYTE must simply
      convert data files without knowing their format in detail.
      These files do not contain double precision variables so the
      word swap issue does not arise.  However, each word may contain
      character data which should not be swapped or binary integer or
      floating-point data which should be swapped.  REBYTE examines
      each word and swaps any that are not 4 printable characters.
      There is a finite chance that a binary value might appear to be
      character valued, so this might not be correct.  The files
      affected are the TG file(s) used to store the last adverbs used
      by a task (which is written by TPUT, GO, and VPUT and read be
      TGET and VGET) and the SG file(s) used to store the full POPS
      vocabulary from the lastexit and under user-specified names
      (which are used by SAVE, GET, and EXIT).  The headers of plot
      files also have this uncertainty; they are used by PLGET and
      EXTLIST.  None of these files are critical, but they should be
      used with some caution after a REBYTE.  All other files are
      converted with full knowledge of their formats and no
      uncertainty about accidental confusion between character and
      binary values.

