DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lkreal2cmplx - create a complex object from real source object(s)

LIBRARY CALL

int lkreal2cmplx(
    kobject real_obj,
    kobject imag_obj,
    double  real_val,
    double  imag_val,
    kobject dest_obj)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

lkreal2cmplx generates a complex destination object, dest_obj, containing complex data from the supplied source object(s), real_obj and imag_obj. The complex data type (float or double) is determined by taking the highest source data type.

Single Source Object: If only one source object is valid, the other component of the complex pair will be the real_val or imag_val passed in. If the source object has map data, the operation will be performed on the map only. For the single source case, location, time, and mask data are not needed or modified.

Two Source Objects: If both source objects are valid, and both contain maps and no value data the operation is performed directly on the map. For the case of two sources with no value data, location, time, and mask data are not needed or modified.

If either source object contains both map and value data, then both objects must have value data, and the data will be mapped before processing.

If the source objects are the same size, then location and time data can be ignored.

If the source objects are different sizes, then location and time data are checked, and if they exist, lkreal2cmplx will only continue if the grid type is uniform. The destination size will the maximum of both source sizes. Padding required by real_obj will be set to real_val, and padding required by imag_obj will be set to imag_val.

If either source object has a validity mask, the destination object will get a mask. If both source objects have masks, they will be combined (logical AND) after processing.

lkreal2cmplx will fail if neither source object is valid; if the source objects do not contain value and/or map data; if either source object is complex; or if the destination object is not valid.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lkreal2cmplx.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.