#
# $Name: Downfits-1_1 $
#
# $Log: README.txt,v $
# Revision 1.1  2002/05/27 18:31:10  robert
# Update e-mail
#
# Revision 1.0  2002/01/06 18:12:19  robc
# First CVS entry
#                                                                         

NOTE: This software will not run under NT.  NT will not allow asm statements
as implemented in this program.

CONTACT: Robert_Creager@LogicalChaos.org

This software was developed using:
   Splash (http://www.wolfman.com/splash.html) version 1.90 for
      windows (the win/unix version are the same),
Windows:
   Borland 5.02
   CFITSIO (http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html)
      for Borland/Windows, version 2.037
Linux:
   gcc 2.95
	CFITSIO 2.3

I modified splash classes slightly to include c_str( ) which returns a
non-constant reference to the string.  This was needed since CFITSIO
doesn't always like constant references to strings...  Splash allows the
ability to work with strings like Perl (splash stands for:
Small PERL-Like List And String Handling), and I like Perl.

The program creates 2 fits files and primary image extension using the file
names given on the command line.

Usage: ./downfits <naxis1> <naxis2> <plate_1 file name> <plate_2 file name>
Where: 
        naxis1 = the number columns in the image
        naxis2 = the number rows in the image
        plate_1 file name = The file name to go with the data in plate_1
        plate_2 file name = The file name to go with the data in plate_2

The current date is written using CFITISO fits_write_data (currently disabled
because of Daylight Savings Problem).

The actual data is then read from the MARK IV ISA card, a byte at a time, with
even/odd 2 byte combos going to the two image array.  The entire data set is
read at one time, and then written at once to the fits files.  From reading
the FITSIO documentation, this appears to be the 'best' way to accomplish
this.

Three files are then looked for - "constant", "plate_1" and "plate_2".
NAXIS1 and NAXIS2 are also looked for on the command line.  NAXIS1 is the
number of COLUMNS on the CCD, and NAXIS2 is the number of ROWS.  For example,
the following command line:

downfits 2043 2037 hbr_1234567.fts hir_1234567

will create two files as named, with the first file having the data in constant
and plate_1, while the second file having the data in constant and plate_2.
The intention is for constant to be filled out with information which doesn't
change for a site, and plate to be modified for each exposure set taken.  The
format is identical to FITS header format except I don't care about column
positions.  Each key/value/comment pair needs to be on one line, with a '='
separating the key/value, and comments are started with '/'.  I support only
2 FITS data types: TSTRING's, which are delimited by '', and TDOUBLE, which
will accept any number I've seen - including the format 1e-8.  There are a
number of keys that I consider reserved, and will not try to update the FITS
header with them.  See parse.cpp for a list.  I use fits_update_key for all
operations, which allows multiple entries in one of the input files to be
the same key, with only the last value being ultimately used.  I do print out
appropriate warnings for each reserved/multiple key value for your info.  All
COMMENT fields are continously added from both the "constant" and "plate_?"
files.  The program is tolerant of errors, basically ignoring them.  The hope
is that the data will always be downloaded and put into the file, regardless
of what happens.  All errors are printed out.

If you intend to modify this code, be careful with the REGEXP's, as they are
unfortunately finicky about order.
