Skip to main content

Phase 3 - Migrating catalogues from ASCII to FITS format - Knowledgebase / Post-Observations (Phase 3) / Phase 3 FAQs - ESO Operations Helpdesk

Phase 3 - Migrating catalogues from ASCII to FITS format

Authors list

Q: How to convert an ascii file (table) to a fits file?

A: You can perform the following steps:

  1. Create a comma separated ascii table. For example if the table (cat1.txt) has n columns separated by white spaces:
    awk '{print $1,","$2,","$3,","$...,","$n-1,","$n}' cat1.txt > cat2.txt
  2. Convert the new table (cat2.txt) into a fits file using the stilts tool:
    stilts tcopy cat2.txt cat.fits ifmt=csv ofmt=fits-basic
    Usage:
    stilts <stilts-flags> tcopy ifmt=<in-format> ofmt=<out-format> [in=]<table> [out=]<out-table>
  3.  Add the missing header keywords according to the ESO Science Data Products Standard.

The STIL Tool Set can be downloaded from:

http://www.star.bris.ac.uk/~mbt/stilts/#install

For more information please check the following documentation:

http://www.star.bris.ac.uk/~mbt/stilts/
http://www.star.bris.ac.uk/~mbt/stilts/sun256/tcopy.html