The "foreign" Package

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

Library: karma
Link With: -lkarma

Functions

foreign_aips1_read_dataset_namesGet the names of AIPS1 datasets in the directory catalogue.
foreign_aips1_readRead an AIPS dataset.
foreign_aips1_read_headerRead an AIPS dataset header.
foreign_aips1_read_dataRead data in an AIPS file.
foreign_aips1_read_historyRead history for an AIPS file.
foreign_aips1_close_data_contextClose a KAIPS1DataContext object.
foreign_aips2_testTest if a directory is an AIPS++ Image file.
foreign_aips2_runFork and execute a programme.
foreign_drao_read_dataset_namesGet the names of DRAO datasets in the directory catalogue.
foreign_drao_readRead a DRAO dataset.
foreign_drao_read_headerRead a DRAO dataset header.
foreign_drao_read_dataRead data in a DRAO file.
foreign_drao_rewind_data_contextRewind a KDRAODataContext object.
foreign_drao_close_data_contextClose a KDRAODataContext object.
foreign_filter_get_formatGet the filter format
foreign_filter_test_directory_datasetTest if a directory is a dataset.
foreign_filter_get_channelGet the channel for a filtered file.
foreign_filter_readRead a filtered file.
foreign_filter_registerRegister a filter.
foreign_fits_read_headerRead a FITS header.
foreign_fits_readRead a FITS file.
foreign_fits_read_dataRead data in a FITS file.
foreign_fits_writeWrite a FITS file to a channel.
foreign_fits_write_iarrayWrite a FITS file to a channel.
foreign_fits_write_headerWrite a FITS header to a channel object.
foreign_fits_write_dataWrite data to a FITS file.
foreign_fits_write_paddingWrite trailing pad bytes up to the card end.
foreign_gildas_readRead a GILDAS dataset.
foreign_gildas_read_headerRead a GILDAS dataset header.
foreign_gildas_read_dataRead data in a GILDAS file.
foreign_gildas_close_data_contextClose a KGILDASDataContext object.
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_gipsy_writeWrite a GIPSY file.
foreign_gipsy_write_iarrayWrite a GIPSY file.
foreign_gipsy_write_headerWrite a GIPSY header.
foreign_guess_and_readGuess file type and read.
foreign_read_and_setupRead a file and perform some setup.
foreign_guess_writeWrite a data structure, guessing the output format.
foreign_idf_testTest if a file is part of an IDF file set.
foreign_idf_read_headerRead an IDF file header.
foreign_idf_read_dataRead data in an IDF image file.
foreign_idf_readRead an IDF file set.
foreign_iraf_readRead an IRAF dataset.
foreign_iraf_read_headerRead an IRAF dataset header.
foreign_iraf_read_dataRead data in an IRAF file.
foreign_iraf_close_data_contextClose a KIRAFDataContext object.
foreign_miriad_test2Test if a directory is a Miriad Image file.
foreign_miriad_read_header2Read a Miriad Image or Visibility file header.
foreign_miriad_readRead a Miriad image file.
foreign_miriad_create_data_contextCreate a context suitable for reading Miriad Image data.
foreign_miriad_read_dataRead data in a Miriad Image file.
foreign_miriad_close_data_contextClose a KMiriadDataContext object.
foreign_miriad_read_historyRead the history component of a Miriad Image file.
foreign_miriad_read_get_alignment_paddingCompute padding to align to a word boundary.
foreign_miriad_writeWrite a Miriad Image file.
foreign_miriad_write_iarrayWrite a Miriad Image file.
foreign_miriad_write_header_entryWrite a Miriad header entry.
foreign_guess_format_from_filenameAttempt to guess the format of a file by examining its filename.
foreign_pgm_readRead a colour image in PGM format from a channel.
foreign_pnm_read_typeRead the type of a PNM file.
foreign_pnm_readRead a PNM file.
foreign_pnm_read2Read a PNM file.
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_ppm_write_pseudoWrite a PseudoColor image to a channel in PPM format.
foreign_ppm_write_rgbWrite a TrueColor 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.
foreign_sunras_write_pseudoWrite a PseudoColor image to a channel in Sun rasterfile format.
foreign_sunras_write_rgbWrite a TrueColor 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_FITS_READList of attributes for reading FITS files (header+data)
foreign_ATT_FITS_WRITEList of attributes for writing FITS files (header+data)
foreign_ATT_FITS_WRITE_DATAList of attributes for writing FITS data
foreign_ATT_GUESS_READList of attributes for guessing and reading data
foreign_ATT_GUESS_WRITEList of attributes for guessing and writing 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_ATT_MIRIAD_WRITEList of attributes for writing Miriad Image files
foreign_ATT_GIPSY_READ_HEADERList of attributes for reading GIPSY Image headers
foreign_ATT_GIPSY_READ_DATAList of attributes for reading GIPSY Image data
foreign_ATT_GIPSY_READList of attributes for reading GIPSY Image files
foreign_ATT_GIPSY_WRITEList of attributes for writing GIPSY Image files
foreign_ATT_GIPSY_WRITE_HEADERList of attributes for writing GIPSY Image file headers
foreign_TYPESList of foreign file types
foreign_ATT_PPM_WRITEList of attributes for writing PPM files
foreign_ATT_PPM_READList of attributes for reading PPM files
foreign_ATT_PGM_READList of attributes for reading PGM files
foreign_ATT_SUNRAS_READList of attributes for reading Sun Rasterfile files
foreign_ATT_SUNRAS_WRITEList of attributes for writing Sun Rasterfile files
foreign_ATT_IDF_READ_HEADERList of attributes for reading IDF headers
foreign_ATT_IDF_READ_DATAList of attributes for reading IDF data
foreign_ATT_IDF_READList of attributes for reading IDF files (header+data)
foreign_ATT_DRAO_READ_HEADERList of attributes for reading DRAO headers
foreign_ATT_DRAO_READList of attributes for reading DRAO files (header+data)


Functions


EXPERIMENTAL FUNCTION: subject to change without notice

CONST char * foreign_aips1_read_dataset_names (CONST char *dirname, unsigned int *num_datasets)

This routine will read the "CA*.???;*" catalogue file in the specified directory and extracts the names of the datasets. The "AIPS_ID" environment variable should be set to your AIPS user ID.

Parameters:

Returns: A pointer to a buffer packed with dataset names. Each dataset name is separated by a '\0' character. The buffer is internally allocated and must not be freed. If no datasets are found NULL is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_aips1_read (CONST char *setname)

Read an AIPS dataset.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_aips1_read_header (CONST char *setname, flag data_alloc, KAIPS1DataContext *context)

Read an AIPS dataset header.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_aips1_read_data (KAIPS1DataContext context, char *data, uaddr num_values)

This routine will read the data of an AIPS dataset from a KAIPS1DataContext object. The header section is NOT read.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_aips1_read_history (KAIPS1DataContext context, multi_array *multi_desc)

Read history for an AIPS file.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_aips1_close_data_context (KAIPS1DataContext context)

Close a KAIPS1DataContext object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_aips2_test (CONST char *dirname, flag test_dir)

Test if a directory is an AIPS++ Image file.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

pid_t foreign_aips2_run (CONST char *filename, int stdout_fd, int close_fd, int *waitflags)

Fork and execute a programme.

Parameters:

Returns: The child process ID on success, else -1.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

CONST char * foreign_drao_read_dataset_names (CONST char *dirname, unsigned int *num_datasets, unsigned int *max_width)

This routine will read the "deffil.mad" catalogue file in the specified directory and extracts the names of the datasets.

Parameters:

Returns: A pointer to a buffer packed with dataset names. Each dataset name is separated by a '\0' character. The buffer is internally allocated and must not be freed. If no datasets are found NULL is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_drao_read (CONST char *setname, flag convert_int_to_float, ...)

Read a DRAO dataset.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_drao_read_header (CONST char *setname, flag data_alloc, flag convert_int_to_float, KDRAODataContext *context, ...)

Read a DRAO dataset header.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_drao_read_data (KDRAODataContext context, char *data, uaddr num_values)

This routine will read the data of a DRAO dataset from a KDRAODataContext object. The header section is NOT read.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_drao_rewind_data_context (KDRAODataContext context)

Rewind a KDRAODataContext object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_drao_close_data_context (KDRAODataContext context)

Close a KDRAODataContext object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int foreign_filter_get_format (CONST char *filename)

Get the filter format

Parameters:

Returns: A value indicating the format of the file. The value FOREIGN_FILE_FORMAT_FILTER_KARMA is returned if a data filter to Karma for the file exists. The value FOREIGN_FILE_FORMAT_FILTER_FITS is returned if a data filter to FITS exists. Otherwise FOREIGN_FILE_FORMAT_UNKNOWN is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_filter_test_directory_dataset (CONST char *dirname)

Test if a directory is a dataset.

Parameters:

Returns: TRUE if the directory is a dataset, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

Channel foreign_filter_get_channel (CONST char *filename)

Get the channel for a filtered file.

Parameters:

Returns: A channel object on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_filter_read (CONST char *filename)

Read a filtered file.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_filter_register (CONST char *extension,CONST char *converter_prog, pid_t (*run) (CONST char *filename, int stdout_fd, int close_fd, int *waitflags), CONST char *tester_prog, flag (*tester_func) (CONST char *dirname, flag test_dir), unsigned int output_type, CONST char *name)

Register a filter.

Parameters:

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


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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_fits_read (CONST char *filename, flag convert_int_to_float, flag sanitise, ...)

Read a FITS file.

Parameters:

Returns: A multi_array descriptor 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_fits_write (Channel channel, multi_array *multi_desc, ...)

This routine will write a Karma data structure to a FITS file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BITPIX", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


flag foreign_fits_write_iarray (Channel channel, iarray array, ...)

This routine will write an Intelligent Array to a FITS file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BITPIX", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_fits_write_header (Channel channel, CONST multi_array *multi_desc, CONST history *first_hist)

Write a FITS header to a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_fits_write_data (Channel channel, multi_array *multi_desc, CONST packet_desc *header_pack_desc, CONST char *header_packet, char *data, uaddr num_values, ...)

This routine will write the data section of a FITS file to a channel. The header section is NOT written.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_fits_write_padding (Channel channel)

Write trailing pad bytes up to the card end.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_gildas_read (CONST char *setname,unsigned int mmap_option, flag writable)

Read a GILDAS dataset.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_gildas_read_header (CONST char *setname, flag data_alloc, unsigned int mmap_option, flag writable, KGILDASDataContext *context)

Read a GILDAS dataset header.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_gildas_read_data (KGILDASDataContext context, char *data, uaddr num_values)

This routine will read the data of a GILDAS dataset from a KGILDASDataContext object. The header section is NOT read.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_gildas_close_data_context (KGILDASDataContext context)

Close a KGILDASDataContext object.

Parameters:

Returns: Nothing.
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


flag foreign_gipsy_write (CONST char *basename, multi_array *multi_desc, ...)

This routine will write a Karma data structure to a GIPSY file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


flag foreign_gipsy_write_iarray (CONST char *basename, iarray array, ...)

This routine will write an Intelligent Array to a GIPSY file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BITPIX", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_gipsy_write_header (Channel channel, CONST packet_desc *header_pack_desc, CONST char *header_packet, ...)

Write a GIPSY header.

Parameters:

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


multi_array * foreign_guess_and_read (CONST char *filename, unsigned int mmap_option, flag writable, 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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_read_and_setup (CONST char *filename, unsigned int mmap_option, flag writable, unsigned int *ftype, flag inform, unsigned int num_dim, unsigned int preferred_type, flag force_type, iarray *array, double *min, double *max, flag discard_zero_range, KwcsAstro *ap)

This routine will attempt to guess the filetype of a file and in the file, converting to an Intelligent Array if possible. The routine then performs some simple checks and some other convenience functions.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_guess_write (CONST char *filename, multi_array *multi_desc, ...)

Write a data structure, guessing the output format.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_idf_test (CONST char *filename)

Test if a file is part of an IDF file set.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

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

This routine will read the header of an IDF 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


EXPERIMENTAL FUNCTION: subject to change without notice

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

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

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

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

Read an IDF file set.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_iraf_read (CONST char *setname)

Read an IRAF dataset.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_iraf_read_header (CONST char *setname, flag data_alloc, KIRAFDataContext *context)

Read an IRAF dataset header.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_iraf_read_data (KIRAFDataContext context, char *data, uaddr num_values)

This routine will read the data of an IRAF dataset from a KIRAFDataContext object. The header section is NOT read.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_iraf_close_data_context (KIRAFDataContext context)

Close a KIRAFDataContext object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_miriad_test2 (CONST char *dirname, flag test_dir)

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_miriad_read_header2 (CONST char *dirname, 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


EXPERIMENTAL FUNCTION: subject to change without notice

KMiriadDataContext foreign_miriad_create_data_context (CONST char *dirname, unsigned int mmap_option, flag writable)

This routine will create a context suitable for reading Miriad Image data. The foreign_miriad_read_data routine may be used to read data sequentially from the context.

Parameters:

Returns: A KMiriadDataContext object on success, else NULL (indicating the image file could not be read).
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_miriad_read_data (KMiriadDataContext context, multi_array *multi_desc, char *data, uaddr num_values, ...)

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

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void foreign_miriad_close_data_context (KMiriadDataContext context)

Close a KMiriadDataContext object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_miriad_read_history (CONST char *dirname, multi_array *multi_desc)

Read the history component of a Miriad Image file.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int foreign_miriad_read_get_alignment_padding (uaddr position, uaddr size)

Compute padding to align to a word boundary.

Parameters:

Returns: The number of padding bytes required.
Multithreading Level: Unsafe


flag foreign_miriad_write (CONST char *dirname, multi_array *multi_desc, ...)

This routine will write a Karma data structure to a Miriad Image file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


flag foreign_miriad_write_iarray (CONST char *dirname, iarray array, ...)

This routine will write an Intelligent Array to a Miriad Image file. The routine will automatically generate essential keywords such as: "NAXIS", "NAXISn", "CTYPEn", "CRVALn", "CRPIXn", "CDELTn", "BITPIX", "BUNIT", "BSCALE" and "BZERO". Also, existing keywords in the data structure which do not conflict with the generated keywords are copied.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_miriad_write_header_entry (Channel channel, CONST char *name, unsigned int type, unsigned int num_values, CONST char *data)

Write a Miriad header entry.

Parameters:

Returns: TRUE on success, else FALSE.
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_pgm_read (Channel channel, ...)

Read a colour image in PGM format from a channel.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int foreign_pnm_read_type (Channel channel, flag *binary)

Read the type of a PNM file.

Parameters:

Returns: The type of PNM file.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_pnm_read (Channel channel)

Read a PNM file.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

multi_array * foreign_pnm_read2 (CONST char *filename, unsigned int mmap_option, flag writable)

Read a PNM file.

Parameters:

Returns: A pointer to the multi_array data structure on success, else NULL.
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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_ppm_write_pseudo (Channel channel, flag binary, CONST char *image, unsigned int type, uaddr *hoffsets, uaddr *voffsets, unsigned int inp_width, unsigned int inp_height, unsigned int out_width, unsigned int out_height, CONST unsigned short *cmap_reds, CONST unsigned short *cmap_greens, CONST unsigned short *cmap_blues, unsigned int cmap_size, unsigned int min_sat_index, unsigned int max_sat_index, unsigned int blank_index, unsigned int cmap_stride, double i_min, double i_max, flag (*iscale_func) (), void *iscale_info)

Write a PseudoColor image to a channel in PPM format.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_ppm_write_rgb (Channel channel, flag binary, CONST unsigned char *image_red, CONST unsigned char *image_green, CONST unsigned char *image_blue, uaddr *hoffsets, uaddr *voffsets, unsigned int inp_width, unsigned int inp_height, unsigned int out_width, unsigned int out_height, CONST unsigned short *cmap_red, CONST unsigned short *cmap_green, CONST unsigned short *cmap_blue, unsigned int cmap_stride)

Write a TrueColor 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.


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_sunras_write_pseudo (Channel channel, CONST char *image, unsigned int type, uaddr *hoffsets, uaddr *voffsets, unsigned int width, unsigned int height, CONST unsigned short *cmap_reds, CONST unsigned short *cmap_greens, CONST unsigned short *cmap_blues, unsigned int cmap_size, unsigned int cmap_stride, double i_min, double i_max)

Write a PseudoColor image to a channel in Sun rasterfile format.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag foreign_sunras_write_rgb (Channel channel, CONST unsigned char *image_red, CONST unsigned char *image_green, CONST unsigned char *image_blue, uaddr *hoffsets, uaddr *voffsets, unsigned int width, unsigned int height, CONST unsigned short *cmap_red, CONST unsigned short *cmap_green, CONST unsigned short *cmap_blue, unsigned int cmap_stride)

Write a TrueColor image to a channel in Sun rasterfile format.

Parameters:

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


Tables


foreign_ATT_FITS_READ_HEADER List of attributes for reading FITS headers

Name Type Meaning
FA_FITS_READ_HEADER_END End of varargs list
FA_FITS_READ_HEADER_ALLOC_TRUNC flag Allow truncated headers


foreign_ATT_FITS_READ_DATA List of attributes for reading FITS 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
FA_FITS_READ_DATA_SKIP_BLOCKSflag Skip blocks


foreign_ATT_FITS_READ List of attributes for reading FITS files (header+data)

Name Type Meaning
FA_FITS_READ_END End of varargs list
FA_FITS_READ_NUM_BLANKS unsigned long * Number of blank values found
FA_FITS_READ_MMAP_OPTION unsigned int See ch_MAP_CONTROLS
FA_FITS_READ_WRITABLE flag If TRUE array may be written to
FA_FITS_READ_SIMPLE flag If TRUE read a ".sfits" file


foreign_ATT_FITS_WRITE List of attributes for writing FITS files (header+data)

Name Type Meaning
FA_FITS_WRITE_END End of varargs list


foreign_ATT_FITS_WRITE_DATA List of attributes for writing FITS data

Name Type Meaning
FA_FITS_WRITE_DATA_END End of varargs list


foreign_ATT_GUESS_READ List of attributes for guessing and reading data

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_GUESS_WRITE List of attributes for guessing and writing data

Name Type Meaning
FA_GUESS_WRITE_END End of varargs list


foreign_ATT_MIRIAD_READ_HEADER List of attributes for reading Miriad Image headers

Name Type Meaning
FA_MIRIAD_READ_HEADER_END End of varargs list


foreign_ATT_MIRIAD_READ_DATA List of attributes for reading Miriad Image 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
FA_MIRIAD_READ_DATA_SKIP_BLOCKSflag Skip blocks


foreign_ATT_MIRIAD_READ List of attributes for reading Miriad Image files

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_ATT_MIRIAD_WRITE List of attributes for writing Miriad Image files

Name Type Meaning
FA_MIRIAD_WRITE_END End of varargs list
FA_MIRIAD_WRITE_EXTRA_HISTORY flag Generate extra history


foreign_ATT_GIPSY_READ_HEADER List of attributes for reading GIPSY Image headers

Name Type Meaning
FA_GIPSY_READ_HEADER_END End of varargs list


foreign_ATT_GIPSY_READ_DATA List of attributes for reading GIPSY Image data

Name Type Meaning
FA_GIPSY_READ_DATA_END End of varargs list
FA_GIPSY_READ_DATA_NUM_BLANKS unsigned long * Number of blank values
FA_GIPSY_READ_DATA_SKIP_BLOCKSflag Skip blocks


foreign_ATT_GIPSY_READ List of attributes for reading GIPSY Image files

Name Type Meaning
FA_GIPSY_READ_END End of varargs list
FA_GIPSY_READ_NUM_BLANKS unsigned long * Number of blank values


foreign_ATT_GIPSY_WRITE List of attributes for writing GIPSY Image files

Name Type Meaning
FA_GIPSY_WRITE_END End of varargs list


foreign_ATT_GIPSY_WRITE_HEADER List of attributes for writing GIPSY Image file headers

Name Type Meaning
FA_GIPSY_WRITE_HEADER_END End of varargs list


foreign_TYPES List of foreign file 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_FILE_FORMAT_GIPSY GIPSY file
FOREIGN_FILE_FORMAT_PGM Portable Grey Map (PGM) file


foreign_ATT_PPM_WRITE List of attributes for writing PPM files

Name Type Meaning
FA_PPM_WRITE_END End of varargs list


foreign_ATT_PPM_READ List of attributes for reading PPM files

Name Type Meaning
FA_PPM_READ_END End of varargs list
FA_PPM_READ_BINARY flag If provided, do not read first line and use flag value


foreign_ATT_PGM_READ List of attributes for reading PGM files

Name Type Meaning
FA_PGM_READ_END End of varargs list


foreign_ATT_SUNRAS_READ List of attributes for reading Sun Rasterfile files

Name Type Meaning
FA_SUNRAS_READ_END End of varargs list


foreign_ATT_SUNRAS_WRITE List of attributes for writing Sun Rasterfile files

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


foreign_ATT_IDF_READ_HEADER List of attributes for reading IDF headers

Name Type Meaning
FA_IDF_READ_HEADER_END End of varargs list


foreign_ATT_IDF_READ_DATA List of attributes for reading IDF data

Name Type Meaning
FA_IDF_READ_DATA_END End of varargs list
FA_IDF_READ_DATA_NUM_BLANKS unsigned long * Number of blank values found
FA_IDF_READ_DATA_SKIP_BLOCKS flag Skip blocks


foreign_ATT_IDF_READ List of attributes for reading IDF files (header+data)

Name Type Meaning
FA_IDF_READ_END End of varargs list
FA_IDF_READ_NUM_BLANKS unsigned long * Number of blank values found


foreign_ATT_DRAO_READ_HEADER List of attributes for reading DRAO headers

Name Type Meaning
FA_DRAO_READ_HEADER_END End of varargs list
FA_DRAO_READ_HEADER_PARTIAL flag Enable reading of partial data


foreign_ATT_DRAO_READ List of attributes for reading DRAO files (header+data)

Name Type Meaning
FA_DRAO_READ_END End of varargs list
FA_DRAO_READ_PARTIAL flag Enable reading of partial data


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services