logo home pagelogo home page

libred.a


autoplot | avoid_warkings | guessef | infilex | my_pgend | outfilex | pgiden_red | pidegter | showhlp | welcome

up.gif

SUBROUTINE AUTOPLOT(N,X,Y,N1,N2,
                    CX,CY,CT,
                    LLIMIT,X1,X2,Y1,Y2,FEXPAND,
                    JUST,LCLEAR,XOPT,YOPT,
                    IDATA,ICOLOR,
                    XV1,XV2,YV1,YV2)
Input: N,X,Y,N1,N2,
       CX,CY,CT,
       LLIMIT,X1,X2,Y1,Y2,FEXPAND
       JUST,LCLEAR,XOPT,YOPT,
       IDATA,ICOLOR,
       XV1,XV2,YV1,YV2
Output: X1,X2,Y1,Y2

Plot X(N),Y(N) (with N in the range N1,...,N2) in the viewport region defined
by XV1,XV2,YV1,YV2, using common routines from PGPLOT.

INTEGER N -> No. of data points to be plotted
REAL X(N) -> X-coordinates of the data to be plotted
REAL Y(N) -> Y-coordinates of the data to be plotted
INTEGER N1,N2 -> subset of X(N),Y(N) to be plotted (N in the range N1,...,N2)
CHARACTER*(*) CX -> X-axis label \
CHARACTER*(*) CY -> Y-axis label  |---> PGLABEL(CX,CY,CT)
CHARACTER*(*) CT ->   plot title /
LOGICAL LLIMIT -> if .TRUE., compute new window limits X1,X2,X3,X4
                  if .FALSE. employ input values
REAL X1,X2,Y1,Y2 -> window limits
REAL FEXPAND -> fraction to be employed to expand limits (only if
                LLIMIT=.TRUE.)
INTEGER JUST -> if JUST=1, the scales of the x and y world coordinates
                will be equal
LOGICAL LCLEAR -> if .TRUE. the viewport rectangle XV1,XV2,YV1,YV2 is cleared
                 prior plotting
CHARACTER*(*) XOPT,YOPT -> controls the plotting of axes (see PGBOX):
   A: draw Axis (X axis is line Y=0, Y axis is line X=0)
   B: draw bottom (X) or left (Y) edge of frame
   C: draw top (X) or right (Y) edge of frame
   G: draw Grid of vertical (X) or horizontal (Y) lines
   I: invert the tick marks; i.e. draw them outside viewport
   L: label axis logarithmically
   N: write numeric lables in the conventional location
   P: extend major tick marks outside the box
   M: write numeric lables in the unconventional location
   T: draw major tick marks at the major coordinate interval
   S: draw minor tick marks (subticks)
   V: orient numeric labels vertically (only to Y)
   1: force decimal labelling, instead of automatic choice (PGNUMB)
   2: force exponential labelling, instead of automatic
INTEGER IDATA -> controls the plotting of data:
   IDATA=-8,...,31: plot symbols with PGPOINT(N,X,Y,IDATA)
   IDATA=100: plot line with PGLINE(N,X,Y)
   IDATA=101: plot line with PGBIN(N,X,Y,.TRUE.)
   IDATA=102: do not plot data (only box, if required)
INTEGER ICOLOR -> PGPLOT color for data
REAL XV1,XV2,YV1,YV2 -> viewport limits


up.gif

SUBROUTINE AVOID_WARNINGS(STWV,DISP,NSCAN,NCHAN)
Input: STWV,DISP,NSCAN,NCHAN
Output: (nothing)

Dummy function to avoid compilation warnings "unused variable".


up.gif

SUBROUTINE GUESSEF(INFILE,OUTFILE)
Input: INFILE
Ouput: OUTFILE

This subroutine determines the expected error file name OUTFILE from INFILE.
An additional "e" character is located between the portion of the file name
(INFILE) preceding the last period (if present) and the last period itself.

CHARACTER*(*) INFILE
CHARACTER*(*) OUTFILE


up.gif

CHARACTER*75 FUNCTION INFILEX(NF,FILENAME,NSCAN,NCHAN,STWV,DISP,MODE,LERR)
Input: NF,FILENAME,MODE,LERR  (and NSCAN,NCHAN,STWV,DISP if MODE=21)
Output: NSCAN,NCHAN,STWV,DISP
Output (COMMON): AIRMASS,TIMEXPOS,OBJECT,FITSFILE,COMMENT

This function opens an input file (if the file exist), reading the header
keywords, and verifying whether the required file has REDUCEME format and
that the image dimensions do not exceed the maximum expected values (defined
in NCMAX,NSMAX --see the file redlib.inc--). The function returns the name
of the file opened. This function does NOT read the data records (this
action must be performed after a call to this function).

INTEGER       NF -> logical unit number of the file to be opened
CHARACTER*(*) FILENAME -> default file name ('@' means there is not default)
INTEGER       NSCAN -> no. of scans (pixels in the spatial direction)
INTEGER       NCHAN -> no. of channels (pixels in the wavelength direction)
REAL          STWV -> central wavelength of the first pixel
REAL          DISP -> dispersion (Angstroms/pixel)
INTEGER       MODE -> indicates the expected file format:
              MODE=1: unformatted (with full header), i.e. REDUCEME format
              MODE=2: unformatted (without header)
              MODE=3: formatted (ascii file)
              MODE=4: formatted, with RECL=2880 to read FITS files
              MODE=11,12,13,14: like MODE=1,2,3,4 but, if the file exist, it
              is opened directly (without prompting)
              MODE=21: like MODE=1 but the function verifies whether the
              input values of NSCAN,NCHAN,STWV, and DISP are identical with
              those in the header of the file.
LOGICAL       LERR -> if .TRUE. the input file corresponds to an error frame;
              if .FALSE. the input file does not corresponds to an error
              frame (only when MODE=1, 11 or 21; otherwise it has no effect)

Apart from NSCAN, NCHAN, STWV, and DISP, other global variables (declared
through COMMON blocks in redlib.inc), are also (re)declared: AIRMASS,
TIMEXPOS, OBJECT, FITSFILE and COMMENT.


up.gif

SUBROUTINE MY_PGEND
If the file .running_HLPHTML exist, this subroutine allows to capture the
last XServe image before calling PGEND.


up.gif

CHARACTER*75 FUNCTION OUTFILEX(NF,FILENAME,NSCAN,NCHAN,STWV,DISP,MODE,LERR)
Input: NF,FILENAME,NSCAN,NCHAN,STWV,DISP,MODE,LERR
Input (COMMON): AIRMASS,TIMEXPOS,OBJECT,FITSFILE,COMMENT
Output: OUTFILEX

This function opens an output file (if the file does NOT exist), writing
the header keywords (usually declared in a previous call to INFILEX).
The function returns the name of the file opened. This function does NOT
write the data records (this action must be performed after a call to this
function).

INTEGER       NF -> logical unit number of the file to be opened
CHARACTER*(*) FILENAME -> default file name ('@' means there is not default)
INTEGER       NSCAN -> no. of scans (pixels in the spatial direction)
INTEGER       NCHAN -> no. of channels (pixels in the wavelength direction)
REAL          STWV -> central wavelength of the first pixel
REAL          DISP -> dispersion (Angstroms/pixel)
INTEGER       MODE -> indicates the expected file format:
              MODE=1: unformatted (with full header), i.e. REDUCEME format
              MODE=2: unformatted (without header)
              MODE=3: formatted (ascii file)
              MODE=11,12,13: like MODE=1,2,3 but, if the file exist, it
              is opened directly (without prompting)
LOGICAL       LERR -> if .TRUE. the input file corresponds to an error frame;
              if .FALSE. the input file does not corresponds to an error
              frame (only when MODE=1, 11 or 21; otherwise it has no effect)

Apart from NSCAN, NCHAN, STWV, and DISP, other global variables (declared
through COMMON blocks in redlib.inc), are also saved: AIRMASS,
TIMEXPOS, OBJECT, FITSFILE and COMMENT.


up.gif

SUBROUTINE PGIDEN_RED
Input (COMMON): THISPROGRAM,CREDUCEVERSION

Write the current program name, the username, date, time and REDUCEME
version at the bottom of the plot.


up.gif

SUBROUTINE PIDEGTER(NTERM,IDN,LCOLOR)
Output: NTERM,IDN,LCOLOR

Open the graphic device(s), detecting whether color is available.

INTEGER NTERM -> No. of opened graphic devices (maximum = MAX_ID_RED)
INTEGER IDN(MAX_ID_RED) -> logical device number associated to each NTERM
LOGICAL LCOLOR(MAX_ID_RED) -> .TRUE. if color is available


up.gif

SUBROUTINE SHOWHLP(CADENA)
Input: CADENA
Output: CADENA

Show additional help in programs at running time. This routine is employed
for maintenance purposes (i.e. the creation of the help WEB page). When
running any REDUCEME program, this routine checks whether any of the
following two files exist:
.running_HLP     -> generates HELP info in the terminal
.running_HLPHTML -> generates HELP info to create a WEB page

CHARACTER*(*) CADENA -> character string to identify the piece of information
                        to be extracted from the help file, which must be
                        located in the directory $reduceme_dir/help/programs


up.gif

SUBROUTINE WELCOME(CSTRING)
Input: CSTRING
Input (COMMON): THISPROGRAM,CREDUCEVERSION

Write the welcome presentation of the programs. This subroutine also
verifies whether the environment variables PGPLOT_DIR and reduceme_dir have
been defined.

CHARACTER*(*) CSTRING -> additional information to be shown as a centered
              character string in the welcome presentation

logo home pagelogo home page