; TRANS
;---------------------------------------------------------------
;! Task to transpose a subimage of an up to 7-dim. image
;# TASK IMAGING
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 2009, 2016, 2020
;;  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
;-----------------------------------------------------------------------
TRANS     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
TRANS:  Task to transpose a subimage of an up to 7-dim. image
INNAME                             Input name(name).
INCLASS                            Input name(class).
INSEQ           0.0      9999.0    Input name(seq. #). 0=>high
INDISK                             Input disk drive #. 0=>any
OUTNAME                            Output name(name).
OUTCLASS                           Output name(class).
OUTSEQ         -1.0      9999.0    Output name(seq. #).
                                     0 => highest unique
OUTDISK                            Output image disk drive #
                                     0 => highest with room
BLC             0.0      4096.0    Bottom left corner of image
                                     0 => entire image
TRC             0.0      4096.0    Top right corner of image
                                     0 => entire image
TRANSCOD                           New axis order in terms of
                                   input axis numbers
BADDISK                            Disks to avoid for scratch
----------------------------------------------------------------
TRANS
Type: Task
Use:  TRANS will perform arbitrary matrix transpositions on
      images of up to 7 dimensions.  It will also reverse
      the order of pixels on any specified axes and will
      carry out these operations on a subarray of the input
      image if so instructed.
Adverbs:
  INNAME......Input name of image(name).    Standard defaults.
  INCLASS.....Input name of image(class).   Standard defaults.
  INSEQ.......Input name of image(seq. #).  0 => highest.
  INDISK......Disk drive # of image.        0 => any.
  OUTNAME.....Output name of image(name).   Standard defaults.
  OUTCLASS....Output name of image(class).  Standard defaults.
  OUTSEQ......Output name of image(seq. #). 0 => highest unique.
  OUTDISK.....Disk drive # of Output image. 0 => highest
              with space.
  BLC.........The bottom left-hand pixel of the input image
              to be included.  0 => 1.
  TRC.........The top right-hand pixel of the input image
              to be included.  0 => high pixel # on that axis
  TRANSCOD....The new axis order in terms of the old axis order
              numbers: i.e. '312' means make input axis 3 the
              first output axis, input axis 1 the second output
              axis, etc.  Use a - to reverse the pixel order on
              an axis, e.g. '3-12', '-312', '-31-2' etc.
              TRANSCOD may contain blank and comma separators as well
              as the minus sign and numbers 1 through 7 only.  All
              input axes having more than 1 pixel must be included in
              TRANSCOD and may be included only once.
  BADDISK.....Disk(s) to avoid in creating scratch files.
----------------------------------------------------------------
TRANS:  Task which interchanges and/or reverses axes in a cube.
DOCUMENTOR:  J.H.van Gorkom NRAO/VLA
RELATED PROGRAMS: MCUBE, MOMNT, SLICE, PROFL

                          PURPOSE

     TRANS changes the order of the axes in a cube and can also
reverse the pixel order of an axis.  For example, if one has a
cube of (RA,DEC) maps with frequency on the third axis, one can
transpose it into a set of (RA,FREQ) maps with declination on
the third axis.  This then makes it possible to do profile
analysis on the maps with MOMNT, to plot single profiles with
SLICE and SL2PL/LWPLA, or to plot a set of profiles with PROFL.
     The pixel order of an axis can be reversed.  This is useful
for example if one has made a cube with increasing frequency on
one axis; by reversing the pixel order one gets the data in
order of increasing velocity.  TRANS can be used on two
dimensional images in order to transpose the image.

                          COMMENT

     TRANS works faster on data in integer (I*2) format, and
most software likely to be used after TRANS requires this
format.  MCUBE creates cubes in real (R*4) format however. It is
therefore worth using CNVRT to convert cube data from real
format to integer format before running TRANS. (See also the
EXPLAIN file for CNVRT).
