I wrote this program because I wanted to import most of the FITS data catalogs contained NASA's ADC CD-ROMS (NASA Goddard Space Flight Center, Astronomical Data Center, NSSDC "Selected Astronomical Catalogs" Volumes 1 through 3) into a PostgreSQL DBMS. I did not want to have to type in the SQL commands to create a table then read in the data for each file as there are a great many files each in it's own unique format. This program will look at a FITS tabular file and determine the number of columns it contains, the data type and heading of each column. It will then create a Postgres Table with analogous characteristics. Finally it copies the data from the FITS table to the newly created database able. Any number of FITS table files may be specified on the command line or a "wild card" may be used (i.e. *.fits) to specify the files to be processed. In this way an entire directory or entire CD-ROM may be processed at once. This is the fourth release of this program. It has been tested under Linux on an Intel Pentium (200Mhz, 96MB RAM) and on a Sun SPARC under Solaris 7. It should run on any computer that supports both Postgres and the "cfitsio" library. Any Linux/UNIX machine should have no problem, and with later versions of Postgres, the MS Windows (win32) platform is supported. On my test machine (above p200) it runs fast enough. The One (appox.) one million row Tycho catalog was imported in under one hour. This program may have use other than as a way to import the ADC CD-ROMs. I'd like to see us (the TASS project) agree to write all tabular TASS Mk IV data products in FITS Table format. If this is done then the "database import problem" is solved by this program. To build fitstab2pg unpack the tar file change to the source directory and type "make depend" followed by "make". If you want you can (as root) also type "make install" to copy the executable to where it belongs. To run the program you will need to enter at least a couple command line options. For a quick summary of the options use the "-H" or "--help" option. Here is a sample output: ------------------ SAMPLE ------------------------------ [chris@rabbit fitstab2pg]$ ./fitstab2pg --help usage: fits2pg [option ...] [FitsFileName ...] -H, --help Will print this message -V, --version Will print the version ID -d, --dbname=NAME Name of the database to be used -h, --host=HOSTNAME Name of machine running Postgres server -p, --port=PORT Port to use to connection to Postgres server -N, --nocreate Disable SQL CREATE of table -m, --msglevel=NUMBER 0=quiet, 1=verbose, 2=debug -P, --prepend=P_STRING table = P_STRING+basename(fitsfilename)+ -A, --append=A_STRING A_STRING Following the options may be any number of filenames. These must contain valid FITS format ASCII or binary format tables. A URL may be specified in place of a filename. The data will be brought in over the network using the specified protocol Column and row filtering may be applied as the FITS table is processed. See the CFITSIO User's Guide, Version 2, section 4.2 for details. fits2pg will create a Postgresql table for each FITS table. One table per FITS file. Column names and data types are presevered [chris@rabbit fitstab2pg]$ ----------------- END SAMPLE ------------------------------ Notice that the Postgres table name is derived from the FITS filename by first dropping any extemtion (.fts, .fit,...) and then prepending or appending a user supplied string if such a string is given. The "-d" option is always required. If the "-h" optionis not supplied fits2pg will asume that the Postgres database server is running on the local machine. If that is not the case use "-h". The default message level is "verbose". The program fits2pg 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, or (at your option) any later version. The full text of this license is contained in the file called "COPYING" that should have supplied along with this README file. If you have any comments, or bug reports send e-mail -- --Chris Albertson home: chrisja@jps.net Redondo Beach, California work: calbertson@logicon.com Version ID $Id: README,v 1.3 1999/06/06 04:36:18 chris Exp $