.sh 3 "Special Function 3:  Sequential Processor " 8 6 3
.pp
This routine is very useful for repetitive
calculations on many files for multiplication, division,
subtraction and special functions only.  For example, if you
wanted to multiply savefiles number 10 to 23 by the constant
1.3452, you would type F3 from Math Operations.  The program will
ask for the operation.  You would type *.  (Other operations
would be /, -, F2, F6 or any other function number except 3 and
4).  Next the program will ask for the first file ID, beginning
file number, ending file number and the file increment.  For this
example, you would type
.ul
V10 23 1.
File increments from 0 to 2000 are valid.  If the file increment
was negative, it is set to zero.  Next you will be asked to type
in the second file ID,  beginning and ending file numbers and
file increment.  For this case, you would type
.ul
C1.3452.
You will then be asked to type in options.  If you wanted errors
included, the file increment should have been 2 since the data and
errors take up 2 files.  Note you can get in an infinite loop if
the file increment is set to zero.  However, you can exit back to
Math Operations by typing
.ul
X
at nearly any point.  If you type
.ul
E
at any point in the processing, that operation will be skipped and
the program will go on to the next operation.  The operations are
performed just as if you had typed in the commands one at a time
or all one line separated by commas in Math Operations.  This
function should save a lot of time and typing.


.sh 3 "Special Function 4:  Sequential Processor (No User Process) "
.pp
This function sets up the commands from function 3 for execution
and thus has no user access.


.sh 3 "Special Function 5: Continuum Removal "
.pp
Type F5.
.pp
The directions follow on the CRT and will be given here.
.pp
"THIS ROUTINE MATCHES A CONTINUUM TO TWO GIVEN POINTS OF A
SPECTRUM AND REMOVES THE CONTINUUM BY DIVIDING."
.pp
A continuum is any file which the user generates by whatever
means available.  However, the user must have a concrete file
with a device name and number available before using this
routine.  You can generate a continuum by using the special math
functions or using Gaffey's Fe2 modified spectrum or whatever you
choose.
.pp
"ENTER TWO VALUES TO WHICH CONTINUUM IS TO BE MATCHED FOLLOWED BY
H, A, OR N REPRESENTING UNITS OF CHANNEL, WAVELENGTH, AND ENERGY
SPACE, AND THE WAVELENGTH FILE # (DEFAULT = H1).  ENTER E OR X TO
EXIT."
.pp
The two points can be entered in whatever units are convenient
for you, in free format (spaces between numbers, no commas).  The
wavelength file is read, and the two values entered are correlated
with the appropriate channel in the wavelength file.  If you
do not specify a unit's code or a wavelength file, the program
accesses wavelength file 1 and assumes your numbers entered are
channels.  You can bail out of the routine here if you wish.
.pp
"ENTER SPECTRUM FILE ID AND #, E TO INCLUDE ERRORS FOLLOWED BY
CONTINUUM FILE ID AND #.  TYPE X TO EXIT."
.pp
The message on the CRT will say "WORKING" when you hit the return
button after entering the information.  The title of the files
used will be printed on the CRT as they are accessed by the
program.  The error file with the spectrum is accessed if asked
for.  The continuum file is scaled to the spectrum file at the
two given points by calculating a scaled slope and an intercept
(or vertical offset) and converting each data point of the
continuum to the scaled continuum through the relationshp Y = mx
+ b where Y is the scaled continuum, m is the slope, x is the
original continuum value at a give channel, and b is the
intercept.  The spectrum is then divided by the scaled
continuum.  The errors are scaled by a factor of (scaled spectrum \(di
original spectrum).
.pp
Finally, the title and history are made and control is transferred
back to the main program to write the file.


.sh 3 "Special Function 6:  Black Body Computation "
.pp
This function computes the Planck black body function
at a given temperature (in degrees Kelvin) and any
wavelength set.  Upon entering the routine, you are asked to type
in the temperature and the wavelength file number.  If no
wavelength file number is specified, the default is file 1.  The
units are computed in Watts per meter squared per micron.  The
wavelength values must be in microns.  When using extreme
temperatures or extreme wavelengths, you should check the results
for underflow or overflow in the CRT plot routines (section 9).
No file or errors are needed since this routine generates a new
file instead of an operation on an old one.  The equation used is
equation 8.6.6.1 in appendix C
where E is the energy for each channel at wavelength \(*l (in
microns), T is the temperature (degrees Kelvin), c is the speed
of light, h is the Planck constant (= 6.6252E-34 Joule-seconds),
and k is the Boltzmann constant (= 1.3806E-23 Joule/\(deK).


.sh 3 "Special Function 7:  Smoothing Function "
.pp
This routine smoothes a spectrum by performing
a weighted smoothing of adjacent channels.  First, the channels are
sorted into increasing wavelengths; note that the smoothing is
done in channel space.  The user then requests how many channels to
include on each side of each data point.  Each point is weighted
by the inverse power of 2 with the power increasing with
increasing distance from the data point to be smoothed.  If the
parameter giving the number of channels is n, then for n = 1 data
point D is computed by equations 8.6.7.1 to 8.6.7.4 in appendix
C.
.pp
The parameter n can vary from 1 to the number of channels divided
by 2.  When the smoothing is finished, the data is sorted into
the original order.  The wavelength file default is the current
file in use (and is printed on the CRT).  If another is desired,
type
.ul
A
and the wavelength file number on the same line as the parameter
N (which must be first on the line).  Also, if data only in a
certain range is to be considered, on the same line, type
.ul
L
and the minimum and maximum data numbers to be included.  Default
limits on L are -1.0E34 to +1.0E34.  If certain channels
should be deleted, type
.ul
D
to delete points.  A message will then be printed to type in the
points to be deleted.  When you are finished typing in points to
be deleted, type
.ul
C
to continue.  A file must be specified before the F7 command, and
errors can be included.  The parameter N seems to give excellent
results when it is 1 or 2.  When N gets large, there seems little
change in the smoothed result.


.sh 3 "Special Function 8:  Channel-File Transpose "
.pp
This routine transposes the array of channel (column) versus
spectrum (rows) to spectrum versus channel.  For example, if you
had 10 spectra of 50 channels each where each spectrum was taken
at 1 hour intervals, this routine transposes the matrix so that
there are 50 output "spectra" of 10 channels each where each
"spectrum" is intensity at 10 different times.  The request for
input spectra are input one per line (file letter ID and file
number).  When all are typed in, type
.ul
B
to begin transpose.  The program will then ask for the beginning
output location (type in file letter ID and file number).  The
output spectra will be output sequentially beginning at that
point (but first the program asks for a common title for the
output spectra).  The number of output spectra is equal to
the number of channels in use.

Note:  As of this writing (June, 1980), devices U and Y are not
properly encoded in the history (the history routine needs
expanding).


.sh 3 "Special Function 9:  Bad Removal (Reflection Method) "
.pp
Type F9.
.pp
This subroutine takes one half of an absorption band and reflects
it about the band minimum then divides a given reflection
spectrum by the calculated band.
.pp
"TYPE IN THE FILE ID AND FILE # TO BE PROCESSED, E TO INCLUDE
ERRORS, FOLLOWED BY L OR R FOR LEFT- OR RIGHT-SIDE OF BAND TO BE
REFLECTED.  TYPE E OR X TO EXIT."
.pp
L or R refers to left- or right-side of the band minimum when the
spectrum is stored in increasing wavelength from left to right.
It refers to the side of the band that you want to be reflected to
the other side.
.pp
"ENTER OUTER LIMITS OF BAND (2 VALUES), ESTIMATED HALF HEIGHT
POINT ON SIDE TO BE REFLECTED FOLLOWED BY H, A, N (CHANNEL,
WAVELENGTH, ENERGY), AND WAVELENGTH FILE NUMBER.  (DEFAULT = H1), TYPE
E OR X TO EXIT."
 .pp
The two outer limits are on either side of the band minimum.  The
first limit tells where to stop the relection process, the second
tells where to stop looking for the band minimum.  The program
types "WORKING" and is doing the following:

.ip 1:
accessing the wavelength file, default is 1.

.ip 2:
correlating the given band limits to channels in the wavelength
file, default is that the limits are given in terms of channels.

.ip 3:
searching for the band minimum by looking for a datum that is
smaller than the three values on either side of it, between the
limits of the \(12 height and the second outer band limit.

.ip 4:
puts values of one side of band into the position symmetrically
opposite to it relative to the band minimum.

.ip 5:
divides spectrum by reflected band.

.ip 6:
scales the errors by a factor of (the residual \(di the original
spectrum).

.ip 7:
calculates title and history.

.ip 8:
returns to the main program.

.pp
This is a primitive means of removing a band.  If there are any
suggestions or improvements, please let me know.
