=pod =head1 NAME B =head1 SYNOPSIS #include int FunInfoGet(Fun fun, int type, char *addr, ...) =head1 DESCRIPTION The B routine returns information culled from the Funtools structure. The first argument is the Fun handle from which information is to be retrieved. This first required argument is followed by a variable length list of pairs of arguments. Each pair consists of an integer representing the type of information to retrieve and the address where the information is to be stored. The list is terminated by a 0. The routine returns the number of get actions performed. The full list of available information is described below. Please note that only a few of these will be useful to most application developers. For imaging applications, the most important types are: FUN_SECT_DIM1 int /* dim1 for section */ FUN_SECT_DIM2 int /* dim2 for section */ FUN_SECT_BITPIX int /* bitpix for section */ These would be used to determine the dimensions and data type of image data retrieved using the FunImageGet() routine. For example: /* extract and bin the data section into an image buffer */ buf = FunImageGet(fun, NULL, NULL); /* get required information from funtools structure. this should come after the FunImageGet() call, in case the call changed sect_bitpix */ FunInfoGet(fun, FUN_SECT_BITPIX, &bitpix, FUN_SECT_DIM1, &dim1, FUN_SECT_DIM2, &dim2, 0); /* loop through pixels and reset values below limit to value */ for(i=0; i the call to FunImageGet(), in order to retrieve the updated bitpix value. See the imblank example code for more details. It also can be useful to retrieve the World Coordinate System information from the Funtools structure. Funtools uses the the WCS Library developed by Doug Mink at SAO, which is available here. (More information about the WCSTools project in general can be found here.) The FunOpen() routine initializes two WCS structures that can be used with this WCS Library. Applications can retrieve either of these two WCS structures using B: FUN_WCS struct WorldCoor * /* wcs structure, for image coordinates*/ FUN_WCS0 struct WorldCoor * /* wcs structure, for physical coordinates */ The structure retrieved by FUN_WCS is a WCS library handle containing parameters suitable for use with image coordinates, regardless of whether the data are images or tables. For this structure, the WCS reference point (CRPIX) has been converted to image coordinates if the underlying file is a table (and therefore in physical coordinates). You therefore must ensure that the positions being passed to a routine like pix2wcs are in image coordinates. The FUN_WCS0 structure has not had its WCS reference point converted to image coordinates. It therefore is useful when passing processing physical coordinates from a table. Once a WCS structure has been retrieved, it can be used as the first argument to the WCS library routines. (If the structure is NULL, no WCS information was contained in the file.) The two important WCS routines that Funtools uses are: #include