The "iarray" Package

These routines provide a simple interface to the recursive, heirarchical data structure supported in Karma, when only n-dimensional data is to be represented.

Library: karma
Link With: -lkarma

Functions

iarray_contourExtract contours from a 2-dimensional Intelligent Array.
iarray_get_image_from_multiGet an image from a Karma data structure.
iarray_get_movie_from_multiGet a movie from a Karma data structure.
iarray_get_nD_from_multiGet a n-dimensional array from a Karma data structure.
iarray_read_nDRead in a Karma arrayfile and yield an "Intelligent Array".
iarray_writeWrite an "Intelligent Array" in the Karma data format.
iarray_createCreate an Intelligent Array.
iarray_create2Create an Intelligent Array.
iarray_get_from_multi_arrayCreate an Intelligent Array from a Karma data structure.
iarray_create_from_array_descCreate an Intelligent Array from a preallocated nD array.
iarray_deallocDeallocate an Intelligent Array.
iarray_dealloc2Deallocate an Intelligent Array.
iarray_put_named_valueAttach a data value to an Intelligent Array.
iarray_put_named_stringAttach a string to an Intelligent Array.
iarray_get_named_valueGet attached data from an Intelligent Array.
iarray_get_named_stringGet attached string from an Intelligent Array.
iarray_get_sub_array_2DCreate a 2-dimensional alias Intelligent Array.
iarray_get_2D_slice_from_3DCreate a 2-dimensional Intelligent Array alias from a slice.
iarray_get_sub_array_3DCreate a 3-dimensional alias Intelligent Array.
iarray_get_3D_slice_from_4DCreate a 3-dimensional Intelligent Array alias from a slice.
iarray_remap_torusRemap Intelligent Array into a torus.
iarray_dim_lengthGet length of a dimension in an Intelligent Array.
iarray_dim_nameGet dimension name in an Intelligent Array.
iarray_set_world_coordsSet the world co-ordinates of an Intelligent Array dimension.
iarray_get_world_coordsGet the world co-ordinates of an Intelligent Array dimension.
iarray_get_dim_descGet a dimension descriptor from an Intelligent Array.
iarray_get_restrictionsGet restriction information.
iarray_is_full_arrayTest if iarray is the same size as the underlying array.
iarray_compare_sizesCompare if two Intelligent Arrays are the same size.
iarray_copy_dataCopy data between Intelligent Arrays.
iarray_clearClear (set to zero) an Intelligent Array.
iarray_fillFill an Intelligent Array with a single value.
iarray_min_maxDetermine the minimum and maximum value of an Intelligent Array.
iarray_scale_and_offsetScale and offset an Intelligent Array.
iarray_clip_scale_and_offsetClip, scale and offset an Intelligent Array.
iarray_add_and_scaleAdd Intelligent Arrays and scale.
iarray_add_and_scale2Add Intelligent Arrays and scale.
iarray_sub_and_scaleSubtract Intelligent Arrays and scale.
iarray_multiply_divideMultiply or divide Intelligent Arrays and scale.
iarray_compute_histogramCompute a histogram of an "Intelligent Array".
iarray_sumDetermine the sum of an Intelligent Array.
iarray_matrix_multiplyPerform a matrix multiply.
iarray_dim_indexThis routine will find the index of a named dimension.
iarray_get_data_scalingGet the scale and offset for data in an Intelligent Array.
iarray_set_data_scalingSet the scale and offset for data in an Intelligent Array.
iarray_get_data_rangeGet the range of data in an Intelligent Array.
iarray_set_data_rangeSet the range of data in an Intelligent Array.
iarray_format_valueFormat a data value into a string.
iarray_create_from_templateCreate an Intelligent Array from a template array.
iarray_create_from_template2Create an Intelligent Array from a template array.
iarray_get_coordinateGet a co-ordinate along a dimension.
iarray_set_dim_nameChange the name of a dimension of an Intelligent Array.
iarray_append_history_stringAdd a history string to an Intelligent Array.
iarray_copy_named_elementCopy a named element from one Intelligent Array to another.
iarray_get_fits_axisGet the FITS axis number of a dimension.
iarray_create_and_setupCreate an Intelligent Array and setup.
iarray_get_associated_wcs_astroGet the KwcsAstro object associated with an Intelligent Array.
iarray_set_value_nameChange the data name of an Intelligent Array.
iarray_find_centroidFind the centroid inside an ellipse.
iarray_copy_attachedCopy attached data from one Intelligent Array to another.
iarray_compare_grids_2DCompare if two image slices have the same world co-ordinate grid.
iarray_get_beam_correctionGet the beam correction for an area in an array.
iarray_register_data_changeNotify data for Intelligent Array has changed.
iarray_get_valuesConvert Intelligent Array data to double precision complex values
iarray_moment_computeCompute the 0th and 1st moments along the Z axis of a cube.
iarray_moment_createCreate 2-D arrays to contain computed moment maps.
iarray_write_mono_psWrite an Intelligent Array as monochrome PostScript.
iarray_write_pseudocolour_psWrite an Intelligent Array as PseudoColour PostScript.
iarray_write_rgb_psWrite an Intelligent Array as TrueColour PostScript.
iarray_regrid_2DRegrid an array by iterating over the output array.
iarray_regrid_3DRegrid an array by iterating over the output array.
iarray_scrollScroll an Intelligent Array.
iarray_rect_to_polarTransform an image from rectangular to polar co-ordinates.
iarray_transform_3DTransform an array by iterating over the input array.
iarray_untransform_3DTransform an array by iterating over the output array.
iarray_create_1DCreate a 1-dimensional Intelligent Array.
iarray_create_2DCreate a 2-dimensional Intelligent Array.
iarray_create_3DCreate a 3-dimensional Intelligent Array.
iarray_create_4DCreate a 4-dimensional Intelligent Array.
iarray_create_shmCreate an n-dimensional Intelligent Array in shared memory.
iarray_put_doubleAttach a double precision data value to an Intelligent Array.
iarray_put_floatAttach a float data value to an Intelligent Array.
iarray_put_intAttach an integer data value to an Intelligent Array.
iarray_get_doubleGet attached double float from an Intelligent Array.
iarray_get_floatGet attached float from an Intelligent Array.
iarray_get_intGet attached integer from an Intelligent Array.
iarray_fill_doubleFill an Intelligent Array with a double precision float value.
iarray_fill_floatFill an Intelligent Array with a single float value.
iarray_fill_intFill an Intelligent Array with a single integer value.
iarray_min_max_floatDetermine the minimum and maximum value of an Intelligent Array.
iarray_min_max_intDetermine the minimum and maximum value of an Intelligent Array.
iarray_scale_and_offset_floatScale and offset an Intelligent Array.
iarray_scale_and_offset_intScale and offset an Intelligent Array.
iarray_num_dimGet number of dimensions in an Intelligent Array.
iarray_typeGet type of data in an Intelligent Array.
iarray_value_nameGet name of data in an Intelligent Array.
iarray_register_destroy_funcRegister destroy function for an Intelligent Array.
iarray_multi_arrayGet the multi_array for an Intelligent Array.
iarray_multi_indexGet the index of the Intelligent Array within the multi_array.
iarray_array_descGet the array_desc for an Intelligent Array.
iarray_arraypGet the array_pointer for an Intelligent Array.
iarray_register_data_change_funcRegister data change function for an Intelligent Array.

Prototype Functions

iarray_PROTO_destroy_funcRegister destruction of an Intelligent Array.


Functions


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_contour (iarray array, unsigned int num_levels, CONST double *contour_levels, uaddr structure_size, uaddr *buffer_sizes, double **x0_arr, double **y0_arr, double **x1_arr, double **y1_arr, uaddr *num_segments)

This routine will extract contours from a 2-dimensional Intelligent Array, producing a list of line segments that approximate the countours. The co-ordinates of the line segments are in linear world co-ordinates.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag iarray_get_image_from_multi (multi_array *multi_desc, iarray *pseudo, iarray *red, iarray *green, iarray *blue, unsigned int *cmap_index)

This routine will find an image embedded in a Karma data structure. The image may be single-channel (PseudoColour) or it may be a TrueColour image (red, green and blue components).

Parameters:

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


flag iarray_get_movie_from_multi (multi_array *multi_desc, iarray *pseudo, iarray *red, iarray *green, iarray *blue, unsigned int *cmap_index)

This routine will find a movie embedded in a Karma data structure. The movie may be single-channel (PseudoColour) or it may be a TrueColour movie (red, green and blue components).

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_get_nD_from_multi (multi_array *multi_desc, CONST char *name, unsigned int num_dim, iarray *pseudo, iarray *red, iarray *green, iarray *blue, unsigned int *cmap_index)

This routine will find an array embedded in a Karma data structure. The array may be single-channel (PseudoColour) or it may be a TrueColour array (red, green and blue components).

Parameters:

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


iarray iarray_read_nD (CONST char *object, flag cache, CONST char *arrayname, unsigned int num_dim, CONST char **dim_names, CONST char *elem_name, unsigned int mmap_option)

Read in a Karma arrayfile and yield an "Intelligent Array".

Parameters:

Returns: A dynamically allocated intelligent array on success, else an error message is printed to the standard output and NULL is returned.
Multithreading Level: Unsafe


flag iarray_write (iarray array, CONST char *arrayfile)

Write an "Intelligent Array" in the Karma data format.

Parameters:

Returns: TRUE on success, else an error message is printed to the standard output and FALSE is returned.
Multithreading Level: Unsafe


iarray iarray_create (unsigned int type, unsigned int num_dim, CONST char **dim_names, CONST unsigned long *dim_lengths, CONST char *elem_name, iarray old_array)

This routine will create an "Intelligent Array", using the Karma general data structure format as the underlying data format. If the environment variable "IARRAY_ALLOC_DEBUG" is set to "TRUE" then the routine will print allocation debugging information.

Parameters:

Returns: A dynamically allocated intelligent array on success, else an error message is printed to the standard output and NULL is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_create2 (unsigned int type, unsigned int num_dim, CONST char **dim_names,CONST unsigned long *dim_lengths, CONST char *elem_name, iarray old_array, flag clear)

This routine will create an "Intelligent Array", using the Karma general data structure format as the underlying data format. If the environment variable "IARRAY_ALLOC_DEBUG" is set to "TRUE" then the routine will print allocation debugging information.

Parameters:

Returns: A dynamically allocated intelligent array on success, else an error message is printed to the standard output and NULL is returned.
Multithreading Level: Unsafe


iarray iarray_get_from_multi_array (multi_array *multi_desc, CONST char *arrayname, unsigned int num_dim, CONST char **dim_names, CONST char *elem_name)

This routine will yield an "Intelligent Array" from a multi array Karma general data structure. The routine searches for a n-dimensional array with a single atomic element at each point in multi-dimensional space

Parameters:

Returns: A dynamically allocated intelligent array on success, else an error message is printed to the standard output and NULL is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_create_from_array_desc (array_desc *arr_desc, CONST array_pointer *arrayp, unsigned int elem_index)

Create an Intelligent Array from a preallocated nD array.

Parameters:

Returns: A dynamically allocated intelligent array on success, else an error message is printed to the standard output and NULL is returned.
Multithreading Level: Unsafe


void iarray_dealloc (iarray array)

This routine will deallocate an "Intelligent Array". If the environment variable "IARRAY_ALLOC_DEBUG" is set to "TRUE" then the routine will print deallocation debugging information.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_dealloc2 (iarray array)

This routine will deallocate an "Intelligent Array". If the environment variable "IARRAY_ALLOC_DEBUG" is set to "TRUE" then the routine will print deallocation debugging information.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag iarray_put_named_value (iarray array, CONST char *name, unsigned int type, double value[2])

This routine will add a unique named value to the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


flag iarray_put_named_string (iarray array, CONST char *name, CONST char *string)

This routine will addor update a unique named string to the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


flag iarray_get_named_value (iarray array, CONST char *name, unsigned int *type, double value[2])

This routine will get a unique named value from the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


char * iarray_get_named_string (iarray array, CONST char *name)

This routine will get a unique named string from the underlying Karma general data structure of an "Intelligent Array".

Parameters:

Returns: A pointer to a dynamically allocated copy of the string on success, else NULL.
Multithreading Level: Unsafe


iarray iarray_get_sub_array_2D (iarray array, int starty, int startx, unsigned int ylen, unsigned int xlen)

This routine will create an "Intelligent Array" which is an alias or a sub-array of another "Intelligent Array". Subsequent modification of the alias array will modify the data of the original array. Sub-arrays may be created from other sub-arrays. The attachment count of the underlying multi_array data structure is incremented on successful completion.

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


iarray iarray_get_2D_slice_from_3D (iarray cube, unsigned int ydim, unsigned int xdim, unsigned int slice_pos)

This routine will create a 2-D "Intelligent Array" which is an alias of an arbitrary slice of a 3-D array.

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_get_sub_array_3D (iarray array, int startz, int starty, int startx, unsigned int zlen, unsigned int ylen, unsigned int xlen)

This routine will create an "Intelligent Array" which is an alias or a sub-array of another "Intelligent Array". Subsequent modification of the alias array will modify the data of the original array. Sub-arrays may be created from other sub-arrays. The attachment count of the underlying multi_array data structure is incremented on successful completion.

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_get_3D_slice_from_4D (iarray hcube, unsigned int zdim, unsigned int ydim, unsigned int xdim, unsigned int cube_pos)

This routine will create a 3-D "Intelligent Array" which is an alias of an arbitrary slice of a 4-D array.

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


void iarray_remap_torus (iarray array, unsigned int boundary_width)

This routine will remap an N-dimensional "Intelligent Array" to a pseudo-toroidal array.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


unsigned long iarray_dim_length (iarray array, unsigned int index)

Get length of a dimension in an Intelligent Array.

Parameters:

Returns: The length of the specified dimension.
Multithreading Level: Unsafe


CONST char * iarray_dim_name (iarray array, unsigned int index)

This routine will get the name of a specified dimension in a simple, n-dimensional array.

Parameters:

Returns: A pointer to the name of the specified dimension.
Multithreading Level: Unsafe


void iarray_set_world_coords (iarray array, unsigned int index, double first, double last)

Set the world co-ordinates of an Intelligent Array dimension.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


void iarray_get_world_coords (iarray array, unsigned int index, double *first, double *last)

Get the world co-ordinates of an Intelligent Array dimension.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


dim_desc * iarray_get_dim_desc (iarray array, unsigned int index)

Get a dimension descriptor from an Intelligent Array.

Parameters:

Returns: A pointer to the dimension descriptor.
Multithreading Level: Unsafe


unsigned int iarray_get_restrictions (iarray array, char ***restr_names, double **restr_values)

This routine will get any associated restrictions for an Intelligent Array. The routine will dynamically allocate space for the restriction data, which must be externally freed.

Parameters:

Returns: The number of restrictions. This may be 0.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_is_full_array (iarray array, flag *all_contiguous)

This routine will test if an Intelligent Array is the same size and dimensionality as the underlying array descriptor.

Parameters:

Returns: TRUE if the Intelligent Array is the same size, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_compare_sizes (iarray array1, iarray array2, flag message)

Compare if two Intelligent Arrays are the same size.

Parameters:

Returns: TRUE of the number of dimensions and dimension lengths are the same, else FALSE.
Multithreading Level: Unsafe


flag iarray_copy_data (iarray output, iarray input, flag magnitude)

This routine will copy data from one "Intelligent Array" to another. The sizes of the two arrays must be identical. The routine can deal with the types of the two arrays being different

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_clear (iarray array)

Clear (set to zero) an Intelligent Array.

Parameters:

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


flag iarray_fill (iarray array, double value[2])

Fill an Intelligent Array with a single value.

Parameters:

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


flag iarray_min_max (iarray array, unsigned int conv_type, double *min, double *max)

Determine the minimum and maximum value of an Intelligent Array.

Parameters:

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


flag iarray_scale_and_offset (iarray out, iarray inp, double scale[2], double offset[2], flag magnitude)

This routine will perform a scale and offset on every element in an "Intelligent Array" (output = input * scale + offset).

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_clip_scale_and_offset (iarray out, iarray inp, double scale, double offset, double lower_clip, double upper_clip, flag blank)

This routine will perform a clipping operation followed by a scale and offset on every element in an "Intelligent Array". The operation following the clipping is: (output = input * scale + offset).

Parameters:

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


flag iarray_add_and_scale (iarray out, iarray inp1, iarray inp2, double scale[2], flag magnitude)

This routine will add two "Intelligent Array" to each other and scales the result. The sizes of the two input arrays and the output must be identical. The routine performs the following computation: OUT = INP1 + INP2 * scale The routine will automatically perform type conversions if necessary.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_add_and_scale2 (iarray out, iarray inp1, iarray inp2, double scale[2], double offset[2], flag magnitude)

This routine will add two "Intelligent Array" to each other and scales the result. The sizes of the two input arrays and the output must be identical. The routine performs the following computation: OUT = INP1 + INP2 * scale + offset The routine will automatically perform type conversions if necessary.

Parameters:

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


flag iarray_sub_and_scale (iarray out, iarray inp1, iarray inp2, double scale[2], flag magnitude)

This routine will subtract two "Intelligent Array" from each other and scales the result. The sizes of the two input arrays and the output must be identical. The routine performs the following computation: OUT = INP1 - INP2 * scale The routine will automatically perform type conversions if necessary.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_multiply_divide (iarray out, iarray inp1, iarray inp2, flag multiply, double scale[2], double offset[2], flag magnitude)

This routine will add two "Intelligent Array" to each other and scales the result. The sizes of the two input arrays and the output must be identical. The routine performs the following computation: OUT = INP1 op (INP2 * scale + offset) where op is the multiply or divide operation. The routine will automatically perform type conversions if necessary.

Parameters:

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


flag iarray_compute_histogram (iarray array, unsigned int conv_type, double min, double max, unsigned long num_bins, unsigned long *histogram_array, unsigned long *histogram_peak, unsigned long *histogram_mode)

Compute a histogram of an "Intelligent Array".

Parameters:

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


flag iarray_sum (iarray array, double sum[2])

Determine the sum of an Intelligent Array.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_matrix_multiply (iarray out, iarray in1, iarray in2, flag thread)

Perform a matrix multiply.

Parameters:

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


unsigned int iarray_dim_index (iarray array, CONST char *name)

This routine will find the index of a named dimension.

Parameters:

Returns: The dimension index if found, else the number of dimension in the array is returned.
Multithreading Level: Unsafe


flag iarray_get_data_scaling (iarray array, double *scale, double *offset)

This routine will determine the scale and offset for data in an Intelligent Array. This may be important when a floating-point array has been converted to an integer array to save space. Scaling information should be attached to the array so that the original data values may be reconstructed (aside from quantisation effects). The following expression may be used to convert scaled values to real values: (output = input * scale + offset). The scaling and offset values should previously have been attached to the Intelligent Array using the iarray_set_data_scaling routine.

Parameters:

Returns: TRUE if either the scaling or offset value were found, else FALSE
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_set_data_scaling (iarray array, double scale, double offset)

This routine will set the scale and offset for data in an Intelligent Array. This may be important when a floating-point array has been converted to an integer array to save space. The scaling information will be attached to the array so that the original data values may be reconstructed (aside from quantisation effects). The following expression may be used to convert scaled values to real values: (output = input * scale + offset).

Parameters:

Returns: TRUE if the scaling information is different from what was already attached to the array, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_get_data_range (iarray array, double *minimum, double *maximum)

This routine will determine the range of data in an Intelligent Array. Range information should be attached to the header.

Parameters:

Returns: TRUE if either the minimum or maximum value were found, else FALSE
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_set_data_range (iarray array, double minimum, double maximum)

This routine will set the range of data in an Intelligent Array. The range information will be attached to the header.

Parameters:

Returns: TRUE if the range information is different from what was already attached to the array, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_format_value (iarray array, char string[STRING_LENGTH], double value, double scale, double offset)

Format a data value into a string.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


iarray iarray_create_from_template (iarray template_arr,unsigned int elem_type, flag copy_world_coords, flag copy_names, flag copy_aux_info)

This routine will create an Intelligent Array of a specified type using an existing Intelligent Array as the template for the size, dimensionality and other attributes.

Parameters:

Returns: An Intelligent Array on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_create_from_template2 (iarray template_arr, unsigned int elem_type, flag copy_world_coords, flag copy_names, flag copy_aux_info, flag clear)

This routine will create an Intelligent Array of a specified type using an existing Intelligent Array as the template for the size, dimensionality and other attributes.

Parameters:

Returns: An Intelligent Array on success, else NULL.
Multithreading Level: Unsafe


double iarray_get_coordinate (iarray array, unsigned int dim_index, double coord_index)

Get a co-ordinate along a dimension.

Parameters:

Returns: The co-ordinate on success, else TOOBIG.
Multithreading Level: Unsafe


void iarray_set_dim_name (iarray array, unsigned int index, CONST char *name, flag new_alloc)

Change the name of a dimension of an Intelligent Array.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag iarray_append_history_string (iarray array, CONST char *string, flag new_alloc)

Add a history string to an Intelligent Array.

Parameters:

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


flag iarray_copy_named_element (iarray out, iarray in, CONST char *name, flag fail_if_not_found, flag fail_on_duplicate, flag replace)

Copy a named element from one Intelligent Array to another.

Parameters:

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


unsigned int iarray_get_fits_axis (iarray array, unsigned int index)

Get the FITS axis number of a dimension.

Parameters:

Returns: The FITS axis number on success, else 0.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_create_and_setup (iarray *array, multi_array *multi_desc, flag inform, unsigned int num_dim, unsigned int required_type, 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

KwcsAstro iarray_get_associated_wcs_astro (iarray array)

Get the KwcsAstro object associated with an Intelligent Array.

Parameters:

Returns: The KwcsAstro object if associated, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_set_value_name (iarray array, CONST char *name, flag new_alloc)

Change the data name of an Intelligent Array.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_find_centroid (iarray array, double *background, flag *inverted, double *xpos, uaddr xradius, double *ypos, uaddr yradius)

This routine will search for the centroid of an object inside a specified ellipse.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_copy_attached (iarray output, iarray input, flag fail_on_duplicate, flag replace)

Copy attached data from one Intelligent Array to another.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_compare_grids_2D (iarray array1, unsigned int hdim1, unsigned int vdim1, iarray array2, unsigned int hdim2, unsigned int vdim2, flag *same)

Compare if two image slices have the same world co-ordinate grid.

Parameters:

Returns: TRUE on success, else FALSE, indicating that comparison failed.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

double iarray_get_beam_correction (iarray array, unsigned int dim1, unsigned int dim2)

Get the beam correction for an area in an array.

Parameters:

Returns: The beam correction, if available, else TOOBIG.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_register_data_change (iarray array, void *call_data)

Notify data for Intelligent Array has changed.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_get_values (iarray array, CONST uaddr *coords, double *values, flag *complex, unsigned int num_values)

This routine will convert many values along the least significant axis of an Intelligent Array to an array of double precision complex values.

Parameters:

Returns: Nothing.
Multithreading Level: Safe.


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_moment_compute (iarray mom0, iarray mom1, iarray cube, float lower_clip, float sum_clip, unsigned int moment1_algorithm, unsigned int start_z, unsigned int stop_z, float *mom0_min, float *mom0_max)

Compute the 0th and 1st moments along the Z axis of a cube.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_moment_create (iarray *mom0, iarray *mom1, iarray cube)

Create 2-D arrays to contain computed moment maps.

Parameters:

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


flag iarray_write_mono_ps (iarray image, PostScriptPage pspage, double xstart, double ystart, double xend, double yend, flag iscale)

This routine will convert a 2-dimensional Intelligent Array to monochrome PostScript. The routine does NOT write PostScript headers or tails.

Parameters:

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


flag iarray_write_pseudocolour_ps (iarray image, PostScriptPage pspage, double xstart, double ystart, double xend, double yend, unsigned short *cmap,unsigned int cmap_size)

This routine will convert a 2-dimensional Intelligent Array to colour PostScript. The routine does NOT write PostScript headers or tails.

Parameters:

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


flag iarray_write_rgb_ps (iarray image_red, iarray image_green, iarray image_blue, PostScriptPage pspage, double xstart, double ystart, double xend, double yend)

This routine will convert three 2-dimensional Intelligent Arrays to colour PostScript. The routine does NOT write PostScript headers or tails.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_regrid_2D (iarray out_arr, KwcsAstro out_ap, iarray in_arr, KwcsAstro in_ap, unsigned int sample_option, float *min, float *max, flag verbose)

Regrid an array by iterating over the output array.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_regrid_3D (iarray out_arr, KwcsAstro out_ap, iarray in_arr, KwcsAstro in_ap, unsigned int sample_option, float *min, float *max, flag verbose)

Regrid an array by iterating over the output array.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_scroll (iarray array, unsigned long num_to_scroll, unsigned int scroll_mode)

This routine will scroll "down" an array by a specified number of co-ordinates along the major dimension (dimension 0).

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void iarray_rect_to_polar (iarray out, iarray in, double centre_x, double centre_y, double radius_major, double radius_minor, double rotation)

This routine will transform an input image with a rectangular co-ordinate system to an output image with a polar co-ordinate system. Lines of constant radius in the output image correspond to the points around an ellipse in the input image. The X axis in the output image will correspond to different radii bins, while the Y axis will correspond to different angle bins. The last X axis index will correspond to the outer ellipse.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_transform_3D (iarray out_arr, KwcsAstro out_ap, iarray in_arr, KwcsAstro in_ap, void (*func) (void *info, unsigned long length, double *x, double *y, double *z), void *info)

Transform an array by iterating over the input array.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag iarray_untransform_3D (iarray out_arr, KwcsAstro out_ap, iarray in_arr, KwcsAstro in_ap, void (*func) (void *info, unsigned long length, double *x, double *y, double *z), void *info)

Transform an array by iterating over the output array.

Parameters:

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


iarray iarray_create_1D (unsigned long xlen, unsigned int type)

This routine will create a 1-dimensional "Intelligent Array", using the Karma general data structure format as the underlying data format

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


iarray iarray_create_2D (unsigned long ylen, unsigned long xlen, unsigned int type)

This routine will create a 2-dimensional "Intelligent Array", using the Karma general data structure format as the underlying data format

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


iarray iarray_create_3D (unsigned long zlen, unsigned long ylen, unsigned long xlen, unsigned int type)

This routine will create a 3-dimensional "Intelligent Array", using the Karma general data structure format as the underlying data format

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


iarray iarray_create_4D (unsigned long zlen, unsigned long ylen, unsigned long xlen, unsigned int wlen, unsigned int type)

This routine will create a 4-dimensional "Intelligent Array", using the Karma general data structure format as the underlying data format

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

iarray iarray_create_shm (unsigned int type, unsigned int num_dim, CONST char **dim_names, CONST uaddr *dim_lengths, CONST char *elem_name, flag force)

Create an n-dimensional Intelligent Array in shared memory.

Parameters:

Returns: A dynamically allocated intelligent array on success, else NULL.
Multithreading Level: Unsafe


flag iarray_put_double (iarray array, CONST char *name, double value)

This routine will put a unique named float value into the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


flag iarray_put_float (iarray array, CONST char *name, float value)

This routine will put a unique named float value into the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


flag iarray_put_int (iarray array, CONST char *name, int value)

This routine will put a unique named integer value into the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


flag iarray_get_double (iarray array, CONST char *name, double *value, flag abort_on_error)

This routine will get a unique named double precision floating point value from the underlying Karma general data structure of an "Intelligent Array".

Parameters:

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


float iarray_get_float (iarray array, CONST char *name)

This routine will get a unique named float value from the underlying Karma general data structure of an "Intelligent Array".

Parameters:

Returns: The value on success, else the process is aborted on error.
Multithreading Level: Unsafe


int iarray_get_int (iarray array, CONST char *name)

This routine will get a unique named integer value from the underlying Karma general data structure of an "Intelligent Array".

Parameters:

Returns: The value on success, else the process is aborted on error.
Multithreading Level: Unsafe


flag iarray_fill_double (iarray array, double value)

Fill an Intelligent Array with a double precision float value.

Parameters:

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


flag iarray_fill_float (iarray array, float value)

Fill an Intelligent Array with a single float value.

Parameters:

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


flag iarray_fill_int (iarray array, int value)

Fill an Intelligent Array with a single integer value.

Parameters:

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


flag iarray_min_max_float (iarray array, float *min, float *max)

Determine the minimum and maximum value of an Intelligent Array.

Parameters:

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


flag iarray_min_max_int (iarray array, int *min, int *max)

Determine the minimum and maximum value of an Intelligent Array.

Parameters:

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


flag iarray_scale_and_offset_float (iarray out, iarray inp, float scale, float offset)

This routine will perform a scale and offset on every element in an "Intelligent Array" (output = input * scale + offset).

Parameters:

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


flag iarray_scale_and_offset_int (iarray out, iarray inp, int scale,int offset)

This routine will perform a scale and offset on every element in an "Intelligent Array" (output = input * scale + offset).

Parameters:

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


unsigned int iarray_num_dim (iarray array)

Get number of dimensions in an Intelligent Array.

Parameters:

Returns: The number of dimensions.
Multithreading Level: Unsafe


unsigned int iarray_type (iarray array)

Get type of data in an Intelligent Array.

Parameters:

Returns: The type of the data in the array.
Multithreading Level: Unsafe


CONST char * iarray_value_name (iarray array)

Get name of data in an Intelligent Array.

Parameters:

Returns: The name of the data in the array.
Multithreading Level: Unsafe


KCallbackFunc iarray_register_destroy_func (iarray array, void (*destroy_func) (iarray array, void *info), void *info)

Register destroy function for an Intelligent Array.

Parameters:

Returns: A KCallbackFunc object. On failure, the process aborts.
Multithreading Level: Unsafe


multi_array * iarray_multi_array (array)

Get the multi_array for an Intelligent Array.

Parameters:

Returns: The multi_array.
Multithreading Level: Unsafe


unsigned int iarray_multi_index (array)

Get the index of the Intelligent Array within the multi_array.

Parameters:

Returns: The index.
Multithreading Level: Unsafe


multi_array * iarray_array_desc (array)

Get the array_desc for an Intelligent Array.

Parameters:

Returns: The array_desc.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

array_pointer * iarray_arrayp (array)

Get the array_pointer for an Intelligent Array.

Parameters:

Returns: A pointer to the array_pointer. This pointer is invalidated by any operation that causes the top level packet data to be reallocated.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KCallbackFunc iarray_register_data_change_func (iarray array, void (*func) (void *info), void *info)

Register data change function for an Intelligent Array.

Parameters:

Returns: A KCallbackFunc object. On failure, the process aborts.
Multithreading Level: Unsafe


Prototype Functions


void iarray_PROTO_destroy_func (iarray array, void *info)

Register destruction of an Intelligent Array.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


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