SDS_SLICE_FILE(3)
NAME
sds_slice
sds_slice_file
- functions to handle data slice operations
SYNOPSIS
#include <soi_sds.h>
SDS *sds_slice(SDS *sdsptr, int *start, int *end)
SDS *sds_slice_file(FILE *fp, int *start, int *end)
DESCRIPTION
sds_slice extracts a cube of data from an existing sds data
array using the indices in the start and end arrays.
sds_slice_file is like sds_slice except it extracts a cube
of data from a FITS file pointer using the indices in the
start and end arrays. Upon execution, the file pointer is
rewound to the beginning of the file. The point is that
subsequent calls to sds_slice_file can retieve new data
slices.
The start and end arrays are of length sds_rank(sdsptr) and
must be malloc'ed and filled before calling sds_slice.
The first dimension is sliced using start[0] and end[0], the
second dimension using start[1] and end[1], and so forth.
For any i (i = 0,...,rank-1), end[i] need NOT be larger than
start[i]. In other words, the slice is just a n-cuboid with
start and end as the diagonally opposite corners.
The entire array will be returned if, for all axes n,
start[n] = 0 and end[n] = length[n] -1. Likewise, A single
point is returned if start[n] = end[n].
Returns a new SDS structure which contains the data array
itself, rank, length indexes, number of bytes per datum, and
data type of the array. However, no attribute will be added
to the new SDS -- the attribute list is empty, until users
set it.
Users need NOT allocate memory for the slice.
In the case of slicing from memory, The original SDS from
which the slice is taken will be unchanged.
FILES
~soi/(release)/include/soi_sds.h
~soi/(release)/include/soi_error.h
~soi/(release)/src/libsds.d/sds_slice.c
SEE ALSO
sds_slice, sds_slice_file
FEATURES and BUGS
This is not a well tested program.
Current implementation still does not support single data
point ie. when start[i] == end[i] for all i's.
HISTORY
93.10.12 K Scott: created this file for SOI V.0.7
1994-02-08 SOI Version 0.8