Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.adass.org/adass/proceedings/adass03/reprints/P4-16.pdf
Дата изменения: Sat Aug 28 02:42:30 2004
Дата индексирования: Tue Oct 2 11:10:15 2012
Кодировка:

Поисковые слова: m 8
Astronomical Data Analysis Software and Systems XIII ASP Conference Series, Vol. 314, 2004 F. Ochsenbein, M. Al len, and D. Egret, eds.

Making FITS available on Dot Net and its applications
Vivek Haridas, Tamґs Budavari, William O'Mullane, Alex Szalay and a ґ Ani Thakar Department of Physics and Astronomy, Johns Hopkins University, Email: haridas@pha.jhu.edu Alberto Conti and Antonio Volpicelli Space Telescope Science Institute Bill Pence NASA/GSFC Abstract. The Flexible Image Transport System (FITS) is a powerful and widely adopted means of exchanging Astronomical Data. There are also a great number of tools and libraries available on many platforms to facilitate working with FITS. We present the FitsLib1 , A library written to facilitate development of astronomical data analysis tools on the Microsoft.Net Platform. This has been developed as a wrapper over one of the very popular and time tested FITS libraries, CFITSIO. Fits.Net library merges the advantages of speed and ruggedness of CFITSIO with the language independence of the Microsoft.Net technology and a simple Document Ob ject Model (DOM). We believe this library will be intuitive for .NET programmers. We present the design and usage patterns of the library in C-Sharp. We also discuss performance issues of the library. Finally we present a number of applications and web services, which are currently running on this library.

1.

Introduction

We wished to use the CFITSIO package in developing image cutout services on the Microsoft's .Net Platform in the C-Sharp language. This is a comprehensive library and we did not feel translation was viable, C-Sharp does allow use of managed C++. We set out to wrap a minimal set of routines in the managed C++ programming environment. This minimal set, however, grew larger as more functionality was required in C-Sharp. It became apparent that developing code with so many pointers
1

http://skyservice.pha.jhu.edu/develop/FitsLib/

424 c Copyright 2004 Astronomical Society of the Pacific. All rights reserved.


Making FITS available on Dot Net and its applications

425

and unmanaged data ob jects in C-Sharp would prove to be prohibitive, both for development and for maintenance. This led to the design of an ob ject-oriented wrapper that eased the memory and safety issues involved with pointers. Initially a minimal package was developed which could perform reading operations on FITS files. Slowly more features were added until most of the popular FITS operations are now possible An undercurrent of a Document Ob ject Model like structure can be seen throughout the package. We felt that it would match closely with the structure of a FITS file and would be easy to associate with for a programmer in an Ob ject Oriented Language such as C-Sharp. 2. Design Overview

One of the design decisions was to make the library Common Language Runtime compatible (CLR). This would enable the wrapper to be used across different .Net languages such as C-Sharp, Visual Basic and Managed C++. This resulted in the whole design being done in two stages. In the first stage a CLR compliant interface was designed. In the second stage this interface was implemented by instantiating and operating on the appropriate CFITSIO data structures. 2.1. The Interface

The interface intends to provide an intuitive Document Ob ject Model (DOM) like layout for a FITS file. Features such as indexing, properties and polymorphism are utilized here to give a DOM layout for the classes involved. The FitsFactory provides methods for creation of new interfaces to FITS files. The Fits interface opens FITS files for read or write operations. There are also specific interfaces for Fits Table and Image units. The FitsHeader interface provides access to header information in every unit. FitsData is the data structure representing a cell of a Table and also the image buffers. 2.2. The Implementation

The implementation focuses on issues such as memory management, invoking the underlying CFITSIO routines, error management, implementing ob ject-oriented data structures and maintaining CFITSIO data structures. Specific classes implement each of the interface classes managing the tasks mentioned above (2.1.). CFitsTable and CFitsImage are the two ma jor implementation classes. The CFitsTable class implements a ma jor portion of the different interfaces to the Fits Table. The CFitsData class implements the FitsData interface by wrapping the fits table vectors and image buffers inside it. 3. Performance Observations s easy to use but, usage. was observed that to outperform the

The ob ject oriented and memory managed .Net interface i introduces a small overhead compared with direct CFITSIO Performance testing of such interfaces is non trivial. It for some very large FITS files the .NET package appears


426

Haridas et al.

Figure 1.

Performance Statistics

CFITSIO, which seems anomalous. This could be due to host of independent variants such as memory paging, code optimization or garbage collection on the .Net platform. However, when tested over a range of different operational requirements and loads, some overhead can be observed. The performance comparisons shown above were done between similar pieces of CFITSIO and FitsLib program code. Additionally, some mathematical operations were done on the data being used in the tables and images. This was done to minimize the effects of code optimization. 4. Applications

Thanks to active usage and support from a small number of developers from the initial stage, the tool is already employed successfully in a few applications and WebServices, some of which are listed below. 4.1. Galex Summary

The GALEX Summary page2 allows users to browse images in depth and obtain details of individual GALEX ob jects. Among the information provided are the ob ject unique identifier, its coordinates in the GALEX combined ob ject catalog and in the individual band passes (Far UV and Near UV).
2

http://galex.stsci.edu/Tools/Explore/explore.aspx


Making FITS available on Dot Net and its applications 4.2. Catalog Archive Server - JOBS

427

This is a system3 used to process queries against large astronomical databases. It uses a system of queues and personal databases to accommodate a variety of different queries in a timely and efficient manner. 4.3. CAS - Service This is an XML Web Services interface4 to the SDSS Catalog Archive Server (CAS). It provides access to catalog data and returns the result in different formats. 5. Summary

FitsLib is a library meant for for astronomers and developers working on Microsoft's .Net Platform. It offers a DOM like layout and the convenience of a .Net language along with the speed of CFITSIO. The latest documentation, samples, source and binary downloads are available from http://skyservice.pha.jhu.edu/develop/FitsLib/ . References HEASARC, CFITSIO User's Reference Guide,
http://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/cfitsio.html

NASA/GSFC, A User's Guide for the Flexible Image Transport System,
http://archive.stsci.edu/fits/users_guide/

Erich Gamma et al., Addison-Wesley Pub Co, Design Patterns,
http://www.awprofessional.com/titles/0-201-63361-2/

Microsoft Corporation, Microsoft Developer Network, http://msdn.microsoft.com/netframework/, http://msdn.microsoft.com/vcsharp/,
http://msdn.microsoft.com/visualc/

3 4

http://skyservice.pha.jhu.edu/devel/casjobs/ http://skyservice.pha.jhu.edu/devel/casservices/casservice.asmx