Report About the Work Related to FITSIO Migration Gary Guoying Li Summary The purpose of this task is to use the NASA CFITSIO C library with some wrapper interface to emulate the existing aips/implement/FITS classes to facilitate translation between FITS and AIPS++ data structures, including various operations on the FITS file, such as read/write/skip a header, read/write some bytes, skip a data unit(HDU), skip some records, and so on. What we will lose is the capability to do I/O to tape. This facility, however, is not currently used and so will have little functional impact to the users. One of the important feature of the new classes is the ability to support larger FITS files ( greater than 2GB ), which are/will be produced by telescope facilities. Besides, we will not need to maintain the low level FITS operations within the code base. In order not to affect any existing code that uses the FITS classes, the previous public interface of the FITS classes have been kept intact while their underlying implementation have been changed to use the NASA CFITSIO C library. But we have added some new methods to the public interface, such as write_priArr_hdr() for write required FITS keywords for Primary Array with one call, write_priGrp_hdr() for write required FITS keywords for Random Group with one call, write_binTbl_hdr() for write required FITS keywords for Binary Table Extension with one call, write_ascTbl_hdr() for write required FITS keywords for Ascii Table Extension with one call, write_imgExt_hdr() for write required FITS keywords for Image Extension with one call, so that the CFITSIO library can be made use of the most and make the use of FITS classes more convenient. But note these new methods will work amoung themselves only. Relationship between the new FITS classes and the previous FITS classes In the newer version of AIPS++, the new FITS classes have completely replaced the previous FITS classes. Since the new FITS classes keeps the public interface of the previous FITS classes, any existing applications that use the FITS classes will not be affected. If someone wants to use the previous FITS classes, he will need to check out an older version of AIPS++. But it really does not matter since he will not feel any difference if he wants only the old feature. How is the CIFTSIO slotted in the AIPS++ system In order for the AIPS++ system to recognize the CFITSIO C library, it needs be be defined in the makedefs file, and the files that use CFITSIO will need to include the related header files of CFITSIO into it. At present, the rpms version of AIPS++ has a rpm for the CFITSIO that will install the CFITSIO lib to /usr/lib and its public header files to /usr/include/cfitsio by default. In the new FITS classes, the funtions in the CFITSIO libray are invoked to perform various actions, such as write to and read from FITS files,skip some records, etc. If one needs to use the large file support feature, he will need to make sure the CFITSIO lib he is using has the large file feature support turned on when being built. In summary, in order to make the large file support feature work, we have done three things: 1. Built a CFITSIO lib that has large file support turned on in its configure file; 2. Set many variable type in the FITS classes to the suitable type to support large file; 3. Turned on the large file support of AIPS++ when building it. Tests that have been done upon the new FITS classes include: 1. All the test applications came with the previous FITS classes run gracefully upon the new FITS classes; 2. New test applications to test those classes/methods that has been wrapped but the existing test applications do not cover them. 3. New test applications for the newly added writting-methods for FITS header creation. and more importantly, the test boundary conditions include that the following methods/constructor should work for FITS file that is larger than 2GB: 1. The method that converts a Measurment set to a FITS file: ms::tofits(......); 2. The method that converts a FITS file to a Measurment set: ms::fitstoms(......); 3. The method that converts an image to a FITS file: image::tofits(......); 4. The constructor that constructs an AIPS++ image by conversion from a FITS image file: imagefromfits(......);