The "foreign" Package

These routines convert between the Karma data format and foreign data formats.

Library: karma
Link With: -lkarma

Functions

foreign_fits_read_headerRead a FITS header.
foreign_fits_read_dataRead data in a FITS file.
foreign_gipsy_testTest if a file is part of a GIPSY file set.
foreign_gipsy_read_headerRead a GIPSY file header.
foreign_gipsy_read_dataRead data in a GIPSY image file.
foreign_gipsy_readRead a GIPSY file set.
foreign_guess_and_readGuess file type and read.
foreign_miriad_testTest if a directory is a Miriad Image file.
foreign_miriad_read_headerRead a Miriad Image file header.
foreign_miriad_readRead a Miriad image file.
foreign_guess_format_from_filenameAttempt to guess the format of a file by examining its filename.
foreign_ppm_readRead a colour image in PPM format from a channel.
foreign_ppm_writeWrite a colour image to a channel in PPM format
foreign_sunras_readRead an image in Sun rasterfile format from a channel.
foreign_sunras_writeWrite a colour image to a channel in Sun rasterfile format

Tables

FOREIGN_ATT_FITS_READ_HEADERList of attributes for reading FITS headers
FOREIGN_ATT_FITS_READ_DATAList of attributes for reading FITS data
FOREIGN_ATT_GUESSList of attributes for guessing and reading data
FOREIGN_ATT_MIRIAD_READ_HEADERList of attributes for reading Miriad Image headers
FOREIGN_ATT_MIRIAD_READ_DATAList of attributes for reading Miriad Image data
FOREIGN_ATT_MIRIAD_READList of attributes for reading Miriad Image files
FOREIGN_TYPESList of foreign file types
FOREIGN_ATT_PPM_READList of attributes for reading PPM files
FOREIGN_ATT_PPM_WRITEList of attributes for writing PPM files
FOREIGN_ATT_SUNRAS_READList of attributes for reading Sun Rasterfile files
FOREIGN_ATT_SUNRAS_WRITEList of attributes for writing Sun Rasterfile files


Functions


multi_array * foreign_fits_read_header (Channel channel, flag data_alloc, flag convert_int_to_float, flag sanitise, ...)

This routine will read the header of a FITS file from a channel. The data section is NOT read.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL.
Multithreading Level: Unsafe


flag foreign_fits_read_data (Channel channel, multi_array *multi_desc, char *data, uaddr num_values, ...)

This routine will read the data of a FITS file from a channel. The header section is NOT read.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag foreign_gipsy_test (CONST char *filename)

Test if a file is part of a GIPSY file set.

Parameters:

Returns: TRUE if the file is part of a GIPSY file set, else FALSE.
Multithreading Level: Unsafe


multi_array * foreign_gipsy_read_header (Channel channel, flag data_alloc, flag sanitise, ...)

This routine will read the header of a GIPSY file from a channel. The data section is NOT read.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL.
Multithreading Level: Unsafe


flag foreign_gipsy_read_data (Channel channel, multi_array *multi_desc, char *data, uaddr num_values, ...)

This routine will read the data of a GIPSY image file from a channel.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


multi_array * foreign_gipsy_read (CONST char *filename, flag sanitise, ...)

Read a GIPSY file set.

Parameters:

Returns: A multi_array descriptor on success, else NULL.
Multithreading Level: Unsafe


multi_array * foreign_guess_and_read (CONST char *filename, unsigned int mmap_option, flag writeable, unsigned int *ftype, ...)

This routine will attempt to guess the filetype of a file and in the file, converting to the Karma data format if possible.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL.
Multithreading Level: Unsafe


flag foreign_miriad_test (CONST char *dirname)

Test if a directory is a Miriad Image file.

Parameters:

Returns: TRUE if the directory is a Miriad Image file, else FALSE.
Multithreading Level: Unsafe


multi_array * foreign_miriad_read_header (Channel channel, flag data_alloc, flag sanitise, ...)

This routine will read the header of a Miriad Image file from a channel. The data section is NOT read.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL.
Multithreading Level: Unsafe


multi_array * foreign_miriad_read (CONST char *dirname, flag sanitise, ...)

Read a Miriad image file.

Parameters:

Returns: A multi_array descriptor on success, else NULL.
Multithreading Level: Unsafe


unsigned int foreign_guess_format_from_filename (CONST char *filename)

Attempt to guess the format of a file by examining its filename.

Parameters:

Returns: A value indicating the format of the file. The value FOREIGN_FILE_FORMAT_KARMA is returned if the extension is ".kf". See FOREIGN_TYPES for a list of possible values.
Multithreading Level: Unsafe


multi_array * foreign_ppm_read (Channel channel, ...)

Read a colour image in PPM format from a channel.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL
Multithreading Level: Unsafe


flag foreign_ppm_write (Channel channel, multi_array *multi_desc, flag binary, ...)

Write a colour image to a channel in PPM format

Parameters:

Returns: TRUE on succes, else FALSE.
Multithreading Level: Unsafe


multi_array * foreign_sunras_read (Channel channel, ...)

Read an image in Sun rasterfile format from a channel.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL
Multithreading Level: Unsafe


flag foreign_sunras_write (Channel channel, multi_array *multi_desc, ...)

Write a colour image to a channel in Sun rasterfile format

Parameters:

Returns: TRUE on succes, else FALSE.
Multithreading Level: Unsafe.


Tables


FOREIGN_ATT_FITS_READ_HEADER

Name Type Meaning
FA_FITS_READ_HEADER_END End of varargs list


FOREIGN_ATT_FITS_READ_DATA

Name Type Meaning
FA_FITS_READ_DATA_END End of varargs list
FA_FITS_READ_DATA_NUM_BLANKS unsigned long * Number of blank values found


FOREIGN_ATT_GUESS

Name Type Meaning
FA_GUESS_READ_END End of varargs list
FA_GUESS_READ_FITS_TO_FLOAT flag Convert FITS data to floating point


FOREIGN_ATT_MIRIAD_READ_HEADER

Name Type Meaning
FA_MIRIAD_READ_HEADER_END End of varargs list


FOREIGN_ATT_MIRIAD_READ_DATA

Name Type Meaning
FA_MIRIAD_READ_DATA_END End of varargs list
FA_MIRIAD_READ_DATA_NUM_BLANKS unsigned long * Number of blank values (includes masked values)
FA_MIRIAD_READ_DATA_NUM_MASKED unsigned long * Number of masked values


FOREIGN_ATT_MIRIAD_READ

Name Type Meaning
FA_MIRIAD_READ_END End of varargs list
FA_MIRIAD_READ_NUM_BLANKS unsigned long * Number of blank values (includes masked values)
FA_MIRIAD_READ_NUM_MASKED unsigned long * Number of masked values


FOREIGN_TYPES

Name Meaning
FOREIGN_FILE_FORMAT_KARMA Karma file (native format)
FOREIGN_FILE_FORMAT_UNKNOWN Unknown format
FOREIGN_FILE_FORMAT_PPM Portable PixMap format (PPM)
FOREIGN_FILE_FORMAT_FITS Flexible Image Transport System (FITS)
FOREIGN_FILE_FORMAT_SUNRAS Sun Rasterfile
FOREIGN_FILE_FORMAT_MIRIAD Miriad Image file


FOREIGN_ATT_PPM_READ

Name Type Meaning
FA_PPM_READ_END End of varargs list


FOREIGN_ATT_PPM_WRITE

Name Type Meaning
FA_PPM_WRITE_END End of varargs list


FOREIGN_ATT_SUNRAS_READ

Name Type Meaning
FA_SUNRAS_READ_END End of varargs list


FOREIGN_ATT_SUNRAS_WRITE

Name Type Meaning
FA_SUNRAS_WRITE_END End of varargs list
FA_SUNRAS_WRITE_NO_IMAGE flag * No image found in data structure


Contact: Richard Gooch
Web Development: Ariel Internet Services