FITS Header Archiving System


FitHAS is an easy-to-use assistant tool for FITS header archiving, which is developed by Chinese Virtual Observatory (China-VO) team, IBM Center of Tianjin University and e-Science Application research Center, CNIC, CAS. The tool provides graphic interface and wizard guiding an archive manager or data provider to extract header information from one or more FITS files (*.fit, *.fits, *.fit.gz, *.fits.gz) and import it to a table, either an existing one or a new one created by the tool according to the header structure of given FITS files. Both local or remote database systems are supported.


  • View primary header information for a given FITS file
  • Import primary header information into a database table for a single FITS file
  • Import primary header information into a database table for multiple FITS files under a directory and its sub-directories
  • Review imported records from a table

System Requirements

  • Sun Microsystems JRE 1.4.2 or later, which can be downloaded here


  • Windows: Please download the self-extract "rar" file here (5.7M), "ReadMe" in both English and Chinese included in the package.
  • Linux: Please download the tar.gz file here (6.3M), "ReadMe" in both English and Chinese included in the package. 

Installation Instructions

  • Windows:
  • 1. Double click on "FitHAS.exe", and the files in the compressed package will be extracted automatically to C:\FitHAS as default, and a shortcut will be created on desktop. After that, the application will start automatically.
    2. For later execution after installation, you can double click "FitHAS.jar" to start the graphic interface or "start.bat" to start the application.

  • Linux:
    1. Decompress the "tar.gz" package, and you'll get the "FitHAS" directory
    2. Run the file "" in the directory to start the application.

Metadata Mapping

The primary FITS header of each FITS file will be inserted into the database table as one record.

You can import headers of FITS files into an existing table or create a new one according to the header structure of the given FITS files. When create a new table, columns that have same names as their corresponding keywords in FITS header will be created. Additional two columns will be added to the table automatically by the system. One is an unique id column ("record_Id") as primary key, and the other is file path column ("path") which is relative to the user defined base directory for the FITS files.

While archiving, each "keyword - value" pair in the FITS primary header will be mapped to corresponding column. One header will not be imported if no corresponding column can be found to match a key word. If there is no corresponding key in a FITS file to a certain column, the column will simply remain null.

Duplication Strategy

Three strategies to avoid duplicate records in a database are supported:

  • By default, when a file is tried to import its header into a database for more then one time, its header will not be inserted as a new record but just be skipped.
  • If the duplication strategy is changed to "update the duplicate files", the duplicated records will be updated according to the new FITS files.
  • If the duplication strategy is set to "clear the table and do archiving", all records will be cleared first imported again.

File Name Filtering

When you choose several files or a directory to archive, it's useful to use a file name filter to specify which file(s) should be archived. That is, any file that doesn't satisfy the filter pattern, even if it's in the directory that you selected, will be excluded and will not be imported into the database.

The filter pattern uses regular expression. All the regular expressions used in Java language are supported here. Some examples are listed below:

character explanation
. Any character (may or may not match line terminators)
\d A digit: [0-9]
\D A non-digit: [^0-9]
\s A whitespace character: [ \t\n\x0B\f\r]
\S A non-whitespace character: [^\s]
\w A word character: [a-zA-Z_0-9]
\W A non-word character: [^\w]
X? X, once or not at all
X* X, zero or more times
X+ X, one or more times
X{n} X, exactly n times
X{n,} X, at least n times
X{n,m} X,at least n but not more than m times
XY X followed by Y
X|Y Either X or Y
(X) X, as a capturing group

Known Problems and Limitations

  • Only MySQL is supported in current release.
  • The data type of all columns except the "record_Id" are set as "TEXT" to keep all information of the original FITS header.

Developers of the tool includes Ms. Wen LI, Ms. Zhen XU, Dr. Chenzhou CUI, Mr. Ce YU and Mr. Jianjun YU. Suggestions and comments are sincerely welcome, please send to Chenzhou Cui

Last Updated on Dec. 12, 2007. 

© 2007, China-VO